WO1996036919A1 - A microcomputer - Google Patents
A microcomputer Download PDFInfo
- Publication number
- WO1996036919A1 WO1996036919A1 PCT/JP1996/001308 JP9601308W WO9636919A1 WO 1996036919 A1 WO1996036919 A1 WO 1996036919A1 JP 9601308 W JP9601308 W JP 9601308W WO 9636919 A1 WO9636919 A1 WO 9636919A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- access
- cache
- processing unit
- central processing
- memory
- Prior art date
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F12/00—Accessing, addressing or allocating within memory systems or architectures
- G06F12/02—Addressing or allocation; Relocation
- G06F12/08—Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
- G06F12/0802—Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
- G06F12/0888—Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches using selective caching, e.g. bypass
Definitions
- the present invention relates to a single-chip microcomputer incorporating a memory and the like together with a central processing unit, and more particularly, to a technology for accelerating a memory access operation inside and outside a microphone opening combination by a central processing unit, for example, a central processing unit.
- RISC reduced instruction set computer
- a ROM Read Only Memory
- a RAM Random Access Memory
- the time required for the CPU to access the memory is short, which is advantageous for speeding up instructions and data fetches.
- the built-in memory can be accessed in one clock cycle of the CPU operation reference clock signal. At this time, external memory access usually requires a plurality of clock cycles.
- Examples of such a single-chip microphone with a combination of a mouthpiece and a commercialized product include, for example, “Nippon Electronics Corp., January 23, 1990, no. There are those described on page 99 to page 112.
- Japanese Patent Application Laid-Open No. 2-187879 discloses a semiconductor device in which an instruction cache memory and a main storage device accessed only when there is no instruction in the instruction cache memory are mounted on the same chip together with a central processing unit. An integrated circuit is shown.
- the present inventor has studied the speeding up of internal and external memory access operations by a single-chip microcomputer equipped with a cache memory and a built-in memory together with a central processing unit. At this time, we focused on two points: lowering of data processing performance due to external memory access, and saturation of improvement in data processing performance with respect to the improvement of the operating frequency of the micro-computer.
- the hit ratio is low, and improvement in data processing performance cannot be expected much.
- the hit rate is low unless there is a large difference between the access speed of the cache memory and the access speed of the internal memory. If so, it became clear that the process of adding cache miss data to the cache memory may eventually lose the significance of installing the cache memory.
- the CPU could access the built-in EPROM or built-in mask ROM in one clock cycle when the operating frequency of the CPU was 2 OMHz .
- the built-in ROM such as large-capacity ROM and flash memory, for which the access time cannot be reduced so much due to the large read line capacity and the bit line capacity, etc.
- the access requires multiple clock cycles.
- the data processing performance of the system saturates even if the operating frequency is increased, especially in a micro-computer with a RISC architecture in which the memory access time is directly proportional to the performance.
- the microcombiner (MPU, MPU 1) formed on one semiconductor substrate includes a central processing unit (1) and a central processing unit (1).
- a built-in memory (9, 10) to be accessed a cache memory (CACHE) coupled to the central processing unit by an internal bus (6), and an external address space of a micro-computer.
- Interface means for causing the external address space to be cached by the cache memory and control means (2, 72) for controlling the internal memory to be non-cacheable.
- the microcomputer (MPU, MPU1) mounts the built-in memory (9, 10) together with the cache memory (CACHE) on the same semiconductor substrate, and the built-in memory is the case of the cache memory in the cache memory.
- the internal memory (9, 10) is not targeted for caching, in other words, the internal memory (9, 10) is mapped to a non-cacheable area, so that the internal memory access can be cache hit in any case. As well as high-speed access.
- the built-in memory is also targeted for cache, if a cache miss occurs during access to the built-in memory, processing for adding data related to the cache miss to the cache memory must be performed.
- the above-mentioned means does not cause such a situation at all.
- the cache memory (CACHE) itself has a small storage capacity and a low cache hit rate, it can be used in combination with the built-in memory (9, 10) that can be accessed at a high speed.
- the overall hit rate for inside and outside of the combination (MPU, MPU 1) can be increased. Therefore, the speed of the memory access in the entire execution process of the operation program by the central processing unit can be increased, and the data processing performance can be improved as a whole.
- the interface means By waiting for the start of the access cycle to the external address space for a certain period of time required to determine the cache hit or cache miss of the cache memory, when a cache hit occurs, the already started pass cycle is stopped halfway. It is possible to prevent the data in the external memory from being destroyed. However, such wait periods will delay the activation of the external pass cycle in the event of a cache miss. Once a cache miss has occurred, taking into account the fact that the state of the cache miss is continuous a plurality of times, and in order to speed up external memory access as much as possible, the interface means must provide access to the external address space.
- the central processing unit has a RISC architecture
- the central processing unit, the built-in memory and the cache memory share an internal bus
- the central processing unit It accesses the internal bus with one clock cycle of its operation reference clock signal as the maximum access speed.
- the cache memory is further provided so long as it outputs a data relating to a cache hit to the internal bus in a period of one clock cycle of an operation reference clock signal of the central processing unit from the start of access by the central processing unit.
- Another micro-computer employs a high-speed RAM (201) having a faster access operation than the built-in memory (202, 203) instead of the cache memory. Furthermore, the central processing unit (200) is specified ( Triggered by the access to the value of C TAR), the bus right is acquired from the central processing unit, and from the specific address (208) of the internal memory (202, 203) or the external address space to another specific address. Is transferred to the high-speed RAM (201), and when the access of the central processing unit after the transfer is the transfer source address (CSAR address ⁇ CEAR), the access target is switched to the high-speed RAM and controlled. The transfer control means (205) is employed. The target of data transfer to the high-speed RAM can be limited to either the internal memory or the external memory, or both.
- Data or programs can be transferred to M (201) in advance and made available. For example, by transferring a certain portion of a program in an internal memory having a slow access time to a high-speed RAM in advance and executing it, the speed of execution of the portion can be increased. Naturally, even if the program does not fit in the internal memory and runs out to the external memory, performance control can be prevented by controlling this external memory in the same way as the internal memory.
- routines that require high speed are relatively limited in the address range and execution timing, such as interrupt service parts, resulting in poor processing performance.
- parts requiring high-speed execution can be transferred to high-speed RAM in advance. As a result, the performance of the entire program processing is improved.
- Still another microcomputer employs a high-speed RAM (401), which has a faster access operation than the built-in memory (402, 403), instead of the cache memory.
- a high-speed RAM (401) Is built-in Triggered by accessing the memory (402, 403) or the external address space (408), the access data is stored in the high-speed RAM in parallel with the access to the internal memory access or the external address space by the central processing unit.
- (401) is performed for a predetermined address range (CSAR ⁇ address ⁇ CE AR), and the access of the central processing unit after the completion of the data transfer for all the addresses in the predetermined address range is performed by the transfer.
- a transfer control means (405) for switching and controlling the access target to a high-speed RAM when the address is the original data is adopted.
- Data transfer to the high-speed RAM can be limited to either the internal memory or the external memory, or both.
- MPU4 employ a high-speed RAM (601), which is faster in access operation than the built-in memory (602, 603), instead of the cache memory. 08) and a data transfer control means (612) for performing data transfer from the central processing unit to the high-speed RAM, and a central processing unit access to a transfer source address (CS AR ⁇ address ⁇ CEAR) of the data transferred to the high-speed RAM.
- Switching control means (6) for switching and controlling access to the high-speed RAM. 0 4).
- the target of data transfer to the high-speed RAM can be either internal memory or external memory, or both.
- the central processing unit tries to access a specified range of the internal memory and unconditionally accesses the high-speed RAM, it can be used when the user initializes the program. If the programs and data to be accelerated in the built-in memory are previously transferred to the high-speed RAM, the data processing performance can be improved. If the program to be accelerated is known among the programs completed by the C compiler assembler, the data processing performance can be easily improved by the above configuration. According to this method, a penalty due to a cache miss and transfer of a high-speed routine during the background processing are eliminated. In addition, the execution time is exactly the same at the time of the first passage and after that, which makes it easy to perform timing design. Naturally, even if the program does not fit in the internal memory and runs out to the external memory, performance control can be prevented by controlling this external memory in the same way as the internal memory. BRIEF DESCRIPTION OF THE FIGURES
- FIG. 1 is a block diagram of an embodiment of a single-chip microcombination according to an embodiment of the present invention.
- FIG. 2 is a block diagram showing an example of a pass controller and an external pass interface included in the microcomputer shown in FIG.
- FIG. 3 is an address mapping diagram in the built-in ROM valid mode in the micro-combination shown in FIG.
- FIG. 4 is an address mapping diagram in a built-in ROM invalid mode in the micro-computer shown in FIG.
- FIG. 5 is an explanatory diagram of an address signal output by the CPU.
- FIG. 6 is an example block diagram of the cache memory.
- FIG. 7 is a timing chart when the CPU performs a read access to the RAM or ROM as an example of access to the non-cacheable area.
- FIG. 8 is a timing chart of read access to the cacheable area by the CPU during a cache shot.
- FIG. 9 is a timing chart of a read access by the CPU to the cacheable area during a cache error.
- FIG. 10 is a timing chart when the control signal B ECNOP is negated during a cache miss.
- FIG. 11 is a timing chart when the control signal BE CNOP is negated at the time of a cache hit.
- FIG. 12 is an explanatory diagram showing a state during a cache hit and a state during a cache miss in a plurality of bus access cycles.
- FIG. 13 is an explanatory diagram of the configuration when the cache memory is also used as the built-in RAM.
- FIG. 14 is an explanatory diagram of an address signal and a cache address of an address array when the cache memory is also used as the built-in RAM.
- FIG. 15 is a block diagram of a single-chip microcomputer according to another embodiment of the present invention.
- FIG. 16 is a block diagram showing an example of a bus controller and an external password interface in the micro-computer shown in FIG. Figure 17 shows the dynamic access ratio r to the internal memory, the cache memory hit ratio h when accessing the external memory, and the total hit ratio.
- FIG. 4 is an explanatory diagram showing the relationship of H.
- FIG. 18 is another explanatory diagram showing the relationship between the dynamic access ratio r to the internal memory, the hit ratio h of the cache memory at the time of accessing the external memory, and the total hit ratio H.
- Fig. 23 is an explanatory diagram showing the miss rate (1-1h) for the cache configuration (number of ways, line length, capacity).
- FIG. 27 is an explanatory diagram showing the relationship between the cache capacity C and the built-in ROM capacity R for the full cache memory based on the results shown in FIG.
- FIG. 28 shows the relationship between the cache capacity C and the internal ROM capacity R based on the results shown in FIG. 25 using a 4-way set-associative (4-way) key.
- FIG. 4 is an explanatory diagram obtained for a cache memory.
- FIG. 29 is an explanatory diagram showing the relationship between the cache capacity C and the built-in ROM capacity R based on the results shown in FIG. 25 for a two-way set-associative (2 way) cache memory.
- FIG. 30 is an explanatory diagram showing the relationship between the cache capacity C and the built-in ROM capacity R based on the results shown in FIG. 25 for a direct map (direct) cache memory.
- FIG. 31 is a block diagram of an embodiment of a microcomputer in which data is transferred to a high-speed RAM in advance to speed up memory access as a whole.
- FIG. 32 is a block diagram of a RAM transfer controller included in the micro-computer shown in FIG.
- FIG. 33 is an explanatory diagram of the address conversion.
- FIG. 34 is a block diagram of the high-speed RAM and the address converter.
- FIG. 35 is a block diagram of an embodiment of a microcombiner in which data is simultaneously transferred to a high-speed RAM to speed up access.
- FIG. 36 is a block diagram of the high-speed RAM included in the micro-computer shown in FIG.
- FIG. 37 is a block diagram of a RAM transfer controller.
- FIG. 38 is an illustration of parallel writing to a high-speed RAM.
- Fig. 39 shows a microcombiner in which information in a low-speed memory is transferred to high-speed RAM in advance by using a DMAC, and the access address for the low-speed memory is replaced with the address of the high-speed RAM to speed up memory access.
- FIG. 3 is a working block diagram of the embodiment.
- FIG. 40 is an example block diagram of a path controller included in the micro-combination shown in FIG. 39.
- FIG. 41 is a block diagram of the high-speed RAM and the address arithmetic unit. BEST MODE FOR CARRYING OUT THE INVENTION
- FIG. 1 shows an embodiment of a single-chip microcombiner according to an embodiment of the present invention.
- the single-chip microcomputer (also simply referred to as a microcombination) MPU has a cache memory CACHE in addition to a ROM (read 'only' memory) 9 and a RAM (random 'access memory) 10.
- ROM 9 and RAM 10 are not cached by the cache memory CACHE.
- the CPU (central processing unit) 1 accesses the built-in ROM 9 or RAMI 0, the cache memory is The built-in ROM 9 or RAM 10 is read / written directly without using the access operation of CACHE.
- the microcomputer MPU includes a CPU 1, a cache memory C ACHE, a ROM 9 in which an operation program or data of the CPU 1 is stored, a RAM 10 serving as a work area of the CPU 1 or a temporary storage area of data, It is formed on a single semiconductor substrate such as monocrystalline silicon, including the MULT 5, the path controller 7, the peripheral circuit 11, the external path interface 12, and the like. An external memory 13 and the like are connected to the external path interface 12 via an external path 14.
- the microcomputer MPU of this embodiment has a RISC architecture, although not particularly limited, and the CPU 1 executes an instruction in one clock cycle in the operation reference clock signal of the CPU 1 per instruction.
- path The pipeline stages such as instruction fetch, instruction decode, instruction execution, and memory access are executed so that the basic cycle number of access is one clock cycle.
- the internal path (I BUS) 6 to which the CPU 1 is connected is a high-speed internal bus having a minimum operation cycle of one clock cycle, and includes an internal address bus I AB, an internal data path I DB, and an internal control path I CB.
- the cache memory CACHE, ROM 9, RAM 10, a multiplier (MULT) 5 for executing a multiplication instruction, and a bus controller 7 are connected to the internal path 6.
- the bus controller 7 controls the internal bus 6 and controls access to the peripheral circuits 11.
- FIG. 2 shows an example block diagram of the bus controller 7 and the external pass interface 12.
- the bus controller 7 includes a circuit block roughly divided into a buffer 71 and a control logic circuit 72.
- the external bus interface 12 has a circuit block roughly divided into a buffer 120 and a timing generation circuit 121.
- the buffer 71 supplies a predetermined signal included in an internal data bus address bus constituting the internal path 6 to the external bus interface 12 and the peripheral circuit 11.
- the control logic circuit 72 determines the access target based on the upper bits of the address signal supplied from the internal path 6, and receives a path command or the like supplied from the internal path 6 to perform read / write access. Judge the type of access such as data width.
- a selection signal MS ROM of the built-in ROM 9, a selection signal MSRAM of the RAM 10, a read / write signal MRW for the built-in circuit, and the like are generated.
- CS 0 to CS 3 read signal RD, write signal WR, row address strobe signal RAS for accessing DRAM (Dynamic RAM), column address strobe signal CAS, etc.
- Timing generation circuit 1 2 1 And outputs a control signal and the like for output from the controller.
- the output timing of the data input / output address signal for external path access is performed by the timing generation circuit 122 controlling the buffer 120 based on the control signal from the control logic circuit 72.
- control logic circuit 72 is notified of a cache hit / miss in the cache memory CACHE by a hit signal 109, and furthermore, the start timing of the external bus access via the external bus interface 12 by the control signal BE CNOP. Alternatively, the wait until the start of the external path access is notified. Then, the control logic circuit 72 notifies the CPU 1 of the path accessible state by the control signal BUS RDY.
- the control signal BUSRDY defines the delimitation of the bus access by the CPU 1.
- FIG. 3 shows an example of address matching in the built-in ROM valid mode in the micro-computer MPU according to the present embodiment
- FIG. 4 shows an example of address matching in the internal ROM invalid mode. Is shown.
- the microcomputer MPU of this embodiment includes a built-in ROM valid mode for validating the built-in ROM 9 and a built-in ROM invalid mode for disabling the built-in ROM 9, and their operation modes are determined by the setting state of a mode pin (not shown). Is done.
- the cache target space by the cache memory CACHE is the CS0 to CS3 space and the DRAM space in FIGS. 3 and 4, and the ROM 9 and the RAM 10 are not subjected to the cache.
- the address signal managed by the CPU 1 is 32 bits (A31 to A0) as shown in FIG. 5, A31 to A24 are used for selecting the space shown in the address map, and A23 and A22 are Used for chip selection in CS space.
- the address signal output via the external path interface 12 is 22 bits A21 to A0.
- the control logic circuit 72 shown includes address decoding logic 721 for space selection and CS space selection according to the operation mode, and generates the selection signals MS ROM and MS RAM according to the address decoding logic 721. , CS 0 to CS 3, and a control signal for outputting AS and CAS from the timing control circuit 121.
- the number of access cycles for external path access is determined by the control logic circuit 72 according to the number of wait states set in the control register 720 for each of the CS0 to CS3 space and DRAM space. Notify one. Note that, for the purpose of space selection and CS space selection, address bits lower than A22 are also actually decoded.
- FIG. 6 shows an example block diagram of the cache memory CACHE.
- the cache memory CACHE includes an address array (AA) 3, a data array (DA) 4, a comparator 20, a cache controller (C CONT) 2, and the like.
- the cache target by the cache memory CA CHE may be any of only an instruction, only data, and both an instruction and data.
- the cache memory CACHE is, for example, a cache that stores an effective address (virtual address or physical address) indicating which position (address) of the external storage device corresponds to information of one cache line that constitutes one entry.
- the address array 3 has a cache tag address 104 and a valid bit 105
- the data array 4 has a data line 106. If necessary, a dirty bit or the like indicating that the contents of the cache memory are updated and different from the contents of the external mass storage device may be provided. Other than these, memory space In some cases, a field indicating the type of the data is added.
- the address signal 100 supplied from the central processing unit CPU 1 to the internal address path IAB is regarded as a tag address 101, an entry address 102, and a line address 103 in a line.
- the byte address 103 in the line is information for selecting the byte data included in the data line 4.
- the entry address 102 is decoded by the decoder 110 and used to select (index) a cache line from the address array 3 and the data array 4. For example, if there are 128 cache lines, the entry address is 7 bits.
- the cache tag address 104 of the indexed cache line is compared with the tag address 101 at the comparator 20. The comparison result and the valid bit 105 are supplied to the cache controller 2.
- the cache controller 2 refers to the comparison result by the comparator 20 and the valid bit 105.For example, if the indexed cache line is valid, the cache tag address 104 of the cache line is the tag. When the address coincides with the address 101, a cache hit is notified to the path controller by the cache hit signal 109. At the same time, required data is selected from the indexed cache line data line 106 at the line address 103 in the line and read out to the internal data path IDB, or the cache line data line is read out. The data of the internal path IDB is written at the position selected by the in-line pipe address 103 with respect to 106.
- 40 is a data output circuit that selects data from the indexed data line at the in-line byte address 103 and outputs it to the internal data path IDB.
- 41 is a predetermined position of the indexed cache line in the line byte. Data that is selected at address 103 to supply write data from internal data path IDB This is an input circuit.
- the bus controller 7 controls to read information for one data line including data corresponding to the access address at that time from the external memory 13, and the cache controller 2 performs The contents of the data line 106 are replaced with the read data (line fill).
- the cache line to be replaced can be determined according to a well-known logic such as [1111; (1 ⁇ & 311 ⁇ 061111136)].
- the corresponding cache address tag 104 is written to the cache line, and the valid bit 105 is set.
- the operations of the data output circuit 40, the data input circuit 41, the output gates 31 and 105, and the input gates 30 and 1505 are performed by an index operation, a line fill operation, and a write operation by the CPU 1.
- the cache controller 2 controls the access.
- the address array 3 and the data array 4 in FIG. 6 are a direct map system with one way, a two-way (2-way) set associative or a four (4 one way) set associative format. And so on. Increasing the number of ways increases the number of cache lines indexed by the entry address, thereby increasing the cache hit rate. When increasing the number of ways, the address array 3 and the data array 4 are also prepared for that number, and the entry address 102 is commonly provided to each way. The cached gu addresses that have been paid and indexed for each way are compared with the guadress at the Comparator evening 20 provided for each way. If the comparison result by any one of the comparators 20 is matched and a cache hit is made, the data array of the way related to the match is subjected to read / write. Line filling is also performed for any one of the ways.
- the determination as to whether or not the access address area by the CPU 1 is an area to be cached by the cache memory CAC HE is not particularly limited, but is performed by the cacheable control circuit 21 of the cache controller 2.
- the cache target space is the CS0 to CS3 space and the DRAM space, and the other space is the cache non-target space (non-cacheable area).
- the cacheable control circuit 21 sets H, 00200000 to! ⁇ ⁇ It has a circuit that determines access of 01 FFFFFF and a circuit that determines access of H '00000000 to H' 01 FFFFFF to determine the cache target space in the internal ROM invalid mode. Determine whether the area is a non-cacheable area.
- the circuit for judging the access from H, 00200000 to H, 01 FFFFFF is not particularly limited, but the output and the access of the circuit for detecting that the 11 bits from the most significant bit of the access address are not all 0s are not limited. This can be determined by the logical sum signal with the output of the circuit that detects that all 7 bits from the most significant bit of the address are 0. Similarly, the circuit that determines access from H '00000000 to H' 01 FFFF FF makes a determination based on the output of the circuit that detects that all 7 bits from the most significant bit of the access address are all 0s. can do. The determination result signal is supplied from the cacheable control circuit 21 to the control signal generation circuit 23.
- the control signal generation circuit 23 When a determination result signal indicating that the access address area by the CPU 1 is not an area to be cached by the cache memory CACHE is supplied from the cacheable control circuit 21 to the control signal generation circuit 23, the control signal generation circuit 23 generates the comparator 20. An operation stop signal for stopping the operation is supplied to each of the input gates 30, 1050, the output gates 31, 1051, the data output circuit 40, the data input circuit 41, and the decoder 110. At this time, the cache memory CACHE becomes inactive.
- the control circuit 23 receives from the cacheable control circuit 21 a determination result signal indicating that the access address area of the CPU 1 is a cache target area by the cache memory CACHE, the control signal generation circuit 23 executes the comparator 20, an input gate 30, 1050, an output gate 31, 1051, a data output circuit 40, a data input circuit 41, and a decoder 110 are supplied with an operation start signal for starting the operation. At this time, the cache memory CACHE is in an operating state.
- the cache controller 2 In response to the access to the non-cacheable area, the cache controller 2 does not perform at least the read and write cache operations for the internal bus 6, and maintains the cache hit signal 109 in a cache miss state.
- the cache operation of reading and writing to the internal path 6 is performed, and the heat signal 109 is changed according to the determination result of the cache heat / miss.
- the cache controller 2 changes the control signal BE CNOP to an enable level for one clock cycle from the path access of the CPU 1 and gives it to the bus controller 7. Is controlled.
- the cache memory CACHE corresponds to the access to the cacheable area, the cache line is indexed, the cache address 104 is compared with the address tag 101, and a cache miss or hit is determined.
- One clock cycle is spent. If the bus controller 7 starts the external access during this time, the data in the external memory 13 accessed by the bus controller 7 may be destroyed.
- the path controller 7 waits for the start of the external bus access operation by setting the control signal BECNOP to the enable level for one clock cycle after the CPU 1 bus access. In the meantime, if the cache hit is notified to the bus controller by the cache hit signal 109, the bus controller 7 does not perform the external bus access and sends the bus ready signal BUS RDY to the state where the next path access operation is possible. Assert and notify CPU1.
- FIG. 7 shows a timing chart when the CPU 1 performs a read access to the RAM 10 or the ROM 9 as an example of an access to the non-cacheable area.
- Reference numerals 1 and 22 denote operation reference clock signals of the CPU 1 and non-overlapping two-phase clock signals.
- the pass command B CMD includes information indicating the bus access width and read / write, and is output by the CPU 1 to the internal control path I CB.
- the output timing is synchronized with the address output to the internal address bus IAB.
- the CPU 1 supplies an address signal to the internal address bus IAB in synchronization with the bus segment notified by the control signal BU SRDY.
- the cache control circuit 21 determines that the cache controller 2 is an access to the RAM 10 or ROM 9 by the address signal, that is, an access to the non-cacheable area, the address array 3 And the operation of array 4 is suppressed and cache hit Signal 109 is maintained in a cache miss state, and the control signal BE C NOP is negated.
- the bus controller 7 decodes the access address signal at that time and asserts the ROM selection signal MSR0M or the RAM selection signal MSRAM, whereby one clock of the clock signal ⁇ 1 is output.
- read data from ROM or RAM is applied to the internal data path IDB.
- the bus controller 7 asserts the bus ready signal BUSRY in synchronization with the next rising edge of the clock signal ⁇ 1, and notifies the CPU 1 that the next bus access is possible.
- FIG. 8 shows a timing chart of read access to the cacheable area by the CPU 1 during a cache hit. Since the access is to the cacheable area, the cacheable control circuit 21 of the cache controller 2 asserts the control signal BECNOP for one clock cycle after the path access by the CPU 1 to start the external access by the bus controller 7. The period is deterred. In the meantime, in the cache memory CACHE, the data array 4 and the address array 3 are read by the index operation, and a cache miss Z jet is determined for the read data. In this example, the cache hit is determined, the read data related to the hit is supplied to the internal data path IDB, and the cache hit is notified to the bus controller 7 by the cache hit signal 109. The bus controller 7 asserts the path ready signal BUS RDY without performing an external path access according to the access at that time, and notifies the CPU 1 of a state in which the next bus access is possible.
- FIG. 9 shows a timing chart of a read access by the CPU 1 to the cacheable area at the time of a cache miss.
- the cache control circuit 21 of the cache controller 2 asserts the control signal BE CNOP during one cycle of the bus access from the CPU 1 to start the external access by the path controller 7. The period is deterred.
- the cache memory CACHE the data array 4 and the address array 3 are read by the index operation, and a cache miss / hit determination is performed on the read data.
- the bus controller 7 activates an external path access according to the access address at that time.
- ZCSn shown in the figure means any of CS0 to CS3 in FIG. /: RD corresponds to RD in Fig. 2.
- External bus access starts from the T2 state, and in the T3 state, read data from the external memory 13 is read into the internal path IDB.
- the tag address related to the cache miss is written to the corresponding cache line as a cache tag address in the T2 state, and the read is performed in parallel with the CPU 1 taking in the read data in the T3 state. Data is written to the corresponding cache line.
- the period during which the external memory 13 is actually accessed is two clock cycles of T2 and T3, but the activation of the external path access is waited for one clock cycle by the control signal BE CNOP. Therefore, read access of CPU 1 requires a total of three clock cycles T1 to T3.
- the state of the cache miss continues for a relatively long time, and in the access to the cacheable area, the previous access to the cacheable area is not performed. Waiting is performed by the control signal BE CNOP only when it is a cache hit, and when the previous access to the cacheable area is a cache miss in the access to the cacheable area, the wait by the control signal BE CNOP is performed. Do not do. At the time of a cache hit following a cache miss to the cacheable area, since the wait by the control signal BE CNOP is not performed, the state of the cache hit is not given to the path roller 7, and the same operation as the cache miss is performed. I do.
- the hit signal generation circuit 22 has a flag FLG that holds the previous determination result of cache hit / miss.
- the hit signal generation circuit 22 compares the previous determination result of the cache miss / hit obtained from the flag FLG with the determination result of the current cache miss / hit, and if the previous cache miss is the current cache hit, the hit signal is generated.
- the cache control circuit 21 grasps the result of the previous cache miss / heat determination from the flag FLG, and if it indicates a cache miss, the control signal BECNOP even if it detects an access to the cacheable area.
- FIG. 10 shows that the control signal BECNOP is negated during a cache miss.
- a timing chart is shown in a case where the operation is performed (a state in which the cache miss is continuous).
- the control signal BECNOP since the control signal BECNOP is negated, the activation of the external path access is advanced by one clock cycle.
- FIG. 11 shows a timing chart when the control signal BECNOP is negated at the time of a cache hit (when the cache hit is made after the cache miss). In this case, the cache hit is actually a cache hit, but since the pass cycle has already been started, the cache hit signal 109 is negated, and the data read from the data array 4 is sent to the internal data bus IDB. Supply will be deterred.
- FIG. 12 shows states during a cache hit and a cache miss in a plurality of bus access cycles.
- A corresponds to the state of FIG. 8
- B corresponds to the state of FIG. 9
- C corresponds to the state of FIG. 10
- D corresponds to the state of FIG.
- the number of clock cycles for external path access is shortened by one clock cycle from the second cache miss, and the cache is switched from cache miss to cache hit.
- the number of clock cycles for the first external bus access at the switch is extended by one clock cycle. Therefore, if the cache access to the cacheable area continues three times or more, the number of clock cycles of the path access as a whole is determined by controlling the cache hit signal 109 and the control signal BECN0P as in this embodiment. Is shortened.
- FIG. 13 shows a configuration example in which the cache memory is also used as the built-in RAM.
- the internal RAM 10 has a data bus width of 32 bits with a capacity of 1 KB per module, and a total of 4 modules constitutes a 4 KB RAM. It shall be.
- the cache memory CACHE has a 1 KB storage capacity for the data array in a micro-computer MPU with such a built-in RAM 10, the cache memory CACHE can be configured by using the built-in RAM . If one module 1KB RAM is used as the data array 4 of the cache memory CACHE, 256 lines can be stored with a data line length of 4 bytes.
- the cache tag address 104 of the address array 3 can be assigned to D24 to D10 as shown in FIG. 14 (B). Since there is an empty bit in the address array 3, in order to utilize that area, the valid bit (V) 105 is assigned to the least significant bit D0 of the address array in this example.
- the valid bit 105 must be reset for each cache line, and to invalidate all the cache lines and initialize the cache memory CACHE, 256 times Requires access.
- the valid bit 105 can be stored in a logic circuit other than the RAM, such as the cache controller 2. For example, a cache of 32 bytes (32 x 8 bits) is prepared in the cache controller 2, and a correspondence is established with 256 cache lines to enable the validity of the register in the cache. Store the data.
- predetermined 8 bits (A 9 to A 2) of the address signal are used as an index for the address array 3, but when the address array 3 is used as a normal RAM, A is used.
- the 10 bits from 9 to A0 are used for addressing.
- the latch 23 holds the tag address, and the held address tag is supplied to one input of the comparator 20 for cache hit / miss determination, and is supplied to the address array 3 at the time of line filling.
- the other input of the comparator 20 is supplied with the cache address tag of the line indexed by the address array 3.
- the aligner 26 is a circuit that determines the correspondence between the internal data bus IDB and the data input / output terminal of the data array 4, and is controlled by the cache controller 2.
- the input circuit 24 and the output circuit 25 are circuits that selectively connect the data input / output terminals of the address array and the data path, and constitute the data input / output circuit when the address array 3 is used as a normal RAM. I do.
- whether or not to use the address array 3 and the data array 4 as ordinary RAM (as a part of RAMIO) can be linked to the validity / invalidity of the cache memory CACHE. Such valid Z invalid control can be determined by the operation mode of the micro-computer.
- the microcomputer MPU 1 shown in FIGS. 15 and 16 differs from the embodiment shown in FIGS. 1 and 2 in the arrangement of the bus controller.
- the bus controller 7 and the peripheral circuit 11 share the internal bus 6.
- the other points are the same as those of the embodiment shown in FIGS. 1 and 2, and the detailed description is omitted.
- the overall hit ratio in a micro computer with built-in memory that is accessed at high speed together with the cache memory will be described.
- the dynamic internal memory access ratio ratio of internal memory access during all memory accesses
- the cache memory hit ratio during external memory access is h
- the internal memory access and cache hit for all memory accesses are performed.
- the overall hit rate that is, the total hit rate H, which is the ratio of external memory accesses considered as the internal memory access, the internal memory access and the external memory access used as the cache hit do not occur at the same time.
- the average number of access clock cycles (average number of access clock cycles) Sa for the internal memory (9, 10) and the external memory (13) of the microcomputer MPU (MPU 1) is:
- FIG. 19 is drawn based on the contents of FIG. 20, and
- FIG. 21 is drawn based on the contents of FIG.
- the micro combination MPU (MPU 1) of this embodiment has the cache memory CACHE and the ROM 9 and RAMI 0 mounted on the same semiconductor substrate, and the RAMI 0 and ROM 9 are the cache memory cache memory CACHE. It is a built-in memory that can be accessed at a high speed, which is accessed in the same one-cycle as in the previous case. In any case, the fact that the internal memory access can be realized in one clock cycle similar to the cache heat is that the internal memories 9 and 10 are not targeted for caching, in other words, the internal memories 9 and 10 are non-cacheable areas. It is guaranteed by mating.
- the interrupt vector and the interrupt service routine are stored in the built-in ROM / RAM in the microcomputer MPU (MPU 1) that has the cache memory CACHE as well as the built-in memory such as ROM / RAM.
- MPU 1 microcomputer MPU
- the relevant ROM / RAM not to be cached, it is possible to speed up the transition to the interrupt processing program in the same way as in the case of a cache hit, even for a program with frequent interrupts. In this regard, the data processing performance or data processing speed can be improved.
- Using the cache memory as the built-in RAM is also advantageous in terms of cost. Furthermore, the valid bits 105 are physically cut off from the address array 3 and stored in a register such as the cache controller 2 so that the clearing of the bit 105 can be efficiently performed by software with a small number of accesses. It will be easier. Also in this regard, the hardware configuration of the cache memory CACHE is reduced, contributing to the cost reduction of the microphone-portable MPU (MPU 1).
- Figure 23 shows the miss rate (11h) for the cache configuration (number of ways, line length, capacity). This value is shown in “Al an. J. Smith,“ Line (block) Size Choice or CPU Caches ””, IEEE Trans, Comput., Vol C-36, no. 9, pp l 063— 1075, Set., 1987], based on the value of the instruction cache miss rate (Fig2).
- the vertical column marked CACHE SIZE indicates the storage capacity (bytes) of the data array of the cache memory CACHE
- the horizontal column marked Line is the cache memory CACHE. Means the number of bytes of the data overnight line in. Then, the value in the vertical column and the value in the horizontal column are exchanged.
- the numerical value written at the point position is the error rate (11h) corresponding to the cache size and line length.
- 23 (A) to 23 (D) show the configuration of the cache memory CACHE, which is full-associative (full), 4-way set associative (4way), and 2-way set associative (2way). , 1-way set associative, that is, direct map (direct).
- the description method is the same as in Fig. 23.
- r ⁇ 0 indicates a cache configuration in which the heat rate exceeds 0.9 even without the internal ROM.
- FIGS. 27 to 30 When the relationship between the cache capacity C [B] and the internal ROM capacity R [KB] is plotted based on the results in FIG. 25, the results in FIGS. 27 to 30 are obtained.
- the configuration of the cache memory is shown in Fig. 27 for full associativity (full), Fig. 28 for 4-way set associative (4 way), Fig. 29 for 2-way set associative (2 way), and 30
- the figure shows a direct map (direct), in which the data line length of the cache memory is a parameter.
- the ROM capacity is 85.33 kilobytes. This means that the overall hit rate will be 0.9. Real At this time, using the above results, it can be seen that the capacity of C and R is sufficient to obtain the required performance.
- C + aR b.
- the cache memory capacity C and the ROM capacity R are not unnecessarily (wastefully) increased, and the storage capacity of the ROM 9 with the built-in microphone MPU (MPU l) and the capacity are reduced in terms of cost and overall heat rate.
- the storage capacity of the cache memory CACHE can be optimized.
- the values of the constants a and b are as shown below from FIG.
- Fig. 31 shows that data is transferred to high-speed RAM in advance and the entire A block diagram of an embodiment of a microcomputer (microcomputer with a built-in pre-transfer format RAM cache) for speeding up memory access is shown.
- the single-chip micro-computer of this embodiment (also simply referred to as a micro-computer) MPU2 has a CPU 200, a ROM 202 in which an operation program or data of the CPU 200 is stored, a work area of the CPU 200 or a data storage area.
- RAM 203 used as a temporary storage area, multiplier (MU LT) 209, bus controller 204, peripheral circuit 210, external bus interface 207, high-speed RAM 201, address converter 2010, RAM transfer controller 205, etc. And formed on one semiconductor substrate such as single crystal silicon.
- the external path interface 207 is connected to an external memory 208 via an external path 211.
- the microcomputer MPU2 of this embodiment has an ISC architecture, although not particularly limited, and the CPU 200 executes an instruction in one clock cycle of the operation reference clock signal of the CPU 200 per instruction, and performs basic bus access. Let the number of cycles be one clock cycle In this way, pipeline stages such as instruction fetch, instruction decode, instruction execution, and memory access are executed by pipeline operation.
- the internal path 206 to which the CPU 200 is connected is a high-speed internal path having a minimum operation cycle of one clock cycle, and includes an internal address path IAB, an internal data bus IDB, and an internal control path ICB.
- the respective circuit modules are connected to the internal bus 206.
- the bus controller 204 performs control of the internal path 206, access control of the peripheral circuit 210, and the like.
- the bus controller 204 determines the area to be accessed based on the higher-order bits of the address signal supplied from the internal path 206, and receives a path command or the like supplied from the internal bus 206 to read / write access data.
- the type of access such as overnight is determined.
- the operation of the built-in ROM 202, AM 203, high-speed RAM 201, etc. is selected according to the results of these determinations, and a chip selection for external access and a read / write instruction are issued to the outside.
- the RAM 203 and the ROM 202 are used for access.
- the high-speed RAM 201 can be accessed in one clock cycle, and is used as a pre-transfer-type RAM cache.
- the RAM transfer controller 205 controls to transfer necessary information of the built-in RAM 203 and the ROM 202 to the high-speed RAM 201.
- FIG. 32 is a block diagram of the RAM transfer controller 205.
- the RAM transfer controller 205 includes a register (CTAR) 301 for storing an address used as a trigger for data transfer to the high-speed RAM 201, that is, a caching trigger address, a caching block address register (CSAR) 302, and a caching block.
- the CSR305 has a valid flag (V) 307 in addition to the operation setting bit of the RAM transfer controller 205.
- each register of CTAR301, CSAR302, CEAR303, and RCAR304 a value to be compared with the address output from the CPU 200 is set.
- the CSR 305 stores setting data for control of the RAM transfer controller 205 and a value including a valid flag 307.
- the registers 301 to 305 can be read-Z-accessed by the CPU 200, and the control circuit 306 decodes the value of the internal address path IAB, selects each register, and outputs the selected address via the internal data path IDB. Those Regis evenings are read-written.
- address information that specifies a part or the entire range of the area of the ROM 202 and the RAM 203 is set.
- the storage capacity of the specifiable range is determined by the storage capacity of the high-speed RAM 201.
- the comparison circuit 311 compares the value of the internal address path I AB with the value of the CTAR 301, and gives the comparison result to the control circuit 306.
- the comparison circuit 312 determines whether or not the value of the internal address bus IAB is equal to or greater than the value of the CSAR 302, and gives the determination result to the control circuit 306.
- the comparison circuit 313 determines whether or not the value of the internal address path I AB is equal to or less than the value of the CE AR 302, and gives the determination result to the control circuit 306. Referring to FIG.
- control circuit 306 detects that the address signal supplied from the CPU 200 to the internal address path IAB matches the value of the CTAR 301, it acquires the bus right from the CPU 200 and Determined by the value of CEAR 303 from the address determined by the value of CSAR302
- the transfer control is performed to a predetermined area of the high-speed ram 201 starting with the value of the CAR 304.
- the conversion control signal 3140 is inactive, and the high-speed RAM 201 is accessed according to the address signal output from the RAM transfer controller 205 to the internal address bus IAB.
- the valid flag 307 is valid and the pass right is abandoned.
- the control circuit 306 refers to the determination result by the comparison circuits 312 and 313 in the determination circuit 314, and the value of the internal address bus IAB is determined by the value of the CSAR 302.
- the address calculator 315 subtracts the value of CSAR302 from the value of RCAR304 (RCAR—CSAR), and the subtracted value is the RAM address.
- the conversion information 316 is supplied to the high-speed RAM 201, and the conversion control signal 310 is activated.
- FIG. 34 shows a block diagram of the high-speed RAM 201 and the address converter 2010.
- the address converter 2010 adds the RAM address conversion information 316 to the value of the internal address bus IAB at that time, and uses this as an access address, which is used as a high-speed RAM. Supply to 201.
- the conversion control signal 3140 is inactive, the value of the internal address path I AB is supplied to the high-speed RAM 201 as it is. It is sufficient for the high-speed RAM 201 to have a configuration of a normal RAM, and thus a detailed description thereof is omitted.
- RCA The value of R 304 is transferred to the high-speed RAM 210 with the value at the beginning.
- the conversion control signal 3140 is activated.
- the path controller 204 selects the operation of the high-speed RAM 201 instead of the operation of the ROM 202, the RAM 203, and the external memory 208.
- CPU 200 outputs address signal 250 via internal path 206.
- the address signal 250 is supplied to the RAM transfer controller 205, and the supplied address signal 250 is compared with the value of the CTAR 301. If the comparison result matches, the RAM transfer controller 205 asserts a bus right request signal (RT CREQ) 251 to the bus controller 204.
- the path controller 204 arbitrates the path right by the path arbiter 220, and gives the path right to the RAM transfer controller 205 at a break of a pass cycle of the CPU 200 or the like.
- the CPU pass right acknowledge signal (CPUACK) 253 is negated, and the RAM transfer controller bus right acknowledge signal (RT CACK) 252 is asserted.
- the RAM transfer controller 205 acquires the bus right in response to the assertion of the RT CACK 2 52, the RAM transfer controller 205 changes the address indicated by the CE SAR 302 from the address indicated by the CSAR 302. For example, instructions or data in the low-speed internal ROM 202, the internal RAM 203, or the external memory 208 in the range up to and including the address in the high-speed RAM 201 indicated by the R CAR 304 Transfer control to the address.
- control circuit 306 Inverts the valid flag 307 in the CSR 305 indicating that an instruction or data is stored in the high-speed RAM to a set state. Then, the RAM transfer controller 205 relinquishes the bus right.
- the address signal 250 output by the CPU 200 is compared with the values of the CSAR 302 and CEAR 303 by the comparators 312 and 313. Be compared. If CS AR ⁇ address signal ⁇ CEAR and the NORD flag 307 is in the set state, the contents of the address signal 250 are converted for access to the high-speed RAM 201. The high-speed RAM 201 is accessed instead of the / external memory 208. If the above conditions are not satisfied, the low-speed built-in ROM 202, built-in RAM 203, or external memory 208 is accessed by the address signal 250 as usual.
- the RAM address conversion information 316 is supplied from the RAM transfer controller 205 to the high-speed RAM 201, and the RAM address conversion information 316 and A conversion control signal 3141 is provided.
- the high-speed RAM 201 can be accessed by the access address calculated by the CPU access address—CSAR + RCAR.
- the path controller 204 selects the operation of the high-speed RAM 210 based on the conversion information 316 and the conversion control signal 3141. Further, the bus controller 204 uses the conversion control signal 310 to inhibit the operation of the ROM 202, the RAM 203, or the external memory 208 corresponding to the address signal 250 on the internal address bus IAB at that time.
- the access address of the high-speed RAM 201 is determined by connecting the upper part of the RC AR and the lower part of the address 250. Is also good. In this case, the values that can be set for CSAR 302 and CEAR 303 are naturally limited. Alternatively, the CEAR 303 may be abolished, and a match between the top of the address 250 and the top of the C SAR 302 may be made.
- the access speed is sufficient for all or any of the ROM 202 and the RAM 203, or a part of each of them, it is possible to adopt a configuration that allows one cycle access.
- the control of the RAM cache is unnecessary for the device connected to the internal path 206 and accessible by one cycle, and one clock cycle access by the CPU 200 is performed as usual.
- the data to be pre-transferred to the high-speed RAM 210 in the above embodiment is not limited to the data in the internal ROM and RAM, but only the data in the external memory or the data in the internal ROM and RAM and the external memory. And both data can be targeted. In these cases, the control can be realized by the same control as in the above embodiment.
- Fig. 35 shows a microcombiner with simultaneous transfer of data to high-speed RAM to speed up access (microcomputer with built-in simultaneous transfer format RAM cache). 2) is shown.
- the single-chip micro-computer of this embodiment (also simply referred to as micro-computer) MPU 3 includes a CPU 400, a ROM 402 in which the CPU 400 operating program or data is stored, a work area of the CPU 400, or a temporary storage area for data.
- An external memory 408 and the like are connected to the external pass interface 407 via an external bus 411.
- the high speed RAM 401 is shown in FIG. The difference from the one described in FIG. 34 is that the operation of the address converter 4010 is not controlled by the conversion control signal 5140, and the RAM address conversion information 516 is always added to the value of the internal address path IAB to achieve high speed operation. Supply to RAM401.
- the microcomputer MPU3 of the present embodiment is not particularly limited, but has a RISC architecture, and the CPU 400 executes an instruction in one clock cycle of the operation reference clock signal of the CPU 400 per instruction.
- Pipeline operation executes pipeline stages such as instruction fetch, instruction decode, instruction execution, and memory access so that the basic number of path access cycles is one clock cycle. I will do it.
- the internal bus 406 to which the CPU 400 is connected is a high-speed internal bus having a minimum operation cycle of one clock cycle, and includes an internal address bus IAB, an internal data bus IDB, and an internal control bus ICB.
- the respective circuit modules are connected to the internal path 406.
- the bus controller 404 controls the internal bus 406 and controls the access to the peripheral circuit 410.
- the bus controller 404 determines an access target area based on the upper bit of the address signal supplied from the internal path 406, and receives a path command or the like supplied from the internal path 406 to read / write access data width. The type of access such as is determined.
- the internal ROM 402 and the RAM 403 are selected in accordance with the determination results, and a control for selecting a chip for external access or giving a read Z-write instruction to the outside through an external bus interface is performed.
- the RAM 403 and the ROM 402 are low-speed internal memories that require two or more clock cycles for access.
- the high-speed RAM 401 is accessible in one clock cycle, and is used as a simultaneous transfer type RAM cache.
- the RAM transfer controller 405 controls to transfer required information of the built-in RAM 403 and the ROM 402 to the high-speed RAM 401.
- FIG. 37 shows a block diagram of the RAM transfer controller 405.
- the RAM transfer controller 405 has a caching block start address register (CSAR) 502, a caching block end address register (CEAR) 503, and an AM cache top address register (R CAR) 504, a control / status register (CSR). 505, and a control circuit 506 for controlling data transfer.
- the CS 505 It has a Nord flag (V) 508.
- a value to be compared with the address output by the CPU 400 is set in CSAR502, CEAR503, and RCAR504.
- the CSR 505 stores the setting data for controlling the RAM transfer controller 405 and the value including the valid flag 508.
- the registers 502 to 505 are made read / write accessible by the CPU 400, and the control circuit 506 decodes the value of the internal address path IAB to select each register, and via the internal data path IDB. Those Regis evenings will be lead Z-written.
- address information for designating a part or all of the area of the ROM 502 and the RAM 503 is set.
- the storage capacity of the specifiable range is determined by the storage capacity of the high-speed RAM 501.
- the comparison circuit 512 determines whether the value of the internal address bus IAB is equal to or greater than the value of the CSAR 502 or is equal to the value of the CSAR 502, and gives the determination result to the control circuit 506.
- the comparison circuit 513 determines whether the value of the internal address path I AB is equal to or less than the value of the CE AR 502 or equal to the value of the CEAR 502, and gives the determination result to the control circuit 506.
- the address signal 450 is supplied to the RAM transfer controller 405, and the supplied address signal is compared with the values of the CSAR 502 and CEAR 503 by the comparators 512 and 513. Be compared. The comparison result is given to the judgment circuit 514.
- the determination circuit 514 detects that the access address matches the value of the CSAR when the NORD flag 508 is in the invalid state, the determination circuit 514 continues until the address signal 450 matches the value of the CEAR 503.
- the address signal 450 changes from the value of CSAR502 to CEAR
- the CPU 400 accesses an instruction or data in the built-in ROM 402, the built-in RAM 403, or the external memory 408 while in the range of the value of 503, the access (read or write) is performed at the same time.
- the access address of the high-speed RAM 401 is calculated by the CPU access address—C SAR + R CAR, as in the above embodiment.
- the arithmetic unit 515 generates RAM address conversion information (RCAR-C SAR) 51 as in the above-described embodiment, and the arithmetic unit 40 10 of the high-speed RAM 401 receives the RAM address conversion information (RCAR-CSAR) 51.
- (CPU access address-C SAR + RCAR) is generated.
- the writing is performed in parallel with the access to the internal ROM 402, the internal RAM 403, or the external memory 408, as shown in FIG.
- the operation selection of the high-speed RAM 401 for such parallel high-speed RAM 401 access is controlled by receiving the conversion control information 5 140 by the bus controller 404.
- the access address of the high-speed RAM 401 may be a connection between the upper part of the RCAR and the lower part of the address signal 450.
- the configurable contents of C SAR 502 and CEAR 503 are limited.
- the CEAR 503 may be abolished, and the higher order of the address signal 450 may be compared with the upper order of the CSAR 502.
- the control circuit 506 sets the valid flag 508 to the set state. Turn around.
- the control circuit 506 has a means for detecting the end of the write operation to the high-speed RAM 401 in the address range from the value of the CSAR 502 to the address of the CEAR 503. Not particularly prepared. That is, in the address range where the access address by the CPU 400 is changed in order, the CSAR 502 and CEA This is because the value of R 503 may be set. Although not particularly limited, it is also possible to provide a circuit for sequentially detecting the presence / absence of access to each address in the address range from the value of CSAR 502 to CEAR 503 and detecting completion of access to all addresses in the range. c
- the control circuit 506 determines that the access address of the CPU is in the range of SAR ⁇ address ⁇ CEAR in the access of the CPU 400.
- the detection is made in 514, the selection of the operation of the internal ROM 402, the internal RAM 403, or the external memory 408 is suppressed by the bus controller 404 by the judgment control signal 5140.
- the bus controller 404 selects the operation of the high-speed RAM 401, supplies the high-speed RAM 401 with the RAM address conversion information 516, and operates the high-speed RAM 401 in one clock cycle. As a result, address access in that range can be sped up.
- the address signal used for accessing the high-speed RAM 401 is CPU access address-CSAR + RCAR, as in the above embodiment. If this address operation requires a time that cannot be ignored, the access address of the high-speed RAM 401 can be made by connecting the upper part of the RCAR and the lower part of the address 450 as described above.
- the data to be simultaneously transferred to the high-speed RAM 210 in the above embodiment is not limited to the data in the built-in ROM and RAM, but only the data in the external memory, or the data in both the built-in ROM and the RAM. De overnight can be targeted. In those cases, it can be realized by the same control as in the above embodiment.
- the processing performance can be improved in the same manner as the micro transfer device with a built-in pre-transfer format RAM cache, but the performance is improved.
- the range of the internal ROM / RAM that you want to speed up is copied to the high-speed RAM 401 at the same time when the CPU 400 accesses the range, the first time that range is executed, The performance depends only on the access time of the built-in ROM / RAM, but the second and subsequent executions are performed by accessing the high-speed RAM 401, so the speed is increased.
- controlling this external memory in the same way as the built-in ROMZRAM can prevent performance degradation.
- FIG. 1 is a block diagram showing an embodiment of a microcomputer (microcomputer with built-in RAM cache) for speeding up memory access.
- the MPU 4 has a CPU 600, a CPU 600 operating program or a ROM 6.02 in which data is stored, a work area of the CPU 600, or a temporary memory.
- RAM 603 as a storage area
- multiplier (MULT) 609 path controller 604
- peripheral circuit 610 external path interface 607
- high-speed RAM 601, address converter 613 address converter 613
- An external memory 608 and the like are connected to the external path interface 607 via an external path 611.
- the micro-view MPU4 of the present embodiment is not particularly limited, It has an ISC architecture, and the CPU 600 executes the instruction in one clock cycle of the operation reference clock signal of the CPU 600 per instruction, and sets the basic cycle number of the path access to one clock cycle.
- the pipeline stages such as instruction fetch, instruction decode, instruction execution, and memory access are executed by line operation.
- the internal path 606 to which the CPU 600 is connected is a high-speed internal path having a minimum operation cycle of one clock cycle, and includes an internal address bus IAB, an internal data bus IDB, and an internal control bus ICB.
- the respective circuit modules are connected to the internal path 606.
- a bus controller 604 controls the internal bus 606 and controls access to peripheral circuits 610.
- the RAM 603 and the ROM 602 are low-speed internal memories that require two or more clock cycles for access.
- the high-speed RAM 601 can be accessed in one clock cycle, and is used as a RAM cache of an address replacement type.
- the DMA controller 612 controls the transfer of required information such as the built-in RAM 603 and the ROM 602 to the high-speed RAM 601 in place of the CPU 600.
- the CPU 600 initializes the operation of the DMA controller 612.
- the control to enable the CPU 600 to access the data transferred to the high-speed RAM 601 by the DMA controller 612 in place of the built-in RAM 603 or the ROM 602 is not particularly limited, but the bus controller 604 performs the control.
- FIG. 40 shows an example block diagram of the bus controller 604.
- the path controller 604 determines the area to be accessed based on the upper bits of the address signal supplied from the internal path 606, and receives a path command supplied from the internal path 606, etc. Judge the type of access such as read / write access time.
- the internal ROM 602 and the RAM 603 are selected in accordance with the determination results, and a chip for external access and a read / write instruction are issued to the outside via the external pass-in interface 607.
- the control is performed by the control circuit 706.
- the bus controller 604 controls the high-speed RAM 601 by using a caching block start address register (CSAR) 702, a caching block end address register (CEAR) 703, a control / status register (CSR) 705, A RAM start address register 707, comparators 712 and 713, a decision circuit 715, and an address calculator 714 are provided.
- CSR 705 provides a parity flag 7051. The flag 7051 is set to a reset state after the DMA controller transfers necessary information of the built-in RAM 603 and the ROM 602 to the high-speed RAM 601 instead of the CPU.
- CSAR 702 and CEAR 703 a value to be compared with an address output from the CPU 600 is set.
- the start address of the address area where the high-speed RAM 601 is mapped is set in the RAM start address register 707.
- the registers 702, 703, 705, and 707 are made read-Z-write accessible by the CPU 600, and the control circuit 706 decodes the value of the internal address path IAB to select each register, and the internal data path IDB. Those Regis evenings are read / written.
- address information that specifies the range of data addresses of the ROM 602 and the RAM 603 transferred to the high-speed RAM 601 by the DMA controller 6 12 is set.
- the comparator circuit 712 determines whether the value of the internal address bus IAB is equal to or greater than the value of the CSAR 702 and provides the determination result to the control circuit 706. You.
- the comparison circuit 713 determines whether the value of the internal address bus IAB is equal to or smaller than the value of the CEAR 702, and gives the determination result to the control circuit 706. Accordingly, when the determination circuit 715 detects that the address signal supplied from the CPU 600 to the internal address path IAB is within the range of CSAR ⁇ address CEAR, the parity flag 7051 is set to the set state.
- the address calculator 714 subtracts the value of the CSAR 702 from the value of the RAM start address register (RCAR) 707 (RCAR-C SAR) and uses the resulting value as the RAM address conversion information.
- the signal is supplied to the high-speed RAM 601 as 716, and the conversion control signal 710 is activated and supplied to the high-speed RAM 601.
- the address calculator 714 is not operated, and the conversion control signal 710 is inactive, regardless of the value of the address of the internal path IAB. Is done.
- the control circuit 706 suppresses the operation selection of the ROM 602 or the RAM 603 specified by the value of the address bus IAB, and instead operates the high-speed RAM 601. Is selected by the selection signal (memory enable signal).
- FIG. 41 is a block diagram of the high-speed RAM 601 and the address calculator 613.
- the address arithmetic unit 613 adds the RAM address conversion information 716 to the value of the internal address path IAB, and uses this as the access address. Supplied to high-speed RA M60 1.
- the address calculator 613 supplies the value of the internal address bus ⁇ directly to the high-speed RAM 601.
- the parity flag 7051 is reset, so that the address signal output by the DMA controller 604 is output.
- High-speed RAM 60 1 accesses according to Is done.
- CPU 600 outputs address signal 650 via internal bus 606.
- the address signal 650 is supplied to the bus controller 604, and the supplied address signal is compared with the values of C SAR 702 and C EAR 703, respectively. If CSAR ⁇ address ⁇ CEAR, the conversion control signal 7150 is activated, and the address calculator 714 converts the access address of the CPU 600 into the address of the high-speed RAM 601.
- the CPU 600 can access data in the low-speed memory 602, 603, or 608 by accessing the high-speed RAM 601 at high speed.
- the access address of high-speed RAM 601 is set to the upper address of high-speed RAM 601 and the address signal.
- the lower part of 650 may be connected.
- the C EAR 603 may be abolished, and the higher order of the address signal 650 and the upper order of the CSAR 602 may be compared.
- the CPU 600 can access it as usual without controlling the RAM cache.
- the data transfer by address replacement to the high-speed RAM 210 in the above embodiment is not limited to the data in the built-in ROM and RAM. Or the data of both the built-in ROM and RAM and the external memory. In those cases, it can be realized by the same control as in the above embodiment.
- the user can execute the program At the time of initial setting, etc., the processing speed can be increased by previously transferring programs and data whose operation in the built-in ROM / RAM is to be accelerated to the high-speed RAM 601 by the DMA C controller 612 or the like. If you know where to increase the speed of a program completed with a C compiler or assembler, you can easily improve the performance with this function. This eliminates the penalty for cache misses and the transfer of high-speed routines during background processing.
- the execution time is exactly the same after the first pass and thereafter, making it easy to perform timing design.
- the program does not fit in the built-in ROMZRAM and runs into an external memory with a slow access time, controlling this external memory in the same way as the built-in ROM / RAM can prevent performance degradation.
- the peripheral circuit 11 may not be directly connected to the internal path 6 but may be connected to a bus dedicated to some peripheral function, and the bus dedicated to the peripheral function may be connected to the internal 6 via another interface circuit. It is possible. Coherency at the time of a data write between the cache memory CACHE and the external memory 13 can be maintained by a write-back or write-through method. In addition, all parity bits are collected at once to initialize the cache memory. It is also possible to separately provide a purge mechanism for clearing. Further, as the cache memory CACHE, it is possible to adopt any one of instruction only, data only, and instruction data mixed type, or a combination thereof.
- the control signal BE CNOP may be generated by the bus controller using the access area determination mechanism.
- the bus controller must be provided with a flag FLG for latching the notification of a cache hit / miss from the cache memory, and control the assertion / negation of the control signal BE CNOP. Further, the generation of such a control signal BE CNOP and the control of the assertion negation may be performed by a dedicated circuit. Further, the determination of the cacheable area / non-cacheable area is not limited to the configuration performed by the cache controller based on the access address as in the above embodiment. For example, the control bit for controlling the cache enable Z disable provided by the bus controller or provided in the cache controller is rewritten according to whether the access area determined by the bus controller is a non-cacheable area or a cacheable area. It may be performed by controlling. Industrial applicability
- the present invention is widely applied to various types of data processing systems including a central processing unit, a microcomputer incorporating a memory such as a ROM, a RAM, and a cache memory, and a microcomputer equipped with an external memory. can do.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Microcomputers (AREA)
- Advance Control (AREA)
- Memory System Of A Hierarchy Structure (AREA)
Abstract
A microcomputer, in which the memory and cache memory are optimally controlled to improve computer processing performance. A microcomputer (MPU) includes built-in memories (9, 10) mounted to the same semiconductor substrate with a cache memory (CACHE). The built-in memories are those which allow high speed access in the same way as a cache hit in the cache memory. High speed access can be made to the built-in memories (9, 10) in all cases in the same way as the cache hit by making them noncacheable, that is, by mapping the built-in memories (9, 10) to a noncacheable area. If they are cacheable, on the other hand, the data relating to a cache miss must be placed in the cache memory in the event of a cache miss during access to the built-in memories.
Description
明 細 書 マイクロコンビュ一夕 技術分野 Description Microcombination Technical Field
本発明は、中央処理装置と共にメモリなどを内蔵したシングルチップ 化されたマイクロコンピュータに係り、特に中央処理装置によるマイク 口コンビユー夕内外のメモリアクセス動作を高速化する技術に関し、例 えば、 中央処理装置が R I S C (Reduced Instruction Set Computer) アーキテクチャを有するマイクロコンビュー夕に適用して有効な技術 に関する。 背景技術 The present invention relates to a single-chip microcomputer incorporating a memory and the like together with a central processing unit, and more particularly, to a technology for accelerating a memory access operation inside and outside a microphone opening combination by a central processing unit, for example, a central processing unit. Relates to a technology that is effective when applied to a micro computer having a reduced instruction set computer (RISC) architecture. Background art
シングルチップマイクロコンビュー夕は、 R O M (Read Only Memory) や R A M (Random Access Memory) が C P U (中央処理装置 =Central Processing Unit) と共に単一半導体基板上に集積されているので、 一 般にその内蔵メモリを C P Uがアクセスするのに要する時間は短く、命 令やデータフェッチを高速化する上において有利である。特に R I S C アーキテクチャを採る C P Uを持つシングルチヅプマイクロコンビュ —夕では、 パイプライン形式で命令を実行していくので、 メモリのァク セススピードがそのままデータ処理性能に比例して効いてくるので、内 蔵メモリを C P Uの動作基準クロヅク信号の 1クロックサイクルでァ クセスできる形態を採るものがある。このとき外部メモリアクセスには 通常複数クロックサイクルを要する。そのようなシングルチップマイク 口コンビユー夕を製品化したものとしては、 例えば、 日経 B P社発行の 「日絰エレク トロニクス 1 9 9 2年 1 1月 2 3日号, n o . 5 6 8」
第 9 9頁乃至第 1 1 2頁に記載のものがある。 また、 特開平 2— 1 8 7 8 8 1号公報には、命令キヤヅシュメモリと該命令キヤッシュメモリに 命令がない場合にのみアクセスされる主記憶装置を中央処理装置と共 に同一チップに搭載した半導体集積回路が示されている。 In a single-chip microcontroller, a ROM (Read Only Memory) and a RAM (Random Access Memory) are integrated together with a CPU (Central Processing Unit) on a single semiconductor substrate. The time required for the CPU to access the memory is short, which is advantageous for speeding up instructions and data fetches. In particular, a single-chip microcomputer with a RISC architecture CPU—In the evening, because instructions are executed in a pipelined fashion, the memory access speed is directly proportional to the data processing performance. In some cases, the built-in memory can be accessed in one clock cycle of the CPU operation reference clock signal. At this time, external memory access usually requires a plurality of clock cycles. Examples of such a single-chip microphone with a combination of a mouthpiece and a commercialized product include, for example, “Nippon Electronics Corp., January 23, 1990, no. There are those described on page 99 to page 112. Japanese Patent Application Laid-Open No. 2-187879 discloses a semiconductor device in which an instruction cache memory and a main storage device accessed only when there is no instruction in the instruction cache memory are mounted on the same chip together with a central processing unit. An integrated circuit is shown.
本発明者は中央処理装置と共にキヤッシュメモリや内蔵メモリを搭 載したシングルチップ化されたマイクロコンピュー夕による内外のメ モリアクセス動作を高速化することについて検討した。 このとき、 外部 メモリアクセスによるデータ処理性能の低下と、マイクロコンビユー夕 の動作周波数向上に対するデータ処理性能向上の飽和という 2点に着 目した。 The present inventor has studied the speeding up of internal and external memory access operations by a single-chip microcomputer equipped with a cache memory and a built-in memory together with a central processing unit. At this time, we focused on two points: lowering of data processing performance due to external memory access, and saturation of improvement in data processing performance with respect to the improvement of the operating frequency of the micro-computer.
前者の外部メモリアクセスという点については、内蔵メモリアクセス は 1クロックサイクルで可能であるにもかかわらず、外部メモリァクセ スは複数クロックサイクルを要するので、極力内部メモリアクセスを行 うようにすることが得策であるが、プログラムサイズが大きく全てのプ ログラムコードを内蔵 R O Mに納めることができない場合は、外部メモ リにプログラムを配置しなければならない。 このとき、 一旦外部メモリ のプログラムを実行開始すると、 命令フェッチなどに時間がかかり、 デ 一夕処理性能は極めて低下してしまう。遅い外部メモリを利用する場合 にもデータ処理性能を向上させるには、マイクロコンビユー夕にキヤヅ シュメモリを内蔵させればよい。しかしながらシングルチヅプマイクロ コンビユー夕にはチップ上に各種周辺機能やメモリ類を搭載する必要 があり、あまり大きなサイズのキヤッシュメモリを搭載することはでき ない。小さいサイズのキャッシュメモリではヒッ ト率が低く、 データ処 理性能の向上はあまり期待できない。特に、 マイクロコンビユー夕内蔵 メモリもキャッシュ対象とする場合、キャッシュメモリのアクセス速度 と内蔵メモリのアクセス速度に大きな差がないときには、ヒッ ト率が低
ければ、キヤッシュミスに係るデータをキヤッシュメモリに追加する処 理によって、結局キヤヅシュメモリ搭載の意義がなくなる場合のあるこ とが明らかにされた。 Regarding the former external memory access, internal memory access is possible in one clock cycle, but external memory access requires multiple clock cycles, so it is advisable to make internal memory access as much as possible. However, if the program size is too large to store all the program codes in the built-in ROM, the program must be placed in external memory. At this time, once the execution of the program in the external memory is started, it takes time to fetch instructions, etc., and the processing performance is extremely reduced. In order to improve data processing performance even when a slow external memory is used, a cache memory may be built in the micro-computer. However, in the single-chip micro combination, it is necessary to mount various peripheral functions and memories on the chip, and it is not possible to mount a cache memory of a very large size. With a small cache memory, the hit ratio is low, and improvement in data processing performance cannot be expected much. In particular, if the internal memory of the microcomputer is also targeted for caching, the hit rate is low unless there is a large difference between the access speed of the cache memory and the access speed of the internal memory. If so, it became clear that the process of adding cache miss data to the cache memory may eventually lose the significance of installing the cache memory.
動作周波数向上に対するデ一夕処理性能向上の飽和という点に関し ては、例えば CPUの動作周波数が 2 OMH zであるとき CPUが内蔵 E PROMまたは内蔵マスク ROMを 1クロックサイクルでアクセス 可能であったとする。 このとき、 CPUの動作周波数がさらに向上して くると、大容量 ROMやフラッシュメモリなどのように大きなヮード線 容量ゃビッ ト線容量などによってアクセスタイムをあまり短縮できな い内蔵 ROMに対しては、そのアクセスに複数クロヅクサイクルを要す るようになる。そうなると、特にメモリアクセス時間がそのまま性能に 比例する R I S Cアーキテクチャーのマイクロコンビユー夕では動作 周波数を上げてもシステムのデータ処理性能が飽和してしまう。 Regarding the saturation of the performance improvement over the operating frequency, it is assumed that the CPU could access the built-in EPROM or built-in mask ROM in one clock cycle when the operating frequency of the CPU was 2 OMHz . At this time, if the operating frequency of the CPU is further improved, the built-in ROM, such as large-capacity ROM and flash memory, for which the access time cannot be reduced so much due to the large read line capacity and the bit line capacity, etc. Then, the access requires multiple clock cycles. In such a case, the data processing performance of the system saturates even if the operating frequency is increased, especially in a micro-computer with a RISC architecture in which the memory access time is directly proportional to the performance.
本発明の目的は、内蔵メモリと共にキャッシュメモリを搭載するシン グルチップのマイクロコンビュー夕における双方のメモリの動作をデ 一夕処理性能向上のために最適に制御することにある。 SUMMARY OF THE INVENTION It is an object of the present invention to optimally control the operation of both memories in a single-chip micro-computer with a built-in memory and a cache memory in order to improve data processing performance.
また、本発明の別の目的は、キャッシュメモリを内蔵しない場合にも、 マイクロコンビュー夕の内外に配置されたメモリのデータアクセスを 向上させることができるマイクロコンビユー夕を提供することにある。 本発明のその他の目的は、外部にメモリを拡張したときや内蔵メモリ が低速な場合にもデータ処理性能の低下を防ぐことができるマイクロ コンビュ一夕を提供することにある。 発明の開示 Another object of the present invention is to provide a micro-computer which can improve data access of memories arranged inside and outside the micro-computer even when a cache memory is not built-in. Another object of the present invention is to provide a micro-computer that can prevent a reduction in data processing performance even when the memory is extended externally or when the built-in memory has a low speed. Disclosure of the invention
本発明において、 1個の半導体基板に形成されたマイクロコンビユー 夕 (MPU, MPU 1) は、 中央処理装置 ( 1) と、 該中央処理装置に
よってアクセスされる内蔵メモリ (9 , 1 0) と、 前記中央処理装置に 内部バス ( 6) で結合されたキヤヅシュメモリ (CACHE) と、 前記 中央処理装置をマイクロコンビュー夕の外部ァドレス空間とインタフ エースさせるインタフェース手段 ( 1 1 , 12) と、 前記外部ァドレス 空間を前記キヤッシュメモリによるキヤヅシュの対象とし、前記内蔵メ モリをキャッシュの非対象に制御する制御手段(2, 72) とを含む。 このように、 マイクロコンビュ一夕 (MPU, MPU 1) は、 キヤヅ シュメモリ (CACHE) と共に内蔵メモリ (9, 1 0) を同一半導体 基板に搭載し、当該内蔵メモリはキヤヅシュメモリにおけるキヤヅシュ ヒヅ卜の場合と同様に高速アクセス可能な内蔵メモリとされる。内蔵メ モリ (9 , 10) をキャッシュ対象としないこと、 換言すれば内蔵メモ リ (9, 10) をノンキヤッシャブルエリアにマツビングする事により、 どのような場合にも内蔵メモリアクセスをキャッシュヒッ 卜と同様に 高速アクセスできることを保証する。すなわち、 マイクロコンビユー夕 内蔵メモリもキヤヅシュの対象とした場合には、当該内蔵メモリのァク セスに際してキヤヅシュミスを生ずると、キャッシュミスに係るデータ をキャッシュメモリに追加するための処理を行わなければならないが、 上記手段においてはそのような事態を一切生じない。 これにより、 キヤ ッシュメモリ (CACHE) 自体の記憶容量が小さくキャッシュヒヅ ト 率が低くても、 高速にアクセス可能な内蔵メモリ ( 9 , 10) と組み合 わせて利用されることで、 中央処理装置によるマイクロコンビユー夕 (MPU, MPU 1 )の内外に対する総合的なヒット率を高めることが できる。 したがって、 中央処理装置による動作プログラムの全体的な実 行過程におけるメモリアクスの高速化、ひいてはデータ処理性能を全体 的に高めることができる。 In the present invention, the microcombiner (MPU, MPU 1) formed on one semiconductor substrate includes a central processing unit (1) and a central processing unit (1). A built-in memory (9, 10) to be accessed, a cache memory (CACHE) coupled to the central processing unit by an internal bus (6), and an external address space of a micro-computer. Interface means for causing the external address space to be cached by the cache memory, and control means (2, 72) for controlling the internal memory to be non-cacheable. As described above, the microcomputer (MPU, MPU1) mounts the built-in memory (9, 10) together with the cache memory (CACHE) on the same semiconductor substrate, and the built-in memory is the case of the cache memory in the cache memory. It is a built-in memory that can be accessed at a high speed in the same manner as described above. The internal memory (9, 10) is not targeted for caching, in other words, the internal memory (9, 10) is mapped to a non-cacheable area, so that the internal memory access can be cache hit in any case. As well as high-speed access. In other words, if the built-in memory is also targeted for cache, if a cache miss occurs during access to the built-in memory, processing for adding data related to the cache miss to the cache memory must be performed. However, the above-mentioned means does not cause such a situation at all. As a result, even when the cache memory (CACHE) itself has a small storage capacity and a low cache hit rate, it can be used in combination with the built-in memory (9, 10) that can be accessed at a high speed. The overall hit rate for inside and outside of the combination (MPU, MPU 1) can be increased. Therefore, the speed of the memory access in the entire execution process of the operation program by the central processing unit can be increased, and the data processing performance can be improved as a whole.
マイクロコンビユー夕は一般的に割り込みなどのタスク切替えが頻
繁に発生し、プログラムカウン夕の値が大きく変化する場合が多いので、 キャッシュメモリ (CACHE)のヒヅト率が低下する傾向が高い。 こ のとき、内蔵メモリと共にキャッシュメモリを搭載している前記マイク 口コンビユー夕 (MPU, MPU 1) において、 割り込みベクタと割り 込み処理プログラムを内蔵メモリに入れるようにし、当該メモリをキヤ ヅシュの対象としないことにより、割り込みが頻出するプログラムでも キヤッシュヒットの場合と同様に、割り込み処理プログラムへの遷移を 高速化する事ができ、この点においてもデータ処理性能もしくはデータ 処理速度を向上させることができる。 Generally, task switching such as interrupts is frequent in microcombinations. Since it frequently occurs and the value of the program count greatly changes in many cases, the hit rate of the cache memory (CACHE) tends to decrease. At this time, in the microphone interface (MPU, MPU1), which has a cache memory together with the built-in memory, the interrupt vector and the interrupt processing program are stored in the built-in memory, and the memory is targeted for cache. By not doing so, it is possible to speed up the transition to the interrupt processing program, as in the case of a cache hit, even in a program in which interrupts frequently occur, and in this regard, the data processing performance or data processing speed can be improved.
シングルチップ化されたマイクロコンビュ一夕に搭載可能なキヤッ シュメモリ及びプログラム格納用 ROMの容量には限りがあり、それを コスト及びデータ処理性能の両面から最適化するには、前記キヤッシュ メモリが 2のべき乗数のウェイ数 (way) を有し、 ROMのデータ記憶 容量を R [KB= ilo-byte] とし、 前述のキャッシュメモリのデータ 記憶容量を C [B=byte] としたとき、 前述のキャッシュメモリのゥェ ィ数とキャッシュェントリのデ一夕ライン長に応じて定数 a、 bを、 8 way以上/ 4バイ トライン長: a=24. 01、 b = 8194 8 way以上 8バイ トライン長: a= 9. 00、 b = 3328 8 way以上 Zl 6バイ トライン長: a= 4. 00、 b = 1280 8 way以上/ 32バイ トライン長: a= 1. 75、 b= 512 8 way以上 64パイ トライン長以上: a = 0. 75、 b = 256 4way/ 4パイ トライン長: a=25. 19、 b = 8804 The capacity of the cache memory and program storage ROM that can be mounted on a single-chip microcomputer is limited, and in order to optimize it both in terms of cost and data processing performance, the cache memory must have two When the number of ways is a power, the data storage capacity of the ROM is R [KB = ilo-byte], and the data storage capacity of the cache memory is C [B = byte]. Constants a and b, 8 way or more / 4-byte line length: a = 24.01, b = 8194 8 way or more 8-byte line length according to the number of memory rows and the cache entry data line length : A = 9.00, b = 3328 8 way or more Zl 6 byte line length: a = 4.00, b = 1280 8 way or more / 32 byte line length: a = 1.75, b = 512 8 way or more 64 More than pipeline length: a = 0.75, b = 256 4way / 4 pipeline length: a = 25.19, b = 8804
4 wa y/ 8バイ トライン長: a= 10. 00、 b = 3584 4 way / 8 byte line length: a = 10.00, b = 3584
4way/l 6バイ トライン長: a= 5. 00、 b = 1536 4wayZ32バイ トライン長: a= 1. 84、 b= 557 4 way / l 6 byte line length: a = 5.00, b = 1536 4wayZ32 byte line length: a = 1.84, b = 557
4 way/64バイ トライン長以上: a = 0. 79、 b = 276
2way/ 4バイ トライン長: a = 32. 4 1、 b= 1 1 1 12 2 wa y/ 8バイ トライン長: a= l l . 90、 b = 4328 2 wa y/ 1 6パイ トライン長: a= 5. 50、 b= 1 792 2 wa yZ32パイ トライン長: a= 2. 03、 b= 65 1 2 way/64パイ トライン長以上: a = 0. 87、 b = 3 1 6 1 wa y/ 4バイ トライン長: a = 36. 06、 b = 1436 1 1 wa y/ 8バイ トライン長: a= 1 8. 75、 b = 6 59 1 lway/1 6バイ トライン長: a= 8. 00、 b = 28 1 6 lway/32パイ トライン長: a= 4. 00、 b = 1280 1 wa y/64バイ トライン長以上: a= 1. 48、 b= 549 と定めたとき、 C + aRが bを越えない関係を満足させるとよい。 キャッシュメモリのキャッシュヒッ ト又はキャッシュミスの判定に 要する一定期間、外部ァドレス空間に対するアクセスサイクルの起動を ウェイ トさせることにより、 キャッシュヒットになるとき、既に起動し たパスサイクルを途中で停止させることによって外部メモリのデータ が破壊される事態を防止することができる。 しかしながら、 そのような ウェイ ト期間は、キヤッシュミスの場合における外部パスサイクル起動 を遅らせることになる。一旦キャッシュミスが発生した場合、 キヤヅシ ュミスの状態は複数回に亘つて連続するという事情を考慮し、外部メモ リアクセスを極力高速化するため、前記イン夕フェース手段は、外部ァ ドレス空間に対するアクセスサイクルの起動を、キヤッシュメモリのキ ャッシュヒッ ト又はキャッシュミスの判定に要する一定期間ウェイ ト し、 当該ウェイ ト動作を、 キャッシュヒヅトの状態がキャッシュミスの 状態に変化された次のアクセスサイクルから抑止し、抑止したウェイ ト 動作を、キヤッシュミスの状態がキヤッシュヒットの状態に変化された 次のアクセスサイクルから再開する。 このとき、 当該キャッシュミスの
状態がキヤッシュヒットの状態に変化されたとき、前記キヤッシュメモ リはヒッ卜に係るデータの入出力動作を抑止し、前記ィン夕フェース手 段は外部ァドレス空間に対するアクセスサイクルを起動する。 4 way / 64 byte line length or more: a = 0.79, b = 276 2-way / 4-byte line length: a = 32.41, b = 1 1 1 12 2 way / 8-byte line length: a = ll.90, b = 4328 2 way / 16 line length: a = 5.50, b = 1 792 2 wa yZ32 pipeline length: a = 2.03, b = 65 1 2 way / 64 pipeline length or more: a = 0.87, b = 3 1 6 1 way / 4 Byte line length: a = 36.06, b = 1436 1 1 way / 8 byte line length: a = 1 8.75, b = 659 1 lway / 16 byte line length: a = 8.00, b = 28 16 lway / 32 byte line length: a = 4.00, b = 1280 1 way / 64 byte line length or more: When a = 1.48, b = 549, C + aR becomes b It is good to satisfy the relationship that does not exceed. By waiting for the start of the access cycle to the external address space for a certain period of time required to determine the cache hit or cache miss of the cache memory, when a cache hit occurs, the already started pass cycle is stopped halfway. It is possible to prevent the data in the external memory from being destroyed. However, such wait periods will delay the activation of the external pass cycle in the event of a cache miss. Once a cache miss has occurred, taking into account the fact that the state of the cache miss is continuous a plurality of times, and in order to speed up external memory access as much as possible, the interface means must provide access to the external address space. Waiting for the start of the cycle for a certain period of time required for determining the cache hit or cache miss of the cache memory, and suppressing the wait operation from the next access cycle in which the cache hit status is changed to the cache miss status; The suppressed wait operation is resumed from the next access cycle after the cache miss state is changed to the cache hit state. At this time, When the state is changed to the cache hit state, the cache memory inhibits the input / output operation of the data related to the hit, and the interface starts an access cycle to the external address space.
ダイレク トマヅプキヤヅシュメモリゃウェイ数の少ないセッ トァソ シァティブ形式のキヤヅシュメモリの場合には、一旦キヤヅシュミスす るとしばらくその状態が連続する性質が顕著である。 このとき、上記の ように、キヤヅシャブルエリァに対するアクセスにおいては前回のキヤ ッシャブルエリアに対するアクセスがキャッシュヒッ トである場合に だけ外部パスサイクルの起動にウェイ トをかけ、キヤッシャブルエリア に対するアクセスにおいて前回のキヤッシャブルエリアに対するァク セスがキヤッシュミスである場合には前記ウェイ トを行わないように する。 これにより、 キヤヅシュミス時のパスサイクルにァドレスヒヅト 判定のための余分なウェイ トサイクルが毎回入らないので、キャッシュ ミス時にけるメモリアクセスの性能低下を防ぐことができる。 In the case of a cache memory of a set-associative type having a small number of direct-map cache memory ways, once a cache miss occurs, the state of the state is remarkably continued for a while. At this time, as described above, in the access to the cacheable area, the activation of the external path cycle is delayed only when the previous access to the cacheable area is a cache hit, and in the access to the cacheable area. If the previous access to the cacheable area was a cache miss, the wait shall not be performed. As a result, since an extra wait cycle for address hit determination is not included in the pass cycle at the time of cache miss every time, it is possible to prevent a decrease in memory access performance at the time of a cache miss.
上記マイクロコンピュータにおいてデータ処理性能を向上させる最 適な形態は、前記中央処理装置は R I S Cアーキテクチャを有し、前記 中央処理装置、 内蔵メモリ、及びキャッシュメモリは内部バスを共有し、 中央処理装置は当該内部バスをその動作基準クロック信号の 1クロッ クサイクルを最高アクセス速度としてアクセスするものである。前記キ ャヅシュメモリは、中央処理装置によるアクセスの開始から該中央処理 装置の動作基準クロック信号の 1クロックサイクルの期間を以てキヤ ッシュヒッ トに係るデ一夕を前記内部バスに出力するものであれば更 にょい。 In the above-mentioned microcomputer, the most suitable form for improving the data processing performance is that the central processing unit has a RISC architecture, the central processing unit, the built-in memory and the cache memory share an internal bus, and the central processing unit It accesses the internal bus with one clock cycle of its operation reference clock signal as the maximum access speed. The cache memory is further provided so long as it outputs a data relating to a cache hit to the internal bus in a period of one clock cycle of an operation reference clock signal of the central processing unit from the start of access by the central processing unit. No.
別のマイクロコンビユー夕 (M P U 2 ) は、 前記キヤヅシュメモリに 代えて、 内蔵メモリ ( 2 0 2 , 2 0 3 ) よりもアクセス動作の速い高速 R A M ( 2 0 1 ) を採用する。 更に、 中央処理装置 ( 2 0 0 ) が特定 (
C TARの値)のアクセスを行なったことをトリガとし、 中央処理装置 からバス権を獲得して前記内蔵メモリ ( 202, 203 )又は前記外部 ァドレス空間の特定ァドレス ( 208 )から別の特定ァドレスまでの内 容を高速 RAM (20 1 ) に転送し、 転送後における中央処理装置のァ クセスが前記転送元ァドレスであるとき(C SAR アドレス≤CEA R)、 当該アクセス対象を高速 RAMに切換え制御する転送制御手段 ( 205 ) を採用する。高速 RAMへのデータ転送対象は、 内蔵メモリ又 は外部メモリの何れか一方に限定したり、或いは双方を対象とすること もできる。 Another micro-computer (MPU 2) employs a high-speed RAM (201) having a faster access operation than the built-in memory (202, 203) instead of the cache memory. Furthermore, the central processing unit (200) is specified ( Triggered by the access to the value of C TAR), the bus right is acquired from the central processing unit, and from the specific address (208) of the internal memory (202, 203) or the external address space to another specific address. Is transferred to the high-speed RAM (201), and when the access of the central processing unit after the transfer is the transfer source address (CSAR address ≤ CEAR), the access target is switched to the high-speed RAM and controlled. The transfer control means (205) is employed. The target of data transfer to the high-speed RAM can be limited to either the internal memory or the external memory, or both.
このようにマイクロコンピュータ (MPU 2)に内蔵された高速 R A The high-speed RA built in the microcomputer (MPU 2)
M (20 1)に事前にデータ若しくはプログラムを転送して利用可能に することができる。例えば、 アクセスタイムが遅い内蔵メモリのプログ ラムなどのうち、ある部分を予め高速 RAM内に転送しておいて実行さ せるようにすることにより、 その部分の実行を高速化できる。 当然、 内 蔵メモリに収まりきれずにプログラムが外部メモリにはみ出しても、こ の外部メモリを内蔵メモリと同様に制御すれば性能低下を防ぐことが できる。シングルチップ化されたマイクロコンビユー夕が対象にする主 なアプリケーションでは、高速性が要求されるルーチンは割り込みサ一 ビスの部分など比較的そのァドレス範囲と実行タイミングが限定され ており、あまり処理性能が必要でないメインルーチンなどのパックグラ ンドル一チンを実行中に高速実行が必要な部分をあらかじめ高速 R A Mに転送しておくことができる。その結果、 プログラム処理全体の性能 が向上される。 Data or programs can be transferred to M (201) in advance and made available. For example, by transferring a certain portion of a program in an internal memory having a slow access time to a high-speed RAM in advance and executing it, the speed of execution of the portion can be increased. Naturally, even if the program does not fit in the internal memory and runs out to the external memory, performance control can be prevented by controlling this external memory in the same way as the internal memory. In the main applications targeted at single-chip micro-computers, routines that require high speed are relatively limited in the address range and execution timing, such as interrupt service parts, resulting in poor processing performance. During the execution of a packed routine, such as a main routine that does not require a program, parts requiring high-speed execution can be transferred to high-speed RAM in advance. As a result, the performance of the entire program processing is improved.
更に別のマイクロコンビユー夕 (MPU3) は、 前記キャッシュメモ リに代えて、 内蔵メモリ (402 , 403) よりもアクセス動作の速い 高速 RAM (40 1) を採用し、 更に、 中央処理装置 (400) が内蔵
メモリ (402, 403)又は前記外部ァドレス空間 (408) をァク セスしたことをトリガとし、中央処理装置によるその内蔵メモリァクセ ス又は外部ァドレス空間のアクセスに並行して当該アクセスデ一夕を 高速 RAM (401) に転送する制御を所定のアドレス範囲 (CSAR ≤ァドレス≤CE AR)に対して行い、所定のァドレス範囲の全てのァ ドレスに対する前記データ転送完了後における中央処理装置のァクセ スが前記転送元データのァドレスであるとき当該アクセス対象を高速 RAMに切換え制御する転送制御手段(405 )を採用する。高速 RA Mへのデ一夕転送対象は、内蔵メモリ又は外部メモリの何れか一方に限 定し、 或いは双方を対象とすることもできる。 Still another microcomputer (MPU3) employs a high-speed RAM (401), which has a faster access operation than the built-in memory (402, 403), instead of the cache memory. ) Is built-in Triggered by accessing the memory (402, 403) or the external address space (408), the access data is stored in the high-speed RAM in parallel with the access to the internal memory access or the external address space by the central processing unit. (401) is performed for a predetermined address range (CSAR ≤ address ≤ CE AR), and the access of the central processing unit after the completion of the data transfer for all the addresses in the predetermined address range is performed by the transfer. A transfer control means (405) for switching and controlling the access target to a high-speed RAM when the address is the original data is adopted. Data transfer to the high-speed RAM can be limited to either the internal memory or the external memory, or both.
データ処理性能をあまり必要としないパックグランド処理が少ない 場合には、高速化したい範囲の情報を予め転送するための時間を割きに くい。 このため、 上記のように、 内蔵メモリの高速化したい範囲を中央 処理装置がアクセスしたとき、それに並行して高速 RAMへも転送する ようにしておけば、その範囲を初めて実行する際は内蔵メモリのァクセ スタイムに依存する性能しか出ないが、 2回目以降の実行は高速 RAM のアクセスとなるため高速化される。当然、 内蔵メモリに収まりきれず にプログラムが外部メモリにはみ出しても、この外部メモリを内蔵メモ リと同様に制御すれば性能低下を防ぐことができる。 If there is little background processing that does not require much data processing performance, it is difficult to allocate time in advance to transfer information in a range to be speeded up. For this reason, as described above, if the central processing unit accesses the range in which the internal memory speed is to be increased, it is also transferred to the high-speed RAM in parallel, so that when the range is executed for the first time, the internal memory Although the performance depends only on the access time, the second and subsequent executions are performed by accessing the high-speed RAM and the speed is increased. Naturally, even if the program runs out of the external memory without being able to fit in the internal memory, performance control can be prevented by controlling the external memory in the same way as the internal memory.
その他のマイクロコンビユー夕 (MPU4)は、 前記キャッシュメモ リに代えて、 内蔵メモリ ( 602, 603 ) よりもアクセス動作の速い 高速 RAM (601) を採用し、 更に、 内蔵メモリ又は外部メモリ (6 08) から前記高速 RAMへのデ一夕転送を行うデータ転送制御手段 ( 612)と、前記高速 RAMに転送されたデータの転送元アドレス(C S AR≤ァドレス≤ C EAR)に対する中央処理装置のアクセスを前記 高速 RAMへのアクセスに切換え制御するアクセス切換え制御手段( 6
0 4 ) とを採用する。高速 R A Mへのデータ転送対象は、 内蔵メモリ又 は外部メモリの何れか一方に限定し、或いは双方を対象とすることもで ぎる。 Other microcomputers (MPU4) employ a high-speed RAM (601), which is faster in access operation than the built-in memory (602, 603), instead of the cache memory. 08) and a data transfer control means (612) for performing data transfer from the central processing unit to the high-speed RAM, and a central processing unit access to a transfer source address (CS AR ≤ address ≤ CEAR) of the data transferred to the high-speed RAM. Switching control means (6) for switching and controlling access to the high-speed RAM. 0 4). The target of data transfer to the high-speed RAM can be either internal memory or external memory, or both.
そのように、中央処理装置が内蔵メモリのある指定された範囲をァク セスしょうとしたときに、無条件に高速 R A Mをアクセスするように構 成すれば、ユーザがプログラムを初期設定する時などに予め、高速 R A M内に内蔵メモリ内の高速化したいプログラムやデータを転送してお けば、 データ処理性能を向上させることができる。 Cコンパイラゃァセ ンブラなどで完成されたプログラムのうち高速化すべきところがわか つていれば、 上記構成にて簡単にデータ処理性能を向上できる。この手 段によれば、 キャッシュミスによるペナルティや、パックグランド処理 中の高速化ルーチンの転送がなくなる。 また、 実行時間が、 初回通過時 とそれ以降も全く同じになり、タイミング設計がやり易い特長を持つ。 当然、内蔵メモリに収まりきれずにプログラムが外部メモリにはみ出し ても、この外部メモリを内蔵メモリと同様に制御すれば性能低下を防ぐ ことができる。 図面の簡単な説明 In this way, if the central processing unit tries to access a specified range of the internal memory and unconditionally accesses the high-speed RAM, it can be used when the user initializes the program. If the programs and data to be accelerated in the built-in memory are previously transferred to the high-speed RAM, the data processing performance can be improved. If the program to be accelerated is known among the programs completed by the C compiler assembler, the data processing performance can be easily improved by the above configuration. According to this method, a penalty due to a cache miss and transfer of a high-speed routine during the background processing are eliminated. In addition, the execution time is exactly the same at the time of the first passage and after that, which makes it easy to perform timing design. Naturally, even if the program does not fit in the internal memory and runs out to the external memory, performance control can be prevented by controlling this external memory in the same way as the internal memory. BRIEF DESCRIPTION OF THE FIGURES
第 1図は本発明の一実施例に係るシングルチップマイクロコンビュ —夕の一実施例プロヅク図である。 FIG. 1 is a block diagram of an embodiment of a single-chip microcombination according to an embodiment of the present invention.
第 2図は第 1図に示されたマイクロコンピュー夕に含まれるパスコ ントローラと外部パスィン夕フェースの一例プロック図である。 FIG. 2 is a block diagram showing an example of a pass controller and an external pass interface included in the microcomputer shown in FIG.
第 3図は第 1図に示されたマイクロコンビユー夕における内蔵 R O M有効モードにおけるアドレスマヅビング図である。 FIG. 3 is an address mapping diagram in the built-in ROM valid mode in the micro-combination shown in FIG.
第 4図は第 1図に示されたマイクロコンビユー夕における内蔵 R O M無効モードにおけるアドレスマッピング図である。
第 5図は CPUが出力するアドレス信号の説明図である。 FIG. 4 is an address mapping diagram in a built-in ROM invalid mode in the micro-computer shown in FIG. FIG. 5 is an explanatory diagram of an address signal output by the CPU.
第 6図はキヤヅシュメモリの一例プロック図である。 FIG. 6 is an example block diagram of the cache memory.
第 7図はノンキヤッシャブルエリアに対するアクセスの一例として CPUが RAM又は ROMをリードアクセスするときのタイミングチ ヤートである。 FIG. 7 is a timing chart when the CPU performs a read access to the RAM or ROM as an example of access to the non-cacheable area.
第 8図は C P Uによるキヤッシャブルエリアに対するキヤヅシュヒ ヅト時のリードアクセスのタイミングチャートである。 FIG. 8 is a timing chart of read access to the cacheable area by the CPU during a cache shot.
第 9図は C P Uによるキヤヅシャブルエリァに対するキヤヅシユミ ス時のリードアクセスのタイミングチャートである。 FIG. 9 is a timing chart of a read access by the CPU to the cacheable area during a cache error.
第 10図はキヤヅシュミス時に制御信号 B ECNOPがネゲートさ れる場合のタイミングチャートである。 FIG. 10 is a timing chart when the control signal B ECNOP is negated during a cache miss.
第 1 1図はキャッシュヒット時に制御信号 BE CNOPがネゲート される場合のタイミングチャートである。 FIG. 11 is a timing chart when the control signal BE CNOP is negated at the time of a cache hit.
第 12図は複数のバスアクセスサイクルにおけるキャッシュヒヅ ト 時とキヤッシュミス時の状態を示す説明図である。 FIG. 12 is an explanatory diagram showing a state during a cache hit and a state during a cache miss in a plurality of bus access cycles.
第 13図はキヤッシュメモリを内蔵 RAMと兼用する場合の構成説 明図である。 FIG. 13 is an explanatory diagram of the configuration when the cache memory is also used as the built-in RAM.
第 14図はキヤッシュメモリを内蔵 RAMと兼用する場合における ァドレス信号とァドレスアレイのキャッシュ夕グァドレスとの説明図 である。 FIG. 14 is an explanatory diagram of an address signal and a cache address of an address array when the cache memory is also used as the built-in RAM.
第 15図は本発明の別の実施例に係るシングルチヅプマイクロコン ピュー夕のブロック図である。 FIG. 15 is a block diagram of a single-chip microcomputer according to another embodiment of the present invention.
第 16図は第 15図に示されるマイクロコンビユー夕におけるバス コントローラと外部パスィン夕フエースの一例ブロヅク図である。 第 17図は内蔵メモリにダイナミックなアクセス比率 r、外部メモリ アクセス時におけるキャッシュメモリのヒヅ ト率 h及び総合ヒッ ト率
Hの関係を示す説明図である。 FIG. 16 is a block diagram showing an example of a bus controller and an external password interface in the micro-computer shown in FIG. Figure 17 shows the dynamic access ratio r to the internal memory, the cache memory hit ratio h when accessing the external memory, and the total hit ratio. FIG. 4 is an explanatory diagram showing the relationship of H.
第 18図は内蔵メモリにダイナミックなアクセス比率 r、外部メモリ アクセス時におけるキャッシュメモリのヒッ ト率 h及び総合ヒヅ ト率 Hの関係を示す別の説明図である。 FIG. 18 is another explanatory diagram showing the relationship between the dynamic access ratio r to the internal memory, the hit ratio h of the cache memory at the time of accessing the external memory, and the total hit ratio H.
第 19図は外部アクセスクロックサイクル数 M = 3のときにおける 平均アクセスクロックサイクル数 S aの説明図である。 FIG. 19 is an explanatory diagram of the average number of access clock cycles Sa when the number of external access clock cycles M = 3.
第 20図は外部アクセスクロックサイクル数 M = 3のときにおける 平均アクセスクロックサイクル数 S aの別の説明図である。 FIG. 20 is another explanatory diagram of the average number of access clock cycles Sa when the number of external access clock cycles M = 3.
第 2 1図は外部アクセスクロックサイクル数 M= 4のときにおける 平均アクセスクロックサイクル数 S aの説明図である。 FIG. 21 is an explanatory diagram of the average number of access clock cycles Sa when the number of external access clock cycles M = 4.
第 22図は外部アクセスクロックサイクル数 M=4のときにおける 平均アクセスクロックサイクル数 S aの別の説明図である。 FIG. 22 is another explanatory diagram of the average number of access clock cycles Sa when the number of external access clock cycles M = 4.
第 23図はキャッシュの構成 (way数、 ライン長、 容量) に対する ミス率 (1一 h) を示す説明図である。 Fig. 23 is an explanatory diagram showing the miss rate (1-1h) for the cache configuration (number of ways, line length, capacity).
第 24図は第 23図に示される値から総合ヒヅト率 H = r + h— r hが 0. 9になる rの値を算出して得られた説明図である。 FIG. 24 is an explanatory diagram obtained by calculating the value of r at which the total heat rate H = r + h−r h becomes 0.9 from the values shown in FIG.
第 25図は PRG= 5 12 K Bとし R 0 M容量 Rを計算して得られ た説明図である。 FIG. 25 is an explanatory diagram obtained by calculating R 0 M capacity R with PRG = 512 KB.
第 26図は第 27図〜第 30図に示される内蔵 ROM容量とキヤッ シュメモリ容量との関係を式 C + aR = bで近似したときのキヤッシ ュメモリの構成に対応する定数 a、 bの説明図である。 Fig. 26 is an explanatory diagram of the constants a and b corresponding to the configuration of the cache memory when the relationship between the internal ROM capacity and the cache memory capacity shown in Figs. 27 to 30 is approximated by the equation C + aR = b. It is.
第 27図は第 25図に示される結果に基づいてキャッシュ容量 Cと 内蔵 R OM容量 Rの関係をフルァソシァティブ(full)キヤッシュメモ リに関して得た説明図である。 FIG. 27 is an explanatory diagram showing the relationship between the cache capacity C and the built-in ROM capacity R for the full cache memory based on the results shown in FIG.
第 28図は第 25図に示される結果に基づいてキャッシュ容量 Cと 内蔵 ROM容量 Rとの関係を 4ウェイセヅトァソシァティブ(4way)キ
ャヅシュメモリに関して得た説明図である。 FIG. 28 shows the relationship between the cache capacity C and the internal ROM capacity R based on the results shown in FIG. 25 using a 4-way set-associative (4-way) key. FIG. 4 is an explanatory diagram obtained for a cache memory.
第 29図は第 25図に示される結果に基づいてキャッシュ容量 Cと 内蔵 R OM容量 Rとの関係を 2ウェイセヅトァソシァティブ(2way)キ ャヅシュメモリに関して得た説明図である。 FIG. 29 is an explanatory diagram showing the relationship between the cache capacity C and the built-in ROM capacity R based on the results shown in FIG. 25 for a two-way set-associative (2 way) cache memory.
第 30図は第 25図に示される結果に基づいてキャッシュ容量 Cと 内蔵 R OM容量 Rの関係をダイレクトマップ(direct)キャッシュメモ リに関して得た説明図である。 FIG. 30 is an explanatory diagram showing the relationship between the cache capacity C and the built-in ROM capacity R based on the results shown in FIG. 25 for a direct map (direct) cache memory.
第 31図は高速 RAMに事前にデ一夕を転送して全体としてのメモ リアクセスの高速化を図ったマイクロコンビュー夕の一実施例プロッ ク図である。 FIG. 31 is a block diagram of an embodiment of a microcomputer in which data is transferred to a high-speed RAM in advance to speed up memory access as a whole.
第 32図は第 3 1図に示されるマイクロコンビユー夕に含まれる R AM転送コントローラのブロック図である。 FIG. 32 is a block diagram of a RAM transfer controller included in the micro-computer shown in FIG.
第 33図はァドレス変換の説明図である。 FIG. 33 is an explanatory diagram of the address conversion.
第 34図は高速 RAM及びァドレス変換器のプロック図である。 第 35図は高速 RAMに同時にデータを転送してアクセスの高速化 を図ったマイクロコンビユー夕の一実施例プロヅク図である。 FIG. 34 is a block diagram of the high-speed RAM and the address converter. FIG. 35 is a block diagram of an embodiment of a microcombiner in which data is simultaneously transferred to a high-speed RAM to speed up access.
第 36図は第 35図に示されるマイクロコンビユー夕に含まれる高 速 RAMのブロック図である。 FIG. 36 is a block diagram of the high-speed RAM included in the micro-computer shown in FIG.
第 37図は RAM転送コントローラのブロック図である。 FIG. 37 is a block diagram of a RAM transfer controller.
第 38図は高速 RAMへの並列ライ ト夕イミングの説明図である。 第 39図は DM ACなどによって低速メモリの情報をあらかじめ高 速 RAMに転送しておき当該低速メモリに対するアクセスァドレスを 高速 RAMのァドレスに置き換えてメモリアクセスの高速化を図った マイクロコンビユー夕の一実施例プロヅク図である。 Figure 38 is an illustration of parallel writing to a high-speed RAM. Fig. 39 shows a microcombiner in which information in a low-speed memory is transferred to high-speed RAM in advance by using a DMAC, and the access address for the low-speed memory is replaced with the address of the high-speed RAM to speed up memory access. FIG. 3 is a working block diagram of the embodiment.
第 40図は第 39図に示されるマイクロコンビユー夕に含まれるパ スコントローラの一例ブロヅク図である。
第 41図は高速 RAM及びァドレス演算器のプロヅク図である。 発明を実施するための最良の形態 FIG. 40 is an example block diagram of a path controller included in the micro-combination shown in FIG. 39. FIG. 41 is a block diagram of the high-speed RAM and the address arithmetic unit. BEST MODE FOR CARRYING OUT THE INVENTION
本発明の詳細な内容は、 《 1》〜《 5》の項目に分けて順次説明され ている。 The detailed contents of the present invention are described in order of << 1 >> to << 5 >>.
《 1. キヤッシュメモリ内蔵シングルチップマイクロコンビユー夕》 第 1図には本発明の一実施例に係るシングルチップマイクロコンビ ユー夕の一実施例が示される。本実施例のシングルチヅプマイクロコン ピュー夕 (単にマイクロコンビユー夕とも記す) MPUは、 ROM (リ ード 'オンリ 'メモリ) 9及び RAM (ランダム 'アクセス ·メモリ) 10に加えてキャッシュメモリ CACHEを一つの半導体基板に搭載 し、 ROM 9及び RAM 10はキャッシュメモリ CACHEによるキヤ ッシュの対象とはされず、 CPU (中央処理装置) 1が内蔵 ROM9又 は RAMI 0をアクセスする場合にはキャッシュメモリ CACHEの アクセス動作を利用せずに直接内蔵 R OM 9又は RAM 10がリード /ライ トされる。 << 1 Single-Chip Microcombiner with Built-in Cache Memory >> FIG. 1 shows an embodiment of a single-chip microcombiner according to an embodiment of the present invention. In the present embodiment, the single-chip microcomputer (also simply referred to as a microcombination) MPU has a cache memory CACHE in addition to a ROM (read 'only' memory) 9 and a RAM (random 'access memory) 10. ROM 9 and RAM 10 are not cached by the cache memory CACHE. When the CPU (central processing unit) 1 accesses the built-in ROM 9 or RAMI 0, the cache memory is The built-in ROM 9 or RAM 10 is read / written directly without using the access operation of CACHE.
前記マイクロコンピュータ MP Uは、 CPU 1、 キャッシュメモリ C ACHE, CPU 1の動作プログラム又はデ一夕が格納される ROM 9、 CPU 1の作業領域若しくはデータの一時記憶領域とされる RAM 1 0、 乗算器(MULT) 5、 パスコントローラ 7、 周辺回路 11、 外部 パスイン夕フェース 12等を含み、単結晶シリコンのような 1個の半導 体基板に形成される。外部パスイン夕フェース 12には外部パス 14を 介して外部メモリ 13等が接続される。 The microcomputer MPU includes a CPU 1, a cache memory C ACHE, a ROM 9 in which an operation program or data of the CPU 1 is stored, a RAM 10 serving as a work area of the CPU 1 or a temporary storage area of data, It is formed on a single semiconductor substrate such as monocrystalline silicon, including the MULT 5, the path controller 7, the peripheral circuit 11, the external path interface 12, and the like. An external memory 13 and the like are connected to the external path interface 12 via an external path 14.
本実施例のマイクロコンビユー夕 MP Uは、特に制限されないが、 R I S Cアーキテクチャを有し、 CPU 1は、 1命令あたり CPU 1の動 作基準ク口ック信号における 1クロックサイクルで命令を実行し、パス
アクセスの基本サイクル数を 1クロックサイクルとするように、パイプ ライン動作によって命令フェッチ、 命令デコード、 命令実行、 メモリア クセスなどのパイプラインステージを実行していく。 CPU 1が接続さ れる内部パス ( I BUS) 6は、 1クロックサイクルを最小動作周期と する高速内部バスであり、 内部アドレスバス I AB、 内部データパス I DB、 内部制御パス I CBから成る。当該内部パス 6には前記キヤッシ ュメモリ CACHE、 ROM9、 RAM 1 0、 乗算命令実行用の乗算器 (MULT) 5、 及びバスコントローラ 7が接続される。バスコントロ ーラ 7は、内部バス 6の制御及び周辺回路 1 1のアクセス制御などを行 う。 The microcomputer MPU of this embodiment has a RISC architecture, although not particularly limited, and the CPU 1 executes an instruction in one clock cycle in the operation reference clock signal of the CPU 1 per instruction. ,path The pipeline stages such as instruction fetch, instruction decode, instruction execution, and memory access are executed so that the basic cycle number of access is one clock cycle. The internal path (I BUS) 6 to which the CPU 1 is connected is a high-speed internal bus having a minimum operation cycle of one clock cycle, and includes an internal address bus I AB, an internal data path I DB, and an internal control path I CB. The cache memory CACHE, ROM 9, RAM 10, a multiplier (MULT) 5 for executing a multiplication instruction, and a bus controller 7 are connected to the internal path 6. The bus controller 7 controls the internal bus 6 and controls access to the peripheral circuits 11.
第 2図にはバスコントローラ 7と外部パスィン夕フェース 1 2の一 例プロヅク図が示される。バスコントローラ 7はバッファ 7 1と制御論 理回路 72とに大別された回路ブロックを含む。外部バスインタフエ一 ス 1 2はバッファ 1 2 0とタイミング生成回路 1 2 1とに大別された 回路プロックを有する。バッファ 7 1は内部パス 6を構成する内部デー 夕バスゃァドレスバスなどに含まれる所定の信号を外部バスィン夕フ エース 12と周辺回路 1 1に供給する。制御論理回路 72は内部パス 6 から供給されるアドレス信号の上位側ビッ トに基づいてアクセス対象 ェリァの判定を行い、また内部パス 6から供給されるパスコマンドなど を受け取ってリード/ライ トゃアクセスデータ幅等のアクセスの種別 を判定する。それらの判定結果に従って内蔵 ROM 9の選択信号 MS R OM、 RAM 10の選択信号 MSRAM、 内蔵回路に対するリード/ラ ィ ト信号 MRW等を生成し、 また、外部アクセスのためのチップ選択信 、、号 C S 0〜C S 3、 リード信号 RD、 ライ ト信号 WR、 DRAM (ダイ ナミヅク RAM)アクセスのためのロウアドレスストローブ信号 RAS、 カラムアドレスストロ一ブ信号 C AS等をタイミング生成回路 1 2 1
から出力させるための制御信号などを出力する。外部パスアクセスのた めのデータ入出力ゃァドレス信号の出力タイミングは、タイミング生成 回路 1 2 1が制御論理回路 72からの制御信号に基づいてバッファ 1 20を制御する事によって行う。 FIG. 2 shows an example block diagram of the bus controller 7 and the external pass interface 12. The bus controller 7 includes a circuit block roughly divided into a buffer 71 and a control logic circuit 72. The external bus interface 12 has a circuit block roughly divided into a buffer 120 and a timing generation circuit 121. The buffer 71 supplies a predetermined signal included in an internal data bus address bus constituting the internal path 6 to the external bus interface 12 and the peripheral circuit 11. The control logic circuit 72 determines the access target based on the upper bits of the address signal supplied from the internal path 6, and receives a path command or the like supplied from the internal path 6 to perform read / write access. Judge the type of access such as data width. According to these judgment results, a selection signal MS ROM of the built-in ROM 9, a selection signal MSRAM of the RAM 10, a read / write signal MRW for the built-in circuit, and the like are generated. CS 0 to CS 3, read signal RD, write signal WR, row address strobe signal RAS for accessing DRAM (Dynamic RAM), column address strobe signal CAS, etc. Timing generation circuit 1 2 1 And outputs a control signal and the like for output from the controller. The output timing of the data input / output address signal for external path access is performed by the timing generation circuit 122 controlling the buffer 120 based on the control signal from the control logic circuit 72.
また、制御論理回路 72にはキャッシュメモリ CACHEにおけるキ ャヅシュヒヅ 卜/ミスがヒッ ト信号 1 09にて通知され、 更に、制御信 号 BE CNOPにて外部バスインタフェース 1 2を介する外部バスァ クセスの開始タイミング若しくは外部パスアクセス開始までのウェイ トが通知される。そして制御論理回路 72は、パスアクセス可能な状態 を制御信号 BUS RDYにて CPU 1に通知する。制御信号 B U S R D Yは CPU 1によるバスアクセスの区切りを規定することになる。 第 3図には本実施例に係るマイクロコンビユー夕 MP Uにおける内 蔵 ROM有効モードにおけるアドレスマツビングの一例が示され、第 4 図には内蔵 R 0 M無効モードにおけるアドレスマツビングの一例が示 される。 Further, the control logic circuit 72 is notified of a cache hit / miss in the cache memory CACHE by a hit signal 109, and furthermore, the start timing of the external bus access via the external bus interface 12 by the control signal BE CNOP. Alternatively, the wait until the start of the external path access is notified. Then, the control logic circuit 72 notifies the CPU 1 of the path accessible state by the control signal BUS RDY. The control signal BUSRDY defines the delimitation of the bus access by the CPU 1. FIG. 3 shows an example of address matching in the built-in ROM valid mode in the micro-computer MPU according to the present embodiment, and FIG. 4 shows an example of address matching in the internal ROM invalid mode. Is shown.
本実施例のマイクロコンビユー夕 MPUは、内蔵 ROM 9を有効とす る内蔵 ROM有効モードとそれを無効とする内蔵 ROM無効モードを 含み、それらの動作モードは図示しないモード端子の設定状態によって 決定される。本実施例においてキヤヅシュメモリ CACHEによるキヤ ヅシュ対象空間は、第 3図及び第 4図における C S 0〜CS 3空間及び DRAM空間とされ、 ROM 9及び RAM 1 0はキヤッシュの対象とは されない。 CPU 1が管理するアドレス信号は第 5図に示されるように 32ビット (A3 1〜A0) とされ、 A3 1〜A24は前記ァドレスマ ップに示される空間の選択に利用され、 A23, A22は C S空間にお けるチップ選択に利用される。外部パスインタフェース 12を介して出 力されるアドレス信号は A 2 1〜A0の 22ビットとされる。第 2図に
示される前記制御論理回路 72は動作モードに応じて空間選択及び C S空間選択のためのアドレスデコード論理 72 1を供え、当該アドレス デコード論理 72 1に従って前記選択信号 MS ROM, MS RAMを生 成すると共に、 C S 0~C S 3、 AS, CASをタイミング制御回路 12 1から出力させるための制御信号を生成する。外部パスアクセスに 際してのアクセスサイクル数は夫々の C S 0〜C S 3空間, DR AM空 間毎にコントロールレジス夕 7 20に設定されるウェイ トステート数 に従って制御論理回路 72がタイミング制御回路 1 2 1に通知する。尚、 空間選択や C S空間選択のために実際には A 2 2よりも下位側のァド レスビヅトもデコード対象とされている。 The microcomputer MPU of this embodiment includes a built-in ROM valid mode for validating the built-in ROM 9 and a built-in ROM invalid mode for disabling the built-in ROM 9, and their operation modes are determined by the setting state of a mode pin (not shown). Is done. In this embodiment, the cache target space by the cache memory CACHE is the CS0 to CS3 space and the DRAM space in FIGS. 3 and 4, and the ROM 9 and the RAM 10 are not subjected to the cache. The address signal managed by the CPU 1 is 32 bits (A31 to A0) as shown in FIG. 5, A31 to A24 are used for selecting the space shown in the address map, and A23 and A22 are Used for chip selection in CS space. The address signal output via the external path interface 12 is 22 bits A21 to A0. Figure 2 The control logic circuit 72 shown includes address decoding logic 721 for space selection and CS space selection according to the operation mode, and generates the selection signals MS ROM and MS RAM according to the address decoding logic 721. , CS 0 to CS 3, and a control signal for outputting AS and CAS from the timing control circuit 121. The number of access cycles for external path access is determined by the control logic circuit 72 according to the number of wait states set in the control register 720 for each of the CS0 to CS3 space and DRAM space. Notify one. Note that, for the purpose of space selection and CS space selection, address bits lower than A22 are also actually decoded.
第 6図にはキャッシュメモリ CACHEの一例ブロック図が示され る。 キャッシュメモリ CACHEはアドレスアレイ (AA) 3、 データ アレイ (DA) 4、コンパレータ 20、及びキャッシュコントローラ(C CONT) 2などを備える。本実施例において、 キャッシュメモリ CA CHEによるキヤッシュ対象は命令のみ、 データのみ、命令とデータの 双方の、 何れであってもよい。 キャッシュメモリ CACHEは、 例えば 一つのェントリを構成する 1キャッシュラインの情報が外部記憶装置 のどの位置 (アドレス) に対応しているかを示す実効アドレス(仮想ァ ドレスまたは物理ァドレス)を記憶するキヤヅシュタグアドレス 104、 その実効ァドレスを先頭とした連続する複数ヮードの情報を記憶する データライン 1 06、そしてそのキャッシュラインに記憶している情報 が有効であるかを示す有効ビヅト (V) 105を備える。 アドレスァレ ィ 3はキャッシュタグアドレス 1 04と有効ビヅ ト 1 05を有し、デー 夕アレイ 4はデ一夕ライン 1 06を有する。尚、必要に応じてキヤッシ ュメモリの内容が更新され外部大容量記憶装置の内容と異なることを 示すダーティビットなどを設ける場合もある。これら以外にメモリ空間
の種類を表わすフィールドが追加される場合もある。 FIG. 6 shows an example block diagram of the cache memory CACHE. The cache memory CACHE includes an address array (AA) 3, a data array (DA) 4, a comparator 20, a cache controller (C CONT) 2, and the like. In this embodiment, the cache target by the cache memory CA CHE may be any of only an instruction, only data, and both an instruction and data. The cache memory CACHE is, for example, a cache that stores an effective address (virtual address or physical address) indicating which position (address) of the external storage device corresponds to information of one cache line that constitutes one entry. A tag address 104, a data line 106 for storing information of a plurality of consecutive codes starting from the effective address, and a valid bit (V) 105 indicating whether the information stored in the cache line is valid. . The address array 3 has a cache tag address 104 and a valid bit 105, and the data array 4 has a data line 106. If necessary, a dirty bit or the like indicating that the contents of the cache memory are updated and different from the contents of the external mass storage device may be provided. Other than these, memory space In some cases, a field indicating the type of the data is added.
中央処理装置 C P U 1から内部アドレスパス I A Bに供給されるァ ドレス信号 1 0 0はタグアドレス 1 0 1、 エントリアドレス 1 0 2、及 びライン内パイ トアドレス 1 0 3とみなされる。ライン内バイトァドレ ス 1 0 3はデータライン 4に含まれるバイ トデ一夕を選択するための 情報とされる。エントリアドレス 1 0 2はデコーダ 1 1 0にてデコード され、アドレスアレイ 3及びデ一夕アレイ 4からキャッシュラインを選 択 (インデヅクス) するために利用される。例えば 1 2 8のキャッシュ ラインが存在する場合にはェントリアドレスは 7ビッ トとされる。イン デヅクスされたキャッシュラインのキャッシュタグアドレス 1 0 4は コンパレー夕 2 0にてタグアドレス 1 0 1と比較される。その比較結果 と前記有効ビヅ ト 1 0 5はキャッシュコントローラ 2に供給される。 キャッシュコントローラ 2はコンパレー夕 2 0による比較結果や有 効ビッ ト 1 0 5を参照し、 例えば、 インデックスされたキャッシュライ ンが有効であって、当該キヤッシユラインのキヤヅシュタグアドレス 1 0 4がタグアドレス 1 0 1に一致する場合、キヤヅシュヒッ ト信号 1 0 9にてパスコントローラ Ίにキヤッシュヒヅ トを通知する。これと共に、 ィンデックスされたキャッシュラインのデータライン 1 0 6からライ ン内パイ トアドレス 1 0 3にて所要のデータが選択されて内部データ パス I D Bへ読み出され、或いはキヤッシュラインのデ一夕ライン 1 0 6に対してライン内パイ トアドレス 1 0 3にて選択される位置に内部 パス I D Bのデータが書き込まれる。 4 0はインデックスされたデータ ラインからライン内バイ トアドレス 1 0 3にてデータを選択して内部 データパス I D Bに出力するデータ出力回路、 4 1はインデックスされ たキヤヅシュラインの所定位置をライン内バイ トアドレス 1 0 3にて 選択して内部データパス I D Bからの書込みデ一夕を供給するデータ
入力回路である。 The address signal 100 supplied from the central processing unit CPU 1 to the internal address path IAB is regarded as a tag address 101, an entry address 102, and a line address 103 in a line. The byte address 103 in the line is information for selecting the byte data included in the data line 4. The entry address 102 is decoded by the decoder 110 and used to select (index) a cache line from the address array 3 and the data array 4. For example, if there are 128 cache lines, the entry address is 7 bits. The cache tag address 104 of the indexed cache line is compared with the tag address 101 at the comparator 20. The comparison result and the valid bit 105 are supplied to the cache controller 2. The cache controller 2 refers to the comparison result by the comparator 20 and the valid bit 105.For example, if the indexed cache line is valid, the cache tag address 104 of the cache line is the tag. When the address coincides with the address 101, a cache hit is notified to the path controller by the cache hit signal 109. At the same time, required data is selected from the indexed cache line data line 106 at the line address 103 in the line and read out to the internal data path IDB, or the cache line data line is read out. The data of the internal path IDB is written at the position selected by the in-line pipe address 103 with respect to 106. 40 is a data output circuit that selects data from the indexed data line at the in-line byte address 103 and outputs it to the internal data path IDB. 41 is a predetermined position of the indexed cache line in the line byte. Data that is selected at address 103 to supply write data from internal data path IDB This is an input circuit.
一方、ィンデックスされたキヤッシユラインが無効である場合、又は、 当該キャッシュラインのキヤヅシュタグ 1 0 4がタグアドレス 1 0 1 に一致しない場合には、キヤッシュヒヅト信号 1 0 9にてバスコント口 ーラ 7にキャッシュミスが通知され、これによつてバスコントローラ 7 は、そのときのアクセスァドレスに応ずるデータを含む 1データライン 分の情報を外部メモリ 1 3から読込む制御を行い、キャッシュコントロ ーラ 2はそれによつて読込まれたデータによってデ一夕ライン 1 0 6 の内容を置き換える (ラインフィル) 。 置き換え対象とされるキヤヅシ ュラインは公知の]^ 11 1;(1^&3 1^06111 1136 )等の論理に従って決定する ことができる。データラインの置き換えに際しては、 それに対応される キャッシュアドレスタグ 1 0 4が当該キヤヅシユラインに書き込まれ、 且つ有効ビヅト 1 0 5がセヅ トされる。 3 0はキャッシュタグアドレス 1 0 4の入力ゲート、 3 1はキャッシュタグアドレス 1 0 4の出力ゲー ト、 1 0 5 0は有効ビヅト 1 0 5の入力ゲート、 1 0 5 1は有効ビット 1 0 5の出力ゲートである。前記データ出力回路 4 0、データ入力回路 4 1、 出力ゲート 3 1 , 1 0 5 1、 及び入力ゲート 3 0, 1 0 5 0の動 作は、 ィンデヅクス動作、 ラインフィル動作、 C P U 1によるライ トァ クセスかによつてキャッシュコントローラ 2が制御する。 On the other hand, if the indexed cache line is invalid, or if the cache tag 104 of the cache line does not match the tag address 101, a cache miss is sent to the bus controller 7 by the cache heat signal 109. Accordingly, the bus controller 7 controls to read information for one data line including data corresponding to the access address at that time from the external memory 13, and the cache controller 2 performs The contents of the data line 106 are replaced with the read data (line fill). The cache line to be replaced can be determined according to a well-known logic such as [1111; (1 ^ & 311 ^ 061111136)]. When replacing a data line, the corresponding cache address tag 104 is written to the cache line, and the valid bit 105 is set. 30 is the input gate of the cache tag address 104, 31 is the output gate of the cache tag address 104, 105 is the input gate of the valid bit 105, and 105 is the valid bit 10 5 output gates. The operations of the data output circuit 40, the data input circuit 41, the output gates 31 and 105, and the input gates 30 and 1505 are performed by an index operation, a line fill operation, and a write operation by the CPU 1. The cache controller 2 controls the access.
第 6図のアドレスアレイ 3及びデータアレイ 4は、ウェイ数が 1のダ ィレクトマップ方式、 ウェイ数が 2の (2— w a y ) セッ トァソシャァ ティブ又は 4個(4一 w a y )のセットァソシャァティブ形式などとさ れる場合がある。 ウェイ数を増やせば、エントリアドレスでインデック スされるキャッシュラインの数が増えるのでキヤヅシュヒヅ ト率が増 す。ウェイ数を増やす場合にはァドレスアレイ 3とデータアレイ 4もそ の数分だけ用意し、夫々のウェイにェントリアドレス 1 0 2が共通に供
給され、各ウェイでインデックスされたキャッシュ夕グァドレスは夫々 のウェイ毎に設けられたコンパレー夕 20にて夕グァドレスと比較さ れる。何れか一つのコンパレー夕 20による比較結果が一致されてキヤ ッシュヒッ トになれば、当該一致に係るウェイのデータアレイがリ一ド /ライ トの対象とされる。ラインフィルも何れか一つのウェイを対象と して行われる。 The address array 3 and the data array 4 in FIG. 6 are a direct map system with one way, a two-way (2-way) set associative or a four (4 one way) set associative format. And so on. Increasing the number of ways increases the number of cache lines indexed by the entry address, thereby increasing the cache hit rate. When increasing the number of ways, the address array 3 and the data array 4 are also prepared for that number, and the entry address 102 is commonly provided to each way. The cached guadresses that have been paid and indexed for each way are compared with the guadress at the Comparator evening 20 provided for each way. If the comparison result by any one of the comparators 20 is matched and a cache hit is made, the data array of the way related to the match is subjected to read / write. Line filling is also performed for any one of the ways.
CPU 1によるアクセスアドレスエリアがキャッシュメモリ CAC HEによるキヤヅシュ対象エリアであるか否かの判定は、特に制限され ないが、キャッシュコントローラ 2のキヤヅシャブル制御回路 21が行 う。本実施例に従えば、 キャッシュ対象空間は CS 0〜CS 3空間と D RAM空間とされ、 それ以外の空間はキヤッシュ非対象空間(ノンキヤ ッシャブルエリア) とされる。 これに応じ、 前記キヤッシャブル制御回 路 21は、内蔵 ROM有効モードにおいてキャッシュ対象空間判定のた めに、 H, 00200000〜! Γ 01 F F F F F Fのアクセスを判定 する回路と、内蔵 ROM無効モードにおいてキヤッシュ対象空間判定の ために、 H' 00000000〜H' 01 FFFFFFのアクセスを判 定する回路とを有し、 CPU 1によるアクセスアドレスがノンキヤッシ ャブルエリアか否かを判定する。 尚、 H, 00200000〜H, 01 FFFFFFのアクセスを判定する回路は、特に制限されないが、 ァク セスァドレスの最上位ビットから 1 1ビヅ トが全ビヅト 0でないこと を検出する回路の出力とアクセスァドレスの最上位ビッ 卜から 7ビッ トが全ビッ ト 0であることを検出する回路の出力との論理和信号にて それを判定できる。 同様に、 H' 00000000〜H' 01 FFFF F Fのアクセスを判定する回路は、アクセスアドレスの最上位ビヅトか ら 7ビッ トが全ビッ ト 0であることを検出する回路の出力にてそれを 判定することができる。
制御信号発生回路 23には、キヤッシャブル制御回路 21から判定結 果信号が供給される。制御信号発生回路 23には、 キヤッシャブル制御 回路 21から、 CPU 1によるアクセスァドレスエリアがキヤヅシュメ モリ CACHEによるキヤヅシュ対象エリァでないことを示す判定結 果信号が供給されると、制御信号発生回路 23はコンパレータ 20、入 力ゲート 30, 1050、 出力ゲート 31, 1051、 データ出力回路 40、 データ入力回路 41、 デコーダ 1 10の各々に、 その動作を止め るための動作停止信号を供給する。 このとき、 キャッシュメモリ CAC HEは非動作状態となる。 また、 制御回路 23は、 キヤッシャブル制御 回路 2 1から CPU 1によるアクセスアドレスエリアがキヤヅシュメ モリ CACHEによるキヤヅシュ対象ェリァであることを示す判定結 果信号が供給されると、制御信号発生回路 23は、 コンパレータ 20、 入力ゲート 30, 1050、 出力ゲート 31, 105 1、 データ出力回 路 40、 データ入力回路 41、 デコーダ 1 10の各々に、 その動作を開 始させるための動作開始信号を供給する。このときキャッシュメモリ C ACHEは動作状態となる。 The determination as to whether or not the access address area by the CPU 1 is an area to be cached by the cache memory CAC HE is not particularly limited, but is performed by the cacheable control circuit 21 of the cache controller 2. According to this embodiment, the cache target space is the CS0 to CS3 space and the DRAM space, and the other space is the cache non-target space (non-cacheable area). In response to this, the cacheable control circuit 21 sets H, 00200000 to!有 し It has a circuit that determines access of 01 FFFFFF and a circuit that determines access of H '00000000 to H' 01 FFFFFF to determine the cache target space in the internal ROM invalid mode. Determine whether the area is a non-cacheable area. The circuit for judging the access from H, 00200000 to H, 01 FFFFFF is not particularly limited, but the output and the access of the circuit for detecting that the 11 bits from the most significant bit of the access address are not all 0s are not limited. This can be determined by the logical sum signal with the output of the circuit that detects that all 7 bits from the most significant bit of the address are 0. Similarly, the circuit that determines access from H '00000000 to H' 01 FFFF FF makes a determination based on the output of the circuit that detects that all 7 bits from the most significant bit of the access address are all 0s. can do. The determination result signal is supplied from the cacheable control circuit 21 to the control signal generation circuit 23. When a determination result signal indicating that the access address area by the CPU 1 is not an area to be cached by the cache memory CACHE is supplied from the cacheable control circuit 21 to the control signal generation circuit 23, the control signal generation circuit 23 generates the comparator 20. An operation stop signal for stopping the operation is supplied to each of the input gates 30, 1050, the output gates 31, 1051, the data output circuit 40, the data input circuit 41, and the decoder 110. At this time, the cache memory CACHE becomes inactive. Further, when the control circuit 23 receives from the cacheable control circuit 21 a determination result signal indicating that the access address area of the CPU 1 is a cache target area by the cache memory CACHE, the control signal generation circuit 23 executes the comparator 20, an input gate 30, 1050, an output gate 31, 1051, a data output circuit 40, a data input circuit 41, and a decoder 110 are supplied with an operation start signal for starting the operation. At this time, the cache memory CACHE is in an operating state.
前記ノンキヤヅシャブルエリァに対するアクセスに対して、キヤヅシ ュコントローラ 2は、 少なくとも、前記内部バス 6に対する読出し及び 書込みのキャッシュ動作を行わず、キャッシュヒッ ト信号 109をキヤ ヅシュミスの状態に維持する。キヤッシャブルエリアに対するアクセス に対しては、前記内部パス 6に対する読出し及び書込みのキヤッシュ動 作を行い、ヒヅト信号 109はキヤッシュヒヅト /ミスの判定結果に応 じて変化される。そして、 キヤヅシャブルエリアに対するアクセスにお いてキヤヅシュコントロ一ラ 2は、 C P U 1のパスアクセスから 1クロ ックサイクルの期間前記制御信号 B E CNO Pをィネーブルレベルに 変化させてバスコントローラ 7に与えるか否かの制御を行う。
上記キャッシュメモリ CACHEにおいてキヤッシャブルエリアの アクセスに対応し、キャッシュラインをインデックスしてキャッシュ夕 グアドレス 1 04とアドレスタグ 1 0 1を比較してキャッシュミス又 はヒッ トを判定するまでには、 1クロックサイクル費やされる。 この間 にバスコントロ一ラ 7が外部アクセスを開始してしまうと、それによつ てアクセスされる外部メモリ 1 3のデ一夕が破壊される虞がある。パス コントローラ 7は、 CPU 1のバスアクセスから 1クロックサイクルの 期間、前記制御信号 BE CNOPがイネ一ブルレベルにされることによ り、 外部バスアクセス動作の開始を待つ。その間にキヤッシュヒット信 号 1 09にてキヤヅシュヒヅ トがバスコントローラ Ίに通知されれば、 バスコントローラ 7は外部バスアクセスを行わず、次のパスアクセス動 作が可能な状態をバスレディー信号 BUS RDYをアサ一トして CP U 1に通知する。 In response to the access to the non-cacheable area, the cache controller 2 does not perform at least the read and write cache operations for the internal bus 6, and maintains the cache hit signal 109 in a cache miss state. For access to the cacheable area, the cache operation of reading and writing to the internal path 6 is performed, and the heat signal 109 is changed according to the determination result of the cache heat / miss. Then, in the access to the cacheable area, the cache controller 2 changes the control signal BE CNOP to an enable level for one clock cycle from the path access of the CPU 1 and gives it to the bus controller 7. Is controlled. The cache memory CACHE corresponds to the access to the cacheable area, the cache line is indexed, the cache address 104 is compared with the address tag 101, and a cache miss or hit is determined. One clock cycle is spent. If the bus controller 7 starts the external access during this time, the data in the external memory 13 accessed by the bus controller 7 may be destroyed. The path controller 7 waits for the start of the external bus access operation by setting the control signal BECNOP to the enable level for one clock cycle after the CPU 1 bus access. In the meantime, if the cache hit is notified to the bus controller by the cache hit signal 109, the bus controller 7 does not perform the external bus access and sends the bus ready signal BUS RDY to the state where the next path access operation is possible. Assert and notify CPU1.
第 7図にはノンキヤヅシャブルエリァに対するアクセスの一例とし て、 CPU 1が RAM 10又は ROM9をリードアクセスするときの夕 ィミングチャートが示される。 1, ø 2は CPU 1の動作基準クロヅ ク信号であり、 ノンォーパラップ 2相のクロック信号である。パスコマ ンド B CMDは、バスアクセス幅やリード/ライ トを指示する情報を含 み、 CPU 1によって内部コントロールパス I CBに出力される。出力 タイミングは内部ァドレスバス I ABへのァドレス出力に同期される。 制御信号 BU SRDYにて通知されるバスの区切りに同期して CPU 1はァドレス信号を内部ァドレスバス I ABに供給する。キヤッシュコ ントローラ 2がそのアドレス信号にて RAM 1 0又は R OM 9に対す るアクセスであること、即ちノンキヤッシャブルエリアに対するァクセ スであることを、 前記キヤッシャブル制御回路 2 1で判定すると、 アド レスアレイ 3及びデ一夕アレイ 4の動作が抑止されてキヤッシュヒッ
ト信号 109がキャッシュミスの状態に維持され、.且つ制御信号 BE C NOPがネゲ一ト状態にされる。これによつてバスコントローラ 7はそ のときのアクセスァドレス信号をデコードして、 ROM選択信号 MS R 0M又は RAM選択信号 MS RAMをアサ一トし、これによつてクロッ ク信号 ø 1の 1クロックサイクルの期間に内部データパス I DBに R OM又は RAMからのリードデ一夕が与えられる。バスコントローラ 7 はクロック信号 ø 1の次の立ち上がりエッジに同期してバスレディー 信号 BU S RD Yをアサ一トし、 CPU 1に次のバスアクセスが可能な ことを通知する。 FIG. 7 shows a timing chart when the CPU 1 performs a read access to the RAM 10 or the ROM 9 as an example of an access to the non-cacheable area. Reference numerals 1 and 22 denote operation reference clock signals of the CPU 1 and non-overlapping two-phase clock signals. The pass command B CMD includes information indicating the bus access width and read / write, and is output by the CPU 1 to the internal control path I CB. The output timing is synchronized with the address output to the internal address bus IAB. The CPU 1 supplies an address signal to the internal address bus IAB in synchronization with the bus segment notified by the control signal BU SRDY. When the cache control circuit 21 determines that the cache controller 2 is an access to the RAM 10 or ROM 9 by the address signal, that is, an access to the non-cacheable area, the address array 3 And the operation of array 4 is suppressed and cache hit Signal 109 is maintained in a cache miss state, and the control signal BE C NOP is negated. As a result, the bus controller 7 decodes the access address signal at that time and asserts the ROM selection signal MSR0M or the RAM selection signal MSRAM, whereby one clock of the clock signal ø1 is output. During the cycle, read data from ROM or RAM is applied to the internal data path IDB. The bus controller 7 asserts the bus ready signal BUSRY in synchronization with the next rising edge of the clock signal ø1, and notifies the CPU 1 that the next bus access is possible.
第 8図には C P U 1によるキヤヅシャブルエリアに対するキヤヅシ ュヒッ ト時のリードアクセスのタイミングチャートが示される。キヤヅ シュブルエリアに対するアクセスであるから、キヤッシュコントローラ 2のキヤヅシャブル制御回路 2 1は CPU 1によるパスアクセスから 1クロックサイクルの期間に制御信号 BECNOPをアサートして、バ スコントローラ 7による外部アクセスの開始をその期間抑止させる。そ の間にキャッシュメモリ CACHEではインデックス動作にてデータ アレイ 4とアドレスアレイ 3がリードされ、そのリードデ一夕に対して キヤッシュミス Zヒヅ 卜の判定が行われる。この例の場合にはキヤヅシ ュヒッ トが判定され、ヒッ トに係るリードデータが内部データパス I D Bに供給され、 且つ、 キャッシュヒヅ ト信号 109にてキャッシュヒッ トがバスコントローラ 7に通知されることにより、バスコントロ一ラ 7 はそのときのアクセスに従った外部パスアクセスを行わずにパスレデ ィー信号 BUS RDYをアサ一トして、次のバスアクセスが可能な状態 を CPU 1に通知する。 FIG. 8 shows a timing chart of read access to the cacheable area by the CPU 1 during a cache hit. Since the access is to the cacheable area, the cacheable control circuit 21 of the cache controller 2 asserts the control signal BECNOP for one clock cycle after the path access by the CPU 1 to start the external access by the bus controller 7. The period is deterred. In the meantime, in the cache memory CACHE, the data array 4 and the address array 3 are read by the index operation, and a cache miss Z jet is determined for the read data. In this example, the cache hit is determined, the read data related to the hit is supplied to the internal data path IDB, and the cache hit is notified to the bus controller 7 by the cache hit signal 109. The bus controller 7 asserts the path ready signal BUS RDY without performing an external path access according to the access at that time, and notifies the CPU 1 of a state in which the next bus access is possible.
第 9図には CPU 1によるキヤッシャブルエリアに対するキヤヅシ ュミス時のリードアクセスのタイミングチヤ一トが示される。キヤッシ
ュブルエリァに対するアクセスであるから、キヤッシュコントローラ 2 のキヤヅシャブル制御回路 2 1は CPU 1によるバスアクセスから 1 ク口ックサイクルの期間に制御信号 B E CNO Pをアサ一トしてパス コントローラ 7による外部アクセスの開始をその期間抑止させる。その 間にキヤヅシュメモリ CACHEではィンデックス動作にてデータァ レイ 4とアドレスアレイ 3がリードされ、そのリードデータに対してキ ャヅシュミス /ヒッ 卜の判定が行われる。この例の場合にはキヤッシュ ミスが判定され、キヤヅシュヒヅ ト信号 109にてキヤヅシュミスがバ スコントローラ 7に通知されると、バスコントローラ 7はそのときのァ クセスアドレスに従った外部パスアクセスを起動する。図の例は C S空 間がアクセスされる場合を示している。図に示される ZC S nは第 2図 の CS 0〜CS 3の何れかを意味する。/: RDは第 2図の RDに対応さ れる。外部バスアクセスは T 2ステートから開始され、 T 3ステートで 外部メモリ 13からのリードデータが内部パス I DBに読込まれる。キ ャッシュメモリ CACHEにおいては、 T 2ステートで当該キャッシュ ミスに係るタグアドレスがキャッシュタグアドレスとして該当するキ ャヅシユラインに書き込まれ、 また、 T 3ステートにおいて CPU 1が リードデータを取り込むのに並行して当該リードデータが該当するキ ャッシユラインに書き込まれる。同図から明らかなように、 外部メモリ 13を実際にアクセスする期間は T 2, T3の 2クロヅクサイクルであ るが、制御信号 BE CNOPにて外部パスアクセスの起動が 1クロック サイクルだけウェイ 卜されているので、 CPU 1のリードアクセスには 全部で T 1〜T 3の 3クロックサイクルを要する。 FIG. 9 shows a timing chart of a read access by the CPU 1 to the cacheable area at the time of a cache miss. Cache Since the access is to the cache area, the cache control circuit 21 of the cache controller 2 asserts the control signal BE CNOP during one cycle of the bus access from the CPU 1 to start the external access by the path controller 7. The period is deterred. In the meantime, in the cache memory CACHE, the data array 4 and the address array 3 are read by the index operation, and a cache miss / hit determination is performed on the read data. In the case of this example, when a cache miss is determined and the cache miss is notified to the bus controller 7 by the cache heat signal 109, the bus controller 7 activates an external path access according to the access address at that time. The example in the figure shows a case where the CS space is accessed. ZCSn shown in the figure means any of CS0 to CS3 in FIG. /: RD corresponds to RD in Fig. 2. External bus access starts from the T2 state, and in the T3 state, read data from the external memory 13 is read into the internal path IDB. In the cache memory CACHE, the tag address related to the cache miss is written to the corresponding cache line as a cache tag address in the T2 state, and the read is performed in parallel with the CPU 1 taking in the read data in the T3 state. Data is written to the corresponding cache line. As is clear from the figure, the period during which the external memory 13 is actually accessed is two clock cycles of T2 and T3, but the activation of the external path access is waited for one clock cycle by the control signal BE CNOP. Therefore, read access of CPU 1 requires a total of three clock cycles T1 to T3.
第 9図から明らかなように、内部ァドレスパス I ΑΒの値が確定して からヒッ ト信号 109の状態が確定するまでには 1クロックサイクル かかるので、その間にチップ選択信号 C Sやリード信号 RDをアサート
し外部バスサイクルを起動してからキヤッシュヒヅ トの状態が確定す ると、一旦起動した外部パスサイクルの途中でチッブ選択信号 C Sゃリ 一ド信号 RDをネゲートしなければならず、これによつて外部メモリ 1 3の内容が破壊する虞がある。そのため、 キヤッシャブルエリアに対す るアクセスでは、制御信号 BE CNOPを外部バスサイクルの起動前に アサ一トして、チップ選択信号 C Sやリード信号 RDのアサートタイミ ングを遅らせるように外部パスサイクルの起動にウェイ トをかける。こ の時、 キヤヅシュミスしていることが判定されれば、外部バスサイクル を起動して外部メモリ 1 3をアクセスし、キャッシュミスに係るキヤッ シユタグァドレスの書換えとデータアレイ 4のラインフィルが行われ る。仮に外部メモリ 13がノンキヤッシャブルエリアとすると、制御信 号 B E CNOPはアサートされず、 CPU 1は 2クロックサイクルで所 望のデータを外部メモリ 13から読込むことができる。すなわち、 ノン キヤッシャブルエリアとして外部メモリ 1 3をアクセスした方が、ァク セスに要する時間は短くて済むことになる。 As is clear from FIG. 9, it takes one clock cycle from when the value of the internal address path I パ ス is determined to when the state of the hit signal 109 is determined, during which time the chip select signal CS and the read signal RD are asserted. When the state of the cache heat is determined after starting the external bus cycle, the chip select signal CS lead signal RD must be negated in the middle of the started external pass cycle. The contents of the external memory 13 may be destroyed. Therefore, in access to the cacheable area, the control signal BE CNOP is asserted before the start of the external bus cycle, and the assertion of the chip select signal CS and the read signal RD is delayed so that the assertion of the external signal is delayed. Wait for activation. At this time, if it is determined that a cache miss has occurred, an external bus cycle is started to access the external memory 13, and the cache tag address related to the cache miss is rewritten and the data array 4 is line-filled. Assuming that the external memory 13 is a non-cacheable area, the control signal BE CNOP is not asserted, and the CPU 1 can read the desired data from the external memory 13 in two clock cycles. That is, when the external memory 13 is accessed as a non-cacheable area, the time required for the access is shorter.
そこで、 本実施例においては、 キャッシュメモリの性質上、 一旦キヤ ヅシュミスを生ずると、キャッシュミスの状態は比較的長く続くことに 着目し、キヤヅシャブルエリアに対するアクセスにおいては前回のキヤ ッシャブルエリアに対するアクセスがキャッシュヒッ トである場合に だけ前記制御信号 BE CNOPによるウェイ トを行い、キヤヅシャブル ェリアに対するアクセスにおいて前回のキヤッシャブルエリアに対す るアクセスがキヤヅシュミスである場合には前記制御信号 BE CNO Pによるウェイ トを行わないようにする。キヤヅシャブルエリアに対す るキャッシュミスに続くキャッシュヒット時は、制御信号 B E CNOP によるウェイ トが行われていないので、キャッシュヒヅ卜の状態はパス ローラ 7には与えず、 キャッシュミスと同様の動作とする。
例えば上述の制御を行うために、 ヒット信号生成回路 2 2は、前回の キヤヅシュヒヅト /ミスの判定結果を保持するフラグ F L Gを有する。 ヒッ ト信号生成回路 2 2はフラグ F L Gから把握される前回のキヤッ シュミス /ヒッ トの判定結果と今回のキヤヅシュミス /ヒットの判定 結果とを比較し、前回キヤッシュミスで今回キヤヅシュヒヅトである場' 合にはバスコントローラ 7に供給されるキヤヅシュヒヅ ト信号 1 0 9 をキャッシュミスを指示するレベルに維持し、 また、 インデックスされ たデータの内部パス I D Bへの出力を抑制させる。また、 キヤッシャブ ル制御回路 2 1はフラグ F L Gから前回のキャッシュミス /ヒヅ トの 判定結果を把握し、 それがキヤヅシュミスを示している場合には、 キヤ ッシャブルエリァに対するアクセスを検出しても制御信号 B E C N O Pをネゲート状態に維持する。 これにより、外部メモリをキャッシュ対 象とするとき、キヤッシュヒットの次に生ずるキヤッシュミスにおいて は(あるパスサイクルにおいてそれまでヒヅトし続け次のパスサイクル でミスヒヅトする時)、そのミスヒヅトした際に生じるパスサイクルは、 外部メモリ 1 3をキャッシュ対象としない場合すなわちキャッシュ無 効時よりも、ヒヅト /ミス判定のためのァドレス比較動作等によってァ クセスサイクル数が延びるので (B E C N O Pによるウェイ ト)、 その 最初のミスヒヅ トサイクルだけは延びたサイクルにしてキャッシュフ ィルしても、それ以降のバスサイクルではキヤヅシュ無効時と同じサイ クル数のバスサイクルで動作してキヤッシュフィル動作を行うことが できる。キャッシュミスが連続した後に、 キャッシュヒットが生じる場 合は、最初のヒットサイクルではキヤッシュ無効時のバスサイクルと同 様に動作されるが、それに続くキヤッシュヒットに係るバスサイクルで は、 キャッシュヒット時の高速なメモリアクセスが行われる。 Therefore, in this embodiment, due to the nature of the cache memory, it is noted that once a cache miss occurs, the state of the cache miss continues for a relatively long time, and in the access to the cacheable area, the previous access to the cacheable area is not performed. Waiting is performed by the control signal BE CNOP only when it is a cache hit, and when the previous access to the cacheable area is a cache miss in the access to the cacheable area, the wait by the control signal BE CNOP is performed. Do not do. At the time of a cache hit following a cache miss to the cacheable area, since the wait by the control signal BE CNOP is not performed, the state of the cache hit is not given to the path roller 7, and the same operation as the cache miss is performed. I do. For example, in order to perform the above-described control, the hit signal generation circuit 22 has a flag FLG that holds the previous determination result of cache hit / miss. The hit signal generation circuit 22 compares the previous determination result of the cache miss / hit obtained from the flag FLG with the determination result of the current cache miss / hit, and if the previous cache miss is the current cache hit, the hit signal is generated. Keeps cache cache signal 109 supplied to bus controller 7 at a level indicating a cache miss, and suppresses output of indexed data to internal path IDB. Also, the cache control circuit 21 grasps the result of the previous cache miss / heat determination from the flag FLG, and if it indicates a cache miss, the control signal BECNOP even if it detects an access to the cacheable area. Is maintained in a negated state. As a result, when the external memory is to be cached, in the case of a cache miss that occurs after a cache hit (when hitting continues in one pass cycle and misses in the next pass cycle), the path that occurs when the miss occurs is executed. When the external memory 13 is not cached, that is, when the cache is invalidated, the number of access cycles is extended by the address comparison operation for heat / miss determination (wait by BECNOP). Even if only the miss cycle is extended and cache-filled, the cache fill operation can be performed in the subsequent bus cycle by operating with the same number of bus cycles as when the cache is invalid. If a cache hit occurs after a series of cache misses, the first hit cycle behaves the same as the cache cycle when cache is disabled, but the subsequent bus cycle for a cache hit causes High-speed memory access is performed.
第 1 0図にはキヤヅシュミス時に制御信号 B E C N O Pがネゲート
される場合(キヤヅシュミスが連続している状態)のタイミングチヤ一 トが示される。第 9図と比較すれば明らかなように、制御信号 B E C N O Pがネゲートされているため、外部パスアクセスの起動が 1クロック サイクル分だけ早くされる。第 1 1図にはキャッシュヒッ ト時に制御信 号 B E C N O Pがネゲートされる場合(キヤヅシュミスに続いてキヤヅ シュヒヅトとされる場合)のタイミングチャートが示される。 この場合 には実際にはキヤヅシュヒッ トであるが既にパスサイクルが起動され ているため、 キャッシュヒット信号 1 0 9はネゲート状態にされ、且つ データアレイ 4からの読み出しデ一夕は内部データバス I D Bへの供 給が抑止される。そして実際にはキャッシュヒヅ卜であるからラインフ ィルも行われない。 C P U 1がデータを取り込むまでには、第 8図に比 ベて 1クロックサイクルだけアクセス動作が長くされる。第 1 2図には 複数のバスアクセスサイクルにおけるキャッシュヒヅ ト時とキヤヅシ ュミス時の状態が示される。第 1 2図における Aは第 8図の状態、 Bは 第 9図の状態、 Cは第 1 0図の状態、 Dは第 1 1図の状態に対応される。 第 1 2図から明らかなように、キャッシュヒットからキャッシュミスに 切り替わったときは第 2回目のキャッシュミスから外部パスアクセス のクロックサイクル数が 1クロックサイクル分短くされ、キヤッシユミ スからキャッシュヒッ トに切り替わったときは切り替わり目の第 1回 目の外部バスアクセスのクロックサイクル数だけが 1クロックサイク ル分長くされる。 したがって、 キヤヅシャブルエリアに対するキヤヅシ ュミスのアクセスが 3回以上続けば、全体としてのパスアクセスのクロ ックサイクル数はキヤヅシュヒッ ト信号 1 0 9と制御信号 B E C N 0 Pを本実施例のように制御する方が短くされる。 Fig. 10 shows that the control signal BECNOP is negated during a cache miss. In this case, a timing chart is shown in a case where the operation is performed (a state in which the cache miss is continuous). As is clear from the comparison with FIG. 9, since the control signal BECNOP is negated, the activation of the external path access is advanced by one clock cycle. FIG. 11 shows a timing chart when the control signal BECNOP is negated at the time of a cache hit (when the cache hit is made after the cache miss). In this case, the cache hit is actually a cache hit, but since the pass cycle has already been started, the cache hit signal 109 is negated, and the data read from the data array 4 is sent to the internal data bus IDB. Supply will be deterred. And since it is actually a cache hit, no line filling is performed. By the time CPU 1 takes in the data, the access operation is extended by one clock cycle as compared to FIG. FIG. 12 shows states during a cache hit and a cache miss in a plurality of bus access cycles. In FIG. 12, A corresponds to the state of FIG. 8, B corresponds to the state of FIG. 9, C corresponds to the state of FIG. 10, and D corresponds to the state of FIG. As is clear from Fig. 12, when switching from a cache hit to a cache miss, the number of clock cycles for external path access is shortened by one clock cycle from the second cache miss, and the cache is switched from cache miss to cache hit. In this case, only the number of clock cycles for the first external bus access at the switch is extended by one clock cycle. Therefore, if the cache access to the cacheable area continues three times or more, the number of clock cycles of the path access as a whole is determined by controlling the cache hit signal 109 and the control signal BECN0P as in this embodiment. Is shortened.
第 1 3図にはキヤッシュメモリを内蔵 R A Mと兼用する場合の構成 例が示される。例えば第 3図及び第 4図で説明したように内蔵 R A M 1
0に 4KBのアドレスエリァが割り当てられるとき、当該内蔵 RAM 1 0は 1モジュールあたり 1 KBの容量でデータバス幅 32ビッ トとさ れ、全部で 4モジュールにて 4 KBの RAMが構成されているものとす る。このような RAM 10を内蔵するマイクロコンビユー夕 MP Uにお いてキャッシュメモリ CACHEがデータアレイに 1 KBの記憶容量 を有する場合、 そのキャッシュメモリ CACHEを、 内蔵 RAMを流用 して構成することができる。その内、 1モジュール 1KBの RAMをキ ャヅシュメモリ CACHEのデータアレイ 4とすると、データライン長 を 4バイ トとして 256ラインを格納できる。また別の 1モジュール 1 KBの RAMをキャッシュのアドレスアレイ 3に使い、 256エントリ 分のキャッシュタグアドレス 104を格納する。このとき 32ビットの アドレス信号は、 第 14図の (A) に示されるように Al, AOはライ ン内バイ トァドレス、 A 9〜A 2はェントリアドレス、 A24〜A 10 はタグアドレスとされる。これに応じてァドレスアレイ 3のキャッシュ タグアドレス 104は第 14図の(B)に示されるように D 24〜D 1 0に割り当てることができる。アドレスアレイ 3には空きビヅトが存在 するので、その領域を活用するために、この例では前記有効ビット(V) 105をァドレスアレイの最下位ビット D 0に割り当ててある。但しそ の場合、キャッシュエントリを無効化するにはキヤッシユライン毎に有 効ビット 105をリセット状態にしなければならず、全てのキャッシュ ラインを無効化してキヤッシュメモリ CACHEを初期化するには 2 56回のアクセスを要する。キャッシュラインの無効化を効率的に行え るようにするには、有効ビット 105を RAM以外のキヤッシュコント ローラ 2の様な論理回路に格納することができる。 例えば 32パイ ト ( 32 X 8ビット)のレジス夕をキャッシュコントローラ 2に用意し、 256本のキャッシュラインとの対応を採って当該レジス夕に有効ビ
ットを格納する。 FIG. 13 shows a configuration example in which the cache memory is also used as the built-in RAM. For example, as described in FIG. 3 and FIG. When a 4 KB address area is assigned to 0, the internal RAM 10 has a data bus width of 32 bits with a capacity of 1 KB per module, and a total of 4 modules constitutes a 4 KB RAM. It shall be. If the cache memory CACHE has a 1 KB storage capacity for the data array in a micro-computer MPU with such a built-in RAM 10, the cache memory CACHE can be configured by using the built-in RAM . If one module 1KB RAM is used as the data array 4 of the cache memory CACHE, 256 lines can be stored with a data line length of 4 bytes. Another 1 KB of 1 KB of RAM is used for the address array 3 of the cache, and the cache tag address 104 of 256 entries is stored. At this time, as shown in (A) of FIG. 14, the 32-bit address signal is Al, AO is the byte address in the line, A9 to A2 is the entry address, and A24 to A10 are the tag address. You. Accordingly, the cache tag address 104 of the address array 3 can be assigned to D24 to D10 as shown in FIG. 14 (B). Since there is an empty bit in the address array 3, in order to utilize that area, the valid bit (V) 105 is assigned to the least significant bit D0 of the address array in this example. However, in that case, to invalidate the cache entry, the valid bit 105 must be reset for each cache line, and to invalidate all the cache lines and initialize the cache memory CACHE, 256 times Requires access. To enable the cache line to be invalidated efficiently, the valid bit 105 can be stored in a logic circuit other than the RAM, such as the cache controller 2. For example, a cache of 32 bytes (32 x 8 bits) is prepared in the cache controller 2, and a correspondence is established with 256 cache lines to enable the validity of the register in the cache. Store the data.
第 1 3図において、ァドレスアレイ 3に対するィンデヅクスにはァド レス信号の所定 8 ビヅ ト (A 9 〜A 2 ) が利用されるが、 ァドレスァレ ィ 3を普通の R A Mとして利用するときは、 A 9 〜A 0の 1 0ビヅトが アドレシングに利用される。ラッチ 2 3はタグアドレスを保持し、保持 されたァドレスタグは、キヤヅシュヒット /ミス判定のためにコンパレ 一夕 2 0の一方の入力に供給され、 また、 ラインフィルに際してァドレ スアレイ 3に供給される。コンパレータ 2 0の他方の入力にはァドレス アレイ 3にてインデックスされたラインのキャッシュアドレスタグが 供給される。ァライナ 2 6は、 内部データバス I D Bとデータアレイ 4 のデータ入出力端子との対応を決める回路であり、キヤッシュコント口 ーラ 2にて制御される。入力回路 2 4と出力回路 2 5はアドレスアレイ のデータ入出力端子とデータパスを選択的に接続する回路であり、ァド レスアレイ 3を普通の R A Mとして利用する場合のデータ入出力絰路 を構成する。第 1 3図において、 アドレスアレイ 3とデ一夕アレイ 4を 普通の R A Mとして (R A M I 0の一部として)利用するか否かは、 キ ャヅシュメモリ C A C H Eの有効/無効に連動させることができる。そ のような有効 Z無効の制御はマイクロコンビユー夕の動作モードによ つて決定することができる。 In FIG. 13, predetermined 8 bits (A 9 to A 2) of the address signal are used as an index for the address array 3, but when the address array 3 is used as a normal RAM, A is used. The 10 bits from 9 to A0 are used for addressing. The latch 23 holds the tag address, and the held address tag is supplied to one input of the comparator 20 for cache hit / miss determination, and is supplied to the address array 3 at the time of line filling. The other input of the comparator 20 is supplied with the cache address tag of the line indexed by the address array 3. The aligner 26 is a circuit that determines the correspondence between the internal data bus IDB and the data input / output terminal of the data array 4, and is controlled by the cache controller 2. The input circuit 24 and the output circuit 25 are circuits that selectively connect the data input / output terminals of the address array and the data path, and constitute the data input / output circuit when the address array 3 is used as a normal RAM. I do. In FIG. 13, whether or not to use the address array 3 and the data array 4 as ordinary RAM (as a part of RAMIO) can be linked to the validity / invalidity of the cache memory CACHE. Such valid Z invalid control can be determined by the operation mode of the micro-computer.
第 1 5図及び第 1 6図に示されるマイクロコンビユー夕 M P U 1は バスコントローラの配置の点で第 1図及び第 2図の実施例と相違され る。第 1 5図及び第 1 6図においてバスコン卜ローラ 7及び周辺回路 1 1は内部バス 6を共有している。その他の点は第 1図及び第 2図の実施 例と同じであるので詳細な説明は省略する。 The microcomputer MPU 1 shown in FIGS. 15 and 16 differs from the embodiment shown in FIGS. 1 and 2 in the arrangement of the bus controller. In FIGS. 15 and 16, the bus controller 7 and the peripheral circuit 11 share the internal bus 6. The other points are the same as those of the embodiment shown in FIGS. 1 and 2, and the detailed description is omitted.
次にキャッシュメモリと共に高速アクセスされる内蔵メモリを搭載 したマイクロコンビュー夕における総合的なヒッ ト率について説明す
る。 ダイナミヅクな内蔵メモリアクセス比率(全メモリアクセス中の内 蔵メモリアクセスの割合) を r、 外部メモリアクセス時のキヤヅシュメ モリのヒヅ ト率を hとするとき、全メモリアクセスに対する内蔵メモリ アクセス及びキヤッシュヒッ トとされる外部メモリアクセスの割合で ある総合的なヒッ ト率、 すなわち総合ヒッ ト率 Hを考えた場合、 内蔵メ モリアクセスとキャッシュヒッ トにされる外部メモリアクセスとは同 時には起こらないので、 当該総合ヒヅ ト率 Hは、 H = r + h— rhとな る Next, the overall hit ratio in a micro computer with built-in memory that is accessed at high speed together with the cache memory will be described. You. When the dynamic internal memory access ratio (ratio of internal memory access during all memory accesses) is r and the cache memory hit ratio during external memory access is h, the internal memory access and cache hit for all memory accesses are performed. Considering the overall hit rate, that is, the total hit rate H, which is the ratio of external memory accesses considered as the internal memory access, the internal memory access and the external memory access used as the cache hit do not occur at the same time. , The total heat rate H is H = r + h-rh
また、外部メモリをアクセスするときのキャッシュヒッ トとキヤッシ ユミスを考慮したときの平均アクセスクロックサイクル数(外部平均ァ クセスクロヅクサイクル数) S oは、 S o = hx l+ (l— h) Mとさ れる。 Mは外部メモリに対するアクセスクロックサイクル数であり、本 実施例においてキヤヅシュメモリ CACHEに対するアクセスクロヅ クサイクル数は 1とされる。 そして、 マイクロコンピュータ MPU (M PU 1 ) の内部メモリ ( 9, 10)及び外部メモリ (13)全体に対す るアクセスクロックサイクル数の平均(平均アクセスクロヅクサイクル 数) Saは、 In addition, the average number of access clock cycles (external average number of access clock cycles) in consideration of cache hits and cache smiths when accessing the external memory is expressed as S o = hx l + (l—h) M It is said. M is the number of access clock cycles to the external memory, and in this embodiment, the number of access clock cycles to the cache memory CACHE is one. The average number of access clock cycles (average number of access clock cycles) Sa for the internal memory (9, 10) and the external memory (13) of the microcomputer MPU (MPU 1) is:
Sa = rx l + ( 1-r) xSo Sa = rx l + (1-r) xSo
=r 1 + (1 -r) x {hx 1 + (1一 h) M} = r 1 + (1 -r) x {hx 1 + (1 h) M}
= (r + h-r h) x 1 + { 1 - (r + h-r h) } M = (r + h-r h) x 1 + {1-(r + h-r h)} M
=H 1 + ( 1一 H) M = H 1 + (1 H) M
とされる。 It is said.
第 17図及び第 18図には前記 r、 h、 Hの関係が示される。 第 1 Ί 図は第 18図の内容に基づいて描かれている。第 17図からも明らかな ように、 H==r + h— r hで表される総合ヒッ ト率 Hを考えれば、 rや hの単独のヒッ ト率よりも総合ヒヅ ト率 Hの方が高くなつている。これ
は、キャッシュメモリ CACHE自体の容量が小さくキャッシュヒヅト 率が低くても、 高速にアクセス可能な内蔵メモリ (9, 10) と組み合 わせることで、総合的なヒヅト率を高めることができるということを意 味するものである。 17 and 18 show the relationship among the above r, h, and H. Figure 1 is drawn based on the contents of Figure 18. As is clear from FIG. 17, considering the total hit rate H represented by H == r + h—rh, the total hit rate H is larger than the single hit rates of r and h alone. Is getting higher. this Is that even if the cache memory itself has a small capacity and the cache hit rate is low, it can increase the overall hit rate by combining it with the built-in memory (9, 10) that can be accessed at high speed. That is what it means.
第 19図及び第 20図には外部アクセスクロヅクサイクル数 M= 3 のときにおける平均アクセスクロックサイクル数 S a (パラメ一夕は h)を示し、第 21図及び第 22図には外部アクセスクロックサイクル 数 M= 4のときにおける平均アクセスクロヅクサイクル数 S a (パラメ 一夕は h)を示する。第 19図は第 20図の内容に基づいて描かれ、 第 21図は第 22図の内容に基づいて描かれている。 FIGS. 19 and 20 show the average number of access clock cycles S a (parameter is h) when the number of external access clock cycles M = 3, and FIGS. 21 and 22 show the number of external access clock cycles. The average number of access clock cycles Sa when the number of cycles M = 4 (parameter is h for one night) is shown. FIG. 19 is drawn based on the contents of FIG. 20, and FIG. 21 is drawn based on the contents of FIG.
上記実施例によれば以下の作用効果を得る。 According to the above embodiment, the following operation and effect can be obtained.
〔1〕本実施例のマイクロコンビユー夕 MP U (MPU 1)は、 キヤ ヅシュメモリ CACHEと共に ROM9, RAMI 0を同一半導体基板 に搭載し、 当該 RAMI 0, ROM 9はキャッシュメモリ CACHEに おけるキヤッシュヒヅ トの場合と同じ 1ク口ヅクサイクルでアクセス される高速アクセス可能な内蔵メモリとされる。さらにどのような場合 にも内蔵メモリアクセスをキャッシュヒヅ トと同様の 1クロヅクサイ クルで実現できることは、 内蔵メモリ 9 , 10をキャッシュ対象としな いこと、換言すれば内蔵メモリ 9, 10をノンキヤッシャブルエリアに マツビングする事によって保証している。 これにより、 キャッシュメモ リ CACHE自体の記憶容量が小さくキャッシュヒット率が低くても、 高速にアクセス可能な内蔵メモリ 9, 10と組み合わせて利用されるこ とで、 CPU 1によるマイクロコンビユー夕 MPU (MPU 1)の内外 に対する総合的なヒッ ト率を高めることができる。 したがって、 CPU 1による動作プログラムの全体的な実行過程におけるメモリアクスの 高速化、 ひいてはデータ処理性能を全体的に高めることができる。
〔2〕マイクロコンビユー夕 MPU (MPU 1 )では一般的に割り込 みなどのタスク切替えが頻繁に発生し、プログラムカウン夕の値が大き く変化する場合が多いので、キヤヅシュメモリ CACHEのヒット率が 低下する傾向が高い。 このとき、 ROM/RAMのような内蔵メモリと 共にキャッシュメモリ CACHEを搭載しているマイクロコンビユー 夕 MPU (MPU 1)において、 割り込みベクタと割り込みサービスル 一チン(割り込み処理プログラム)を内蔵 ROM/RAMに入れるよう にし、 当該 ROM/RAMをキャッシュの対象としないことにより、割 り込みが頻出するプログラムでもキャッシュヒットの場合と同様に、割 り込み処理プログラムへの遷移を高速化する事ができ、この点において もデータ処理性能もしくはデータ処理速度を向上させることができる。 [1] The micro combination MPU (MPU 1) of this embodiment has the cache memory CACHE and the ROM 9 and RAMI 0 mounted on the same semiconductor substrate, and the RAMI 0 and ROM 9 are the cache memory cache memory CACHE. It is a built-in memory that can be accessed at a high speed, which is accessed in the same one-cycle as in the previous case. In any case, the fact that the internal memory access can be realized in one clock cycle similar to the cache heat is that the internal memories 9 and 10 are not targeted for caching, in other words, the internal memories 9 and 10 are non-cacheable areas. It is guaranteed by mating. As a result, even when the storage capacity of the cache memory CACHE itself is small and the cache hit rate is low, it can be used in combination with the built-in memories 9 and 10 that can be accessed at high speed. The overall hit rate for the inside and outside of the MPU 1) can be increased. Therefore, the speed of the memory access in the overall execution process of the operation program by the CPU 1 can be increased, and the data processing performance can be improved as a whole. [2] In the microcomputer MPU (MPU1), task switching such as interrupts generally occurs frequently, and the value of the program counter often changes greatly. High tendency to decrease. At this time, the interrupt vector and the interrupt service routine (interrupt processing program) are stored in the built-in ROM / RAM in the microcomputer MPU (MPU 1) that has the cache memory CACHE as well as the built-in memory such as ROM / RAM. By making the relevant ROM / RAM not to be cached, it is possible to speed up the transition to the interrupt processing program in the same way as in the case of a cache hit, even for a program with frequent interrupts. In this regard, the data processing performance or data processing speed can be improved.
〔3〕ダイレクトマヅプキヤヅシュメモリやウェイ数の少ないセヅト ァソシァティブ形式のキャッシュメモリの場合には、一旦キャッシユミ スするとしばらくその状態が連続する性質が顕著である。 このとき、 キ ャヅシャブルエリアに対するアクセスにおいては前回のキヤヅシャブ ルェリァに対するアクセスがキヤヅシュヒヅ トである場合にだけ制御 信号 B E CNOPにて外部パスサイクルの起動にウェイ トをかけ、キヤ ヅシャブルエリアに対するアクセスにおいて前回のキヤヅシャブルエ リアに対するアクセスがキャッシュミスである場合には前記制御信号 BECNOPによるウェイ トを行わないようにする。 これにより、 キヤ ッシュミス時のバスサイクルにアドレスヒッ ト判定のための余分なゥ エイ トサイクルが毎回入らないので、キヤッシュミス時にけるメモリア クセスの性能低下を防ぐことができる。そのような制御が行われる場合 には、キヤヅシャブルエリァに対するキヤッシュミスに続くキヤヅシュ ヒッ ト時は、制御信号 BE CNOPによるウェイ トが行われていないの で、 キャッシュヒットの状態はバスコントローラ 7には与えず、 キヤヅ
シュミスと同様の動作が行われることになるが、そのような動作はキヤ ッシュミスからヒッ トへの切り替わり時の 1回のアクセスだけとされ るから、キヤッシュミスの状態が複数回のアクセスに亘つて続くことが 一般的であることを考慮すれば、システム全体としてのメモリアクセス を確実に高速化できる。 [3] In the case of a direct-map cache memory or a set-associative cache memory with a small number of ways, once cache-cached, its state is remarkably continuous for a while. At this time, in the access to the cacheable area, the start of the external pass cycle is waited by the control signal BE CNOP only when the previous access to the cacheable buffer is a cache hit, and the access to the cacheable area is performed. If the previous access to the cacheable area was a cache miss, the wait by the control signal BECNOP is not performed. As a result, an extra eight cycle for address hit determination is not included in the bus cycle at the time of a cache miss every time, so that it is possible to prevent memory access performance degradation at the time of a cache miss. When such control is performed, at the time of a cache hit following a cache miss to the cacheable area, the wait state by the control signal BE CNOP is not performed, so that the cache hit state is determined by the bus controller 7. Not give to The same operation as in the case of Schmitt will be performed, but such operation is performed only once when switching from cache miss to hit, and the state of the cache miss will be repeated over multiple accesses. Considering that the continuation is general, it is possible to surely speed up memory access as a whole system.
〔4〕キヤヅシュメモリを内蔵 RAMと兼用することにより、 コスト 面からも有利である。さらにバリッドビット 105をアドレスアレイ 3 から物理的に切り放してキヤヅシュコントローラ 2などのレジス夕に 格納することにより、ノ リッドビット 105のクリアを少ないアクセス 回数でソフトウエア的に能率的に行うことも容易になる。この点におい ても、 キャッシュメモリ CACHEのハードウェア構成が減り、マイク 口コンビユー夕 MPU (MPU 1) のコスト低減に寄与する。 [4] Using the cache memory as the built-in RAM is also advantageous in terms of cost. Furthermore, the valid bits 105 are physically cut off from the address array 3 and stored in a register such as the cache controller 2 so that the clearing of the bit 105 can be efficiently performed by software with a small number of accesses. It will be easier. Also in this regard, the hardware configuration of the cache memory CACHE is reduced, contributing to the cost reduction of the microphone-portable MPU (MPU 1).
《 2. 内蔵 R 0 M記憶容量とキャッシュメモリ記憶容量との適正化》 次に上記実施例のような ROMとキャッシュメモリを内蔵するマイ クロコンピュー夕における当該 ROMの記憶容量とキヤヅシュメモリ の記憶容量との最適化について説明する。 << 2. Optimization of Internal R 0 M Storage Capacity and Cache Memory Storage Capacity >> Next, in a microcomputer having a built-in ROM and cache memory as in the above embodiment, the storage capacity of the ROM and the storage capacity of the cache memory are compared. The optimization of will be described.
第 23図はキャッシュの構成 (way数、 ライン長、 容量) に対する ミス率 (1一 h) を示している。 本値は『Al an. J. Smi t h, 「L ine (b l o ck) S i z e Cho i c e f or CPU Cache s」 , I EEE Trans, Comput. , vo l C- 36, no. 9, pp l 063— 1075, Se t. , 1987』の 命令キヤヅシュミス率 (F i g2) の値を元にしている。 第 23図の (A) 〜 (D) における CACHE SIZEと記された縦の欄はキャッシュメ モリ CACHEのデータアレイの記憶容量 (バイ ト) を示し、 Line と 記された横の欄はキヤヅシュメモリ CACHEにおけるデ一夕ライン のバイ ト数を意味する。そして前記縦の欄の数値と横の欄の数値との交
点位置に記された数値は、当該キヤッシュサイズとライン長に対応され るミス率 (1一 h) とされる。 第 23図の (A)〜 (D) は、 キヤッシ ュメモリ CACHEの構成を、 フルァソシァティブ(full)、 4ウェイ セヅトァソシァティブ(4way)、 2ウェイセットァソシァティブ(2way)、 1ウェイセヅトァソシァティブ即ちダイレクトマップ(direct)とした 場合に対応される。 Figure 23 shows the miss rate (11h) for the cache configuration (number of ways, line length, capacity). This value is shown in “Al an. J. Smith,“ Line (block) Size Choice or CPU Caches ””, IEEE Trans, Comput., Vol C-36, no. 9, pp l 063— 1075, Set., 1987], based on the value of the instruction cache miss rate (Fig2). In (A) to (D) of FIG. 23, the vertical column marked CACHE SIZE indicates the storage capacity (bytes) of the data array of the cache memory CACHE, and the horizontal column marked Line is the cache memory CACHE. Means the number of bytes of the data overnight line in. Then, the value in the vertical column and the value in the horizontal column are exchanged. The numerical value written at the point position is the error rate (11h) corresponding to the cache size and line length. 23 (A) to 23 (D) show the configuration of the cache memory CACHE, which is full-associative (full), 4-way set associative (4way), and 2-way set associative (2way). , 1-way set associative, that is, direct map (direct).
第 24図は、第 23図の値から総合ヒヅト率 H = r + h— rhが 0. 9になる rの値を算出したものを示す。記述の仕方は第 23図と同様で ある。第 24図において r≤ 0のところは、 内蔵 ROMがなくてもヒヅ ト率が 0. 9を超えるキャッシュ構成を意味している。 FIG. 24 shows the result of calculating the value of r at which the total heat rate H = r + h—rh becomes 0.9 from the values in FIG. The description method is the same as in Fig. 23. In FIG. 24, r≤0 indicates a cache configuration in which the heat rate exceeds 0.9 even without the internal ROM.
ここで仮定として、 全プログラム容量が PRG [KB]ならば、 内蔵 ROM容量を R = r x PRGとする。実際は頻繁に実行されるルーチン は内蔵 ROMに置くので、 一般に R< r x PRGとなるが、 ここではヮ ースト条件を考え、 R = rxPRGとする。さらに一般的な仮定として、 P R G = 5 12 KBとし、 ROM容量 Rを計算すると第 25図の結果を 得る。 第 25図の記述の仕方は第 23図と同様である。 Assuming here that if the total program capacity is PRG [KB], the internal ROM capacity is R = r x PRG. Actually, since frequently executed routines are stored in the built-in ROM, generally, R <rxPRG. However, here, considering the cost condition, R = rxPRG. As a more general assumption, PRG = 512 KB, and calculating the ROM capacity R yields the results in Figure 25. The description method in FIG. 25 is the same as that in FIG.
第 25図の結果に基づいてキャッシュ容量 C [B]と内蔵 ROM容量 R [KB]の関係をプロヅトすると第 27図〜第 30図の結果を得る。 キャッシュメモリの構成は、 第 27図がフルァソシァティブ(full)、 第 28図が 4ウェイセットァソシァティブ(4way)、 第 29図が 2ゥェ ィセッ トァソシァティブ ( 2way ) 、 第 3 0図がダイ レク トマップ (direct)であり、 夫々はキャッシュメモリのデータライン長がパラメ 一夕とされている。例えば第 27図においてデ一夕ライン長が 8パイ ト のフルァソシァティブ形式のキヤヅシュメモリを採用する場合、キヤヅ シュメモリの容量を 2048バイ トとするとき、 ROM容量は 85. 3 3キロバイ トであれば総合ヒット率が 0. 9になることを意味する。実
際に上記の結果を用いて、必要な性能を得るには、前記 Cと Rの容量が あれば十分であることがわかる。 When the relationship between the cache capacity C [B] and the internal ROM capacity R [KB] is plotted based on the results in FIG. 25, the results in FIGS. 27 to 30 are obtained. The configuration of the cache memory is shown in Fig. 27 for full associativity (full), Fig. 28 for 4-way set associative (4 way), Fig. 29 for 2-way set associative (2 way), and 30 The figure shows a direct map (direct), in which the data line length of the cache memory is a parameter. For example, in FIG. 27, when a cache memory of a full format with a data line length of 8 bits is adopted, and the capacity of the cache memory is 2048 bytes, the ROM capacity is 85.33 kilobytes. This means that the overall hit rate will be 0.9. Real At this time, using the above results, it can be seen that the capacity of C and R is sufficient to obtain the required performance.
第 26図は、第 27図〜第 30図に示される内蔵 ROM容量とキヤッ シュメモリ容量との関係を式 C + aR = bで近似したときの、キヤッシ ュメモリの構成に対応する定数 a、 bが示される。本実施例のマイクロ コンビュ一夕において内蔵 ROM容量とキヤヅシュメモリ容量とを実 際に決定する場合には、 関係式: C + aR≤bを満足するように、 コス トと照らし合わせながら Rと Cの容量を決定すればよい。換言すれば、 C + aR>bとなる範囲を少なくとも除くように C, Rを決定する。こ れにより、 キャッシュメモリ容量 Cと ROM容量 Rをむやみに (無駄 に)大きくすることなく、 コスト及び総合ヒヅト率の点においてマイク 口コンビユー夕 MPU (MPU l)内蔵の ROM 9の記憶容量とキヤヅ シュメモリ CACHEの記憶容量とを最適化することができる。前記定 数 a、 bの値は第 26図より以下に示される通りである。 FIG. 26 shows the constants a and b corresponding to the configuration of the cache memory when the relationship between the internal ROM capacity and the cache memory capacity shown in FIGS. 27 to 30 is approximated by the equation C + aR = b. Is shown. When the internal ROM capacity and the cache memory capacity are actually determined in the microcomputer of this embodiment, the relationship between R and C is checked against the cost so as to satisfy the relational expression: C + aR≤b. What is necessary is just to determine the capacity. In other words, C and R are determined so as to exclude at least the range where C + aR> b. As a result, the cache memory capacity C and the ROM capacity R are not unnecessarily (wastefully) increased, and the storage capacity of the ROM 9 with the built-in microphone MPU (MPU l) and the capacity are reduced in terms of cost and overall heat rate. The storage capacity of the cache memory CACHE can be optimized. The values of the constants a and b are as shown below from FIG.
8 wa y以上 Z4バイ トライン長: a= 24. 01、 b = 8194 8 wa y以上 8バイ トライン長: a= 9. 00、 b = 3328 8 way以上 Zl 6パイ トライン長: a = 4. 00、 b= 1280 8 & 以上/32パィ トラィン長: &= 1. 75、 b= 512 8 way以上 Z64バイ トライン長以上: a = 0. 75、 b = 256 4wayZ4パイ トライン長: a= 25. 19、 b = 8804 8 way or more Z4 byte line length: a = 24.01, b = 8194 8 way or more 8 byte line length: a = 9.00, b = 3328 8 way or more Zl 6 line length: a = 4.00 , B = 1280 8 & more / 32-byte line length: & = 1.75, b = 512 8 way or more Z64 byte line length or more: a = 0.75, b = 256 4-way Z4 pipeline length: a = 25.19 , B = 8804
4 wa y/8パイ トライン長: a= 10. 00、 b = 3584 4 wa y / 8 pipeline length: a = 10.00, b = 3584
4way/l 6パイ トライン長: a= 5. 00、 b = 1536 4way / l 6 pipeline length: a = 5.00, b = 1536
4wa y/32バイ トライン長: a= 1. 84、 b= 557 4way / 32 byte line length: a = 1.84, b = 557
4 wa y/64バイ トライン長以上: a = 0. 79、 b = 276 2 wayZ4バイ トライン長: a = 32. 41、 b = 1 1 1 12 2 wayZ8パイ トライン長: a= 1 1. 90、 b = 4328
2way/l 6パイ トライン長: a= 5. 50、 b= 1792 4 way / 64 byte line length or more: a = 0.79, b = 276 2 wayZ4 byte line length: a = 32.41, b = 1 1 1 12 2 wayZ8 pipe line length: a = 1 1.90, b = 4328 2way / l 6 pipeline length: a = 5.50, b = 1792
2wayZ32バイ トライン長: a = 2. 03、 b = 651 2wayZ32 byte line length: a = 2.03, b = 651
2 wa yZ64バイ トライン長以上: a = 0. 87、 b = 316 1 wayZ4パイ トライン長: a = 36. 06、 b= 14361 1 wa y/8バイ トライン長: a= 18. 75、 b = 6591 2 wa y Z64 byte line length or more: a = 0.87, b = 316 1 way Z4 byte line length: a = 36.06, b = 14361 1 way / 8 byte line length: a = 18.75, b = 6591
1 wa y/ 16パイ トライン長: a = 8. 00、 b = 2816 1 way / 16 line length: a = 8.00, b = 2816
1 way/32バイ トライン長: a = 4. 00、 b= 1280 1 way / 32 byte line length: a = 4.00, b = 1280
1 wayZ64バイ トライン長以上: a= 1. 48、 b = 549 《3. 事前転送形式 RAMキヤッシュ内蔵マイクロコンビユー夕》 第 31図には高速 RAMに事前にデータを転送して、全体としてのメ モリアクセスの高速化を図ったマイクロコンビユー夕(事前転送形式 R AMキヤヅシュ内蔵マイクロコンピュータ)の一実施例プロック図が示 される。 1 wayZ64 byte line length or more: a = 1.48, b = 549 《3. Pre-transfer format Micro-computer with built-in RAM cache》 Fig. 31 shows that data is transferred to high-speed RAM in advance and the entire A block diagram of an embodiment of a microcomputer (microcomputer with a built-in pre-transfer format RAM cache) for speeding up memory access is shown.
本実施例のシングルチップマイクロコンビユー夕(単にマイクロコン ビュー夕とも記す) MPU2は、 CPU200、 CPU 200の動作プ ログラム又はデ一夕が格納される ROM 202、 CPU 200の作業領 域若しくはデータの一時記憶領域とされる RAM203、 乗算器(MU L T) 209、 バスコントロ一ラ 204、 周辺回路 210、 外部バスィ ン夕フェース 207、 高速 RAM 201、 アドレス変換器 2010、 R AM転送コントロ一ラ 205等を含み、単結晶シリコンのような 1個の 半導体基板に形成される。外部パスインタフェース 207には外部パス 21 1を介して外部メモリ 208等が接続される。 The single-chip micro-computer of this embodiment (also simply referred to as a micro-computer) MPU2 has a CPU 200, a ROM 202 in which an operation program or data of the CPU 200 is stored, a work area of the CPU 200 or a data storage area. RAM 203 used as a temporary storage area, multiplier (MU LT) 209, bus controller 204, peripheral circuit 210, external bus interface 207, high-speed RAM 201, address converter 2010, RAM transfer controller 205, etc. And formed on one semiconductor substrate such as single crystal silicon. The external path interface 207 is connected to an external memory 208 via an external path 211.
本実施例のマイクロコンビュー夕 MPU2は、特に制限されないが、 I S Cアーキテクチャを有し、 CPU 200は、 1命令あたり CPU 200の動作基準クロック信号における 1クロックサイクルで命令を 実行し、バスアクセスの基本サイクル数を 1クロックサイクルとするよ
うに、 パイプライン動作によって命令フェッチ、 命令デコード、 命令実 行、 メモリアクセスなどのパイプラインステージを実行していく。 CP U 200が接続される内部パス 206は、 1クロックサイクルを最小動 作周期とする高速内部パスであり、 内部アドレスパス I A B、 内部デー 夕バス I DB、 内部制御パス I CBから成る。当該内部バス 206には 前記夫々の回路モジュールが接続される。バスコントローラ 204は、 内部パス 206の制御及び周辺回路 210のアクセス制御などを行う。 バスコントローラ 204は内部パス 206から供給されるァドレス 信号の上位側ビッ トに基づいてアクセス対象エリァの判定を行い、また 内部バス 206から供給されるパスコマンドなどを受け取ってリード /ライ トゃアクセスデ一夕幅等のアクセスの種別を判定する。それらの 判定結果に従って内蔵 ROM202、 AM203、高速 RAM201 等の動作選択を行い、 また、外部アクセスのためのチップ選択やリード ノライ トの指示を外部に対して行う。 The microcomputer MPU2 of this embodiment has an ISC architecture, although not particularly limited, and the CPU 200 executes an instruction in one clock cycle of the operation reference clock signal of the CPU 200 per instruction, and performs basic bus access. Let the number of cycles be one clock cycle In this way, pipeline stages such as instruction fetch, instruction decode, instruction execution, and memory access are executed by pipeline operation. The internal path 206 to which the CPU 200 is connected is a high-speed internal path having a minimum operation cycle of one clock cycle, and includes an internal address path IAB, an internal data bus IDB, and an internal control path ICB. The respective circuit modules are connected to the internal bus 206. The bus controller 204 performs control of the internal path 206, access control of the peripheral circuit 210, and the like. The bus controller 204 determines the area to be accessed based on the higher-order bits of the address signal supplied from the internal path 206, and receives a path command or the like supplied from the internal bus 206 to read / write access data. The type of access such as overnight is determined. The operation of the built-in ROM 202, AM 203, high-speed RAM 201, etc. is selected according to the results of these determinations, and a chip selection for external access and a read / write instruction are issued to the outside.
本実施例において前記 RAM 203及び ROM 202はアクセスに In this embodiment, the RAM 203 and the ROM 202 are used for access.
2クロックサイクル以上必要な低速内蔵メモリとされる。これに対して 前記高速 RAM 201は 1クロックサイクルでアクセス可能とされ、事 前転送形式の RAMキヤッシュとして利用される。 RAM転送コントロ ーラ 205は内蔵 RAM 203及び ROM 202の所要の情報を高速 RAM 201に転送する制御を行う。 It is a low-speed internal memory that requires at least two clock cycles. On the other hand, the high-speed RAM 201 can be accessed in one clock cycle, and is used as a pre-transfer-type RAM cache. The RAM transfer controller 205 controls to transfer necessary information of the built-in RAM 203 and the ROM 202 to the high-speed RAM 201.
第 32図には RAM転送コント口一ラー 205のブロック図が示さ れる。 RAM転送コントローラ 205は、 キヤシングトリガアドレス即 ち高速 RAM 20 1へのデータ転送起動要因とされるァドレスを格納 するレジスタ (CTAR) 301、 キヤシングブロック閧始ァドレスレ ジス夕 (CSAR) 302、 キヤシングブロック終了ァドレスレジス夕 (CEAR) 303、 RAMキャッシュ先頭アドレスレジス夕 (RCA
R) 304、 コントロール Zステータスレジス夕 (CSR) 305の各 レジス夕と、 デ一夕転送制御を行う制御回路 306を有する。 CSR3 05は RAM転送コン トローラー 205の動作設定ビヅ 卜の他にバリ ヅドフラグ (V) 307を有する。 FIG. 32 is a block diagram of the RAM transfer controller 205. The RAM transfer controller 205 includes a register (CTAR) 301 for storing an address used as a trigger for data transfer to the high-speed RAM 201, that is, a caching trigger address, a caching block address register (CSAR) 302, and a caching block. End address register evening (CEAR) 303, RAM cache top address register evening (RCA R) 304, Control Z status register (CSR) 305, and a control circuit 306 for performing data transfer control. The CSR305 has a valid flag (V) 307 in addition to the operation setting bit of the RAM transfer controller 205.
CTAR301、 CSAR302、 CEAR303、 R C AR 304 の各レジス夕には CPU 200が出力するァドレスと比較されるべき 値が設定される。また C S R 305は RAM転送コントローラー 205 のコントロール用の設定データやバリッドフラグ 307を含む値が格 納される。それらレジス夕 301〜305は CPU200によってリー ド Zライ トアクセス可能とされ、制御回路 306が内部ァドレスパス I A Bの値をデコ一ドして各レジス夕を選択し、内部デ一夕パス I DBを 介してそれらレジス夕がリードノライ トされる。 CSAR 302及び C EAR 303には前記 ROM 202及び RAM 203のエリアの一部 若しくは全部の範囲を指定するアドレス情報が設定されることになる。 指定可能範囲の記憶容量は高速 R AM 201の記憶容量によって決ま o In each register of CTAR301, CSAR302, CEAR303, and RCAR304, a value to be compared with the address output from the CPU 200 is set. The CSR 305 stores setting data for control of the RAM transfer controller 205 and a value including a valid flag 307. The registers 301 to 305 can be read-Z-accessed by the CPU 200, and the control circuit 306 decodes the value of the internal address path IAB, selects each register, and outputs the selected address via the internal data path IDB. Those Regis evenings are read-written. In the CSAR 302 and the CEAR 303, address information that specifies a part or the entire range of the area of the ROM 202 and the RAM 203 is set. The storage capacity of the specifiable range is determined by the storage capacity of the high-speed RAM 201.
比較回路 3 1 1は内部アドレスパス I ABの値と CTAR30 1の 値とを比較して、 その比較結果を制御回路 306に与える。比較回路 3 12は内部ァドレスバス I ABの値が C S AR 302の値以上のァド レスかを判定して、 その判定結果を制御回路 306に与える。比較回路 313は内部ァドレスパス I ABの値が C E AR 302の値以下のァ ドレスかを判定して、 その判定結果を制御回路 306に与える。第 33 図も参照するに、 制御回路 306は、 CPU 200から内部ァドレスパ ス I A Bに供給されるァドレス信号が C T AR 301の値に一致する ことを検出すると、 CPU 200からバス権を取得して、 CSAR30 2の値によって決まるアドレスから CEAR 303の値によって決ま
るアドレスまでのデ一夕を、: CAR 304の値を先頭とする高速 R A M201の所定領域に転送制御する。 このとき、変換制御信号 3140 は非活性状態にされており、高速 RAM 201は、 RAM転送コントロ ーラ 205が内部ァドレスバス I ABに出力するァドレス信号に従つ てアクセスされる。 当該転送を完了した後は、パリヅ ドフラグ 307を 有効とし、 パス権を放棄する。 また、 制御回路 306は、 パリッドフラ グ 307が有効にされているときは、 比較回路 312、 313による判 定結果を判定回路 314で参照し、 内部アドレスバス IABの値が、 C SAR302の値によって決まるアドレスから CEAR303の値に よって決まるァドレスの範囲に入っていることを検出すると、アドレス 演算器 315にて RCAR304の値から CSAR 302の値を減算 し (RCAR— CSAR)、 減算された値を RAMアドレス変換情報 3 16として、 高速 RAM201に供給し、 且つ、 変換制御信号 310を 活性化する。 The comparison circuit 311 compares the value of the internal address path I AB with the value of the CTAR 301, and gives the comparison result to the control circuit 306. The comparison circuit 312 determines whether or not the value of the internal address bus IAB is equal to or greater than the value of the CSAR 302, and gives the determination result to the control circuit 306. The comparison circuit 313 determines whether or not the value of the internal address path I AB is equal to or less than the value of the CE AR 302, and gives the determination result to the control circuit 306. Referring to FIG. 33 as well, when the control circuit 306 detects that the address signal supplied from the CPU 200 to the internal address path IAB matches the value of the CTAR 301, it acquires the bus right from the CPU 200 and Determined by the value of CEAR 303 from the address determined by the value of CSAR302 The transfer control is performed to a predetermined area of the high-speed ram 201 starting with the value of the CAR 304. At this time, the conversion control signal 3140 is inactive, and the high-speed RAM 201 is accessed according to the address signal output from the RAM transfer controller 205 to the internal address bus IAB. After the completion of the transfer, the valid flag 307 is valid and the pass right is abandoned. When the parity flag 307 is enabled, the control circuit 306 refers to the determination result by the comparison circuits 312 and 313 in the determination circuit 314, and the value of the internal address bus IAB is determined by the value of the CSAR 302. When it is detected that the address is within the address range determined by the value of CEAR303, the address calculator 315 subtracts the value of CSAR302 from the value of RCAR304 (RCAR—CSAR), and the subtracted value is the RAM address. The conversion information 316 is supplied to the high-speed RAM 201, and the conversion control signal 310 is activated.
第 34図には高速 RAM 201及びァドレス変換器 20 10のプロ ック図が示される。前記変換制御信号 3140が活性化されている状態 において、 ァドレス変換器 2010は、 そのときの内部ァドレスバス I ABの値に、前記 RAMアドレス変換情報 316を加算し、 これをァク セスアドレスとして高速 RAM 201に供給する。変換制御信号 314 0が非活性状態のときは、内部ァドレスパス I ABの値がそのまま高速 RAM 201に供給される。高速 RAM 201は、通常の RAMの構成 を有すれば十分であるからその詳細な説明は省略する。 したがって、バ リッドフラグ 307がリセット状態のとき、 また、 変換制御信号 314 0が非活性状態のとき、第 33図に示されるように、 RAM転送コント ローラ 205から内部ァドレスバス I ABに出力されるァドレス信号 に従って、 CSAR302〜CEAR303の範囲のデータが、 RCA
R 304の値を先頭として、高速 RAM 2 1 0に転送される。ノ、 Jヅド フラグ 307がセット状態のときは、 CPU200が C SAR 302の 値によって決まるアドレスから CEAR 30 3の値によって決まるァ ドレスの範囲内をアクセスすると、変換制御信号 3 140が活性化され、 実際には、 R CAR 304を先頭とする高速 RAM 20 1の領域がァク セスされる。パスコントローラ 204は、変換制御信号 3 140が活性 化されているときは、 ROM 202、 RAM 203、 外部メモリ 208 の動作選択に代えて、 高速 RAM20 1を動作選択する。 FIG. 34 shows a block diagram of the high-speed RAM 201 and the address converter 2010. In a state where the conversion control signal 3140 is activated, the address converter 2010 adds the RAM address conversion information 316 to the value of the internal address bus IAB at that time, and uses this as an access address, which is used as a high-speed RAM. Supply to 201. When the conversion control signal 3140 is inactive, the value of the internal address path I AB is supplied to the high-speed RAM 201 as it is. It is sufficient for the high-speed RAM 201 to have a configuration of a normal RAM, and thus a detailed description thereof is omitted. Therefore, when the valid flag 307 is in the reset state, and when the conversion control signal 3140 is in the inactive state, the address signal output from the RAM transfer controller 205 to the internal address bus IAB as shown in FIG. According to the data in the range of CSAR302 to CEAR303, RCA The value of R 304 is transferred to the high-speed RAM 210 with the value at the beginning. When the CPU 200 accesses the address determined by the value of CSAR 302 from the address determined by the value of CSAR 302 when the flag 307 is set, the conversion control signal 3140 is activated. However, actually, the area of the high-speed RAM 201 starting with the R CAR 304 is accessed. When the conversion control signal 3140 is activated, the path controller 204 selects the operation of the high-speed RAM 201 instead of the operation of the ROM 202, the RAM 203, and the external memory 208.
CPU 200が内蔵 ROM 202、 内蔵 RAM 203、又は外部メモ リ 208内にある命令やデータをアクセスしょうとしたときの動作の 一例を説明する。 CPU 200が内部パス 206を介してアドレス信号 250を出力する。アドレス信号 250が RAM転送コントローラー 2 05に供給され、供給されたアドレス信号 250が CTAR 30 1の値 と比較される。その比較結果が一致していれば、 RAM転送コントロー ラー 205はバスコン トローラー 204にバス権要求信号(RT CRE Q) 25 1をアサートする。パスコントローラー 204はパスアービタ 220にてパス権を調停し、 CPU 200のパスサイクルの切れ目など で、パス権を RAM転送コントローラー 205に与える。これによつて、 CPUパス権ァクノリヅジ信号(CPUACK) 253がネゲートされ、 RAM転送コン トローラバス権ァクノ リ ヅジ信号(RT CACK) 25 2がアサートされる。 RT CACK 2 52のアサートを受けて、 RAM 転送コントロ一ラー 205がバス権を獲得すると、 RAM転送コントロ ーラ 205は、前記 C SAR 302で指されるアドレスから C E AR 3 03で指されるアドレスまでの範囲の例えば低速な内蔵 ROM202、 内蔵 RAM 203、又は外部メモリ 208内にある命令又はデータを、 前記 R CAR 304で指される高速 RAM 2 0 1内のアドレスから後
のァドレスに転送制御する。転送が終了したら、 制御回路 306が、 高 速 RAM内に命令又はデ一夕が格納されていることを示す C SR 30 5内のバリッドフラグ 307をセヅト状態に反転する。そして RAM転 送コントローラ 205はバス権を放棄する。 An example of an operation when the CPU 200 tries to access an instruction or data in the internal ROM 202, the internal RAM 203, or the external memory 208 will be described. CPU 200 outputs address signal 250 via internal path 206. The address signal 250 is supplied to the RAM transfer controller 205, and the supplied address signal 250 is compared with the value of the CTAR 301. If the comparison result matches, the RAM transfer controller 205 asserts a bus right request signal (RT CREQ) 251 to the bus controller 204. The path controller 204 arbitrates the path right by the path arbiter 220, and gives the path right to the RAM transfer controller 205 at a break of a pass cycle of the CPU 200 or the like. As a result, the CPU pass right acknowledge signal (CPUACK) 253 is negated, and the RAM transfer controller bus right acknowledge signal (RT CACK) 252 is asserted. When the RAM transfer controller 205 acquires the bus right in response to the assertion of the RT CACK 2 52, the RAM transfer controller 205 changes the address indicated by the CE SAR 302 from the address indicated by the CSAR 302. For example, instructions or data in the low-speed internal ROM 202, the internal RAM 203, or the external memory 208 in the range up to and including the address in the high-speed RAM 201 indicated by the R CAR 304 Transfer control to the address. When the transfer is completed, the control circuit 306 inverts the valid flag 307 in the CSR 305 indicating that an instruction or data is stored in the high-speed RAM to a set state. Then, the RAM transfer controller 205 relinquishes the bus right.
CPU 200が RAM転送コントローラー 205からバス権を獲得 して CPU 200がパスアクセスを起動すると、 CPU 200が出力す るアドレス信号 250は、 比較器 312, 313にて前記 CSAR30 2, CEAR 303の値と比較される。 C S AR≤アドレス信号≤ C E A Rであって、 ノ リッ ドフラグ 307がセヅト状態ならば、 そのアドレ ス信号 250の内容は、高速 RAM201アクセス用に変換され、 これ により、低速な内蔵 ROM 202ノ内蔵 RAM 203/外部メモリ 20 8に代えて高速 RAM201がアクセスされる。上記条件が成立してい ない場合には、通常通り、 アドレス信号 250によって低速な内蔵 RO M202、 内蔵 RAM 203、又は外部メモリ 208などがアクセスさ れる。 When the CPU 200 acquires the bus right from the RAM transfer controller 205 and activates the path access, the address signal 250 output by the CPU 200 is compared with the values of the CSAR 302 and CEAR 303 by the comparators 312 and 313. Be compared. If CS AR ≤ address signal ≤ CEAR and the NORD flag 307 is in the set state, the contents of the address signal 250 are converted for access to the high-speed RAM 201. The high-speed RAM 201 is accessed instead of the / external memory 208. If the above conditions are not satisfied, the low-speed built-in ROM 202, built-in RAM 203, or external memory 208 is accessed by the address signal 250 as usual.
上記条件が成立している場合の動作を更に詳述すれば、 RAM転送コ ントローラー 205から高速 RAM 201へ RAMァドレス変換情報 316が供給され、またバスコントローラ 204へは RAMァドレス変 換情報 316及び変換制御信号 3141が与えられる。これによつて高 速 RAM201は、 CPUアクセスアドレス一 CSAR + RCARで計 算されたアクセスァドレスによってアクセス可能にされる。一方、パス コントロ一ラ 204は、 RAMァ卞レス変換情報 316及び変換制御信 号 3141にて高速 RAM210を動作選択する。またバスコントロー ラ 204は前記変換制御信号 31 0にて、そのときの内部ァドレスバ ス I AB上のァドレス信号 250に対応される、 ROM202、 RAM 203、 又は外部メモリ 208に対する動作選択を抑止する。アドレス
演算器 3 1 5及びァドレス変換器 20 1 0による演算に無視し得ない 時間がかかる場合には、高速 RAM 20 1のアクセスアドレスを、 RC ARの上位とアドレス 2 50の下位を接続したものとしてもよい。この 場合、 CSAR 302と CEAR 303に設定可能な値は自ずと制限さ れることになる。或いは CEAR 303を廃止し、 アドレス 250の上 位と C SAR 302の上位との一致比較を行うようにしてもよい。 The operation when the above condition is satisfied will be described in further detail. The RAM address conversion information 316 is supplied from the RAM transfer controller 205 to the high-speed RAM 201, and the RAM address conversion information 316 and A conversion control signal 3141 is provided. As a result, the high-speed RAM 201 can be accessed by the access address calculated by the CPU access address—CSAR + RCAR. On the other hand, the path controller 204 selects the operation of the high-speed RAM 210 based on the conversion information 316 and the conversion control signal 3141. Further, the bus controller 204 uses the conversion control signal 310 to inhibit the operation of the ROM 202, the RAM 203, or the external memory 208 corresponding to the address signal 250 on the internal address bus IAB at that time. address If the operation by the arithmetic unit 3 15 and the address converter 20 10 takes time that cannot be ignored, the access address of the high-speed RAM 201 is determined by connecting the upper part of the RC AR and the lower part of the address 250. Is also good. In this case, the values that can be set for CSAR 302 and CEAR 303 are naturally limited. Alternatively, the CEAR 303 may be abolished, and a match between the top of the address 250 and the top of the C SAR 302 may be made.
尚、 上記 ROM 202、 RAM 203の全て又は何れかが、 或いは、 各々の一部分が、 アクセススピードが間に合えば、 1サイクルアクセス 可能な構成を採用することも可能である。 この場合、 内部パス 206に 接続された 1サイクルアクセス可能なデバイスに対して前記 RAMキ ャヅシュの制御は不要とされ、通常通りの CPU 200による 1クロヅ クサイクルアクセスが行われる。 また、上記実施例における高速 RAM 2 10への事前転送の対象データは、 内蔵 ROM, RAMのデ一夕に限 定されず、外部メモリのデータだけを対象とし、或いは内蔵 ROM及び RAMと外部メモリとの双方のデータを対象とすることができる。それ らの場合にも上記実施例と同様の制御によって実現できる。 If the access speed is sufficient for all or any of the ROM 202 and the RAM 203, or a part of each of them, it is possible to adopt a configuration that allows one cycle access. In this case, the control of the RAM cache is unnecessary for the device connected to the internal path 206 and accessible by one cycle, and one clock cycle access by the CPU 200 is performed as usual. Further, the data to be pre-transferred to the high-speed RAM 210 in the above embodiment is not limited to the data in the internal ROM and RAM, but only the data in the external memory or the data in the internal ROM and RAM and the external memory. And both data can be targeted. In these cases, the control can be realized by the same control as in the above embodiment.
本実施例によれば、アクセスタイムが遅い内蔵 ROM 202又は RA M203に格納されているプログラムのうち、ある部分をあらかじめ高 速 RAM20 1に転送して、当該プログラムを実行させるようにすれば、 その部分の実行を高速化できる。当然、 内蔵 ROMZRAMに収まりき れずにプログラムがアクセスタイムの遅い外部メモリ 208にはみ出 しても、この外部メモリ 208を内蔵 ROM/RAMと同様に制御すれ ば性能低下を防ぐことができる。シングルチヅプマイクロコンピュー夕 が対象にする主なアプリケーションでは、高速性が要求されるルーチン は割り込み処理プログラムなどのように比較的そのァドレス範囲と実 行夕イミングが限定されており、あまり処理性能が必要でないパックグ
ランドルーチン (例えばメインルーチン)を実行中に高速実行が必要な 部分をあらかじめ高速 RAM 201に転送しておくことができる。その 結果、 プログラム処理全体の性能を向上させることができる。 According to the present embodiment, if a certain portion of the program stored in the internal ROM 202 or the RAM 203 having a slow access time is transferred to the high-speed RAM 201 in advance and the program is executed, Part execution can be accelerated. Naturally, even if the program does not fit in the built-in ROMZRAM and protrudes into the external memory 208 having a slow access time, the performance can be prevented from deteriorating by controlling the external memory 208 in the same manner as the built-in ROM / RAM. In the main applications targeted for single-chip microcomputers, routines that require high speed have relatively limited address ranges and execution timings, such as interrupt processing programs, and therefore have very low processing performance. Not needed During execution of a land routine (for example, a main routine), a portion requiring high-speed execution can be transferred to the high-speed RAM 201 in advance. As a result, the performance of the entire program processing can be improved.
《4. 同時転送形式 RAMキヤヅシュ内蔵マイクロコンビユー夕》 第 35図には高速 RAMに同時にデータを転送してアクセスの高速 化を図ったマイクロコンビユー夕(同時転送形式 RAMキヤヅシュ内蔵 マイクロコンビュ一夕) の一実施例ブロック図が示される。 << 4. Simultaneous transfer format Microcomputer with built-in RAM cache >> Fig. 35 shows a microcombiner with simultaneous transfer of data to high-speed RAM to speed up access (microcomputer with built-in simultaneous transfer format RAM cache). 2) is shown.
本実施例のシングルチップマイクロコンビユー夕(単にマイクロコン ビュー夕とも記す) MPU 3は、 CPU400、 CPU400動作プロ グラム又はデータが格納される ROM 402、 CPU 400の作業領域 若しくはデータの一時記憶領域とされる RAM403、乗算器(MUL T) 409、 パスコントローラ 404、 周辺回路 410、 外部パスイン 夕フェース 407、 高速 RAM 401、 ァドレス変換器 4010、 及び RAM転送コントロ一ラ 405等を含み、単結晶シリコンのような 1個 の半導体基板に形成される。外部パスィン夕フェース 407には外部バ ス 41 1を介して外部メモリ 408等が接続される。高速 RAM 401 は第 36図に示される。第 34図で説明したものとの相違点は、 ァドレ ス変換器 4010の動作が変換制御信号 5140にて制御されず、常に、 内部ァドレスパス I A Bの値に RAMァドレス変換情報 5 16を加算 して高速 RAM401に供給する。 The single-chip micro-computer of this embodiment (also simply referred to as micro-computer) MPU 3 includes a CPU 400, a ROM 402 in which the CPU 400 operating program or data is stored, a work area of the CPU 400, or a temporary storage area for data. RAM 403, multiplier (MULT) 409, path controller 404, peripheral circuit 410, external path interface 407, high-speed RAM 401, address converter 4010, RAM transfer controller 405, etc. It is formed on one such semiconductor substrate. An external memory 408 and the like are connected to the external pass interface 407 via an external bus 411. The high speed RAM 401 is shown in FIG. The difference from the one described in FIG. 34 is that the operation of the address converter 4010 is not controlled by the conversion control signal 5140, and the RAM address conversion information 516 is always added to the value of the internal address path IAB to achieve high speed operation. Supply to RAM401.
本実施例のマイクロコンビユー夕 MP U 3は、特に制限されないが、 R I S Cアーキテクチャを有するものであって、 CPU400は、 1命 令あたり C PU 400の動作基準クロック信号における 1クロックサ ィクルで命令を実行し、パスアクセスの基本サイクル数を 1クロックサ ィクルとするように、 パイブライン動作によって命令フェッチ、命令デ コード、命令実行、 メモリアクセスなどのパイプラインステージを実行
していく。 CPU400が接続される内部バス 406は、 1クロックサ ィクルを最小動作周期とする高速内部バスであり、内部ァドレスバス I AB、 内部データバス I DB、 内部制御バス I CBから成る。 当該内部 パス 406には前記夫々の回路モジュールが接続される。バスコント口 ーラ 404は、内部バス 406の制御及び周辺回路 410のアクセス制 御などを行う。 The microcomputer MPU3 of the present embodiment is not particularly limited, but has a RISC architecture, and the CPU 400 executes an instruction in one clock cycle of the operation reference clock signal of the CPU 400 per instruction. Pipeline operation executes pipeline stages such as instruction fetch, instruction decode, instruction execution, and memory access so that the basic number of path access cycles is one clock cycle. I will do it. The internal bus 406 to which the CPU 400 is connected is a high-speed internal bus having a minimum operation cycle of one clock cycle, and includes an internal address bus IAB, an internal data bus IDB, and an internal control bus ICB. The respective circuit modules are connected to the internal path 406. The bus controller 404 controls the internal bus 406 and controls the access to the peripheral circuit 410.
バスコントローラ 404は内部パス 406から供給されるァドレス 信号の上位側ビヅトに基づいてアクセス対象エリアの判定を行い、また 内部パス 406から供給されるパスコマンドなどを受け取ってリード /ライ トゃアクセスデータ幅等のアクセスの種別を判定する。それらの 判定結果に従って内蔵 ROM 402や RAM403等の選択を行い、ま た、外部アクセスのためのチップ選択やリード Zライ 卜の指示を外部バ スィン夕フェースを介して外部に与える制御を行う。 The bus controller 404 determines an access target area based on the upper bit of the address signal supplied from the internal path 406, and receives a path command or the like supplied from the internal path 406 to read / write access data width. The type of access such as is determined. The internal ROM 402 and the RAM 403 are selected in accordance with the determination results, and a control for selecting a chip for external access or giving a read Z-write instruction to the outside through an external bus interface is performed.
本実施例において前記 RAM 403及び ROM 402はアクセスに 2クロックサイクル以上必要な低速内蔵メモリとされる。これに対して 前記高速 RAM401は 1クロックサイクルでアクセス可能とされ、同 時転送形式の RAMキヤヅシュとして利用される。 RAM転送コントロ ーラ 405は内蔵 RAM 403及び ROM 402の所要の情報を高速 RAM401に転送する制御を行う。 In this embodiment, the RAM 403 and the ROM 402 are low-speed internal memories that require two or more clock cycles for access. On the other hand, the high-speed RAM 401 is accessible in one clock cycle, and is used as a simultaneous transfer type RAM cache. The RAM transfer controller 405 controls to transfer required information of the built-in RAM 403 and the ROM 402 to the high-speed RAM 401.
第 37図には RAM転送コントローラー 405のブロック図が示さ れる。 RAM転送コントローラ 405は、 キヤシングブロック開始アド レスレジスタ (CSAR) 502、 キヤシングブロヅク終了ァドレスレ ジス夕(CEAR) 503、: AMキヤヅシュ先頭ァドレスレジス夕(R CAR) 504、 コントロール /ステータスレジスタ (CSR) 505 の各レジス夕と、 データ転送制御を行う制御回路 506を有する。 CS 505は RAM転送コントローラー 405の動作設定ビヅ トの他に
ノ リヅ ドフラグ (V) 508を有する。 FIG. 37 shows a block diagram of the RAM transfer controller 405. The RAM transfer controller 405 has a caching block start address register (CSAR) 502, a caching block end address register (CEAR) 503, and an AM cache top address register (R CAR) 504, a control / status register (CSR). 505, and a control circuit 506 for controlling data transfer. In addition to the operation setting bit of the RAM transfer controller 405, the CS 505 It has a Nord flag (V) 508.
CSAR502、 CEAR503、 RCAR504には CPU400 が出力するアドレスと比較されるべき値が設定される。また C SR 50 5は RAM転送コントロ一ラー 405のコントロール用の設定データ やバリッドフラグ 508を含む値が格納される。それらレジスタ 502 〜505は CPU400によってリード/ライ トアクセス可能とされ、 制御回路 506が内部アドレスパス I ABの値をデコードして各レジ ス夕を選択し、内部デ一夕パス I DBを介してそれらレジス夕がリード Zライ トされる。 CSAR502及び CEAR 503には前記 ROM 5 02及び RAM 503のエリアの一部若しくは全部の範囲を指定する ァドレス情報が設定されることになる。指定可能範囲の記憶容量は高速 RAM501の記憶容量によって決まる。 A value to be compared with the address output by the CPU 400 is set in CSAR502, CEAR503, and RCAR504. The CSR 505 stores the setting data for controlling the RAM transfer controller 405 and the value including the valid flag 508. The registers 502 to 505 are made read / write accessible by the CPU 400, and the control circuit 506 decodes the value of the internal address path IAB to select each register, and via the internal data path IDB. Those Regis evenings will be lead Z-written. In the CSAR 502 and the CEAR 503, address information for designating a part or all of the area of the ROM 502 and the RAM 503 is set. The storage capacity of the specifiable range is determined by the storage capacity of the high-speed RAM 501.
比較回路 5 12は内部アドレスバス I ABの値が CSAR 502の 値以上のァドレスか、また CSAR502の値に等しいァドレスかを判 定して、 その判定結果を制御回路 506に与える。比較回路 513は内 部ァドレスパス I ABの値が CE AR 502の値以下のァドレスか、ま た CEAR 502の値に等しいァドレスかを判定して、その判定結果を 制御回路 506に与える。 The comparison circuit 512 determines whether the value of the internal address bus IAB is equal to or greater than the value of the CSAR 502 or is equal to the value of the CSAR 502, and gives the determination result to the control circuit 506. The comparison circuit 513 determines whether the value of the internal address path I AB is equal to or less than the value of the CE AR 502 or equal to the value of the CEAR 502, and gives the determination result to the control circuit 506.
CPU400が内部パス 406を介してァドレス信号 450を出力 すると、ァドレス信号 450が RAM転送コントローラ 405に供給さ れ、供給されたアドレス信号が比較器 512, 513にて前記 CSAR 502, CEAR 503の値と比較される。比較結果は判定回路 514 に与えられる。判定回路 5 14は、ノ リッドフラグ 508が無効状態の 時、アクセスアドレスが C SARの値に一致していることを検出すると、 それ以降、ァドレス信号 450が前記 C EAR 503の値に一致するま での間、或いはアドレス信号 450が CSAR502の値から C EAR
5 0 3の値の範囲に入っている間、 CPU400が内蔵 ROM402、 内蔵 RAM 40 3、又は外部メモリ 408内にある命令やデータをァク セスしたときに、 同時に、 このアクセス (リード又はライ ト) した命令 やデータを高速 RAM 40 1にライ トする。この時の高速 RAM 40 1 のアクセスアドレスは前記実施例同様に、 CPUアクセスアドレス一 C SAR + R CAR、 で計算される。即ち、 演算器 5 1 5が前記実施例同 様に: RAMアドレス変換情報(RCAR— C SAR) 5 1を生成し、 こ れを受ける高速 RAM 40 1の演算器 40 1 0が高速 RAMアクセス アドレス(CPUアクセスアドレス一 C SAR+RCAR)を生成する。 ライ ト夕イミングは、第 3 8図に示されるように、 内蔵 ROM 402、 内蔵 RAM 40 3、又は外部メモリ 408のアクセスに並行して行われ る。そのような並列的な高速 RAM 40 1アクセスのための高速 RAM 40 1の動作選択は、変換制御情報 5 1 40をバスコントローラ 404 が受けることによって制御する。高達 RAMァドレスのァドレス演算に 時間がかかる場合には、高速 RAM40 1のアクセスァドレスは、 RC ARの上位とアドレス信号 45 0の下位を接続したものとしてもよい。 この場合、 C SAR 5 0 2と CEAR 5 03の設定可能な内容は制限を 受ける。或いは、 CEAR 503を廃止し、 アドレス信号 4 50の上位 と C SAR 5 02の上位との一致比較を行うようにしてもよい。 C SA R 5 0 2の値から CEAR 5 0 3までのァドレス範囲に対するデータ の高速 RAM 40 1へのライ ト動作が終了されると、制御回路 5 0 6は バリッドフラグ 5 0 8をセット状態に転ずる。本実施例において制御回 路 5 0 6は、 C SAR 5 02の値から C EAR 5 03までのアドレス範 囲に対するデ一夕の高速 R AM40 1へのライ ト動作の終了を検出す る手段を特に備えていない。即ち、 CPU400によるアクセスァドレ スが順番に変化されるァドレス範囲において C SAR 5 0 2と CEA
R 503の値を設定すればよいからである。特に制限されないが、 C S AR 502の値から CEAR 503までのァドレス範囲における個々 のァドレスに対するアクセスの有無を逐次検出して当該範囲の全ての ァドレスに対するアクセスの完了を検出する回路を設けることも可能 ある c When the CPU 400 outputs the address signal 450 via the internal path 406, the address signal 450 is supplied to the RAM transfer controller 405, and the supplied address signal is compared with the values of the CSAR 502 and CEAR 503 by the comparators 512 and 513. Be compared. The comparison result is given to the judgment circuit 514. When the determination circuit 514 detects that the access address matches the value of the CSAR when the NORD flag 508 is in the invalid state, the determination circuit 514 continues until the address signal 450 matches the value of the CEAR 503. Or the address signal 450 changes from the value of CSAR502 to CEAR When the CPU 400 accesses an instruction or data in the built-in ROM 402, the built-in RAM 403, or the external memory 408 while in the range of the value of 503, the access (read or write) is performed at the same time. ) Write the written instructions and data to the high-speed RAM 401. At this time, the access address of the high-speed RAM 401 is calculated by the CPU access address—C SAR + R CAR, as in the above embodiment. That is, the arithmetic unit 515 generates RAM address conversion information (RCAR-C SAR) 51 as in the above-described embodiment, and the arithmetic unit 40 10 of the high-speed RAM 401 receives the RAM address conversion information (RCAR-CSAR) 51. (CPU access address-C SAR + RCAR) is generated. The writing is performed in parallel with the access to the internal ROM 402, the internal RAM 403, or the external memory 408, as shown in FIG. The operation selection of the high-speed RAM 401 for such parallel high-speed RAM 401 access is controlled by receiving the conversion control information 5 140 by the bus controller 404. If it takes time to perform the address calculation of the high RAM address, the access address of the high-speed RAM 401 may be a connection between the upper part of the RCAR and the lower part of the address signal 450. In this case, the configurable contents of C SAR 502 and CEAR 503 are limited. Alternatively, the CEAR 503 may be abolished, and the higher order of the address signal 450 may be compared with the upper order of the CSAR 502. When the operation of writing data to the high-speed RAM 401 in the address range from the value of CSAR 502 to CEAR 503 is completed, the control circuit 506 sets the valid flag 508 to the set state. Turn around. In the present embodiment, the control circuit 506 has a means for detecting the end of the write operation to the high-speed RAM 401 in the address range from the value of the CSAR 502 to the address of the CEAR 503. Not particularly prepared. That is, in the address range where the access address by the CPU 400 is changed in order, the CSAR 502 and CEA This is because the value of R 503 may be set. Although not particularly limited, it is also possible to provide a circuit for sequentially detecting the presence / absence of access to each address in the address range from the value of CSAR 502 to CEAR 503 and detecting completion of access to all addresses in the range. c
制御回路 506は、ノ リッドフラグ 508がセヅトされている状態に おいては、 CPU400のアクセスにおいて、 CPUのアクセスァドレ スが、 C SAR≤アドレス≤C EARの範囲に入っていることを判定回 路 5 14で検出したときは、判定制御信号 5140にて、 内蔵 ROM 4 02、 内蔵 RAM 403、又は外部メモリ 408の動作選択をバスコン トローラ 404で抑止させる。それに代えて、バスコントローラ 404 に高速 RAM401の動作を選択させ、高速 RAM401には RAMァ ドレス変換情報 516を供給して、高速 RAM 401を 1クロックサイ クルで動作させる。これによつてその範囲のァドレスアクセスを高速化 することができる。高速 RAM 401のアクセスに利用されるァドレス 信号は、前記実施例同様に、 CPUアクセスアドレス一 CSAR + RC AR、 とされる。 このァドレス演算に無視し得ない時間を要する場合に は、 前述の通り、 高速 RAM 401のアクセスアドレスを、 RCARの 上位とアドレス 450の下位を接続したものとすることができる。 尚、上記実施例における高速 RAM210への同時転送の対象データ は、 内蔵 ROM, RAMのデータに限定されず、 外部メモリのデータだ けを対象とし、或いは内蔵 ROM及び RAMど外部メモリとの双方のデ 一夕を対象とすることができる。それらの場合にも上記実施例と同様の 制御によって実現できる。 When the NORD flag 508 is set, the control circuit 506 determines that the access address of the CPU is in the range of SAR ≤ address ≤ CEAR in the access of the CPU 400. When the detection is made in 514, the selection of the operation of the internal ROM 402, the internal RAM 403, or the external memory 408 is suppressed by the bus controller 404 by the judgment control signal 5140. Instead, the bus controller 404 selects the operation of the high-speed RAM 401, supplies the high-speed RAM 401 with the RAM address conversion information 516, and operates the high-speed RAM 401 in one clock cycle. As a result, address access in that range can be sped up. The address signal used for accessing the high-speed RAM 401 is CPU access address-CSAR + RCAR, as in the above embodiment. If this address operation requires a time that cannot be ignored, the access address of the high-speed RAM 401 can be made by connecting the upper part of the RCAR and the lower part of the address 450 as described above. The data to be simultaneously transferred to the high-speed RAM 210 in the above embodiment is not limited to the data in the built-in ROM and RAM, but only the data in the external memory, or the data in both the built-in ROM and the RAM. De overnight can be targeted. In those cases, it can be realized by the same control as in the above embodiment.
本実施例によれば、前記事前転送形式 RAMキヤッシュ内蔵マイクロ コンビユー夕と同様に処理性能の向上を図ることができるが、性能をあ
まり必要としないパックグランド処理が少ない場合、高速化したい範囲 を予め転送するための時間を割きにくい。 このため、 内蔵 ROM/RA Mの高速化したい範囲を CPU 400がアクセスしたときに同時に高 速 RAM 401へもアクセスデ一夕をコピーするようにしておけば、そ の範囲を初めて実行する際は内蔵 R OM/R AMのアクセスタイムに 依存する性能しか出ないが、 2回目以降の実行は高速 RAM401のァ クセスとなるため高速化される。当然、 内蔵 ROMZRAMに収まりき れずにプログラムがアクセスタイムの遅い外部メモリにはみ出しても、 この外部メモリを内蔵 ROMZR AMと同様に制御すれば性能低下を 防ぐことができる。 According to the present embodiment, the processing performance can be improved in the same manner as the micro transfer device with a built-in pre-transfer format RAM cache, but the performance is improved. When there are few background processes that are not required, it is difficult to take the time to pre-transfer the range to be speeded up in advance. For this reason, if the range of the internal ROM / RAM that you want to speed up is copied to the high-speed RAM 401 at the same time when the CPU 400 accesses the range, the first time that range is executed, The performance depends only on the access time of the built-in ROM / RAM, but the second and subsequent executions are performed by accessing the high-speed RAM 401, so the speed is increased. Naturally, even if the program does not fit in the built-in ROMZRAM and runs out to an external memory with a slow access time, controlling this external memory in the same way as the built-in ROMZRAM can prevent performance degradation.
《5. ァドレス置換形式 RAMキヤヅシュ内蔵マイクロコンビユー夕》 第 39図には DMA Cなどによって低速メモリの情報をあらかじめ 高速 RAMに転送しておき、当該低速メモリに対するアクセスァドレス を高速 RAMのァドレスに置き換えてメモリアクセスの高速化を図つ たマイクロコンピュータ(ァドレス置き換え形式 RAMキヤヅシュ内蔵 マイクロコンビュ一夕) の一実施例ブロック図が示される。 《5. Address replacement format Microcomputer with built-in RAM cache》 In Fig. 39, the information of the low-speed memory is transferred to the high-speed RAM in advance by DMAC and the address of the low-speed memory is replaced with the address of the high-speed RAM. FIG. 1 is a block diagram showing an embodiment of a microcomputer (microcomputer with built-in RAM cache) for speeding up memory access.
本実施例のシングルチップマイクロコンビュー夕(単にマイクロコン ビュー夕とも記す) MPU4は、 CPU 600、 CPU 600動作プロ グラム又はデータが格納される ROM 6.02、 CPU 600の作業領域 若しくはデ一夕の一時記憶領域とされる RAM 603、乗算器(MUL T) 609、 パスコン トローラ 604、 周辺回路 610、 外部パスィン 夕フェース 607、 高速 RAM 601、 ァドレス変換器 613、 及び D MAコントローラ 612等を含み、単結晶シリコンのような 1個の半導 体基板に形成される。外部パスインタフェース 607には外部パス 61 1を介して外部メモリ 608等が接続される。 The MPU 4 has a CPU 600, a CPU 600 operating program or a ROM 6.02 in which data is stored, a work area of the CPU 600, or a temporary memory. Includes RAM 603 as a storage area, multiplier (MULT) 609, path controller 604, peripheral circuit 610, external path interface 607, high-speed RAM 601, address converter 613, and DMA controller 612. It is formed on one semiconductor substrate such as silicon. An external memory 608 and the like are connected to the external path interface 607 via an external path 611.
本実施例のマイクロコンビュー夕 MPU4は、特に制限されないが、
I S Cアーキテクチャを有するものであって、 CPU 600は、 1命 令あたり CPU 600の動作基準クロック信号における 1クロックサ ィクルで命令を実行し、パスアクセスの基本サイクル数を 1クロックサ ィクルとするように、 パイプライン動作によって命令フェッチ、命令デ コード、命令実行、 メモリアクセスなどのパイプラインステージを実行 していく。 CPU 600が接続される内部パス 606は、 1クロックサ ィクルを最小動作周期とする高速内部パスであり、内部ァドレスバス I AB、 内部データバス I DB、 内部制御バス I CBから成る。 当該内部 パス 606には前記夫々の回路モジュールが接続される。バスコント口 —ラ 604は、内部バス 606の制御及び周辺回路 6 10のアクセス制 御などを行う。 Although the micro-view MPU4 of the present embodiment is not particularly limited, It has an ISC architecture, and the CPU 600 executes the instruction in one clock cycle of the operation reference clock signal of the CPU 600 per instruction, and sets the basic cycle number of the path access to one clock cycle. The pipeline stages such as instruction fetch, instruction decode, instruction execution, and memory access are executed by line operation. The internal path 606 to which the CPU 600 is connected is a high-speed internal path having a minimum operation cycle of one clock cycle, and includes an internal address bus IAB, an internal data bus IDB, and an internal control bus ICB. The respective circuit modules are connected to the internal path 606. A bus controller 604 controls the internal bus 606 and controls access to peripheral circuits 610.
本実施例において前記 RAM 603及び ROM 602は、アクセスに 2クロックサイクル以上必要な低速内蔵メモリとされる。これに対して 前記高速 RAM 601は、 1クロックサイクルでアクセス可能とされ、 ァドレス置き換え形式の RAMキヤッシュとして利用される。 DM Aコ ントローラ 612は、 CPU600に代わって内蔵 RAM 603及び R OM 602などの所要の情報を高速 RAM601に転送したりする制 御を行う。 DMAコントローラ 612に対する動作の初期設定は CPU 600が行う。 DMAコントローラ 612にて高速 RAM 601に転送 されたデ一夕を内蔵 RAM 603又は ROM 602などに代えて CP U 600がアクセス可能にする制御は、特に制限されないが、バスコン トロ一ラ 604が行う。 In this embodiment, the RAM 603 and the ROM 602 are low-speed internal memories that require two or more clock cycles for access. On the other hand, the high-speed RAM 601 can be accessed in one clock cycle, and is used as a RAM cache of an address replacement type. The DMA controller 612 controls the transfer of required information such as the built-in RAM 603 and the ROM 602 to the high-speed RAM 601 in place of the CPU 600. The CPU 600 initializes the operation of the DMA controller 612. The control to enable the CPU 600 to access the data transferred to the high-speed RAM 601 by the DMA controller 612 in place of the built-in RAM 603 or the ROM 602 is not particularly limited, but the bus controller 604 performs the control.
第 40図にはバスコントローラ 604の一例ブロック図が示される。 パスコントローラ 604は、内部パス 606から供給されるアドレス信 号の上位側ビットに基づいてアクセス対象エリアの判定を行って行い、 また内部パス 606から供給されるパスコマンドをなどを受け取って
リード/ライ トゃアクセスデ一夕幅等のアクセスの種別を判定する。そ れらの判定結果に従って内蔵 ROM 6 02や RAM 603等の選択を 行い、 また、外部アクセスのためのチヅプ選択やリード ライ トの指示 を外部パスイン夕フェース 607を介して外部に行う。それらの制御は 制御回路 706が行う。バスコントローラ 604は高速 RAM 60 1を 制御するために、 キヤシングブロック開始アドレスレジスタ (C SA R) 702、 キヤシングブロック終了アドレスレジス夕 (CEAR) 7 03、 コントロール /ステータスレジスタ (C SR) 705、 RAM先 頭アドレスレジスタ 707、 比較器 7 12, 7 13、 判定回路 7 1 5、 及びァドレス演算器 7 14を備える。 C SR 705はパリヅ ドフラグ 7 05 1を供える。当該フラグ 705 1は DM Aコントローラが CPUに 代わって内蔵 RAM 6 03及び ROM 602の所要の情報を高速 R A M60 1に転送した後、 セヅト状態にされる。 FIG. 40 shows an example block diagram of the bus controller 604. The path controller 604 determines the area to be accessed based on the upper bits of the address signal supplied from the internal path 606, and receives a path command supplied from the internal path 606, etc. Judge the type of access such as read / write access time. The internal ROM 602 and the RAM 603 are selected in accordance with the determination results, and a chip for external access and a read / write instruction are issued to the outside via the external pass-in interface 607. The control is performed by the control circuit 706. The bus controller 604 controls the high-speed RAM 601 by using a caching block start address register (CSAR) 702, a caching block end address register (CEAR) 703, a control / status register (CSR) 705, A RAM start address register 707, comparators 712 and 713, a decision circuit 715, and an address calculator 714 are provided. CSR 705 provides a parity flag 7051. The flag 7051 is set to a reset state after the DMA controller transfers necessary information of the built-in RAM 603 and the ROM 602 to the high-speed RAM 601 instead of the CPU.
CSAR 702、 CEAR 703には CPU 600が出力するァドレ スと比較されるべき値が設定される。 RAM先頭ァドレスレジスタ 70 7には高速 RAM 60 1がマツビングされるアドレス領域の先頭アド レスが設定される。 それらレジスタ 702 , 703, 705 , 707は CPU 600によってリード Zライ トアクセス可能とされ、制御回路 7 06が内部ァドレスパス I ABの値をデコードして各レジス夕を選択 し、内部データパス I DBを介してそれらレジス夕がリード/ライ トさ れる。 CSAR 702及び C EAR 703には前記 DM Aコントローラ 6 1 2によって高速 RAM 60 1に転送された ROM 602 , RAM 6 03のデータアドレスの範囲を指定するアドレス情報が設定されるこ とになる。 In CSAR 702 and CEAR 703, a value to be compared with an address output from the CPU 600 is set. The start address of the address area where the high-speed RAM 601 is mapped is set in the RAM start address register 707. The registers 702, 703, 705, and 707 are made read-Z-write accessible by the CPU 600, and the control circuit 706 decodes the value of the internal address path IAB to select each register, and the internal data path IDB. Those Regis evenings are read / written. In the CSAR 702 and the CEAR 703, address information that specifies the range of data addresses of the ROM 602 and the RAM 603 transferred to the high-speed RAM 601 by the DMA controller 6 12 is set.
比較回路 7 1 2は内部アドレスバス I ABの値が C SAR 702の 値以上のアドレスかを判定して、その判定結果を制御回路 706に与え
る。比較回路 7 1 3は内部アドレスバス I ABの値が CEAR 702の 値以下のアドレスかを判定して、その判定結果を制御回路 706に与え る。それによつて判定回路 7 1 5は、 CPU 600から内部ドレスパス I ABに供給されるアドレス信号が、 C SAR≤アドレス CEARの 範囲に入っていることを検出すると、パリッドフラグ 705 1がセット 状態にされていることを条件に、アドレス演算器 7 14にて RAM先頭 アドレスレジス夕 (RCAR) 707の値から C S AR 702の値を減 算し (RCAR— C SAR)、 減算された値を RAMアドレス変換情報 7 1 6として、 高速 RAM60 1に供給し、 更に、 変換制御信号 7 1 5 0を活性化して高速 RAM 60 1に供給する。バリヅ ドフラグ 705 1 がリセット状態にされているときは、内部パス I A Bのアドレスの値に 拘わらず、 前記ァドレス演算器 7 14は動作されず、 且つ、 変換制御信 号 7 1 50は非活性状態にされる。制御回路 706は、 変換制御信号 7 1 50を活性化するとき、アドレスバス I ABの値が指定する ROM 6 02又は RAM 603の動作選択を抑止し、それに代えて高速 R AM 6 0 1の動作を選択信号 (メモリイネ一ブル信号) で選択する。 The comparator circuit 712 determines whether the value of the internal address bus IAB is equal to or greater than the value of the CSAR 702 and provides the determination result to the control circuit 706. You. The comparison circuit 713 determines whether the value of the internal address bus IAB is equal to or smaller than the value of the CEAR 702, and gives the determination result to the control circuit 706. Accordingly, when the determination circuit 715 detects that the address signal supplied from the CPU 600 to the internal address path IAB is within the range of CSAR ≤ address CEAR, the parity flag 7051 is set to the set state. The address calculator 714 subtracts the value of the CSAR 702 from the value of the RAM start address register (RCAR) 707 (RCAR-C SAR) and uses the resulting value as the RAM address conversion information. The signal is supplied to the high-speed RAM 601 as 716, and the conversion control signal 710 is activated and supplied to the high-speed RAM 601. When the valid flag 705 1 is in the reset state, the address calculator 714 is not operated, and the conversion control signal 710 is inactive, regardless of the value of the address of the internal path IAB. Is done. When activating the conversion control signal 710, the control circuit 706 suppresses the operation selection of the ROM 602 or the RAM 603 specified by the value of the address bus IAB, and instead operates the high-speed RAM 601. Is selected by the selection signal (memory enable signal).
第 4 1図には高速 RAM 6 0 1及びアドレス演算器 6 1 3のブロヅ ク図が示される。ァドレス演算器 6 1 3は、 変換制御信号 7 1 50が活 性化されているとき、 内部ァドレスパス I ABの値に、前記 RAMァド レス変換情報 7 1 6を加算し、これをアクセスアドレスとして高速 R A M60 1に供給する。変換制御信号 7 1 50が非活性状態の場合には、 アドレス演算器 6 1 3は内部アドレスバス ΓΑΒの値を直接高速 R A M 60 1に供給する。 DMAコントローラ 6 12にて ROM602, R AM 603のデータが高速 RAM 60 1に転送されるときは前記パリ ヅ ドフラグ 705 1がリセヅ ト状態にされるので、 DM Aコント ローラ 6 04が出力するアドレス信号に従って高速 RAM 60 1がアクセス
される。 FIG. 41 is a block diagram of the high-speed RAM 601 and the address calculator 613. When the conversion control signal 7150 is activated, the address arithmetic unit 613 adds the RAM address conversion information 716 to the value of the internal address path IAB, and uses this as the access address. Supplied to high-speed RA M60 1. When the conversion control signal 7150 is inactive, the address calculator 613 supplies the value of the internal address bus 直接 directly to the high-speed RAM 601. When the data of the ROM 602 and the RAM 603 is transferred to the high-speed RAM 601 by the DMA controller 612, the parity flag 7051 is reset, so that the address signal output by the DMA controller 604 is output. High-speed RAM 60 1 accesses according to Is done.
DMAコントローラ 6 12による高速 RAM 601へのデータ転送 が行われた後に、 CPU 600が内蔵 ROM 602、内蔵 RAM 603、 又は外部メモリ 608内にある命令やデータをアクセスしょうとした ときの動作の一例を説明する。 CPU 600が内部バス 606を介して アドレス信号 650を出力する。アドレス信号 650がバスコントロ一 ラ 604に供給され、供給されたァドレス信号は C S AR 702及び C EAR 703の値とそれそれ比較される。 CSAR^アドレス≤CEA Rであれば、 変換制御信号 7150が活性化され、且つァドレス演算器 714にて CPU600のアクセスァドレスは高速 RAM 601のァ ドレスに変換される。 これによつて、 CPU 600は高速 RAM 601 を高速アクセスすることによって、低速メモリ 602、 603又は 60 8のデータをアクセスできる。 このときの、 CPUアクセスアドレス一 C S AR+高速 RAM先頭ァドレス、というアドレス演算に無視し得な い時間がかかる場合には、高速 RAM601のアクセスアドレスを、高 速 RAM 601の先頭ァドレスの上位とァドレス信号 650の下位を 接続したものとすればよい。或いは C EAR 603を廃止し、 アドレス 信号 650の上位と CSAR 602の上位との一致比較を行うように してもよい。 An example of the operation when the CPU 600 tries to access an instruction or data in the internal ROM 602, the internal RAM 603, or the external memory 608 after the data transfer to the high-speed RAM 601 by the DMA controller 612 is performed. explain. CPU 600 outputs address signal 650 via internal bus 606. The address signal 650 is supplied to the bus controller 604, and the supplied address signal is compared with the values of C SAR 702 and C EAR 703, respectively. If CSAR ^ address≤CEAR, the conversion control signal 7150 is activated, and the address calculator 714 converts the access address of the CPU 600 into the address of the high-speed RAM 601. Thus, the CPU 600 can access data in the low-speed memory 602, 603, or 608 by accessing the high-speed RAM 601 at high speed. At this time, if it takes a considerable time to perform the address operation of CPU access address-one CS AR + high-speed RAM top address, the access address of high-speed RAM 601 is set to the upper address of high-speed RAM 601 and the address signal. The lower part of 650 may be connected. Alternatively, the C EAR 603 may be abolished, and the higher order of the address signal 650 and the upper order of the CSAR 602 may be compared.
尚、 ROM602、 RAM603の全て又は何れかが、 或いは、 各々 の一部分が、 アクセススピードが間に合えば、 1サイクルアクセスが可 能である構成も採れる。 この場合、 内部パス 606に接続されたデパイ スはもともと 1サイクルアクセスできるので上記 RAMキヤヅシュの 制御は行わずに通常通りに CPU 600がアクセスできる。 また、上記 実施例における高速 RAM 2 10へのアドレス置き換えによるデータ 転送の対象は、 内蔵 ROM, RAMのデータに限定されず、 外部メモリ
のデータだけを対象とし、或いは内蔵 ROM及び RAMと外部メモリと の双方のデ一夕を対象とすることができる。それらの場合にも上記実施 例と同様の制御によって実現できる。 In addition, if all or any of the ROM 602 and the RAM 603, or a part of each of the ROM 603 and the RAM 603, has a sufficient access speed, it is possible to perform a one-cycle access. In this case, since the depice connected to the internal path 606 can originally be accessed for one cycle, the CPU 600 can access it as usual without controlling the RAM cache. The data transfer by address replacement to the high-speed RAM 210 in the above embodiment is not limited to the data in the built-in ROM and RAM. Or the data of both the built-in ROM and RAM and the external memory. In those cases, it can be realized by the same control as in the above embodiment.
上記実施例のように、 CPU 600が内蔵 ROM/RAMのある指定 された範囲をアクセスしょうとしたときに、無条件に内蔵の高速 RAM 601をアクセス可能にする構成によれば、ユーザがプログラムの初期 設定時などにあらかじめ DMA Cコントローラー 6 12などにより高 速 RAM601に内蔵 ROM/RAM内の動作を高速化したいプログ ラムやデータを転送しておけば、処理の高速化を図ることができる。 C コンパイラやアセンブラなどで完成したプログラムのうち高速化すべ きところがわかっていれば、本機能にて簡単に性能向上できる。 この方 式だと、 キャッシュミスによるペナルティや、バックグランド処理中の 高速化ルーチンの転送がなくなる。 また、 実行時間が、 初回通過時とそ れ以降も全く同じになり、 タイミング設計がやりやすい特長をもつ。当 然、内蔵 ROMZR AMに収まりきれずにプログラムがアクセスタイム の遅い外部メモリにはみ出しても、この外部メモリを内蔵 ROM/RA Mと同様に制御すれば性能低下を防ぐことができる。 According to the configuration in which the CPU 600 unconditionally accesses the internal high-speed RAM 601 when the CPU 600 attempts to access a specified range of the internal ROM / RAM as in the above-described embodiment, the user can execute the program At the time of initial setting, etc., the processing speed can be increased by previously transferring programs and data whose operation in the built-in ROM / RAM is to be accelerated to the high-speed RAM 601 by the DMA C controller 612 or the like. If you know where to increase the speed of a program completed with a C compiler or assembler, you can easily improve the performance with this function. This eliminates the penalty for cache misses and the transfer of high-speed routines during background processing. In addition, the execution time is exactly the same after the first pass and thereafter, making it easy to perform timing design. Naturally, even if the program does not fit in the built-in ROMZRAM and runs into an external memory with a slow access time, controlling this external memory in the same way as the built-in ROM / RAM can prevent performance degradation.
以上本発明者によってなされた発明を実施例に基づいて具体的に説 明したが、 本発明はそれに限定されるものではなく、 その要旨を逸脱し ない範囲において種々変更可能であることは言うまでもない。 Although the invention made by the inventor has been specifically described based on the embodiments, the present invention is not limited thereto, and it is needless to say that various modifications can be made without departing from the gist of the invention. .
例えば、周辺回路 1 1を内部パス 6に直結せず、何らかの周辺機能専 用バスに接続して、その周辺機能専用バスと内部 6を別のイン夕フエ一 ス回路を介して接続することも可能である。キャッシュメモリ CACH Eと外部メモリ 13との間のデ一夕ライ ト時のコヒ一レンシについて はライ トバックやライ トスルー方式等によって保つことができる。また、 キャッシュメモリの初期化などのために全パリヅ ドビヅ トを一括して
クリアするパージ機構を別に設けておくことも可能である。更に、 キヤ ヅシュメモリ CACHEとしては、 命令専用、 データ専用、 命令データ 混合型の何れか、又はそれらを組み合わせの構成を採用することが可能 である。前記制御信号 BE CNOPについてはバスコントローラがその アクセスエリア判定機構を流用して生成してもよい。その場合には、キ ャッシュメモリからのキヤッシュヒヅ ト /ミスの通知をラツチするフ ラグ FLGをバスコントローラが備えて、前記制御信号 BE CNOPの アサ一ト /ネゲートの制御を行わなければならない。更にそのような制 御信号 B E CNOPの生成とアサ一トノネゲートの制御を専用回路で 行ってもよい。 また、 キヤヅシャブルエリァ /ノンキヤッシャブルエリ ァの判定は上記実施例のようにアクセスァドレスに基づいてキヤヅシ ュコントローラが行う構成に限定されない。例えば、バスコントローラ が行ったり、 或いは、 キャッシュコントローラに設けられたキヤッシュ ィネーブル Zデイスエーブルを制御する制御ビヅトを、バスコントロー ラが判定したアクセスエリァがノンキヤッシャブルエリァかキヤヅシ ャブルエリァかに応じて書換制御することで行ってもよい。 産業上の利用可能性 For example, the peripheral circuit 11 may not be directly connected to the internal path 6 but may be connected to a bus dedicated to some peripheral function, and the bus dedicated to the peripheral function may be connected to the internal 6 via another interface circuit. It is possible. Coherency at the time of a data write between the cache memory CACHE and the external memory 13 can be maintained by a write-back or write-through method. In addition, all parity bits are collected at once to initialize the cache memory. It is also possible to separately provide a purge mechanism for clearing. Further, as the cache memory CACHE, it is possible to adopt any one of instruction only, data only, and instruction data mixed type, or a combination thereof. The control signal BE CNOP may be generated by the bus controller using the access area determination mechanism. In this case, the bus controller must be provided with a flag FLG for latching the notification of a cache hit / miss from the cache memory, and control the assertion / negation of the control signal BE CNOP. Further, the generation of such a control signal BE CNOP and the control of the assertion negation may be performed by a dedicated circuit. Further, the determination of the cacheable area / non-cacheable area is not limited to the configuration performed by the cache controller based on the access address as in the above embodiment. For example, the control bit for controlling the cache enable Z disable provided by the bus controller or provided in the cache controller is rewritten according to whether the access area determined by the bus controller is a non-cacheable area or a cacheable area. It may be performed by controlling. Industrial applicability
以上のように、 本発明は、 中央処理装置と共に ROM, RAM, キヤ ッシュメモリ等のメモリを内蔵したマイクロコンビユー夕、そして外部 メモリ等と一緒にマイクロコンピュータを搭載した各種データ処理シ ステムに広く適用することができる。
As described above, the present invention is widely applied to various types of data processing systems including a central processing unit, a microcomputer incorporating a memory such as a ROM, a RAM, and a cache memory, and a microcomputer equipped with an external memory. can do.
Claims
1. 1個の半導体基板に形成されたマイクロコンピュー夕であって、 中 央処理装置と、該中央処理装置によってアクセスされる内蔵メモリと、 前記中央処理装置に内部パスで結合されたキヤッシュメモリと、前記中 央処理装置をマイクロコンビュー夕の外部ァドレス空間とィン夕フエ ースさせるインタフェース手段と、前記外部ァドレス空間を前記キヤッ シュメモリによるキヤッシュの対象とし、前記内蔵メモリをキヤッシュ の非対象に制御する制御手段と、を含んで成るものであることを特徴と するマイクロコンピュー夕。 1. A microcomputer formed on a single semiconductor substrate, comprising: a central processing unit; a built-in memory accessed by the central processing unit; and a cache memory coupled to the central processing unit by an internal path. Interface means for causing the central processing unit to interface with the external address space of the micro-computer; and setting the external address space as a target of cache by the cache memory, and setting the internal memory to a non-cache target. And control means for controlling the microcomputer.
2. 前記キャッシュメモリは 2のべき乗数のウェイ数を有し、 前記内 蔵メモリは、前記中央処理装置の動作プログラムを格納する R 0 Mを含 み、 当該 ROMのデータ記憶容量を Rキロバイ トとし、前述のキヤッシ ュメモリのデータ記憶容量を Cパイ トとしたとき、前述のキャッシュメ モリのウェイ数とキャッシュェントリのデ一夕ライン長に応じて定数 • a、 bを、 下記の通り、 2. The cache memory has a number of ways of a power of 2, the internal memory includes R0M for storing an operation program of the central processing unit, and the data storage capacity of the ROM is R kilobytes. When the data storage capacity of the cache memory is C bytes, the constants a and b are set as follows according to the number of ways in the cache memory and the length of the data line in the cache entry.
8 way以上/ 4パイ トライン長: a = 24. 01、 b = 8194 8 way以上/ 8バイ トライン長: a= 9. 00、 b = 3328 8 way以上/ /16バイ トライン長: a= 4. 00、 b= 1280 8 way以上 Z32バイ トライン長: a= 1. 75、 b= 512 8 wa y以上 64パイ トライン長以上: a = 0. 75、 b = 256 4 wa y/ 4パイ トライン長: a = 25. 19、 b = 8804 4 wa y/ 8パイ トライン長: a= 10. 00、 b = 3584 4wayZl 6パイ トライン長: a= 5. 00、 b = 1536 4 wa y/32パイ トライン長: a= 1. 84、 b = 557 4 wa yZ64バイ トライン長以上: a = 0. 79、 b = 276
2 wa y/ 4パイ トライン長: a=32. 41、 b = 1 1 1 12 2 wa y/ 8パイ トライン長: a= 1 1. 90、 b = 4328 2way/16バイ トライン長: a= 5. 50、 b = 1792 2way/32バイ トライン長: a= 2. 03, b= 651 2 wa yZ64パイ トライン長以上: a = 0. 87、 b = 316 1 wa y/ 4パイ トライン長: a= 36. 06、 b = 14361 1 wa y/ 8バイ トライン長: a= 18. 75、 b= 6591 1 wa y/ 16バイ トライン長: a = 8. 00、 b = 2816 1 wayZ32パイ トライン長: a= 4. 00、 b = 1280 1 way/64バイ トライン長以上: a= 1. 48、 b= 549 と定めたとき、 C + aRは bを越えない関係を満足して成るものである ことを特徴とする請求の範囲第 1項記載のマイクロコンピュー夕。8 way or more / 4 line length: a = 24.01, b = 8194 8 way or more / 8 byte line length: a = 9.00, b = 3328 8 way or more / 16 byte line length: a = 4 00, b = 1280 8 way or more Z32 byte line length: a = 1.75, b = 512 8 way or more 64 line length or more: a = 0.75, b = 256 4 way / 4 line length: a = 25.19, b = 8804 4 way / 8 line length: a = 10.00, b = 3584 4wayZl 6 line length: a = 5.00, b = 1536 4 way / 32 line length : A = 1.84, b = 557 4 wa y Z64 byte line length or more: a = 0.79, b = 276 2 way / 4 line length: a = 32.41, b = 1 1 1 12 2 way / 8 line length: a = 1.90, b = 4328 2way / 16 byte line length: a = 5 50, b = 1792 2 way / 32 byte line length: a = 2. 03, b = 651 2 way y More than 64 line length: a = 0.87, b = 316 1 way / 4 line length: a = 36.06, b = 14361 1 way / 8 byte line length: a = 18.75, b = 6551 1 way / 16 byte line length: a = 8.00, b = 2816 1 wayZ32 pipe line length: a = 4.00, b = 1280 1-way / 64-byte line length or more: When a = 1.48 and b = 549, C + aR must satisfy the relationship not exceeding b. The microcomputer according to claim 1, wherein:
3.前記インタフェース手段は、外部アドレス空間に対するアクセスサ ィクルの起動を、キャッシュメモリのキヤヅシュヒッ ト又はキヤヅシュ ミスの判定に要する一定期間ウェイ トし、 当該ウェイ ト動作を、キヤッ シュヒットの状態がキヤッシュミスの状態に変化された次のアクセス サイクルから抑止し、抑止したウェイ ト動作を、 キャッシュミスの状態 がキャッシュヒッ 卜の状態に変化された次のアクセスサイクルから再 開するものであり、当該キヤヅシュミスの状態がキヤヅシュヒヅ トの状 態に変化されたとき前記キヤッシュメモリはヒッ トに係るデータの入 出力動作を抑止し、前記ィン夕フェース手段は外部ァドレス空間に対す るアクセスサイクルの起動するものであることを特徴とする請求の範 囲第 1項記載のマイクロコンビユー夕。 3. The interface means waits for the activation of an access cycle to the external address space for a certain period of time required for determining cache cache or cache miss in the cache memory, and executes the wait operation when the cache hit state is cache miss. In this case, the wait operation is suppressed from the next access cycle in which the state has been changed, and the suppressed wait operation is restarted from the next access cycle in which the state of the cache miss has been changed to the state of the cache hit. When the state of the cache memory is changed to a cache hit state, the cache memory inhibits input / output operation of data related to the hit, and the interface means starts an access cycle to an external address space. The microcontroller according to claim 1 characterized by the following features: Biyu evening.
4.前記中央処理装置は RI S Cアーキテクチャを有し、前記中央処理 装置、 内蔵メモリ、 及びキャッシュメモリは内部バスを共有し、 中央処 理装置は当該内部パスをその動作基準クロック信号の 1クロックサイ
クルを最高アクセス速度としてアクセスするものであることを特徴と する請求の範囲第 1項記載のマイクロコンビユー夕。 4. The central processing unit has an RISC architecture, the central processing unit, the built-in memory, and the cache memory share an internal bus, and the central processing unit passes the internal path through one clock cycle of its operation reference clock signal. 2. The micro-combination device according to claim 1, wherein the vehicle is accessed at a maximum access speed.
5 .前記中央処理装置は: I S Cアーキテクチャを有し、前記中央処理 装置、 内蔵メモリ、 及びキャッシュメモリは内部パスを共有し、 中央処 理装置は当該内部パスをその動作基準クロック信号の 1クロックサイ クルを最高アクセス速度としてアクセスするものであることを特徴と する請求の範囲第 2項記載のマイクロコンピュータ。 5. The central processing unit has an ISC architecture, the central processing unit, the internal memory, and the cache memory share an internal path, and the central processing unit transmits the internal path to one clock cycle of its operation reference clock signal. 3. The microcomputer according to claim 2, wherein the microcomputer is accessed at a maximum access speed.
6 .前記中央処理装置は R I S Cアーキテクチャを有し、前記中央処理 装置、 内蔵メモリ、 及びキャッシュメモリは内部パスを共有し、 中央処 理装置は当該内部バスをその動作基準クロック信号の 1クロックサイ クルを最高アクセス速度としてアクセスするものであることを特徴と する請求の範囲第 3項記載のマイクロコンビユー夕。 6. The central processing unit has a RISC architecture, the central processing unit, internal memory, and cache memory share an internal path, and the central processing unit uses the internal bus for one clock cycle of its operation reference clock signal. 4. The micro-combination device according to claim 3, wherein the access speed is set as a maximum access speed.
7 .前記キャッシュメモリは、 中央処理装置によるアクセスの開始から 該中央処理装置の動作基準クロック信号の 1クロックサイクルの期間 を以てキャッシュヒッ トに係るデータを前記内部バスに出力するもの であることを特徴とする請求の範囲第 4項記載のマイクロコンビユー 夕。 7.The cache memory outputs data related to a cache hit to the internal bus in a period of one clock cycle of an operation reference clock signal of the central processing unit from the start of access by the central processing unit. The micro combination according to claim 4, wherein:
8 .前記キャッシュメモリは、 中央処理装置によるアクセスの開始から 該中央処理装置の動作基準クロック信号の 1クロックサイクルの期間 を以てキャッシュヒッ トに係るデータを前記内部バスに出力するもの であることを特徴とする請求の範囲第 5項記載のマイクロコンピュー 夕。 8.The cache memory outputs data related to a cache hit to the internal bus in a period of one clock cycle of an operation reference clock signal of the central processing unit from the start of access by the central processing unit. 6. The microcomputer according to claim 5, wherein:
9 .前記キャッシュメモリは、 中央処理装置によるアクセスの開始から 該中央処理装置の動作基準クロック信号の 1クロックサイクルの期間 を以てキャッシュヒッ トに係るデータを前記内部パスに出力するもの であることを特徴とする請求の範囲第 6項記載のマイクロコンビユー
夕。 9. The cache memory outputs data related to a cache hit to the internal path in a period of one clock cycle of an operation reference clock signal of the central processing unit from the start of access by the central processing unit. The microcombination according to claim 6, wherein evening.
1 0 . 1個の半導体基板に形成されたマイクロコンビユー夕であって、 中央処理装置と、該中央処理装置によってアクセスされる内蔵メモリと、 当該内蔵メモリよりもアクセス動作の速い高速 R A Mと、前記中央処理 装置が特定のアクセスを行なったことをトリガとし、中央処理装置から バス権を獲得して前記内蔵メモリの特定ァドレスから別の特定ァドレ スまでの内容を前記高速 R A Mに転送し、転送後における中央処理装置 のアクセスが前記転送元ァドレスであるとき当該アクセス対象を高速 R A Mに切換え制御する転送制御手段と、を含んで成るものであること を特徴とするマイクロコンビユー夕。 10. A micro-computer formed on one semiconductor substrate, comprising: a central processing unit; a built-in memory accessed by the central processing unit; a high-speed RAM having a faster access operation than the built-in memory; Triggered by the central processing unit making a specific access, the bus right is acquired from the central processing unit, and the contents from a specific address of the internal memory to another specific address are transferred to the high-speed RAM, and transferred. Transfer control means for switching and controlling the access target to a high-speed RAM when the access of the central processing unit later is the transfer source address.
1 1 . 1個の半導体基板に形成されたマイクロコンビュ一夕であって、 中央処理装置と、該中央処理装置によってアクセスされる高速 R A Mと、 前記中央処理装置をマイクロコンピュータの外部ァドレス空間とイン 夕フェースさせるイン夕フェース手段と、前記中央処理装置が特定のァ クセスを行なったことをトリガとし、中央処理装置からバス権を獲得し て前記外部ァドレス空間の特定ァドレスから別の特定アドレスまでの 内容を前記高速 R A Mに転送し、転送後における中央処理装置のァクセ スが前記転送元ァドレスであるとき当該アクセス対象を高速 R A Mに 切換え制御する転送制御手段と、を含んで成るものであることを特徴と するマイクロコンピュー夕。 11. A microcomputer formed on one semiconductor substrate, comprising: a central processing unit; a high-speed RAM accessed by the central processing unit; An interface means for causing the CPU to execute a specific access, and having the central processing unit perform a specific access as a trigger, acquire a bus right from the central processing unit, and obtain a bus address from the specific address in the external address space to another specific address. Transfer control means for transferring the contents to the high-speed RAM, and switching the access target to the high-speed RAM when the access of the central processing unit after the transfer is the transfer source address. Microcomputer featured as a feature.
1 2 . 1個の半導体基板に形成されたマイクロコンビュ一夕であって、 中央処理装置と、該中央処理装置によってアクセスされる内蔵メモリと、 前記中央処理装置によってアクセスされる高速 R A Mと、前記中央処理 装置が前記内蔵メモリをアクセスしたことをトリガとし、中央処理装置 によるその内蔵メモリのアクセスに並行して当該アクセスデータを高 速 R AMに転送する制御を所定のァドレス範囲に対して行い、所定のァ
ドレス範囲のァドレスに対する前記データ転送完了後における中央処 理装置のアクセスが前記転送元データのァドレスであるとき当該ァク セス対象を高速 R A Mに切換え制御する転送制御手段と、を含んで成る ものであることを特徴とするマイクロコンピュー夕。 12. A microcomputer formed on one semiconductor substrate, comprising: a central processing unit; a built-in memory accessed by the central processing unit; a high-speed RAM accessed by the central processing unit; Triggered by the central processing unit accessing the internal memory as a trigger, control is performed for transferring the access data to the high-speed RAM in parallel with the access of the internal memory by the central processing unit to a predetermined address range, Predetermined key Transfer control means for switching the access target to a high-speed RAM when an access of the central processing unit after completion of the data transfer to an address in the address range is the address of the transfer source data. A microcomputer that is characterized by the fact that
1 3 . 1個の半導体基板に形成さ、れたマイクロコンビュ一夕であって、 中央処理装置と、該中央処理装置によってアクセスされる高速 R A Mと、 前記中央処理装置をマイクロコンビュー夕の外部ァドレス空間とイン 夕フェースさせるインタフエース手段と、前記中央処理装置が前記外部 アドレス空間をアクセスしたことをトリガとし、中央処理装置によるそ の外部ァドレス空間のアクセスに並行して当該アクセスデータを高速 R A Mに転送する制御を所定のァドレス範囲に対して行い、所定のァド レス範囲のァドレスに対する前記データ転送完了後における中央処理 装置のアクセスが前記転送元データのァドレスであるとき当該ァクセ ス対象を高速 R A Mに切換え制御する転送制御手段と、を含んで成るも のであることを特徴とするマイクロコンビユー夕。 13. A microcomputer formed on one semiconductor substrate, comprising: a central processing unit; a high-speed RAM accessed by the central processing unit; An interface means for interfacing with the address space; and a central processing unit accessing the external address space as a trigger. When the central processing unit accesses the external address space, the access data is transferred to the high-speed RAM in parallel. When the access of the central processing unit after the completion of the data transfer to the address in the predetermined address range is the address of the transfer source data, the access target is controlled at high speed. Transfer control means for switching control to a RAM. Evening evening.
1 4 . 1個の半導体基板に形成されたマイクロコンビュ一夕であって、 中央処理装置と、該中央処理装置によってアクセスされる内蔵メモリと、 当該内蔵メモリよりもアクセス動作の速い高速 R A Mと、前記中央処理 装置をマイクロコンビュー夕の外部ァドレス空間とインタフェースさ せるイン夕フェース手段と、前記中央処理装置が内蔵メモリ又は前記外 部アドレス空間をアクセスしたことをトリガとし、中央処理装置による その内蔵メモリアクセス又は外部ァドレス空間のアクセスに並行して 当該アクセスデータを高速 R A Mに転送する制御を所定のァドレス範 囲に対して行い、所定のァドレス範囲のァドレスに対する前記データ転 送完了後における中央処理装置のアクセスが前記転送元データのァド レスであるとき当該アクセス対象を高速 R A Mに切換え制御する転送
制御手段と、を含んで成るものであることを特徴とするマイクロコンビ ユー夕。 14. A microcomputer formed on one semiconductor substrate, comprising: a central processing unit; a built-in memory accessed by the central processing unit; a high-speed RAM having an access operation faster than the built-in memory; Interface means for interfacing the central processing unit with the external address space of the micro computer; and triggering when the central processing unit accesses the built-in memory or the external address space, and the central processing unit The central processing unit controls the transfer of the access data to the high-speed RAM in a predetermined address range in parallel with the memory access or the access to the external address space, and after the completion of the data transfer for the addresses in the predetermined address range. When the access to the target is the address of the transfer source data, the access target is Transfer controlled by switching to RAM A microcombination device comprising: a control means.
15.1個の半導体基板に形成されたマイクロコンビユー夕であって、 中央処理装置と、該中央処理装置によってアクセスされる内蔵メモリと、 当該内蔵メモリよりもアクセス動作の速い高速 RAMと、前記内蔵メモ リから前記高速 RAMへのデータ転送を行うデータ転送制御手段と、前 記高速 RAMに転送されたデータの転送元ァドレスに対する中央処理 装置のアクセスを前記高速 RAMへのアクセスに切換え制御するァク セス切換え制御手段と、を含んで成るものであることを特徴とするマイ クロコンビュー夕。 15. A micro-computer formed on one semiconductor substrate, comprising: a central processing unit; a built-in memory accessed by the central processing unit; a high-speed RAM having a faster access operation than the built-in memory; Data transfer control means for transferring data from the memory to the high-speed RAM, and access for controlling switching of access of the central processing unit to access to the high-speed RAM with respect to the source address of the data transferred to the high-speed RAM. And a switching control means.
16.1個の半導体基板に形成されたマイクロコンビユー夕であって、 中央処理装置と、該中央処理装置によってアクセスされる高速 RAMと、 前記中央処理装置をマイクロコンビユー夕の外部ァドレス空間とイン 夕フェースさせるィン夕フェース手段と、前記ィン夕フェース手段に接 続される外部メモリから前記高速 RAMへのデータ転送を行うデータ 転送制御手段と、前記高速 RAMに転送されたデータの転送元ァドレス に対する中央処理装置のアクセスを前記高速 RAMへのアクセスに切 換え制御するアクセス切換え制御手段と、を含んで成るものであること を特徴とするマイクロコンピュータ。 16. A micro-computer formed on one semiconductor substrate, comprising: a central processing unit; a high-speed RAM accessed by the central processing unit; and an external address space of the micro-computer and an internal address. Interface means for performing interface, data transfer control means for performing data transfer from an external memory connected to the interface means to the high-speed RAM, and a transfer source address of the data transferred to the high-speed RAM. And an access switching control means for controlling access of the central processing unit to access to the high-speed RAM.
17.1個の半導体基板に形成されたマイクロコンビュ一夕であって、 中央処理装置と、該中央処理装置によってアクセスされる内蔵メモリと、 当該内蔵メモリよりもアクセス動作の速い高速 RAMと、前記中央処理 装置をマイクロコンビユー夕の外部ァドレス空間とイン夕フェースさ せるインタフェース手段と、前記ィン夕フヱース手段に接続される外部 メモリ又は前記内蔵メモリから前記高速 RAMへのデータ転送を行う デ一夕転送制御手段と、前記高速 RAMに転送されたデ一夕の転送元ァ
ドレスに対する中央処理装置のアクセスを前記高速 R A Mへのァクセ スに切換え制御するアクセス切換え制御手段と、を含んで成るものであ ることを特徴とするマイクロコンビユー夕。
17. A microcomputer formed on one semiconductor substrate, comprising: a central processing unit; a built-in memory accessed by the central processing unit; a high-speed RAM having a faster access operation than the built-in memory; Interface means for interfacing the device with the external address space of the micro-computer; and data transfer for transferring data from the external memory or the internal memory connected to the interface means to the high-speed RAM. Control means, and a transfer source key for the data transferred to the high-speed RAM. An access switching control means for switching and controlling access of the central processing unit to the dress to access to the high-speed RAM.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP53470696A JP3735373B2 (en) | 1995-05-19 | 1996-05-17 | Microcomputer |
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP7/145552 | 1995-05-19 | ||
JP14555295 | 1995-05-19 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO1996036919A1 true WO1996036919A1 (en) | 1996-11-21 |
Family
ID=15387817
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/JP1996/001308 WO1996036919A1 (en) | 1995-05-19 | 1996-05-17 | A microcomputer |
Country Status (2)
Country | Link |
---|---|
JP (1) | JP3735373B2 (en) |
WO (1) | WO1996036919A1 (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7136965B2 (en) | 2000-08-07 | 2006-11-14 | Nec Corporation | Microcomputer |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPS61136145A (en) * | 1984-12-07 | 1986-06-24 | Hitachi Ltd | Cash memory control circuit |
JPS6227825A (en) * | 1985-07-29 | 1987-02-05 | Fujitsu Ten Ltd | General-purpose high-speed processor |
JPH0195343A (en) * | 1987-10-07 | 1989-04-13 | Matsushita Electric Ind Co Ltd | Storage device |
JPH02187881A (en) * | 1989-01-13 | 1990-07-24 | Mitsubishi Electric Corp | Semiconductor integrated circuit |
JPH0528040A (en) * | 1991-07-18 | 1993-02-05 | Oki Electric Ind Co Ltd | Quick memory access system |
JPH0535467A (en) * | 1991-07-31 | 1993-02-12 | Nec Corp | Microprocessor |
JPH05210974A (en) * | 1991-10-03 | 1993-08-20 | Smc Standard Microsyst Corp | Coupling system of static cash memory and dynamic main memory on same chip |
-
1996
- 1996-05-17 JP JP53470696A patent/JP3735373B2/en not_active Expired - Fee Related
- 1996-05-17 WO PCT/JP1996/001308 patent/WO1996036919A1/en active Application Filing
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPS61136145A (en) * | 1984-12-07 | 1986-06-24 | Hitachi Ltd | Cash memory control circuit |
JPS6227825A (en) * | 1985-07-29 | 1987-02-05 | Fujitsu Ten Ltd | General-purpose high-speed processor |
JPH0195343A (en) * | 1987-10-07 | 1989-04-13 | Matsushita Electric Ind Co Ltd | Storage device |
JPH02187881A (en) * | 1989-01-13 | 1990-07-24 | Mitsubishi Electric Corp | Semiconductor integrated circuit |
JPH0528040A (en) * | 1991-07-18 | 1993-02-05 | Oki Electric Ind Co Ltd | Quick memory access system |
JPH0535467A (en) * | 1991-07-31 | 1993-02-12 | Nec Corp | Microprocessor |
JPH05210974A (en) * | 1991-10-03 | 1993-08-20 | Smc Standard Microsyst Corp | Coupling system of static cash memory and dynamic main memory on same chip |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7136965B2 (en) | 2000-08-07 | 2006-11-14 | Nec Corporation | Microcomputer |
Also Published As
Publication number | Publication date |
---|---|
JP3735373B2 (en) | 2006-01-18 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20230418759A1 (en) | Slot/sub-slot prefetch architecture for multiple memory requestors | |
US8725987B2 (en) | Cache memory system including selectively accessible pre-fetch memory for pre-fetch of variable size data | |
US12332790B2 (en) | Multi-level cache security | |
US5745732A (en) | Computer system including system controller with a write buffer and plural read buffers for decoupled busses | |
US5157774A (en) | System for fast selection of non-cacheable address ranges using programmed array logic | |
KR100262906B1 (en) | Data line drawing method and system | |
US20240264955A1 (en) | Multiple-requestor memory access pipeline and arbiter | |
US6321321B1 (en) | Set-associative cache-management method with parallel and single-set sequential reads | |
US7877537B2 (en) | Configurable cache for a microprocessor | |
JP2000242558A (en) | Cache system and operating method thereof | |
JPH07129471A (en) | Computer system containing main memory and pre-fetch cache and operation method thereof | |
JPH0628256A (en) | Data processing system | |
JPH0962572A (en) | Device and method for stream filter | |
JP2013529816A (en) | Method and system for reducing power consumption of a memory device | |
EP2095243A2 (en) | Configurable cache for a microprocessor | |
KR101462220B1 (en) | Configurable cache for a microprocessor | |
US5717894A (en) | Method and apparatus for reducing write cycle wait states in a non-zero wait state cache system | |
EP0309995B1 (en) | System for fast selection of non-cacheable address ranges using programmed array logic | |
US6484237B1 (en) | Unified multilevel memory system architecture which supports both cache and addressable SRAM | |
JP3515333B2 (en) | Information processing equipment | |
WO1996036919A1 (en) | A microcomputer | |
JPH11184752A (en) | Data processing device and data processing system | |
WO2004031963A1 (en) | Semiconductor data processor | |
JP3378270B2 (en) | Multiprocessor system | |
JPS5927994B2 (en) | computer system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
AK | Designated states |
Kind code of ref document: A1 Designated state(s): CN JP KR SG US |
|
AL | Designated countries for regional patents |
Kind code of ref document: A1 Designated state(s): AT BE CH 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 | ||
122 | Ep: pct application non-entry in european phase |