WO2013128624A1 - マイクロコンピュータおよび不揮発性半導体装置 - Google Patents
マイクロコンピュータおよび不揮発性半導体装置 Download PDFInfo
- Publication number
- WO2013128624A1 WO2013128624A1 PCT/JP2012/055341 JP2012055341W WO2013128624A1 WO 2013128624 A1 WO2013128624 A1 WO 2013128624A1 JP 2012055341 W JP2012055341 W JP 2012055341W WO 2013128624 A1 WO2013128624 A1 WO 2013128624A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- address
- code
- signal
- register
- output
- Prior art date
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F12/00—Accessing, addressing or allocating within memory systems or architectures
- G06F12/02—Addressing or allocation; Relocation
- G06F12/0223—User address space allocation, e.g. contiguous or non contiguous base addressing
- G06F12/023—Free address space management
- G06F12/0238—Memory management in non-volatile memory, e.g. resistive RAM or ferroelectric memory
- G06F12/0246—Memory management in non-volatile memory, e.g. resistive RAM or ferroelectric memory in block erasable memory, e.g. flash memory
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/30—Arrangements for executing machine instructions, e.g. instruction decode
- G06F9/30003—Arrangements for executing specific machine instructions
- G06F9/3005—Arrangements for executing specific machine instructions to perform operations for flow control
- G06F9/30065—Loop control instructions; iterative instructions, e.g. LOOP, REPEAT
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/30—Arrangements for executing machine instructions, e.g. instruction decode
- G06F9/32—Address formation of the next instruction, e.g. by incrementing the instruction counter
- G06F9/322—Address formation of the next instruction, e.g. by incrementing the instruction counter for non-sequential address
- G06F9/324—Address formation of the next instruction, e.g. by incrementing the instruction counter for non-sequential address using program counter relative addressing
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2212/00—Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
- G06F2212/72—Details relating to flash memory management
- G06F2212/7208—Multiple device management, e.g. distributing data over multiple flash devices
Definitions
- the device of Patent Document 1 Japanese Patent Laid-Open No. 10-27704 includes a modified address register and a comparison circuit.
- the ROM fetch address and the value of the modified address register are compared by the comparison circuit, and the result is sent to the instruction decoder.
- the instruction decoder detects a match in the comparison circuit, the microinstruction is executed to start from a predetermined address on the RAM.
- the configuration is such that the start address of the correction program is acquired and execution of the program is branched to the start address of the correction program in the same RAM.
- the device disclosed in Japanese Patent Application Laid-Open No. 8-95946 discloses an instruction queue, a fetch pointer, a register for storing the address of a bug portion of the built-in ROM, and a memory based on an output result of a comparison circuit that compares the contents of the register and the fetch pointer.
- a selection circuit for outputting the above program or a specific branch instruction is provided. When the content of the fetch pointer matches the content of the register, the branch instruction is transferred from the selection circuit to the instruction queue, and the CPU shifts to the correction program by executing the branch instruction, and the execution of the bug portion is avoided.
- Patent Document 1 and Patent Document 2 can insert and change codes, there is a problem that a large amount of hardware is required. In addition, the performance of the apparatus deteriorates due to the overhead time associated with the branch jump.
- a microcomputer includes a program counter that updates an address by adding a first value or a second value, and stops updating the address when a multi-cycle instruction is executed, and a program counter A selection circuit that selects either the insertion code corresponding to the address specified by the program counter in the register or the original code of the address specified by the program counter in the ROM according to the address of the register, and selection by the selection circuit An instruction execution unit for executing the generated code.
- microcomputer and the nonvolatile semiconductor device of one embodiment of the present invention it is possible to insert a code and execute a multi-cycle instruction.
- (A) is a figure showing the example of the code (original code) currently recorded on ROM, and the code inserted.
- (B) is a figure showing the code after a change of the microcomputer A provided with the code change function.
- (C) is a figure showing the code after change of ROM of the microcomputer B provided with the code insertion function.
- (A) is a figure showing the example of the code (original code) currently recorded on ROM, and the code to change.
- (B) is a figure showing the code after a change of the microcomputer A provided with the code change function.
- (C) is a figure showing the code after the change of the microcomputer B provided with the code insertion function.
- (A) is a diagram showing instruction fetch and execution timing in a single cycle system.
- (A) is a diagram showing an example of values held in the address register 31 of the code insertion register set 29-i.
- (B) is a diagram showing an original code and an insertion code.
- (C) is a timing chart under the conditions shown in (a) and (b).
- (A) is a diagram showing an example of values held in the address register 31 of the code insertion register set 29-i.
- (B) is a diagram showing an original code and an insertion code.
- (C) is a timing chart under the conditions shown in (a) and (b). It is a figure showing the structure of the flash memory control part 102 of 2nd Embodiment. It is a figure showing the structure of the program counter 51.
- FIG. 22 is a diagram illustrating a configuration of a code insertion register set 40-0 included in an insertion code register set block 396. It is a figure showing the structure of the flash memory control part 423 of 6th Embodiment.
- FIG. 6 is a diagram illustrating a configuration of a program counter 72.
- FIG. 10 is a diagram showing a configuration of an insertion code register set block 743.
- FIG. 22 is a diagram illustrating a configuration of a code insertion register set 88-0 included in an insertion code register set block 743.
- (A) is a diagram showing an example of values held in the address register 31 of the code insertion register set 88-i.
- (B) is a timing chart under the conditions of (a). It is a figure showing the structure of the flash memory control part 388 of 9th Embodiment.
- FIG. 11 is a diagram illustrating a configuration of an insertion code register set block 389.
- FIG. 25 is a diagram illustrating a configuration of a code insertion register set 86-0 included in an insertion code register set block 389.
- A) is a diagram showing an example of values held in the address register 31 of the code insertion register set 86-i.
- (B) is a timing chart under the conditions of (a).
- FIG. 1A shows an example of a code (original code) recorded in the ROM and a code to be inserted.
- the original code is the instructions 0 to 10, 11, and 12, and the code inserted after the instruction 3 is the instruction 3 ′.
- FIG. 1B is a diagram showing the code after the change of the microcomputer A having the code change function.
- the instruction 3 ′ is stored at the address “0x0108”. Since the NOP area before the change is the address “0x0116”, the storage positions of the instruction 4 to the instruction 10 are moved to the addresses “0x010A” to “0x0116”. Therefore, the necessary change code amount is “8”. That is, since it is necessary to change from the area to be inserted to the NOP area, a huge amount of change is required depending on the position of the NOP area. It is necessary to provide only a register set for the change, and the hardware becomes large-scale. As a countermeasure against this, it is conceivable to provide a large NOP area. However, since the redundant processing time increases, the processing performance of the CPU deteriorates.
- FIG. 1 (c) is a diagram showing the code after the ROM of the microcomputer B having the code insertion function is changed.
- the instruction 3 ' is stored at the address "0x0106". Therefore, the necessary change code amount is “1”.
- FIG. 2A shows an example of a code (original code) recorded in the ROM and a code to be changed.
- the original codes are the instructions 0 to 10, 11, and 12, indicating that the instruction 3 is changed to the instruction 3 '.
- FIG. 2 (b) is a diagram showing the code after the change of the microcomputer A having the code change function.
- the instruction 3 stored in the address “0x0106” is changed to the instruction 3 ′. Therefore, the necessary change code amount is “1”.
- FIG. 2 (c) is a diagram showing the code after the change of the microcomputer B having the code insertion function.
- the instruction 3 ′ and the jump instruction “JUMP0108” are stored at the address “0x0104”. Therefore, the necessary change code amount is “2”.
- a cycle is a cycle of a so-called constant frequency reference clock signal that serves as a reference for operation timing.
- the program counter is updated in conjunction with this cycle.
- FIG. 3A is a diagram showing instruction fetch and execution timing in the single cycle method.
- FIG. 3B is a diagram showing instruction fetch and execution timing in the multi-cycle method.
- the single cycle method has the disadvantages that the time of one cycle is limited by the longest path (longest instruction execution time), the time of one cycle becomes long, and the required amount of hardware increases. Therefore, it can be said that it is desirable to adopt a multi-cycle method.
- the code insertion function needs to correspond to the multi-cycle method.
- the PC update stop signal is for one cycle as described in paragraph [0049], and is not compatible with the multi-cycle method.
- FIG. 4 is a timing diagram in the case of inserting a single cycle instruction in Patent Document 3 when a part of the code (original code) recorded in the ROM is a multi-cycle instruction.
- R0106 which is a part of the original code is a multi-cycle instruction (3-cycle instruction).
- “0x...” Represents a hexadecimal display.
- a PC stall signal which is a signal for stopping the update of the program counter for a period of (multi-cycle number-1), is output from the instruction execution unit.
- the PC stall signal is a signal output when a multi-cycle instruction is executed by a general processor. Then, a simple logic is generated from the PC stall signal and the address coincidence signal, and it is considered to realize a code insertion function in multicycle instruction execution.
- FIG. 5A is a timing chart in the case where a normal operation is performed even if a single cycle instruction is inserted when a part of the code (original code) recorded in the ROM is a multi-cycle instruction.
- the timing diagram of the IF execution code, address, IF stage execution code, and EX stage execution code is an expected value necessary for realizing the code insertion.
- the timing chart of the PC stall signal shows the operation in a general multi-cycle microcomputer, and the timing chart of the address match signal shows the operation when a simple comparator is used.
- the address match signal and the PC stall signal are both at the “H” level in the previous cycle, the address match signal is at the “H” level in the current cycle, and the PC stall signal is “ In such a case, it is necessary to provide a logic circuit so that the newly provided PC update stop signal becomes “H” level.
- FIG. 5B is a timing chart when the code (original code) recorded in the ROM is a single cycle instruction and operates normally even if a multi-cycle instruction is inserted.
- the address match signal and the PC stall signal are both at the “L” level in the previous cycle, the address match signal is at the “H” level, and the PC stall signal is “ In such a case, it is necessary to provide a logic circuit in which the PC update stop signal becomes “H” level.
- the address match signal and the PC The level of the stall signal is the same.
- the code to be fetched is the CodeReg side that holds the insertion code in FIG. 5A, and the ROM side that holds the original code in FIG. 5B, and they do not match.
- FIG. 6 is a diagram showing the configuration of the microcomputer according to the present embodiment.
- the microcomputer shown in the figure is not particularly limited, but is formed on a semiconductor substrate (chip) by a known semiconductor integrated circuit manufacturing technique.
- CPU 4 controls the entire processing of the microcomputer 1.
- the CPU 4 can access the flash memory 3.
- the RAM 5 stores various data and is used as a work area for the CPU 4.
- the peripheral device 6 exchanges data with the outside via the I / O port 11.
- the AD converter 7 converts an analog signal input from the analog input terminal 9 into a digital signal.
- the DA converter 8 converts the digital signal into an analog signal and outputs the analog signal to the analog output terminal 10.
- the flash memory 3 is a non-volatile memory, and can be electrically erased and written on the semiconductor substrate.
- the flash memory 3 stores an operation program of the CPU 4 or various data, although not particularly limited.
- the flash memory control unit 2 controls the flash memory 3 in a predetermined sequence according to the access from the CPU 3.
- the flash memory control unit 2 stores a program for controlling operations such as erasing, writing, and reading of the flash memory 3, and also executes the program.
- This program includes, for example, an instruction for monitoring an error in rewriting operation of the flash memory.
- the flash memory control unit 2 checks the register indicating the error, and if there is an error, transmits the error to the CPU 4.
- the instruction for monitoring such an error is arranged for every fixed address in the program so that it is read at a fixed time interval. Execution of this instruction causes other processing performance to deteriorate. Therefore, it is necessary to arrange this program at an appropriate interval. On the other hand, there is a case where safety is emphasized and the error monitoring time interval is shortened even at the expense of some degradation in processing performance.
- the flash memory control unit 2 has a function of inserting a new code into a program made up of an original code that is an instruction incorporated in advance, so that the hardware of the microcomputer is not changed. It becomes possible to respond to the request.
- FIG. 7 is a diagram illustrating a configuration of the flash memory control unit 2 according to the first embodiment.
- the flash memory control unit 2 includes a program counter 12, a flash control code ROM 13, an insertion code register set block 17, a register selection signal generation circuit 18, a code selection circuit 14, an instruction An execution unit 15 and an interface controller 16 are provided.
- the flash control code ROM 13 stores a plurality of original codes which are pre-installed instructions.
- the flash control code ROM 13 outputs the original code stored at the address output from the program counter 12.
- the second and higher bits from the least significant bit of the output of the program counter are valid.
- the flash control code ROM 13 according to the present embodiment is functionally equivalent to a mask ROM, but is not in a so-called large-capacity memory write-in-prohibited state, but is assumed to be fixedly incorporated in advance by a logic circuit or the like. is doing.
- the insertion code register set block 17 has at least one insertion code and a register set that holds the address of the insertion code.
- the insertion code register set block 17 sends the first signal to the program counter when the bit excluding the least significant bit of the address of the insertion code held matches the bit excluding the least significant bit of the address of the program counter 12. 12 and output (that is, the address match signal is set to the “H” level).
- the insertion code register set block 17 outputs the first signal and outputs the second signal to the code selection circuit 14 when the least significant bit of the address of the program counter 12 is “1” (that is, the address The complete match signal is set to the “H” level), and the held insertion code is output as a code register output signal.
- the program counter 12 updates the address that is the counter value by adding the first value or the second value. That is, the program counter 12 updates the counter value based on the address match signal and the PC control signal, and outputs an address that is the counter value to the internal address bus 23.
- the program counter 12 stops updating the address when the multi-cycle instruction is executed. More specifically, when receiving the first signal, the program counter 12 adds “1” to the least significant bit, and when not receiving the first signal, the program counter 12 is the second least significant bit. "1" is added to.
- the register selection signal generation circuit 18 supplies code register selection signals 0 to n and address register selection signals 0 to n, which will be described later, to the insertion code register set block 17.
- the code register selection signals 0 to n and the address register selection signals 0 to n are activated as selection signals when the code to be inserted and the address to insert the code are set in the insertion code register set block 17.
- the code selection circuit 14 inserts the original code output from the flash control code ROM 13 and the insertion code output from the insertion code register set block 17 on the basis of the address complete match signal that changes according to the address output from the program counter 12.
- One of the codes is output to the instruction execution unit 15 as an execution code. More specifically, the code selection circuit 14 selects the insertion code when receiving the second signal, and selects the original code when not receiving the second signal.
- the instruction execution unit 15 fetches the execution code output from the code selection circuit 14 and executes the fetched execution code.
- At least one of a plurality of original codes and insertion codes is a multi-cycle instruction. That is, in the control of the flash memory 3, processing with a multi-cycle instruction is required.
- the interface controller 16 is connected to the main data bus 273, receives an interrupt from the outside of the flash memory control unit, and outputs an interrupt signal to the instruction execution unit 15.
- the instruction execution unit 15 and the interface controller 16 are connected to the flash memory 3 via the internal data bus 21.
- FIG. 8 is a diagram for explaining the functions of the instruction execution unit 15 and the program counter 12.
- the instruction execution unit 15 includes a fetch unit 35 and an execution unit 36.
- the fetch unit 35 fetches the execution code output from the code selection circuit 14 and outputs it to the execution unit 35.
- the execution unit 36 executes the fetched execution code.
- the execution unit 36 outputs to the program counter 12 a calculation result PC indicating an immediate value, a calculation result PC selection signal for instructing selection of an immediate value, and a PC control signal such as a PC stall signal.
- the PC stall signal is set to the “H” level when the multi-cycle instruction is executed.
- FIG. 9 is a diagram showing the configuration of the program counter 12. As shown in FIG. 9, the program counter 12 includes a selector 24, an adder 25, a selector 26, a selector 27, and a PC register 28.
- the selector 24 outputs “0x01” when the address match signal output from the insertion code register set block 17 is “H” level, and outputs “0x02” when the address match signal is “L” level.
- the selector 26 receives the output of the adder 25 and the calculation result PC (that is, the immediate value) output from the instruction execution unit 15.
- the selector 26 outputs the operation result PC when the operation result PC selection signal output from the instruction execution unit 15 is “H” level, and outputs the output of the adder 25 when the operation result PC selection signal is “L” level. Output.
- the selector 27 receives the output of the selector 26 and the address output from the PC register 28.
- the selector 27 outputs the address output from the PC register 28 when the PC stall signal output from the instruction execution unit 15 is “H” level, and outputs the output of the selector 26 when the PC stall signal is “L” level. Output.
- the PC register 28 latches the output of the selector 27 and outputs it to the internal address bus 23 as the address of the flash control code ROM 13.
- the logic circuit OR2 outputs a logical sum of (n + 1) code register output signals 0 to n as a code register output signal. That is, when at least one of the (n + 1) code register output signals 0 to n has an “H” level bit (that is, when an insertion code is output), the code register output signal becomes an insertion code. That is, when all the bits of (n + 1) code register output signals 0 to n are at “L” level (that is, when no insertion code is output), all the bits of the code register output signal are “L”. Become.
- the logic circuit OR3 outputs a logical sum of (n + 1) address complete match signals 0 to n as an address complete match signal. That is, when at least one of (n + 1) address complete match signals 0 to n is at “H” level, the address complete match signal is at “H” level.
- FIG. 11 is a diagram showing the configuration of the code insertion register set 29-0.
- the configuration of the code insertion register sets 29-1 to 29-n is the same as that of the code insertion register set 29-0 in FIG.
- the logic circuit AND1 outputs an “H” level signal to the control terminal of the address register 31 when the clock clk and the address register selection signal 0 are both “H” level.
- the logic circuit AND2 has a complete address when the address match signal 0 is “H” level and the least significant bit (address [0]) of the 16-bit address output from the program counter 12 is “1”.
- Match signal 0 is set to "H" level.
- the least significant bit that is not valid as the address of the plurality of original codes in the flash control code ROM 13 is “1”, it means that an address that is not in the flash control code ROM 13 is designated. Become.
- the logic circuit AND4 outputs an “H” level signal to the control terminal of the code register 32 when the clock clk and the code register selection signal 0 are both at the “H” level.
- FIG. 12 is a diagram showing the configuration of the code selection circuit 14. As shown in FIG. 12, the code selection circuit 14 includes a selector 33.
- the code selection circuit 14 outputs the original code “R0102” to the fetch unit 35 of the instruction execution unit 15 because the address complete match signal is at the “L” level.
- the execution unit 36 of the instruction execution unit 15 executes the original code “R0100” output to the fetch unit 35 in the previous cycle.
- the code selection circuit 14 outputs the original code “R0104” to the fetch unit 35 of the instruction execution unit 15 because the address complete match signal is at the “L” level.
- the execution unit 36 of the instruction execution unit 15 executes the original code “R0102” output to the fetch unit 35 in the previous cycle.
- the selector 24 of the program counter 12 outputs “0x02”.
- the output address of the program counter 12 becomes “0x0106” added by “0x02”.
- the upper 15 bits of the address “0x0106” match the upper 15 bits of the address “0x0106” held in the address register 31 of the code insertion register set # 0.
- the address match signal becomes “H” level (because address match signal 0 becomes “H” level).
- the least significant bit of the output address of the program counter 12 is “0”.
- the address complete match signal remains at “L” level, and the code register output signal remains “0x0000”.
- R0106 which is the original code of the address “0x0106”
- the code selection circuit 14 outputs the original code “R0106” to the fetch unit 35 of the instruction execution unit 15 because the address complete match signal is at the “L” level.
- the execution unit 36 of the instruction execution unit 15 executes the original code “R0104” output to the fetch unit 35 in the previous cycle.
- the selector 24 of the program counter 12 outputs “0x01”.
- the output address of the program counter 12 becomes “0x0107” added by “0x01”.
- the upper 15 bits of the address “0x0107” match the upper 15 bits of the address “0x0106” held in the address register 31 of the code insertion register set # 0.
- the address match signal becomes “H” level (because address match signal 0 becomes “H” level).
- the least significant bit of the output address of the program counter 12 is “1”.
- the address complete match signal becomes “H” level (because the address complete match signal 0 becomes “H” level).
- the code register output signal becomes the insertion code “Code Reg. 0” held in the code register 32 (because the code register output signal 0 becomes “Code Reg. 0”). Since the address complete match signal is at “H” level, the code selection circuit 14 outputs the insertion code “Code Reg. 0” to the fetch unit 35 of the instruction execution unit 15. The execution unit 36 of the instruction execution unit 15 executes the original code “R0106” output to the fetch unit 35 in the previous cycle.
- the code selection circuit 14 outputs the original code “R0108” to the fetch unit 35 of the instruction execution unit 15 because the address complete match signal is at the “L” level.
- the execution unit 36 of the instruction execution unit 15 executes the insertion code “Code Reg. 0” output to the fetch unit 35 in the previous cycle.
- FIG. 14A shows an example of values held in the address register 31 of the code insertion register set 29-i (hereinafter, code insertion register set #i).
- code insertion register set #i the upper 15 bits (2nd to 16th bits) of “0x0106” are held in the address register 31 of the code insertion register set # 0 and stored in the address register 31 of the code insertion register set # 1.
- the upper 15 bits of “0x8000” are held, and the upper 15 bits of “0x8002” are held in the address register 31 of the code insertion register set # 2.
- the insertion code “Code Reg. 0” is held in the code register 32 of the register set for code insertion # 0.
- the original code “R0106” is a 3-cycle instruction
- the other original code is a 1-cycle instruction
- the insertion code “Code Reg. 0” is a 1-cycle instruction.
- FIG. 14 (c) is a timing chart under the conditions shown in FIGS. 14 (a) and 14 (b).
- the 16-bit address (PC value [15: 0]) output from the program counter 12 is “0x0102”.
- the upper 15 bits of the address “0x0102” are different from the upper 15 bits of the address “0x0106” held in the address register 31 of the code insertion register set # 0.
- the address match signal and the address complete match signal become “L” level, and the code register output signal becomes “0x0000”.
- “R0102” that is the original code of the address “0x0102” is output from the flash control code ROM 13.
- the code selection circuit 14 outputs the original code “R0102” to the fetch unit 35 of the instruction execution unit 15 because the address complete match signal is at the “L” level.
- the execution unit 36 of the instruction execution unit 15 executes the original code “R0100” output to the fetch unit 35 in the previous cycle.
- the code selection circuit 14 outputs the original code “R0104” to the fetch unit 35 of the instruction execution unit 15 because the address complete match signal is at the “L” level.
- the execution unit 36 of the instruction execution unit 15 executes the original code “R0102” output to the fetch unit 35 in the previous cycle.
- the selector 24 of the program counter 12 outputs “0x02”.
- the output address of the program counter 12 becomes “0x0106” added by “0x02”.
- the upper 15 bits of the address “0x0106” match the upper 15 bits of the address “0x0106” held in the address register 31 of the code insertion register set # 0.
- the address match signal becomes “H” level (because address match signal 0 becomes “H” level).
- the least significant bit of the output address of the program counter 12 is “0”.
- the address complete match signal remains at “L” level, and the code register output signal remains “0x0000”.
- the selector 24 of the program counter 12 outputs “0x01”.
- the output address of the program counter 12 becomes “0x0107” added by “0x01”.
- the upper 15 bits of the address “0x0107” match the upper 15 bits of the address “0x0106” held in the address register 31 of the code insertion register set # 0.
- the address match signal becomes “H” level (because address match signal 0 becomes “H” level).
- the output address of the program counter 12 is “1” because the least significant bit is “0x01” added.
- the address complete match signal becomes “H” level (because the address complete match signal 0 becomes “H” level).
- the code register output signal becomes the insertion code “Code Reg. 0” held in the code register 32 (because the code register output signal 0 becomes “Code Reg. 0”). Since the address complete match signal is at “H” level, the code selection circuit 14 outputs the insertion code “Code Reg. 0” to the fetch unit 35 of the instruction execution unit 15.
- the execution unit 36 of the instruction execution unit 15 executes the original code “R0106” output to the fetch unit 35 in the previous cycle.
- the execution unit 36 sets the PC stall signal to the “H” level.
- the code selection circuit 14 outputs the insertion code “Code Reg. 0” to the fetch unit 35 of the instruction execution unit 15.
- the execution unit 36 of the instruction execution unit 15 continues to execute the original code “R0106” of the three-cycle instruction (end of execution for two cycles).
- the program counter 12 outputs the same address “0x0107” as in the previous cycle.
- the upper 15 bits of the address “0x0107” match the upper 15 bits of the address “0x0106” held in the address register 31 of the code insertion register set # 0.
- the address match signal becomes “H” level (because address match signal 0 becomes “H” level).
- the address complete match signal becomes “H” level (because the address complete match signal 0 becomes “H” level).
- the code register output signal becomes the insertion code “Code Reg.
- the code selection circuit 14 outputs the original code “R0108” to the fetch unit 35 of the instruction execution unit 15 because the address complete match signal is at the “L” level.
- the execution unit 36 of the instruction execution unit 15 executes the insertion code “Code Reg. 0” output to the fetch unit 35 in the previous cycle.
- the code selection circuit 14 outputs the original code “R010A” to the fetch unit 35 of the instruction execution unit 15 because the address complete match signal is at the “L” level.
- the execution unit 36 of the instruction execution unit 15 executes the original code “R0108” output to the fetch unit 35 in the previous cycle.
- FIG. 15A shows an example of values held in the address register 31 of the code insertion register set 29-i (hereinafter, code insertion register set #i).
- code insertion register set #i the upper 15 bits of “0x0106” are held in the address register 31 of the code insertion register set # 0
- the upper 15 bits of “0x8000” are held in the address register 31 of the code insertion register set # 1.
- the upper 15 bits of “0x8002” are held in the address register 31 of the code insertion register set # 2.
- the insertion code “Code Reg. 0” is held in the code register 32 of the register set for code insertion # 0.
- the original code “R0106” is a one-cycle instruction
- the other original codes are also one-cycle instructions
- the insertion code “Code Reg.0” is a three-cycle instruction.
- FIG. 15 (c) is a timing chart under the conditions shown in FIGS. 15 (a) and 15 (b).
- the 16-bit address (PC value [15: 0]) output from the program counter 12 is “0x0102”.
- the upper 15 bits of the address “0x0102” are different from the upper 15 bits of the address “0x0106” held in the address register 31 of the code insertion register set # 0.
- the address match signal and the address complete match signal become “L” level, and the code register output signal becomes “0x0000”.
- “R0102” that is the original code of the address “0x0102” is output from the flash control code ROM 13.
- the code selection circuit 14 outputs the original code “R0102” to the fetch unit 35 of the instruction execution unit 15 because the address complete match signal is at the “L” level.
- the execution unit 36 of the instruction execution unit 15 executes the original code “R0100” output to the fetch unit 35 in the previous cycle.
- the code selection circuit 14 outputs the original code “R0104” to the fetch unit 35 of the instruction execution unit 15 because the address complete match signal is at the “L” level.
- the execution unit 36 of the instruction execution unit 15 executes the original code “R0102” output to the fetch unit 35 in the previous cycle.
- the selector 24 of the program counter 12 outputs “0x02”.
- the output address of the program counter 12 becomes “0x0106” added by “0x02”.
- the upper 15 bits of the address “0x0106” match the upper 15 bits of the address “0x0106” held in the address register 31 of the code insertion register set # 0.
- the address match signal becomes “H” level (because address match signal 0 becomes “H” level).
- the address complete match signal remains “L” level and the code register output signal remains “0x0000”.
- R0106 which is the original code of the address “0x0106”
- the code selection circuit 14 outputs the original code “R0106” to the fetch unit 35 of the instruction execution unit 15 because the address complete match signal is at the “L” level.
- the execution unit 36 of the instruction execution unit 15 executes the original code “R0104” output to the fetch unit 35 in the previous cycle.
- the selector 24 of the program counter 12 outputs “0x01”.
- the output address of the program counter 12 becomes “0x0107” added by “0x01”.
- the upper 15 bits of the address “0x0107” match the upper 15 bits of the address “0x0106” held in the address register 31 of the code insertion register set # 0.
- the address match signal becomes “H” level (because address match signal 0 becomes “H” level).
- the output address of the program counter 12 is “1” because the least significant bit is “0x01” added.
- the address complete match signal becomes “H” level (because the address complete match signal 0 becomes “H” level).
- the code register output signal becomes the insertion code “Code Reg. 0” held in the code register 32 (because the code register output signal 0 becomes “Code Reg. 0”). Since the address complete match signal is at “H” level, the code selection circuit 14 outputs the insertion code “Code Reg. 0” to the fetch unit 35 of the instruction execution unit 15. The execution unit 36 of the instruction execution unit 15 executes the original code “R0106” output to the fetch unit 35 in the previous cycle.
- the code selection circuit 14 outputs the original code “R0108” to the fetch unit 35 of the instruction execution unit 15 because the address complete match signal is at the “L” level.
- the execution unit 36 of the instruction execution unit 15 executes the insertion code “Code Reg. 0” output to the fetch unit 35 in the previous cycle.
- the execution unit 36 sets the PC stall signal to the “H” level.
- the program counter 12 outputs the same address “0x0108” as in the previous cycle.
- the upper 15 bits of the address “0x0108” are different from the upper 15 bits of the address “0x0106” held in the address register 31 of the code insertion register set # 0.
- the address match signal and the address complete match signal become “L” level, and the code register output signal becomes “0x0000”.
- the execution unit 36 of the instruction execution unit 15 continues to execute the insertion code “Code Reg. 0” of the 3-cycle instruction (end of execution for two cycles).
- the program counter 12 outputs the same address “0x0108” as in the previous cycle.
- the upper 15 bits of the address “0x0108” are different from the upper 15 bits of the address “0x0106” held in the address register 31 of the code insertion register set # 0.
- the address match signal and the address complete match signal become “L” level, and the code register output signal becomes “0x0000”.
- the execution unit 36 of the instruction execution unit 15 continues to execute the insertion code “Code Reg. 0” of the 3-cycle instruction (end of execution for 3 cycles).
- the execution unit 36 ends the execution of the insertion code “Code Reg. 0”, which is a three-cycle instruction, and sets the PC stall signal to the “L” level.
- the code selection circuit 14 outputs the original code “R010A” to the fetch unit 35 of the instruction execution unit 15 because the address complete match signal is at the “L” level.
- the execution unit 36 of the instruction execution unit 15 executes the original code “R0108” output to the fetch unit 35 in the previous cycle.
- the addresses of the plurality of original codes are valid from the least significant bit to the (k + 1) th bit or more.
- k is a natural number of 1 or more.
- FIG. 16 is a diagram illustrating the configuration of the flash memory control unit 102 according to the second embodiment.
- 16 differs from the flash memory control unit 2 in FIG. 7 in a program counter 51 and an insertion code register set block 52.
- the insertion code register set block 52 holds a maximum of 2k-1 insertion codes and the address of the insertion code.
- the insertion code register set block 52 determines that when the bit excluding the k bits from the least significant bit of the held insertion code address matches the bit excluding the k bits from the least significant address of the program counter 51.
- the first signal is output (that is, the address match signal is set to the “H” level).
- the insertion code register set block 52 outputs the first signal and holds the k bits from the least significant bit of the address of the insertion code held therein and the k bits from the least significant address of the program counter 51 address.
- the second signal is output (that is, the address complete match signal is set to the “H” level), and the insertion code held corresponding to the address of the program counter 51 is output.
- the insertion code register set block 52 outputs a second signal and simultaneously outputs an insertion end signal indicating an insertion end when outputting the last insertion code when a plurality of insertion codes are successively inserted. To do. The generation of the insertion end signal will be described later.
- the program counter 51 adds “1” to the least significant bit when receiving the first signal, and “1” to the (k + 1) th bit from the least significant bit when not receiving the first signal. Is added. When receiving the insertion end signal, the program counter 51 adds “1” to the (k + 1) th bit from the least significant bit and sets the k bits from the least significant bit to “0” even when the first signal is received. "
- FIG. 17 is a diagram showing the configuration of the program counter 51.
- the program counter 51 includes a selector 53, an adder 25, a logic circuit AND74, a selector 26, a selector 27, and a PC register 28.
- the selector 53 receives the address match signal and the insertion end signal from the insertion code register set block 52.
- the selector 53 outputs “0x01” when the address match signal is at “H” level and the insertion end signal is at “L” level.
- the selector 53 receives the address match signal when the address match signal is “L” level and the insertion end signal is “H” level.
- the “L” level and the insertion end signal are “L” level, “0x20” is output.
- the adder 25 adds the 20-bit address output from the PC register 28 and the value output from the selector 53.
- the logic circuit AND74 outputs a logical product of the negative 5 bits of the 20 bits output from the adder 25 and the negative of the insertion end signal. In other words, the logic circuit AND74 outputs the lower 5 bits of the 20 bits output from the adder 25 when the insertion end signal is at the “L” level.
- the logic circuit AND74 outputs 5-bit “0b00000” when the insertion end signal is at “H” level.
- “0b...” Represents binary display.
- the selector 26 includes a signal in which the upper 15 bits of the 20 bits output from the adder 25 are set to the upper 15 bits, and the 5-bit signal output from the logic circuit AND 74 is set to the lower 5 bits.
- the output calculation result PC is received.
- the selector 26 outputs the operation result PC when the operation result PC selection signal output from the instruction execution unit 15 is at “H” level, and the adder 25 and the logic circuit when the operation result PC selection signal is at “L” level.
- the signal from the AND 74 is output.
- the selector 27 receives the output of the selector 26 and the address output from the PC register 28.
- the selector 27 outputs an address output from the PC register 28 when the PC stall signal output from the instruction execution unit 15 is “H” level, and receives from the selector 26 when the PC stall signal is “L” level. Output a signal.
- the PC register 28 latches the output of the selector 27 and outputs it to the internal address bus 23 as the address of the flash control code ROM.
- FIG. 18 is a diagram illustrating the configuration of the insertion code register set block 52.
- the code insertion register set 54-i receives an address output from the program counter 51 and data transmitted through the data bus, and further receives a code register selection signal i, an address register selection signal i, an address from the code selection circuit 14. In response to the less register 2 selection signal i and the insertion end register selection signal i, an address match signal i, an address complete match signal i, an insertion end signal i, and a code register output signal i are output.
- the logic circuit OR1 outputs a logical sum of (n + 1) address match signals 0 to n as an address match signal. That is, when at least one of (n + 1) address match signals 0 to n is at “H” level, the address match signal is at “H” level.
- the logic circuit OR2 outputs a logical sum of (n + 1) code register output signals 0 to n as a code register output signal. That is, when at least one of the (n + 1) code register output signals 0 to n has an “H” level bit (that is, when an insertion code is output), the code register output signal becomes an insertion code. That is, when all the bits of (n + 1) code register output signals 0 to n are at “L” level (that is, when no insertion code is output), all the bits of the code register output signal are “L”. Become.
- the logic circuit OR3 outputs a logical sum of (n + 1) address complete match signals 0 to n as an address complete match signal. That is, when at least one of (n + 1) address complete match signals 0 to n is at “H” level, the address complete match signal is at “H” level.
- the logic circuit OR 54 outputs a logical sum of (n + 1) insertion end signals 0 to n as an insertion end signal. That is, when at least one of (n + 1) insertion end signals 0 to n is at “H” level, the insertion end signal is at “H” level.
- the address match signals 0 to n and the address match signal are 1-bit signals.
- the address complete match signals 0 to n and the address complete match signal are 1-bit signals.
- the insertion end signals 0 to n and the insertion end signal are 1-bit signals.
- the code register output signals 0 to n and the code register output signal are 16-bit signals.
- FIG. 19 is a diagram showing the configuration of the code insertion register set 54-0.
- the configuration of the code insertion register sets 54-1 to 54-n is the same as the configuration of the code insertion register set 54-0 in FIG.
- the code insertion register set 54-0 includes a logic circuit AND1, an address register 31, an address comparator 30, a logic circuit AND4, a code register 32, a logic circuit 54, and an address register. 56, an address comparator 57, a logic circuit 56, an insertion end register 59, a logic circuit AND2, a logic circuit 55, and a logic circuit AND3.
- the logic circuit AND1 outputs an “H” level signal to the control terminal of the address register 31 when the clock clk and the address register selection signal 0 are both “H” level.
- the address register 31 latches and holds the 15-bit address (that is, the address to insert the insertion code) sent through the data bus when the input to the control terminal is at “H” level.
- the address comparator 30 matches the upper 15 bits (address [19: 5]) of the 20-bit address output from the program counter 12 with the 15-bit address held in the address register 31.
- the address match signal 0 is set to the “H” level.
- the logic circuit AND 54 outputs an “H” level signal to the control terminal of the code register 32 when the clock clk and the address register 2 selection signal 0 are both “H” level.
- the address register 56 latches and holds the 5-bit address sent through the data bus when the input to the control terminal is at “H” level.
- the address register 56 holds an address indicating the insertion order when a plurality of insertion codes are successively inserted.
- the logic circuit AND 56 outputs a signal of “H” level to the control terminal of the insertion end register 59 when the clock clk and the insertion end register selection signal 0 are both “H” level.
- the logic circuit AND55 receives the address complete match signal 0 and the output of the insertion end register 59.
- the logic circuit AND55 outputs 1-bit data (insertion end) held in the insertion end register 59 as the insertion end signal 0 when the address complete match signal 0 is at “H” level.
- the logic circuit AND4 outputs an “H” level signal to the control terminal of the code register 32 when the clock clk and the code register selection signal 0 are both at the “H” level.
- the logic circuit AND3 receives the address complete match signal 0 and the output of the code register 32.
- the logic circuit AND3 outputs 16-bit data (that is, an insertion code) held in the code register 32 as the code register output signal 0 when the address complete match signal 0 is at “H” level.
- the logic circuit AND3 outputs 16-bit “0x0000” as the code register output signal 0 when the address complete match signal 0 is at “L” level.
- the address match signal 0 is a 1-bit signal.
- the address complete match signal 0 is a 1-bit signal.
- the insertion end signal 0 is a 1-bit signal.
- the code register output signal 0 is a 16-bit signal.
- the upper 15 bits of “0x01062” are held in the address register 31 of the code insertion register set # 1, and the lower 5 bits of “0x01062” are held in the address register 56. Further, the insertion code “Code Reg. 1” is held in the code register 32 of the code insertion register set # 1, and the insertion end “0b1” is held in the insertion end register 59 of the code insertion register set # 1. Further, it is assumed that the original code “R...” Is held at the address “0x...” Of the flash control code ROM 13.
- R01020 which is the original code of the address “0x01020”, is output from the flash control code ROM 13.
- the code selection circuit 14 outputs the original code “R01020” to the fetch unit 35 of the instruction execution unit 15 because the address complete match signal is at the “L” level.
- the execution unit 36 of the instruction execution unit 15 executes the original code “R01000” output to the fetch unit 35 in the previous cycle.
- the selector 53 of the program counter 51 outputs “0x20”.
- the output address of the program counter 51 becomes “0x01040” added by “0x20”.
- the upper 15 bits of the address “0x01040” are different from the upper 15 bits of the address “0x01061” held in the address register 31 of the code insertion register set # 0, and the address of the code insertion register set # 1. This is also different from the upper 15 bits of the address “0x01062” held in the register 31.
- the selector 53 of the program counter 51 outputs “0x20”.
- the output address of the program counter 51 becomes “0x01060” added by “0x20”.
- the upper 15 bits of the address “0x01060” match the upper 15 bits of the address “0x01061” held in the address register 31 of the code insertion register set # 0, and the address of the code insertion register set # 1 This also matches the upper 15 bits of the address “0x01062” held in the register 31.
- the address match signal becomes “H” level (because address match signal 0 and address match signal 1 become “H” level).
- the lower 5 bits of the address “0x01060” are different from the lower 5 bits of the address “0x01061” held in the address register 56 of the code insertion register set # 0, and the address of the code insertion register set # 1. This is different from the lower 5 bits of the address “0x01062” held in the register 56.
- the address complete match signal remains at “L” level (because address complete match signal 0 and address complete match signal 1 remain at “L” level). Since the address complete match signal is “L” level, the code register output signal is “0x0000” and the insertion end signal is “0b0”.
- “R01060”, which is the original code of the address “0x01060”, is output from the flash control code ROM 13.
- the code selection circuit 14 outputs the original code “R01060” to the fetch unit 35 of the instruction execution unit 15 because the address complete match signal is at the “L” level.
- the execution unit 36 of the instruction execution unit 15 executes the original code “R01040” output to the fetch unit 35 in the previous cycle.
- the selector 24 of the program counter 51 outputs “0x01”. Therefore, the output address of the program counter 51 is “0x01061” added by “0x01”.
- the upper 15 bits of the address “0x01061” match the upper 15 bits of the address “0x01061” held in the address register 31 of the code insertion register set # 0, and the address of the code insertion register set # 1 This matches the upper 15 bits of the address “0x01062” held in the register 31.
- the address match signal becomes “H” level (because address match signal 0 and address match signal 1 become “H” level).
- the address complete match signal is at the “H” level. (Because the address complete match signal 0 is at “H” level). Since the address complete match signal 0 becomes “H” level, the code register output signal 0 becomes the insertion code “Code Reg. 0” held in the code register 32 of the code insertion register set # 0. As a result, the code register output signal becomes the insertion code “Code Reg. 0”.
- the insertion end signal 0 becomes the insertion end “0b0” held in the insertion end register 59 of the code insertion register set # 0. As a result, the insertion end signal becomes “0b0”. Since the address complete match signal is at “H” level, the code selection circuit 14 outputs the insertion code “Code Reg. 0” to the fetch unit 35 of the instruction execution unit 15. The execution unit 36 of the instruction execution unit 15 executes the original code “R01060” output to the fetch unit 35 in the previous cycle.
- the selector 24 of the program counter 51 outputs “0x01”. Therefore, the output address of the program counter 51 is “0x01062” added by “0x01”.
- the upper 15 bits of the address “0x01062” match the upper 15 bits of the address “0x01061” held in the address register 31 of the code insertion register set # 0, and the address register 31 of the code insertion register set # 1. Matches the upper 15 bits of the address “0x01062” held in the. As a result, the address match signal becomes “H” level (because address match signal 0 and address match signal 1 become “H” level).
- the address complete match signal is at the “H” level. (Because the address complete match signal 1 is at "H” level). Since the address complete match signal 1 becomes “H” level, the code register output signal 1 becomes the insertion code “Code Reg. 1” held in the code register 32 of the code insertion register set # 1. As a result, the code register output signal becomes the insertion code “Code Reg. 1”. Since the address complete match signal 1 becomes “H” level, the insertion end signal 1 becomes the insertion end “0b1” held in the insertion end register 59 of the code insertion register set # 1.
- the code selection circuit 14 outputs the insertion code “Code Reg. 1” to the fetch unit 35 of the instruction execution unit 15 because the address complete match signal is at “H” level.
- the execution unit 36 of the instruction execution unit 15 executes the insertion code “Code Reg. 0” output to the fetch unit 35 in the previous cycle.
- the selector 24 of the program counter 51 outputs “0x20”. Since the insertion end signal is “0b1”, the lower 5 bits of the output of the adder 25 are set to “0” by the logic circuit 74. As a result, the output address of the program counter 51 is “0x01080”. The upper 15 bits of the address “0x01080” are different from the upper 15 bits of the address “0x01061” held in the address register 31 of the code insertion register set # 0, and the address register 31 of the code insertion register set # 1. This is different from the upper 15 bits of the address “0x01062” held in.
- the selector 53 of the program counter 51 outputs “0x20”.
- the output address of the program counter 51 becomes “0x010A0” added by “0x20”.
- the upper 15 bits of the address “0x010A0” are different from the upper 15 bits of the address “0x01061” held in the address register 31 of the code insertion register set # 0, and the address register 31 of the code insertion register set # 1. This is different from the upper 15 bits of the address “0x01062” held in.
- the address match signal and the address complete match signal become “L” level
- the code register output signal becomes “0x0000”
- the insertion end signal becomes “0b0”.
- “R010A0” which is the original code of the address “0x010A0”
- the code selection circuit 14 outputs the original code “R010A0” to the fetch unit 35 of the instruction execution unit 15 because the address complete match signal is at the “L” level.
- the execution unit 36 of the instruction execution unit 15 executes the original code “R01080” output to the fetch unit 35 in the previous cycle.
- the operation is the same as in the sixth cycle.
- the address of the original code is designated by bits other than the predetermined number of bits from the least significant bit of the program counter address, and the code is inserted using the predetermined number of bits from the least significant bit. Therefore, one or more codes can be inserted between two original codes, and a multi-cycle instruction can be executed.
- the output of the program counter 12 has been described as 16 bits. However, in this embodiment, since a plurality of instruction codes are inserted, the output of the program counter 51 is 20 bits. Assumed.
- FIG. 21 is a diagram illustrating a configuration of the flash memory control unit 312 according to the third embodiment.
- the insertion code register set block 164 outputs the first signal when the bit except the least significant bit of the held insertion code address matches the bit except the least significant bit of the address of the program counter 12. (That is, the address match signal is set to the “H” level).
- the insertion code register set block 164 outputs the first signal and outputs the second signal when the least significant bit of the address of the insertion code that is held matches the least significant bit of the address of the program counter 12. Output (that is, set the address match signal to “H” level) and output the held insertion code.
- FIG. 22 is a diagram showing the configuration of the code insertion register set 64-0 included in the insertion code register set block 164.
- the configuration of the code insertion register sets 64-1 to 64-n is the same as that of the code insertion register set 64-0 in FIG.
- the address register 131 latches and holds the 16-bit address sent through the data bus when the output of the logic circuit AND1 is at “H” level.
- the coincidence circuit XNOR1 has the least significant bit (address [0]) of the 16-bit address output from the program counter 12 and the least significant bit of the 16-bit address held in the address register 131. When they match, the match signal is set to the “H” level.
- the logic circuit AND2 sets the address complete match signal 0 to “H” level when the address match signal 0 is “H” level and the match signal output from the match circuit NROR1 is “H” level.
- FIG. 23A is a diagram showing an example of values held in the address register 31 of the code insertion register set 64-i (hereinafter, code insertion register set #i).
- code insertion register set #i 16-bit “0x0106” is held in the address register 131 of the code insertion register set # 0.
- the insertion code “Code Reg. 0” is held in the code register 32 of the register set for code insertion # 0.
- the original code “R...” Is held at the address “0x...” Of the flash control code ROM 13.
- FIG. 23B is a timing chart under the conditions of FIG. In the 0th cycle, the 16-bit address (PC value [15: 0]) output from the program counter 12 is “0x0102”.
- the upper 15 bits of the address “0x0102” are different from the upper 15 bits of the address “0x0106” held in the address register 131.
- the address match signal and the address complete match signal become “L” level, and the code register output signal becomes “0x0000”.
- “R0102” that is the original code of the address “0x0102” is output from the flash control code ROM 13.
- the code selection circuit 14 outputs the original code “R0102” to the fetch unit 35 of the instruction execution unit 15 because the address complete match signal is at the “L” level.
- the execution unit 36 of the instruction execution unit 15 executes the original code “R0100” output to the fetch unit 35 in the previous cycle.
- the code selection circuit 14 outputs the original code “R0104” to the fetch unit 35 of the instruction execution unit 15 because the address complete match signal is at the “L” level.
- the execution unit 36 of the instruction execution unit 15 executes the original code “R0102” output to the fetch unit 35 in the previous cycle.
- the selector 24 of the program counter 12 outputs “0x02”, so that the output address of the program counter 12 is added by “0x02”. It becomes “0x0106”. Since the upper 15 bits of the address “0x0106” match the upper 15 bits of the address “0x0106” held in the address register 131, the address match signal becomes “H” level (the address match signal 0 is “H”). To become a level). Further, since the lower 1 bit of the address “0x0106” matches the lower 1 bit of the address “0x0106” held in the address register 131, the address complete match signal becomes “H” level (address complete match signal 0). Is at “H” level).
- the code register output signal becomes the insertion code “Code Reg. 0” held in the code register 32 (because the code register output signal 0 becomes “Code Reg. 0”). Since the address complete match signal is at “H” level, the code selection circuit 14 outputs the insertion code “Code Reg. 0” to the fetch unit 35 of the instruction execution unit 15. The execution unit 36 of the instruction execution unit 15 executes the original code “R0104” output to the fetch unit 35 in the previous cycle.
- the selector 24 of the program counter 12 outputs “0x01”.
- the output address of the program counter 12 becomes “0x0107” added by “0x01”. Since the upper 15 bits of the address “0x0107” match the upper 15 bits of the address “0x0106” held in the address register 131, the address match signal becomes “H” level (the address match signal 0 is “H”). To become a level).
- the lower 1 bit of the address “0x0107” is different from the lower 1 bit of the address “0x0106” held in the address register 131.
- the address complete match signal becomes “L” level (because the address complete match signal 0 and the address complete match signal become “L” level), and the code register output signal becomes “0x0000”.
- the code selection circuit 14 outputs the original code “R0106” to the fetch unit 35 of the instruction execution unit 15 because the address complete match signal is at the “L” level.
- the execution unit 36 of the instruction execution unit 15 executes the insertion code “Code Reg. 0” output to the fetch unit 35 in the previous cycle.
- the code selection circuit 14 outputs the original code “R0108” to the fetch unit 35 of the instruction execution unit 15 because the address complete match signal is at the “L” level.
- the execution unit 36 of the instruction execution unit 15 executes the original code “R0106” output to the fetch unit 35 in the previous cycle.
- the operation is the same as the fourth cycle.
- the address of the original code is designated by bits other than the least significant bit of the address of the program counter, and the code is coded using the least significant bit. Since the insertion is controlled, one code can be inserted between two original codes, and a multi-cycle instruction can be executed. Further, according to the present embodiment, it is possible to select whether to execute the inserted code after the original code (post-insertion) or before the original code (pre-insertion).
- FIG. 24 is a diagram illustrating a configuration of the flash memory control unit 103 according to the fourth embodiment.
- the flash memory control unit 103 in FIG. 24 is different from the flash memory control unit 102 in the second embodiment in FIG.
- the program counter 65 When the program counter 65 receives the insertion end signal, the k bits from the least significant bit are set to “1”.
- FIG. 25 is a diagram illustrating the configuration of the program counter 65 according to the fourth embodiment.
- the program counter 65 includes a selector 68, an adder 25, a logic circuit OR68, a selector 26, a selector 27, and a PC register 28.
- the selector 68 receives an address match signal from the insertion code register set block 52.
- the selector 68 outputs “0x01” when the address match signal is at “H” level.
- the selector 68 outputs “0x20” when the address match signal is at “L” level.
- the adder 25 adds the 20-bit address “19: 0” output from the PC register 28 and the value output from the selector 68.
- the logic circuit OR68 outputs the logical sum of the lower 5 bits of the 20 bits output from the adder 25 and the insertion end signal. That is, logic circuit OR 68 outputs the lower 5 bits of the 20 bits output from adder 25 when the insertion end signal is at “L” level. The logic circuit OR68 outputs 5-bit “0b11111” when the insertion end signal is at “H” level.
- the selector 26 sets the upper 15 bits (6th to 20th bits) of the 20 bits output from the adder 25 as the upper 15 bits, and sets the 5-bit signal output from the logic circuit OR68 as the lower 5 bits. And the calculation result PC output from the instruction execution unit 15 are received.
- the selector 26 outputs the operation result PC when the operation result PC selection signal output from the instruction execution unit 15 is at “H” level, and the adder 25 and the logic circuit when the operation result PC selection signal is at “L” level. 58 signals are output.
- the selector 27 receives the output of the selector 26 and the address output from the PC register 28.
- the selector 27 outputs the address output from the PC register 28 when the PC stall signal output from the instruction execution unit 15 is “H” level, and outputs the output of the selector 26 when the PC stall signal is “L” level. Output.
- the PC register 28 latches the output of the selector 27 and outputs it to the internal address bus 23 as the address of the flash control code ROM.
- FIG. 26B is a timing chart under the condition of FIG. In the 0th cycle, the 20-bit address (PC value [19: 0]) output from the program counter 65 is “0x01020”.
- the upper 15 bits of the address “0x01020” are different from the upper 15 bits of the address “0x01060” held in the address register 31 of the code insertion register set # 0, and the address register 31 of the code insertion register set # 1. This is different from the upper 15 bits of the address “0x01061” held in.
- the address match signal and the address complete match signal become “L” level
- the code register output signal becomes “0x0000”
- the insertion end signal becomes “0b0”.
- R01020 which is the original code of the address “0x01020”, is output from the flash control code ROM 13.
- the code selection circuit 14 outputs the original code “R01020” to the fetch unit 35 of the instruction execution unit 15 because the address complete match signal is at the “L” level.
- the execution unit 36 of the instruction execution unit 15 executes the original code “R01000” output to the fetch unit 35 in the previous cycle.
- the selector 68 of the program counter 65 outputs “0x20”.
- the output address of the program counter 65 becomes “0x01040” added by “0x20”.
- the upper 15 bits of the address “0x01040” are different from the upper 15 bits of the address “0x01061” held in the address register 31 of the code insertion register set # 0, and the address register 31 of the code insertion register set # 1. This is different from the upper 15 bits of the address “0x01062” held in.
- the address match signal and the address complete match signal become “L” level, the code register output signal becomes “0x0000”, and the insertion end signal becomes “0b0”.
- R01040 which is the original code of the address “0x01040” is output from the flash control code ROM 13.
- the code selection circuit 14 outputs the original code “R01040” to the fetch unit 35 of the instruction execution unit 15 because the address complete match signal is at the “L” level.
- the execution unit 36 of the instruction execution unit 15 executes the original code “R01020” output to the fetch unit 35 in the previous cycle.
- the selector 68 of the program counter 65 outputs “0x20”.
- the output address of the program counter 65 becomes “0x01060” added by “0x20”.
- the upper 15 bits of the address “0x01060” match the upper 15 bits of the address “0x01060” held in the address register 31 of the code insertion register set # 0, and the address register 31 of the code insertion register set # 1 Since the upper 15 bits of the address “0x01061” held in the address match, the address match signal becomes “H” level (because the address match signal 0 and the address match signal 1 become “H” level).
- the address complete match signal is “H” level. (Because the address complete match signal 0 is at “H” level). Since the address complete match signal 0 becomes “H” level, the code register output signal 0 becomes the insertion code “Code Reg. 0” held in the code register 32 of the code insertion register set # 0. As a result, the code register output signal becomes the insertion code “Code Reg. 0”.
- the insertion end signal 0 becomes the insertion end “0b0” held in the insertion end register 59 of the code insertion register set # 0. As a result, the insertion end signal becomes “0b0”. Since the address complete match signal is at “H” level, the code selection circuit 14 outputs the insertion code “Code Reg. 0” to the fetch unit 35 of the instruction execution unit 15. The execution unit 36 of the instruction execution unit 15 executes the original code “R01040” output to the fetch unit 35 in the previous cycle.
- the selector 68 of the program counter 65 outputs “0x01”.
- the output address of the program counter 65 becomes “0x01061” added by “0x01”.
- the upper 15 bits (6th to 20th bits) of the address “0x01061” match the upper 15 bits of the address “0x01060” held in the address register 31 of the code insertion register set # 0, and the code is inserted. This corresponds to the upper 15 bits of the address “0x01061” held in the address register 31 of the register set # 1.
- the address match signal becomes “H” level (because address match signal 0 and address match signal 1 become “H” level).
- the lower 5 bits of the address “0x01061” match the lower 5 bits of the address “0x01061” held in the address register 56 of the code insertion register set # 1.
- the address complete match signal becomes “H” level (because the address complete match signal 1 becomes “H” level).
- the code register output signal 1 becomes the insertion code “Code Reg. 1” held in the code register 32 of the code insertion register set # 1.
- the code register output signal becomes the insertion code “Code Reg. 1”. Since the address complete match signal 1 becomes “H” level, the insertion end signal 1 becomes the insertion end “0b1” held in the insertion end register 59 of the code insertion register set # 1.
- the code selection circuit 14 outputs the insertion code “Code Reg. 1” to the fetch unit 35 of the instruction execution unit 15 because the address complete match signal is at “H” level.
- the execution unit 36 of the instruction execution unit 15 executes the insertion code “Code Reg. 0” output to the fetch unit 35 in the previous cycle.
- the selector 68 of the program counter 65 outputs “0x01”. Since the insertion end signal is “0b1”, the lower 5 bits of the 20-bit address output from the adder 25 are set to “1” by the logic circuit OR68. As a result, the output address of the program counter 65 is “0x0107F”. The upper 15 bits (6th to 20th bits) of the address “0x0107F” match the upper 15 bits of the address “0x01060” held in the address register 31 of the code insertion register set # 0, and the code is inserted. This matches the upper 15 bits of the address “0x01061” held in the address register 31 of the register set # 1.
- the address match signal becomes “H” level (because address match signal 0 and address match signal 1 become “H” level).
- the lower 5 bits of the address “0x0107F” are different from the lower 5 bits of the address “0x01060” held in the address register 56 of the code insertion register set # 0, and the address of the code insertion register set # 1. This is different from the lower 5 bits of the address “0x01061” held in the register 56.
- the address complete match signal is at the “L” level (because the address complete match signal 0 and the address complete match signal are at the “L” level). Since the address complete match signal becomes “L” level, the code register output signal becomes “0x0000” and the insertion end signal becomes “0b0”.
- the selector 68 of the program counter 65 outputs “0x01”. Since the insertion end signal is “0b0”, the lower 5 bits of the 20-bit address output from the adder 25 are output as they are by the logic circuit OR68. As a result, the output address of the program counter 65 is “0x01080”. The upper 15 bits of the address “0x01080” are different from the upper 15 bits of the address “0x01060” held in the address register 31 of the code insertion register set # 0, and the address of the code insertion register set # 1 This is different from the upper 15 bits of the address “0x01061” held in the register 31.
- the address match signal becomes “L” level (because address match signal 0 and address match signal 1 become “L” level).
- the lower 5 bits of the address “0x01080” are different from the lower 5 bits of the address “0x01060” held in the address register 56 of the code insertion register set # 0, and the address register of the code insertion register set # 1 This is different from the lower 5 bits of the address “0x01061” held in 56.
- the address complete match signal becomes “L” level (because address complete match signal 0 and address complete match signal 1 become “L” level). Since the address complete match signal is “L” level, the code register output signal is “0x0000” and the insertion end signal is “0b0”.
- R01080 which is the original code of the address “0x01080”, is output from the flash control code ROM 13.
- the code selection circuit 14 outputs the original code “R01080” to the fetch unit 35 of the instruction execution unit 15 because the address complete match signal is at the “L” level.
- the execution unit 36 of the instruction execution unit 15 executes the original code “R01060” output to the fetch unit 35 in the previous cycle.
- the selector 68 of the program counter 65 outputs “0x20”, so that the output address of the program counter 65 is incremented by “0x20”. It becomes “0x010A0”.
- the upper 15 bits of the address “0x010A0” are different from the upper 15 bits of the address “0x01060” held in the address register 31 of the code insertion register set # 0, and the address register 31 of the code insertion register set # 1. This is different from the upper 15 bits of the address “0x01061” held in.
- the operation is the same as in the sixth cycle.
- the address of the original code is specified by bits other than the predetermined number of bits from the least significant bit of the address of the program counter, and the predetermined address from the least significant bit is designated. Since the insertion of the code is controlled using the number of bits, it is possible to insert one or more codes between two original codes and to execute a multi-cycle instruction. Further, according to the present embodiment, when the address from the program counter matches the value of the address register, the insertion code is executed with respect to the second embodiment in which the execution of the insertion code is executed before the original code. Is executed after the original code.
- FIG. 27 is a diagram illustrating the configuration of the flash memory control unit 395 according to the fifth embodiment.
- the flash memory control unit 395 in FIG. 27 is different from the flash memory control unit 2 in the first embodiment in FIG. 7 in an insertion code register set block 396.
- FIG. 28 is a diagram showing the configuration of the code insertion register set 40-0 included in the insertion code register set block 396.
- the configuration of the code insertion register sets 40-1 to 40-n is the same as that of the code insertion register set 40-0 in FIG.
- the code insertion register set 40-0 in FIG. 28 is different from the code insertion register set 29-0 in the first embodiment in FIG. 11 in the logic circuit AND6, the status register 34, and the logic circuit AND5. is there.
- the logic circuit AND6 outputs an “H” level signal to the control terminal of the status register 34 when the clock clk and the status register selection signal 0 are both at the “H” level.
- the status register 34 latches and holds the 1-bit status value sent through the data bus when the input to the control terminal is at “H” level.
- the logic circuit AND5 outputs a logical product of the output of the status register 34 and the output of the address comparator 30 as an address match signal 0. Therefore, when the status value is set to “0”, the address match signal 0 and the address complete match signal 0 are always at the “L” level. As a result, when the stator value is “0”, the code selection circuit 12 selects the original code output from the flash control code ROM 13 regardless of the address of the program counter 12. As a result, the code insertion function described in this embodiment is disabled.
- the validity / invalidity of the code insertion function can be switched according to the status value.
- FIG. 29 is a diagram illustrating a configuration of the flash memory control unit 423 according to the sixth embodiment.
- the insertion code register set block 424 outputs the first signal when the bit except the most significant bit of the held insertion code address matches the bit other than the most significant bit of the address of the program counter 72. (That is, the address match signal is set to the “H” level).
- the insertion code register set block 424 outputs the first signal and outputs the second signal when the most significant bit of the address of the program counter 72 is “1” (that is, the address complete match signal “ And the held insertion code is output.
- the program counter 72 adds “1” to the most significant bit when receiving the first signal, and adds “1” to the second least significant bit when not receiving the first signal.
- FIG. 30 shows a configuration of program counter 72.
- the program counter 72 includes a selector 73, an adder 25, a logic circuit AND 72, a selector 26, a selector 27, and a PC register 28.
- the selector 73 receives the address match signal and the address complete match signal from the insertion code register set block 424.
- the selector 73 outputs “0x10000” when the address match signal is “H” level and the address complete match signal is “L” level.
- the selector 73 is operable when the address match signal is “L” level and the address complete match signal is “H” level, when the address match signal is “L” level and the address complete match signal is “L” level, or When the coincidence signal is “H” level and the address complete coincidence signal is “H” level, “0x02” is output.
- the adder 25 adds the 17-bit address “16: 0” output from the PC register 28 and the value output from the selector 73.
- the output of the program counter 72 is assumed to be 17 bits.
- the logic circuit AND72 outputs the logical product of the most significant 1 bit of the 17 bits output from the adder 25 and the negative of the address complete match signal. That is, the logic circuit AND 72 outputs the most significant 1 bit of the 17 bits output from the adder 25 when the address complete match signal is at “L” level. Logic circuit AND72 outputs 1-bit “0b0” when the address complete match signal is at “H” level.
- the selector 26 sets the lower 16 bits of the 17 bits output from the adder 25 as the lower 16 bits, the 1 bit signal output from the logic circuit AND 72 as the highest 1 bit, and the instruction execution unit 15. And the calculation result PC output from.
- the selector 26 outputs the operation result PC when the operation result PC selection signal output from the instruction execution unit 15 is at “H” level, and the adder 25 and the logic circuit when the operation result PC selection signal is at “L” level.
- the signal from the AND 72 is output.
- the selector 27 receives the output of the selector 26 and the address output from the PC register 28.
- the selector 27 outputs the address output from the PC register 28 when the PC stall signal output from the instruction execution unit 15 is “H” level, and outputs the output of the selector 26 when the PC stall signal is “L” level. Output.
- the PC register 28 latches the output of the selector 27 and outputs it to the internal address bus 23 as the address of the flash control code ROM.
- FIG. 31 is a diagram showing the configuration of the code insertion register set 71-0 included in the insertion code register set block 424.
- the configuration of the code insertion register sets 71-1 to 71-n is the same as that of the code insertion register set 71-0 in FIG.
- the code insertion register set 71-0 includes a logic circuit AND1, an address register 31, an address comparator 30, a logic circuit AND4, a code register 32, and a logic circuit AND71.
- the logic circuit AND1 outputs an “H” level signal to the control terminal of the address register 31 when the clock clk and the address register selection signal 0 are both “H” level.
- the address register 31 latches and holds the 16-bit address sent through the data bus when the input to the control terminal is at “H” level.
- the address comparator 30 matches the lower 16 bits (address [15: 0]) of the 17-bit address output from the program counter 72 with the 16-bit address held in the address register 31.
- the address match signal 0 is set to the “H” level.
- the logic circuit AND4 outputs an “H” level signal to the control terminal of the code register 32 when the clock clk and the code register selection signal 0 are both at the “H” level.
- the code register 32 latches and holds 16-bit data (that is, an insertion code) sent through the data bus when the input to the control terminal is at “H” level.
- FIG. 32A shows an example of values held in the address register 31 of the code insertion register set 71-i (hereinafter, code insertion register set #i).
- code insertion register set #i the lower 16 bits of “0x00106” are held in the address register 31 of the code insertion register set # 0.
- the insertion code “Code Reg. 0” is held in the code register 32 of the code insertion register set # 0. Further, it is assumed that the original code “R...” Is held at the address “0x...” Of the flash control code ROM 13.
- FIG. 32B is a timing chart under the condition of FIG. In the 0th cycle, the 17-bit address (PC value [16: 0]) output from the program counter 72 is “0x00102”.
- the lower 16 bits of the address “0x00102” are different from the lower 16 bits of the address “0x00106” held in the address register 31 of the code insertion register set # 0.
- the address match signal and the address complete match signal become “L” level, and the code register output signal becomes “0x00000”.
- “R00102” which is the original code of the address “0x00102” is output from the flash control code ROM 13.
- the code selection circuit 14 outputs the original code “R00102” to the fetch unit 35 of the instruction execution unit 15 because the address complete match signal is at the “L” level.
- the execution unit 36 of the instruction execution unit 15 executes the original code “R00100” output to the fetch unit 35 in the previous cycle.
- the code selection circuit 14 outputs the original code “R00104” to the fetch unit 35 of the instruction execution unit 15 because the address complete match signal is at the “L” level.
- the execution unit 36 of the instruction execution unit 15 executes the original code “R00102” output to the fetch unit 35 in the previous cycle.
- the selector 24 of the program counter 72 outputs “0x02”.
- the output address of the program counter 72 becomes “0x00106” added by “0x02”.
- the lower 16 bits of the address “0x00106” match the lower 16 bits of the address “0x00106” held in the address register 31 of the code insertion register set # 0.
- the address match signal becomes “H” level (because address match signal 0 becomes “H” level).
- the address complete match signal remains “L” level and the code register output signal remains “0x00000”.
- R00106 which is the original code of the address “0x00106”
- the code selection circuit 14 outputs the original code “R00106” to the fetch unit 35 of the instruction execution unit 15 because the address complete match signal is at the “L” level.
- the execution unit 36 of the instruction execution unit 15 executes the original code “R00104” output to the fetch unit 35 in the previous cycle.
- the selector 73 of the program counter 72 outputs “0x10000”. As a result, the output address of the program counter 72 becomes “0x10106” added by “0x10000”. Since the lower 16 bits of the address “0x10106” match the lower 16 bits of the address “0x00106” held in the address register 31 of the code insertion register set # 0, the address match signal becomes “H” level ( This is because the address match signal 0 becomes “H” level). Since the most significant bit of the output address of the program counter 72 is “1”, the address complete match signal becomes “H” level (because the address match signal 0 becomes “H” level).
- the code register output signal becomes the insertion code “Code Reg. 0” held in the code register 32 (because the code register output signal 0 becomes “Code Reg. 0”). Since the address complete match signal is at “H” level, the code selection circuit 14 outputs the insertion code “Code Reg. 0” to the fetch unit 35 of the instruction execution unit 15. The execution unit 36 of the instruction execution unit 15 executes the original code “R00106” output to the fetch unit 35 in the previous cycle.
- R00108 which is the original code of the address “0x00108”
- the code selection circuit 14 outputs the original code “R00108” to the fetch unit 35 of the instruction execution unit 15 because the address complete match signal is at the “L” level.
- the execution unit 36 of the instruction execution unit 15 executes the insertion code “Code Reg. 0” output to the fetch unit 35 in the previous cycle.
- the addresses of the plurality of original codes are valid from the second least significant bit, but the present invention is not limited to this, and the addresses of the plurality of original codes are the least significant bits.
- the nth bit or more may be effective. However, n is a natural number of 1 or more.
- the program counter 72 may add “1” to the nth bit from the least significant bit when the first signal is not received (when the address match signal is “L” level).
- the address input to each program counter and insertion code register set may be [15: 1], but [15: 0] It is written.
- FIG. 33 is a diagram illustrating a configuration of the flash memory control unit 623 according to the seventh embodiment.
- the flash memory control unit 623 in FIG. 33 is different from the flash memory control unit 102 in the second embodiment in FIG. 16 in an insertion code register set block 624 and a program counter 74.
- the insertion code register set block 624 holds a maximum of 2k-1 insertion codes and the address of the insertion code.
- the insertion code register set block 624 is configured such that when the bit excluding the k bits from the most significant address of the held insertion code matches the bit excluding the k bits from the most significant address of the program counter 74.
- the first signal is output (that is, the address match signal is set to the “H” level).
- the insertion code register set block 624 outputs the first signal and holds the k bits from the most significant bit of the address of the insertion code held therein and the k bits from the most significant address of the program counter 74 address. When this occurs, the second signal is output (the address complete match signal is set to the “H” level), and the inserted code corresponding to the address of the program counter 74 is output.
- the insertion code register set block 624 outputs a second signal and simultaneously outputs an insertion end signal indicating an insertion end when outputting the last insertion code when a plurality of insertion codes are successively inserted. To do.
- the program counter 74 When the program counter 74 receives the first signal, the program counter 74 adds “1” to the kth bit from the most significant bit, and when not receiving the first signal, the program counter 74 adds “1” to the mth bit from the least significant bit. Add 1 ”.
- the program counter 74 When receiving the insertion end signal, the program counter 74 adds “1” to the mth bit from the least significant bit and “0” the k bits from the most significant bit even when receiving the first signal. To.
- FIG. 34 shows a configuration of program counter 74.
- the program counter 74 includes a selector 77, an adder 25, a logic circuit AND74, a selector 26, a selector 27, and a PC register 28.
- the selector 77 receives the address match signal and the insertion end signal from the insertion code register set block 624.
- the selector 77 outputs “0x10000” when the address match signal is “H” level and the insertion end signal is “L” level.
- the selector 73 selects the address match signal when the address match signal is “L” level and the insertion end signal is “H” level, when the address match signal is “L” level and when the insertion end signal is “L” level, or the address match signal. Is “H” level and the insertion end signal is “H” level, “0x02” is output.
- the adder 25 adds the 20-bit address output from the PC register 28 and the value output from the selector 73.
- the logic circuit AND74 outputs the logical product of the upper 4 bits of the 20 bits output from the adder 25 and the negative of the insertion end signal. That is, logic circuit AND 74 outputs the upper 4 bits of the 20 bits output from adder 25 when the insertion end signal is at “L” level. The logic circuit AND74 outputs 4-bit “0b0000” when the insertion end signal is at “H” level.
- the selector 26 sets the lower 16 bits of the 20 bits output from the adder 25 as lower 16 bits, the 4-bit signal output from the logic circuit AND 74 as upper 4 bits, and the instruction execution unit 15
- the output calculation result PC is received.
- the selector 26 outputs the operation result PC when the operation result PC selection signal output from the instruction execution unit 15 is at “H” level, and the adder 25 and the logic circuit when the operation result PC selection signal is at “L” level.
- the signal from the AND 74 is output.
- the selector 27 receives the output of the selector 26 and the address output from the PC register 28.
- the selector 27 outputs the address output from the PC register 28 when the PC stall signal output from the instruction execution unit 15 is “H” level, and outputs the output of the selector 26 when the PC stall signal is “L” level. Output.
- the PC register 28 latches the output of the selector 27 and outputs it to the internal address bus 23 as the address of the flash control code ROM.
- FIG. 35 is a diagram showing a configuration of a code insertion register set 78-0 included in the insertion code register set block 624.
- the configuration of the code insertion register sets 78-1 to 78-n is the same as that of the code insertion register set 78-0 in FIG.
- the code insertion register set 78-0 includes a logic circuit AND1, an address register 31, an address comparator 30, a logic circuit AND4, a code register 32, a logic circuit 54, and an address register. 156, an address comparator 157, a logic circuit 56, an insertion end register 59, a logic circuit AND2, a logic circuit 55, and a logic circuit AND3.
- the logic circuit AND1 outputs an “H” level signal to the control terminal of the address register 31 when the clock clk and the address register selection signal 0 are both “H” level.
- the address register 31 latches and holds the 16-bit address sent through the data bus when the input to the control terminal is at “H” level.
- the address comparator 30 matches the lower 16 bits (address [15: 0]) of the 20-bit address output from the program counter 74 with the 16-bit address held in the address register 31.
- the address match signal 0 is set to the “H” level.
- the logic circuit AND 54 outputs an “H” level signal to the control terminal of the code register 32 when the clock clk and the address register 2 selection signal 0 are both “H” level.
- the address register 156 latches and holds the 4-bit address sent through the data bus when the input to the control terminal is at “H” level.
- the address comparator 57 determines that the upper 4 bits (address [19:16]) of the 20-bit address output from the program counter 74 and the 4-bit address held in the address register 156 match. In addition, an “H” level coincidence signal is output.
- the logic circuit AND2 sets the address complete match signal 0 to “H” level when the address match signal 0 is “H” level and the match signal output from the address comparator 157 is “H” level.
- the insertion end register 59 latches and holds 1-bit data (insertion end) sent through the data bus when the input to the control terminal is at “H” level.
- the logic circuit AND55 receives the address complete match signal 0 and the output of the insertion end register 59.
- the logic circuit AND55 outputs 1-bit data (insertion end) held in the insertion end register 59 as the insertion end signal 0 when the address complete match signal 0 is at “H” level.
- the logic circuit AND4 outputs an “H” level signal to the control terminal of the code register 32 when the clock clk and the code register selection signal 0 are both at the “H” level.
- the code register 32 latches and holds 16-bit data (that is, an insertion code) sent through the data bus when the input to the control terminal is at “H” level.
- the logic circuit AND3 receives the address complete match signal 0 and the output of the code register 32.
- the logic circuit AND3 outputs 16-bit data (that is, an insertion code) held in the code register 32 as the code register output signal 0 when the address complete match signal 0 is at “H” level.
- the logic circuit AND3 outputs 16-bit “0x0000” as the code register output signal 0 when the address complete match signal 0 is at “L” level.
- the lower 16 bits “0x20106” are held in the address register 31 of the code insertion register set # 1, and the upper 4 bits “0x20106” are held in the address register 156.
- the insertion code “Code Reg. 1” is held in the code register 32 of the code insertion register set # 01.
- the insertion end “0b1” is held in the insertion end register 59 of the code insertion register set # 1. Further, it is assumed that the original code “R...” Is held at the address “0x...” Of the flash control code ROM 13.
- FIG. 36B is a timing chart under the condition of FIG. In the 0th cycle, the 20-bit address (PC value [19: 0]) output from the program counter 74 is “0x00102”.
- the upper 15 bits of the address “0x00102” are different from the lower 16 bits of the address “0x10106” held in the address register 31 of the code insertion register set # 0, and the address register 31 of the code insertion register set # 1. This is different from the lower 16 bits of the address “0x20106” held in.
- the address match signal and the address complete match signal become “L” level
- the code register output signal becomes “0x0000”
- the insertion end signal becomes “0b0”.
- R00102 which is the original code of the address “0x00102” is output from the flash control code ROM 13.
- the code selection circuit 14 outputs the original code “R00102” to the fetch unit 35 of the instruction execution unit 15 because the address complete match signal is at the “L” level.
- the execution unit 36 of the instruction execution unit 15 executes the original code “R00100” output to the fetch unit 35 in the previous cycle.
- the selector 77 of the program counter 74 outputs “0x02”.
- the output address of the program counter 74 is “0x00104” added by “0x02”.
- the lower 16 bits of the address “0x00104” are different from the lower 16 bits of the address “0x10106” held in the address register 31 of the code insertion register set # 0, and the address register 31 of the code insertion register set # 1. This is different from the lower 16 bits of the address “0x20106” held in.
- the address match signal and the address complete match signal become “L” level
- the code register output signal becomes “0x0000”
- the insertion end signal becomes “0b0”.
- “R00104” which is the original code of the address “0x00104”
- the code selection circuit 14 outputs the original code “R00104” to the fetch unit 35 of the instruction execution unit 15 because the address complete match signal is at the “L” level.
- the execution unit 36 of the instruction execution unit 15 executes the original code “R00102” output to the fetch unit 35 in the previous cycle.
- the upper 4 bits of the address “0x00106” are different from the upper 4 bits of the address “0x10106” held in the address register 156 of the code insertion register set # 0, and the address of the code insertion register set # 1 This is different from the upper 4 bits of the address “0x20106” held in the register 156.
- the address complete match signal remains at “L” level (because address complete match signal 0 and address complete match signal 1 remain at “L” level). Since the address complete match signal is “L” level, the code register output signal is “0x0000” and the insertion end signal is “0b0”.
- “R00106”, which is the original code of the address “0x00106”, is output from the flash control code ROM 13.
- the code selection circuit 14 outputs the original code “R00106” to the fetch unit 35 of the instruction execution unit 15 because the address complete match signal is at the “L” level.
- the execution unit 36 of the instruction execution unit 15 executes the original code “R00104” output to the fetch unit 35 in the previous cycle.
- the selector 24 of the program counter 74 outputs “0x10000”. Therefore, the output address of the program counter 74 is “0x10106” added by “0x10000”.
- the lower 16 bits of the address “0x10106” match the lower 16 bits of the address “0x10106” held in the address register 31 of the code insertion register set # 0, and the address of the code insertion register set # 1 Since it matches the lower 16 bits of the address “0x20106” held in the register 31, the address match signal becomes “H” level (because the address match signal 0 and the address match signal 1 become “H” level).
- the upper 4 bits of the address “0x10106” match the upper 4 bits of the address “0x10106” held in the address register 156 of the code insertion register set # 0.
- the address complete match signal becomes “H” level (because the address complete match signal 0 becomes “H” level).
- the code register output signal 0 becomes the insertion code “Code Reg. 0” held in the code register 32 of the code insertion register set # 0.
- the code register output signal becomes the insertion code “Code Reg. 0”. Since the address complete match signal 0 becomes “H” level, the insertion end signal 0 becomes the insertion end “0b0” held in the insertion end register 59 of the code insertion register set # 0.
- the insertion end signal becomes “0b0”. Since the address complete match signal is at “H” level, the code selection circuit 14 outputs the insertion code “Code Reg. 0” to the fetch unit 35 of the instruction execution unit 15. The execution unit 36 of the instruction execution unit 15 executes the original code “R00106” output to the fetch unit 35 in the previous cycle.
- the selector 77 of the program counter 74 outputs “0x10000”. Therefore, the output address of the program counter 74 is “0x20106” added by “0x10000”.
- the lower 16 bits of the address “0x20106” match the lower 16 bits of the address “0x10106” held in the address register 31 of the code insertion register set # 0, and the address register 31 of the code insertion register set # 1. Matches the lower 16 bits of the address “0x20106” held in the. As a result, the address match signal becomes “H” level (because address match signal 0 and address match signal 1 become “H” level).
- the upper 4 bits of the address “0x20106” match the upper 4 bits of the address “0x20106” held in the address register 156 of the code insertion register set # 1.
- the address complete match signal becomes “H” level (because the address complete match signal 1 becomes “H” level).
- the code register output signal 1 becomes the insertion code “Code Reg. 1” held in the code register 32 of the code insertion register set # 1.
- the code register output signal becomes the insertion code “Code Reg. 1”. Since the address complete match signal 1 becomes “H” level, the insertion end signal 1 becomes the insertion end “0b1” held in the insertion end register 59 of the code insertion register set # 1.
- the code selection circuit 14 outputs the insertion code “Code Reg. 1” to the fetch unit 35 of the instruction execution unit 15 because the address complete match signal is at “H” level.
- the execution unit 36 of the instruction execution unit 15 executes the insertion code “Code Reg. 0” output to the fetch unit 35 in the previous cycle.
- the selector 24 of the program counter 74 outputs “0x02”. Further, since the insertion end signal is “0b1”, the upper 4 bits (17th to 20th bits) of the output of the adder 25 are set to “0” by the logic circuit AND74. As a result, the output address of the program counter 74 is “0x00108”. The lower 16 bits of the address “0x00108” are different from the lower 16 bits of the address “0x10106” held in the address register 31 of the code insertion register set # 0, and the address register 31 of the code insertion register set # 1.
- the address match signal becomes “L” level (because address match signal 0 and address match signal 1 become “L” level).
- the upper 4 bits of the address “0x00108” are different from the upper 4 bits of the address “0x10106” held in the address register 156 of the code insertion register set # 0, and the address register of the code insertion register set # 1 This is different from the upper 4 bits of the address “0x20106” held in 156.
- the address complete match signal becomes “L” level (because address complete match signal 0 and address complete match signal 1 become “L” level).
- the code register output signal is “0x0000” and the insertion end signal is “0b0”.
- “R00108”, which is the original code of the address “0x00108”, is output from the flash control code ROM 13.
- the code selection circuit 14 outputs the original code “R00108” to the fetch unit 35 of the instruction execution unit 15 because the address complete match signal is at the “L” level.
- the execution unit 36 of the instruction execution unit 15 executes the insertion code “Code Reg. 1” output to the fetch unit 35 in the previous cycle.
- the selector 77 of the program counter 74 outputs “0x02”.
- the output address of the program counter 74 is “0x0010A” added by “0x02”.
- the lower 16 bits of the address “0x0010A” are different from the lower 16 bits of the address “0x10106” held in the address register 31 of the code insertion register set # 0, and the address register 31 of the code insertion register set # 1. This is different from the lower 16 bits of the address “0x20106” held in.
- the m address coincidence signal and the address complete coincidence signal become “L” level
- the code register output signal becomes “0x0000”
- the insertion end signal becomes “0b0”.
- “R0010A” which is the original code of the address “0x0010A”
- the code selection circuit 14 outputs the original code “R0010A” to the fetch unit 35 of the instruction execution unit 15 because the address complete match signal is at the “L” level.
- the execution unit 36 of the instruction execution unit 15 executes the original code “R00108” output to the fetch unit 35 in the previous cycle.
- the operation is the same as in the sixth cycle.
- the address of the original code is specified by bits other than the predetermined number of bits from the most significant bit of the program counter address, and the code is inserted using the predetermined number of bits from the most significant bit. Therefore, one or more codes can be inserted between two original codes, and a multi-cycle instruction can be executed.
- the addresses of the plurality of original codes are valid for the second and higher bits from the least significant bit and excluding the most significant bit.
- FIG. 37 is a diagram illustrating the configuration of the flash memory control unit 742 according to the eighth embodiment.
- the flash memory control unit 742 in FIG. 37 is different from the flash memory control unit 2 in the first embodiment in FIG. 7 in an insertion code register set block 743 and a program counter 91.
- the insertion code register set block 743 matches the bits other than the most significant bit of the address of the insertion code that is held with the bits other than the most significant bit of the address of the program counter 91, and the most significant of the address of the program counter 91.
- the bit is “1”
- the first signal is output (the address complete match signal is set to “H” level), and the held insertion code is output.
- the program counter 91 adds “1” to the most significant bit when receiving the first signal, and adds “1” to the second least significant bit when not receiving the first signal, The most significant bit is set to “0”.
- FIG. 38 is a diagram showing the configuration of program counter 91.
- the program counter 91 of FIG. 38 is different from the program counter 72 of the sixth embodiment of FIG. 30 in a selector 92 and a logic circuit AND92.
- the selector 92 receives an address complete match signal from the insertion code register set block 743.
- the selector 92 outputs “0x10000” when the address complete match signal is at “H” level.
- the selector 92 outputs “0x02” when the address complete match signal is “L”.
- the logic circuit AND92 outputs the logical product of the most significant bit of the 17 bits output from the adder 25 and the address complete match signal. In other words, logic circuit AND 92 outputs the most significant bit of the 17 bits output from adder 25 when the address complete match signal is at “H” level. Logic circuit AND92 outputs 1-bit “0b0” when the address complete match signal is at “L” level.
- FIG. 39 shows a structure of insertion code register set block 743.
- the code insertion register set 88-i receives an address output from the program counter 91 and data transmitted in the data bus, and further receives a code register selection signal i and an address register selection signal i from the code selection circuit 14. In response, an address complete match signal i and a code register output signal i are output.
- the logic circuit OR 88 outputs a logical sum of (n + 1) code register output signals 0 to n as a code register output signal. That is, when at least one of the (n + 1) code register output signals 0 to n has an “H” level bit (that is, when an insertion code is output), the code register output signal becomes an insertion code. That is, when all the bits of (n + 1) code register output signals 0 to n are at “L” level (that is, when no insertion code is output), all the bits of the code register output signal are “L”. Become.
- the logic circuit OR89 outputs a logical sum of (n + 1) address complete match signals 0 to n as an address complete match signal. That is, when at least one of (n + 1) address complete match signals 0 to n is at “H” level, the address complete match signal is at “H” level.
- FIG. 40 is a diagram showing the configuration of the code insertion register set 88-0 included in the insertion code register set block 743.
- the configuration of the code insertion register sets 88-1 to 88-n is the same as that of the code insertion register set 88-0 in FIG.
- the code insertion register set 88-0 in FIG. 40 is different from the code insertion register set 71-0 in the sixth embodiment in FIG. 31 in that an address match signal is not output from the address comparator 30 to the outside. And a logic circuit AND88.
- FIG. 41A shows an example of values held in the address register 31 of the code insertion register set 88-i (hereinafter, code insertion register set #i).
- code insertion register set #i the lower 16 bits of “0x00106” are held in the address register 31 of the code insertion register set # 0.
- the insertion code “Code Reg. 0” is held in the code register 32 of the code insertion register set # 0. Further, it is assumed that the original code “R...” Is held at the address “0x...” Of the flash control code ROM 13.
- FIG. 41 (b) is a timing chart under the conditions of FIG. 41 (a).
- the 17-bit address output from the program counter 91 (PC value [16: 0] is “0x00102”.
- the lower 16 bits of the address “0x00102” are the register set # for code insertion. This is different from the lower 16 bits of the address “0x00106” held in the address register 31 of 0.
- the address complete match signal becomes “L” level and the code register output signal becomes “0x00000”.
- “R00102”, which is the original code of the address “0x00102” is output from the ROM 13. Since the address complete match signal is at the “L” level, the code selection circuit 14 uses the original code “R00102” as the instruction execution unit 15.
- Execution unit 36 of the line section 15 executes the original code "R00100" outputted to the fetch unit 35 in the previous cycle.
- the code selection circuit 14 outputs the original code “R00104” to the fetch unit 35 of the instruction execution unit 15 because the address complete match signal is at the “L” level.
- the execution unit 36 of the instruction execution unit 15 executes the original code “R00102” output to the fetch unit 35 in the previous cycle.
- the selector 92 of the program counter 91 outputs “0x02”.
- the output address of the program counter 91 becomes “0x00106” added by “0x02”.
- the lower 16 bits of the address “0x00106” match the lower 16 bits of the address “0x0106” held in the address register 31 of the code insertion register set # 0.
- the most significant bit (17th bit: address [16]) of the address “0x00106” is “0”.
- the address complete match signal becomes “H” level (because the address complete match signal 0 becomes “H” level).
- the code register output signal becomes the insertion code “Code Reg.
- the code selection circuit 14 outputs the insertion code “Code Reg. 0” to the fetch unit 35 of the instruction execution unit 15 because the address complete match signal is at “H” level.
- the execution unit 36 of the instruction execution unit 15 executes the original code “R00106” output to the fetch unit 35 in the previous cycle.
- the selector 92 of the program counter 91 outputs “0x10000”. As a result, the output address of the program counter 91 becomes “0x10106” added by “0x10000”.
- the lower 16 bits of the address “0x10106” match the lower 16 bits of the address “0x00106” held in the address register 31 of the code insertion register set # 0, but the most significant bit (17 bits) of the address “0x10106” Eye: Address [16]) is “1”.
- the address complete match signal becomes “L” level (because the address complete match signal 0 becomes “L” level).
- the code register output signal becomes “0x00000”.
- the flash control code ROM 13 outputs “R00106” which is the original code of the address “0x00106” in which the most significant bit (17th bit) of the output address “0x10106” of the program counter 91 is set to “0”.
- the selector 92 of the program counter 91 outputs “0x00002”. Further, since the address complete match signal is at “L” level, the most significant bit (17th bit) of the output address of the adder 25 becomes “0”. As a result, the output address of the program counter 91 is “0x00108”. The lower 16 bits of the address “0x00108” are different from the lower 16 bits of the address “0x00106” held in the address register 31 of the code insertion register set # 0. As a result, the address complete match signal becomes “L” level and the code register output signal becomes “0x00000”.
- the operation is the same as the fourth cycle.
- the address of the original code is designated by bits other than the most significant bit of the address of the program counter, and the code is coded using the most significant bit. Since the insertion is controlled, one or more codes can be inserted between two original codes, and a multi-cycle instruction can be executed. Further, according to the present embodiment, when the address from the program counter matches the value of the address register, the insertion code is executed in comparison with the sixth embodiment in which the execution of the insertion code is executed after the original code. Execute before the original code.
- the addresses of the plurality of original codes are valid for the second and higher bits from the least significant bit and excluding the most significant bit.
- the address may be valid for the nth bit from the least significant bit and excluding the most significant bit.
- n is a natural number of 1 or more.
- the program counter 91 adds “1” to the nth bit from the least significant bit, and the most significant bit.
- the bit can be set to “0”.
- FIG. 42 is a diagram illustrating the configuration of the flash memory control unit 388 of the ninth embodiment.
- the flash memory control unit 388 of FIG. 42 is different from the flash memory control unit 102 of the second embodiment of FIG. 16 in an insertion code register set block 389 and a program counter 94.
- the insertion code register set block 389 holds a maximum of 2k-1 insertion codes and the address of the insertion code.
- the bits excluding the k bits from the most significant bit of the held insertion code address match the bits excluding the k bits from the most significant address of the program counter 94, and
- a first signal is output (address complete match signal is At the same time, the inserted insertion code corresponding to the address of the program counter 94 is output.
- the program counter 94 When receiving the first signal, the program counter 94 adds “1” to the kth bit from the most significant bit, and when not receiving the first signal, the program counter 94 adds “1” to the mth bit from the least significant bit. 1 ”is added, and k bits from the most significant bit are set to“ 0 ”.
- FIG. 43 is a diagram showing the configuration of program counter 94.
- the selector 92 receives an address complete match signal from the insertion code register set block 389.
- the selector 92 outputs “0x10000” when the address complete match signal is at “H” level.
- the selector 92 outputs “0x02” when the address complete match signal is “L”.
- the logic circuit AND94 outputs a logical product of the upper 4 bits (17th to 19th bits) of the 20 bits output from the adder 25 and the address complete match signal. That is, logic circuit AND 94 outputs the upper 4 bits of the 20 bits output from adder 25 when the address complete match signal is at “H” level. The logic circuit AND94 outputs 4-bit “0b0” when the address complete match signal is at “L” level.
- FIG. 44 shows a structure of insertion code register set block 389.
- the code insertion register set 86-i receives an address output from the program counter 94 and data transmitted through the data bus, and further receives a code register selection signal i, an address register selection signal i and an address from the code selection circuit 14. In response to the register 2 selection signal i, an address complete match signal i and a code register output signal i are output.
- the logic circuit OR 88 outputs a logical sum of (n + 1) code register output signals 0 to n as a code register output signal. That is, when at least one of the (n + 1) code register output signals 0 to n has an “H” level bit (that is, when an insertion code is output), the code register output signal becomes an insertion code. That is, when all the bits of (n + 1) code register output signals 0 to n are at “L” level (that is, when no insertion code is output), all the bits of the code register output signal are “L”. Become.
- FIG. 45 is a diagram showing the configuration of the code insertion register set 86-0 included in the insertion code register set block 389. As shown in FIG. The configuration of the code insertion register sets 86-1 to 86-n is the same as that of the code insertion register set 86-0 in FIG.
- the lower 16 bits of “0x10106” are held in the address register 31 of the code insertion register set # 1, and the upper 4 bits (17th to 20th bits) of “0x10106” are held in the address register 156. Also, the insertion code “Code Reg. 1” is held in the code register 32 of the code insertion register set # 1. Further, it is assumed that the original code “R...” Is held at the address “0x...” Of the flash control code ROM 13.
- FIG. 46B is a timing chart under the condition of FIG. In the 0th cycle, the 20-bit address (PC value [19: 0]) output from the program counter 94 is “0x00102”.
- the lower 16 bits of the address “0x00102” are different from the lower 16 bits of the address “0x00106” held in the address register 31 of the code insertion register set # 0.
- the address complete match signal becomes “L” level and the code register output signal becomes “0x00000”.
- “R00102” which is the original code of the address “0x00102” is output from the flash control code ROM 13.
- the code selection circuit 14 outputs the original code “R00102” to the fetch unit 35 of the instruction execution unit 15 because the address complete match signal is at the “L” level.
- the execution unit 36 of the instruction execution unit 15 executes the original code “R00100” output to the fetch unit 35 in the previous cycle.
- the code selection circuit 14 outputs the original code “R00104” to the fetch unit 35 of the instruction execution unit 15 because the address complete match signal is at the “L” level.
- the execution unit 36 of the instruction execution unit 15 executes the original code “R00102” output to the fetch unit 35 in the previous cycle.
- the selector 92 of the program counter 94 outputs “0x02”. As a result, the output address of the program counter 94 becomes “0x00106” added by “0x02”.
- the lower 16 bits of the address “0x00106” match the lower 16 bits of the address “0x00106” held in the address register 31 of the code insertion register set # 0.
- the upper 4 bits (17th to 20th bits) address [16] to [19] of address “0x00106” are the addresses “0x0106” held in address register 156 of code insertion register set # 0. Matches the upper 4 bits of.
- the address complete match signal becomes “H” level (because the address complete match signal 0 becomes “H” level).
- the code register output signal becomes the insertion code “Code Reg. 0” held in the code register 32 (because the code register output signal 0 becomes “Code Reg. 0”). Since the address complete match signal is at “H” level, the code selection circuit 14 outputs the insertion code “Code Reg. 0” to the fetch unit 35 of the instruction execution unit 15.
- the execution unit 36 of the instruction execution unit 15 executes the original code “R00104” output to the fetch unit 35 in the previous cycle.
- the selector 92 of the program counter 94 outputs “0x10000”. As a result, the output address of the program counter 94 becomes “0x10106” added by “0x10000”.
- the lower 16 bits of the address “0x10106” match the lower 16 bits of the address “0x10106” held in the address register 31 of the code insertion register set # 1.
- the upper 4 bits (17th to 20th bits) addresses [16] to [19] of the address “0x10106” are the addresses “0x10106” held in the address register 156 of the code insertion register set # 1. Matches the upper 4 bits of.
- the address complete match signal becomes “H” level (because the address complete match signal 1 becomes “H” level).
- the code register output signal becomes the insertion code “Code Reg. 1” held in the code register 32 (because the code register output signal 0 becomes “Code Reg. 1”).
- the code selection circuit 14 outputs the insertion code “Code Reg. 1” to the fetch unit 35 of the instruction execution unit 15 because the address complete match signal is at “H” level.
- the execution unit 36 of the instruction execution unit 15 executes the insertion code “Code Reg. 0” output to the fetch unit 35 in the previous cycle.
- the selector 92 of the program counter 94 outputs “0x10000”.
- the output address of the program counter 94 becomes “0x20106” added by “0x10000”.
- the lower 16 bits of the address “0x20106” match the lower 16 bits of the addresses “0x00106” and “0x10106” held in the address registers 31 of the code insertion register sets # 0 and # 1.
- the upper 4 bits (17th to 20th bits) addresses [16] to [19] of the address “0x20106” are the addresses held in the address registers 156 of the code insertion register sets # 0 and # 1.
- the address complete match signal becomes “L” level (because the address complete match signal 0 and the address complete match signal become “L” level).
- the code register output signal becomes “0x00000”.
- the flash control code ROM 13 outputs “R00106”, which is the original code of the address “0x00106” in which the upper 4 bits (17th to 20th bits) of the output address “0x20106” of the program counter 94 are set to “0”.
- the code selection circuit 14 outputs the original code “R00106” to the fetch unit 35 of the instruction execution unit 15 because the address complete match signal is at the “L” level.
- the execution unit 36 of the instruction execution unit 15 executes the insertion code “Code Reg. 1” output to the fetch unit 35 in the previous cycle.
- the selector 92 of the program counter 94 outputs “0x02”. Further, since the address complete match signal is at “L” level, the upper 4 bits (17th to 20th bits) of the output address of the adder 25 become “0”. As a result, the output address of the program counter 94 is “0x00108”. Further, since the lower 16 bits of the address “0x00108” are different from the lower 16 bits of the address “0x00106” held in the address register 31, the address complete match signal becomes “L” level, and the code register output signal becomes “ 0x00000 ". “R00108”, which is the original code of the address “0x00108”, is output from the flash control code ROM 13.
- the code selection circuit 14 outputs the original code “R00108” to the fetch unit 35 of the instruction execution unit 15 because the address complete match signal is at the “L” level.
- the execution unit 36 of the instruction execution unit 15 executes the original code “R00106” output to the fetch unit 35 in the previous cycle.
- the operation is the same as the fifth cycle.
- the address of the original code is designated by bits other than the predetermined number of bits from the most significant bit of the program counter address, and the predetermined value is designated from the most significant bit. Since the insertion of the code is controlled using the number of bits, it is possible to insert one or more codes between two original codes and to execute a multi-cycle instruction. Further, according to the present embodiment, when the address from the program counter matches the value of the address register, the insertion code is executed with respect to the seventh embodiment in which the execution of the insertion code is executed after the original code. Execute before the original code.
- the present invention is not fixed to the above embodiment.
- the code register value may be fixed to a specific value.
- the code types that can be inserted are limited, but the size of the register can be reduced.
- code register value may be stored in the ROM, or may be stored in a circuit combining logic circuits. Only a specific command (for example, an error monitor command) may be inserted.
- the flash memory control unit can also have a general-purpose processor having the same function.
- the flash memory 3 and the flash memory control unit 2 shown in FIG. 6 may constitute a nonvolatile semiconductor device formed on one semiconductor substrate (chip).
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Microcomputers (AREA)
- Stored Programmes (AREA)
- Executing Machine-Instructions (AREA)
Abstract
Description
[第1の実施形態]
(コード挿入とコード変更について)
まず、コード変更機能を備えたマイクロコンピュータAと、コード追加機能を備えたマイクロコンピュータBにおいて、コード挿入に伴う変更が必要なコード量について説明する。
次に、単一サイクル方式とマルチサイクル方式について説明する。以下、サイクルとは、動作タイミングの基準となる、所謂一定周波数の基準クロック信号のサイクルである。
そして、このサイクルに連動してプログラムカウンタの更新が実施されるものとする。
次に、ROMに記録されているコード(オリジナルコード)の一部がマルチサイクル命令の場合において単一サイクル命令を挿入する場合の問題点を説明する。
PCストール信号のタイミング図は、一般的なマルチサイクル方式のマイクロコンピュータにおける動作を示したもの、アドレス一致信号のタイミング図は、単純な比較器を用いた場合の動作を示したものである。
図6は、本実施の形態のマイクロコンピュータの構成を表わす図である。同図に示されるマイクロコンピュータは、特に制限されないが、公知の半導体集積回路製造技術により、半導体基板(チップ)に形成される。
周辺装置6は、I/Oポート11を介して外部との間でデータを授受する。
図7に示すように、このフラッシュメモリ制御部2は、プログラムカウンタ12と、フラッシュ制御コード用ROM13と、挿入コードレジスタセットブロック17と、レジスタ選択信号生成回路18と、コード選択回路14と、命令実行部15と、インタフェースコントローラ16とを備える。
図8に示すように、命令実行部15は、フェッチ部35と、実行部36とを備える。フェッチ部35は、コード選択回路14から出力される実行コードをフェッチし、実行部35に出力する。実行部36は、フェッチされた実行コードを実行する。実行部36は、即値を示す演算結果PC、即値の選択を指示する演算結果PC選択信号、およびPCストール信号などのPC制御信号をプログラムカウンタ12へ出力する。PCストール信号は、マルチサイクル命令の実行時に「H」レベルに設定される。
図9に示すように、プログラムカウンタ12は、セレクタ24と、加算器25と、セレクタ26と、セレクタ27と、PC用レジスタ28とを備える。
図10に示すように、挿入コードレジスタセットブロック17は、挿入するコードおよびこのコードを挿入する場所(アドレス)を保持するコード挿入用レジスタセット29-i(i=0~n)と、論理回路OR1,OR2,OR3とを備える。
図12に示すように、コード選択回路14は、セレクタ33を含む。
次に、オリジナルコードおよび挿入コードが単一サイクル命令の場合の動作例を説明する。
第0サイクルでは、プログラムカウンタ12から出力される16ビットのアドレス(PC(Program Counter)値[15:0])は、「0x0102」である。また、アドレス「0x0102」の上位15ビットは、コード挿入用レジスタセット#0のアドレスレジスタ31に保持されているアドレス「0x0106」の上位15ビットと相違する。その結果、アドレス一致信号およびアドレス完全一致信号が「L」レベルとなり、コードレジスタ出力信号が「0x0000」となる。フラッシュ制御コード用ROM13から「0x0102」のアドレスのオリジナルコードである「R0102」が出力される。コード選択回路14は、アドレス完全一致信号が「L」レベルであるので、オリジナルコード「R0102」を命令実行部15のフェッチ部35に出力する。命令実行部15の実行部36は、1つ前のサイクルでフェッチ部35に出力されたオリジナルコード「R0100」を実行する。
(第1の実施形態の動作例2)
次に、オリジナルコードの一部がマルチサイクル命令であり、挿入コードが単一サイクル命令の場合の動作を説明する。
第0サイクルでは、プログラムカウンタ12から出力される16ビットのアドレス(PC値[15:0])は、「0x0102」である。また、アドレス「0x0102」の上位15ビットは、コード挿入用レジスタセット#0のアドレスレジスタ31に保持されているアドレス「0x0106」の上位15ビットと相違する。その結果、アドレス一致信号およびアドレス完全一致信号が「L」レベルとなり、コードレジスタ出力信号が「0x0000」となる。フラッシュ制御コード用ROM13から「0x0102」のアドレスのオリジナルコードである「R0102」が出力される。コード選択回路14は、アドレス完全一致信号が「L」レベルであるので、オリジナルコード「R0102」を命令実行部15のフェッチ部35に出力する。命令実行部15の実行部36は、1つ前のサイクルでフェッチ部35に出力されたオリジナルコード「R0100」を実行する。
(第1の実施形態の動作例3)
次に、オリジナルコードが単一サイクル命令であり、挿入コードがマルチサイクル命令の場合の動作を説明する。
第0サイクルでは、プログラムカウンタ12から出力される16ビットのアドレス(PC値[15:0])は、「0x0102」である。また、アドレス「0x0102」の上位15ビットは、コード挿入用レジスタセット#0のアドレスレジスタ31に保持されているアドレス「0x0106」の上位15ビットと相違する。その結果、アドレス一致信号、およびアドレス完全一致信号が「L」レベルとなり、コードレジスタ出力信号が「0x0000」となる。フラッシュ制御コード用ROM13から「0x0102」のアドレスのオリジナルコードである「R0102」が出力される。コード選択回路14は、アドレス完全一致信号が「L」レベルであるので、オリジナルコード「R0102」を命令実行部15のフェッチ部35に出力する。命令実行部15の実行部36は、1つ前のサイクルでフェッチ部35に出力されたオリジナルコード「R0100」を実行する。
[第2の実施形態]
本実施の形態では、複数のオリジナルコードのアドレスは、最下位から(k+1)ビット目以上のビットが有効である。ただし、kは1以上の自然数である。
図16は、第2の実施形態のフラッシュメモリ制御部102の構成を表わす図である。
図17は、プログラムカウンタ51の構成を表わす図である。
図18に示すように、挿入コードレジスタセットブロック52は、コード挿入用レジスタセット54-i(i=0~n)と、論理回路OR1,OR2,OR3,OR54とを備える。
図20(a)は、コード挿入用レジスタセット29-i(以下、コード挿入用レジスタセット#i)のアドレスレジスタ31に保持されている値の例を示す図である。この例では、コード挿入用レジスタセット#0のアドレスレジスタ31に「0x01061」の上位15ビット(第6ビット目~第20ビット目)が保持され、アドレスレジスタ56に「0x01061」の下位5ビット(第1ビット目~第5ビット目)が保持されている。また、コード挿入用レジスタセット#0のコードレジスタ32に挿入コード「Code Reg.0」が保持され、コード挿入用レジスタセット#0の挿入エンドレジスタ59に挿入エンド「0b0」が保持されている。
第0サイクルでは、プログラムカウンタ51から出力される20ビットのアドレス(PC値[19:0])は、「0x01020」である。また、アドレス「0x01020」の上位15ビットは、コード挿入用レジスタセット#0のアドレスレジスタ31に保持されているアドレス「0x01061」の上位15ビットと相違し、かつコード挿入用レジスタセット#1のアドレスレジスタ31に保持されているアドレス「0x01062」の上位15ビットとも相違するため、アドレス一致信号、およびアドレス完全一致信号が「L」レベルとなり、コードレジスタ出力信号が「0x0000」となり、挿入エンド信号が「0b0」となる。フラッシュ制御コード用ROM13から「0x01020」のアドレスのオリジナルコードである「R01020」が出力される。コード選択回路14は、アドレス完全一致信号が「L」レベルであるので、オリジナルコード「R01020」を命令実行部15のフェッチ部35に出力する。命令実行部15の実行部36は、1つ前のサイクルでフェッチ部35に出力されたオリジナルコード「R01000」を実行する。
以上のように、本実施の形態によれば、プログラムカウンタのアドレスの最下位から所定個数のビット以外のビットでオリジナルコードのアドレスを指定し、最下位から所定個数のビットを用いてコードの挿入を制御するので、2つのオリジナルコードの間に1個以上のコードの挿入が可能で、かつマルチサイクル命令の実行が可能となる。また、第1の実施の形態によれば、プログラムカウンタ12の出力は16ビットとして説明したが、本実施の形態では、複数個の命令コードを挿入する為、プログラムカウンタ51の出力は20ビットと仮定した。
(構成)
図21は、第3の実施形態のフラッシュメモリ制御部312の構成を表わす図である。
挿入前のオリジナルコードおよび挿入コードが単一サイクル命令の場合の動作例を説明する。
第0サイクルでは、プログラムカウンタ12から出力される16ビットのアドレス(PC値[15:0])は、「0x0102」である。アドレス「0x0102」の上位15ビットは、アドレスレジスタ131に保持されているアドレス「0x0106」の上位15ビットと相違する。その結果、アドレス一致信号、およびアドレス完全一致信号が「L」レベルとなり、コードレジスタ出力信号が「0x0000」となる。フラッシュ制御コード用ROM13から「0x0102」のアドレスのオリジナルコードである「R0102」が出力される。コード選択回路14は、アドレス完全一致信号が「L」レベルであるので、オリジナルコード「R0102」を命令実行部15のフェッチ部35に出力する。命令実行部15の実行部36は、1つ前のサイクルでフェッチ部35に出力されたオリジナルコード「R0100」を実行する。
以上のように、本実施の形態によれば、第1の実施形態と同様に、プログラムカウンタのアドレスの最下位ビット以外のビットでオリジナルコードのアドレスを指定し、最下位ビットを用いてコードの挿入を制御するので、2つのオリジナルコードの間に1個のコードの挿入が可能で、かつマルチサイクル命令の実行が可能となる。また、本実施の形態によれば、挿入コードの実行を オリジナルコードの後に実行するか(後挿入)かオリジナルコードの前に実行するか(前挿入)を選択することができる。
(構成)
図24は、第4の実施形態のフラッシュメモリ制御部103の構成を表わす図である。
図25は、第4の実施形態のプログラムカウンタ65の構成を表わす図である。
図26(a)は、コード挿入用レジスタセット54-i(以下、コード挿入用レジスタセット#i)のアドレスレジスタ31に保持されている値の例を示す図である。この例では、コード挿入用レジスタセット#0のアドレスレジスタ31に「0x01060」の上位15ビットが保持され、アドレスレジスタ56に「0x01060」の下位5ビットが保持されている。また、コード挿入用レジスタセット#0のコードレジスタ32に挿入コード「Code Reg.0」が保持されている。また、コード挿入用レジスタセット#0の挿入エンドレジスタ59に挿入エンド「0b0」が保持されている。コード挿入用レジスタセット#1のアドレスレジスタ31に「0x01061」の上位15ビットが保持され、アドレスレジスタ56に「0x01061」の下位5ビットが保持されている。また、コード挿入用レジスタセット#01コードレジスタ32に挿入コード「Code Reg.1」が保持されている。また、コード挿入用レジスタセット#1の挿入エンドレジスタ59に挿入エンド「0b1」が保持されている。また、フラッシュ制御コード用ROM13のアドレス「0x・・・・」には、オリジナルコード「R・・・・」が保持されているものとする。
第0サイクルでは、プログラムカウンタ65から出力される20ビットのアドレス(PC値[19:0])は、「0x01020」である。アドレス「0x01020」の上位15ビットは、コード挿入用レジスタセット#0のアドレスレジスタ31に保持されているアドレス「0x01060」の上位15ビットと相違し、かつコード挿入用レジスタセット#1のアドレスレジスタ31に保持されているアドレス「0x01061」の上位15ビットと相違する。その結果、アドレス一致信号、およびアドレス完全一致信号が「L」レベルとなり、コードレジスタ出力信号が「0x0000」となり、挿入エンド信号が「0b0」となる。フラッシュ制御コード用ROM13から「0x01020」のアドレスのオリジナルコードである「R01020」が出力される。コード選択回路14は、アドレス完全一致信号が「L」レベルであるので、オリジナルコード「R01020」を命令実行部15のフェッチ部35に出力する。命令実行部15の実行部36は、1つ前のサイクルでフェッチ部35に出力されたオリジナルコード「R01000」を実行する。
以上のように、本実施の形態によれば、第2の実施形態と同様に、プログラムカウンタのアドレスの最下位から所定個数のビット以外のビットでオリジナルコードのアドレスを指定し、最下位から所定個数のビットを用いてコードの挿入を制御するので、2つのオリジナルコードの間に1個以上のコードの挿入が可能で、かつマルチサイクル命令の実行が可能となる。また、本実施の形態によれば、プログラムカウンタからのアドレスがアドレスレジスタの値と一致した場合、挿入コードの実行をオリジナルコードの前に実行していた第2の実施の形態に対し、挿入コードの実行をオリジナルコードの後に実行する。
(構成)
図27は、第5の実施形態のフラッシュメモリ制御部395の構成を表わす図である。
(構成)
図29は、第6の実施形態のフラッシュメモリ制御部423の構成を表わす図である。
図30に示すように、プログラムカウンタ72は、セレクタ73と、加算器25と、論理回路AND72と、セレクタ26と、セレクタ27と、PC用レジスタ28とを備える。
図32(a)は、コード挿入用レジスタセット71-i(以下、コード挿入用レジスタセット#i)のアドレスレジスタ31に保持されている値の例を示す図である。この例では、コード挿入用レジスタセット#0のアドレスレジスタ31に「0x00106」の下位16ビットが保持されている。また、コード挿入用レジスタセット#0のコードレジスタ32に挿入コード「Code Reg.0」が保持されている。また、フラッシュ制御コード用ROM13のアドレス「0x・・・・」には、オリジナルコード「R・・・・」が保持されているものとする。
第0サイクルでは、プログラムカウンタ72から出力される17ビットのアドレス(PC値[16:0])は、「0x00102」である。また、アドレス「0x00102」の下位16ビットは、コード挿入用レジスタセット#0のアドレスレジスタ31に保持されているアドレス「0x00106」の下位16ビットと相違する。その結果、アドレス一致信号、およびアドレス完全一致信号が「L」レベルとなり、コードレジスタ出力信号が「0x00000」となる。フラッシュ制御コード用ROM13から「0x00102」のアドレスのオリジナルコードである「R00102」が出力される。コード選択回路14は、アドレス完全一致信号が「L」レベルであるので、オリジナルコード「R00102」を命令実行部15のフェッチ部35に出力する。命令実行部15の実行部36は、1つ前のサイクルでフェッチ部35に出力されたオリジナルコード「R00100」を実行する。
以上のように、本実施の形態によれば、プログラムカウンタのアドレスの最上位ビット以外のビットでオリジナルコードのアドレスを指定し、最上位ビットを用いてコードの挿入を制御するので、2つのオリジナルコードの間に1個のコードの挿入が可能で、かつマルチサイクル命令の実行が可能となる。
本実施の形態では、複数のオリジナルコードのアドレスは、最下位からmビット目以上のビットが有効であるとする。
図33のフラッシュメモリ制御部623が、図16の第2の実施形態のフラッシュメモリ制御部102と相違する点は、挿入コードレジスタセットブロック624とプロラムカウンタ74である。
図34は、プログラムカウンタ74の構成を表わす図である。
図36(a)は、コード挿入用レジスタセット78-i(以下、コード挿入用レジスタセット#i)のアドレスレジスタ31に保持されている値の例を示す図である。この例では、コード挿入用レジスタセット#0のアドレスレジスタ31に「0x10106」の下位16ビットが保持され、アドレスレジスタ156に「0x10106」の上位4ビットが保持されている。また、コード挿入用レジスタセット#0のコードレジスタ32に挿入コード「Code Reg.0」が保持されている。また、コード挿入用レジスタセット#0の挿入エンドレジスタ59に挿入エンド「0b0」が保持されている。コード挿入用レジスタセット#1のアドレスレジスタ31に「0x20106」の下位16ビットが保持され、アドレスレジスタ156に「0x20106」の上位4ビットが保持されている。また、コード挿入用レジスタセット#01のコードレジスタ32に挿入コード「Code Reg.1」が保持されている。また、コード挿入用レジスタセット#1の挿入エンドレジスタ59に挿入エンド「0b1」が保持されている。また、フラッシュ制御コード用ROM13のアドレス「0x・・・・」には、オリジナルコード「R・・・・」が保持されているものとする。
第0サイクルでは、プログラムカウンタ74から出力される20ビットのアドレス(PC値[19:0])は、「0x00102」である。アドレス「0x00102」の上位15ビットは、コード挿入用レジスタセット#0のアドレスレジスタ31に保持されているアドレス「0x10106」の下位16ビットと相違し、かつコード挿入用レジスタセット#1のアドレスレジスタ31に保持されているアドレス「0x20106」の下位16ビットと相違する。その結果、アドレス一致信号、およびアドレス完全一致信号が「L」レベルとなり、コードレジスタ出力信号が「0x0000」となり、挿入エンド信号が「0b0」となる。フラッシュ制御コード用ROM13から「0x00102」のアドレスのオリジナルコードである「R00102」が出力される。コード選択回路14は、アドレス完全一致信号が「L」レベルであるので、オリジナルコード「R00102」を命令実行部15のフェッチ部35に出力する。命令実行部15の実行部36は、1つ前のサイクルでフェッチ部35に出力されたオリジナルコード「R00100」を実行する。
以上のように、本実施の形態によれば、プログラムカウンタのアドレスの最上位から所定個数のビット以外のビットでオリジナルコードのアドレスを指定し、最上位から所定個数のビットを用いてコードの挿入を制御するので、2つのオリジナルコードの間に1個以上のコードの挿入が可能で、かつマルチサイクル命令の実行が可能となる。
本実施の形態では、複数のオリジナルコードのアドレスは、最下位から2ビット目以上、かつ最上位ビットを除くビットが有効である。
図37のフラッシュメモリ制御部742が、図7の第1の実施形態のフラッシュメモリ制御部2と相違する点は、挿入コードレジスタセットブロック743とプログラムカウンタ91である。
図38のプログラムカウンタ91が、図30の第6の実施形態のプログラムカウンタ72と相違する点は、セレクタ92と論理回路AND92である。
図39に示すように、挿入コードレジスタセットブロック743は、挿入するコードおよび挿入するアドレスを保持するコード挿入用レジスタセット88-i(i=0~n)と、論理回路OR88,OR89とを備える。
図41(a)は、コード挿入用レジスタセット88-i(以下、コード挿入用レジスタセット#i)のアドレスレジスタ31に保持されている値の例を示す図である。この例では、コード挿入用レジスタセット#0のアドレスレジスタ31に「0x00106」の下位16ビットが保持されている。また、コード挿入用レジスタセット#0のコードレジスタ32に挿入コード「Code Reg.0」が保持されている。また、フラッシュ制御コード用ROM13のアドレス「0x・・・・」には、オリジナルコード「R・・・・」が保持されているものとする。
第0サイクルでは、プログラムカウンタ91から出力される17ビットのアドレス(PC値[16:0]は、「0x00102」である。また、アドレス「0x00102」の下位16ビットは、コード挿入用レジスタセット#0のアドレスレジスタ31に保持されているアドレス「0x00106」の下位16ビットと相違する。その結果、アドレス完全一致信号が「L」レベルとなり、コードレジスタ出力信号が「0x00000」となる。フラッシュ制御コード用ROM13から「0x00102」のアドレスのオリジナルコードである「R00102」が出力される。コード選択回路14は、アドレス完全一致信号が「L」レベルであるので、オリジナルコード「R00102」を命令実行部15のフェッチ部35に出力する。命令実行部15の実行部36は、1つ前のサイクルでフェッチ部35に出力されたオリジナルコード「R00100」を実行する。
第3サイクルでは、前サイクルのアドレス完全一致信号が「H」レベルのため、プログラムカウンタ91のセレクタ92が「0x10000」を出力する。これにより、プログラムカウンタ91の出力アドレスは、「0x10000」だけ加算された「0x10106」となる。アドレス「0x10106」の下位16ビットは、コード挿入用レジスタセット#0のアドレスレジスタ31に保持されているアドレス「0x00106」の下位16ビットと一致するが、アドレス「0x10106」の最上位ビット(17ビット目:アドレス[16])は「1」である。その結果、アドレス完全一致信号が「L」レベルとなる(アドレス完全一致信号0が「L」レベルとなるため)。さらに、コードレジスタ出力信号が「0x00000」となる。フラッシュ制御コード用ROM13からプログラムカウンタ91の出力アドレス「0x10106」の最上位ビット(17ビット目)を「0」にした「0x00106」のアドレスのオリジナルコードである「R00106」が出力される。コード選択回路14は、アドレス完全一致信号が「L」レベルであるので、オリジナルコード「R00106」を命令実行部15のフェッチ部35に出力する。命令実行部15の実行部36は、1つ前のサイクルでフェッチ部35に出力された挿入コード「Code Reg.0」を実行する。
以上のように、本実施の形態によれば、第6の実施形態と同様に、プログラムカウンタのアドレスの最上位ビット以外のビットでオリジナルコードのアドレスを指定し、最上位ビットを用いてコードの挿入を制御するので、2つのオリジナルコードの間に1個以上のコードの挿入が可能で、かつマルチサイクル命令の実行が可能となる。また、本実施の形態によれば、プログラムカウンタからのアドレスがアドレスレジスタの値と一致した場合、挿入コードの実行をオリジナルコードの後に実行していた第6の実施の形態に対し、挿入コードの実行をオリジナルコードの前に実行する。
本実施の形態では、複数のオリジナルコードのアドレスは、最下位からmビット目以上のビットが有効であるとする。
図42のフラッシュメモリ制御部388が、図16の第2の実施形態のフラッシュメモリ制御部102と相違する点は、挿入コードレジスタセットブロック389と、プロラムカウンタ94である。
図43は、プログラムカウンタ94の構成を表わす図である。
図44に示すように、挿入コードレジスタセットブロック389は、挿入するコードおよび挿入するアドレスを保持するコード挿入用レジスタセット86-i(i=0~n)と、論理回路OR88,OR89とを備える。
図46(a)は、コード挿入用レジスタセット86-i(以下、コード挿入用レジスタセット#i)のアドレスレジスタ31に保持されている値の例を示す図である。この例では、コード挿入用レジスタセット#0のアドレスレジスタ31に「0x00106」の下位16ビットが保持され、アドレスレジスタ156に「0x00106」の上位4ビット(17ビット目~20ビット目)が保持されている。また、コード挿入用レジスタセット#0のコードレジスタ32に挿入コード「Code Reg.0」が保持されている。コード挿入用レジスタセット#1のアドレスレジスタ31に「0x10106」の下位16ビットが保持され、アドレスレジスタ156に「0x10106」の上位4ビット(17ビット目~20ビット目)が保持されている。また、コード挿入用レジスタセット#1のコードレジスタ32に挿入コード「Code Reg.1」が保持されている。また、フラッシュ制御コード用ROM13のアドレス「0x・・・・」には、オリジナルコード「R・・・・」が保持されているものとする。
第0サイクルでは、プログラムカウンタ94から出力される20ビットのアドレス(PC値[19:0])は、「0x00102」である。アドレス「0x00102」の下位16ビットは、コード挿入用レジスタセット#0のアドレスレジスタ31に保持されているアドレス「0x00106」の下位16ビットと相違する。その結果、アドレス完全一致信号が「L」レベルとなり、コードレジスタ出力信号が「0x00000」となる。フラッシュ制御コード用ROM13から「0x00102」のアドレスのオリジナルコードである「R00102」が出力される。コード選択回路14は、アドレス完全一致信号が「L」レベルであるので、オリジナルコード「R00102」を命令実行部15のフェッチ部35に出力する。命令実行部15の実行部36は、1つ前のサイクルでフェッチ部35に出力されたオリジナルコード「R00100」を実行する。
以上のように、本実施の形態によれば、第7の実施形態と同様に、プログラムカウンタのアドレスの最上位から所定個数のビット以外のビットでオリジナルコードのアドレスを指定し、最上位から所定個数のビットを用いてコードの挿入を制御するので、2つのオリジナルコードの間に1個以上のコードの挿入が可能で、かつマルチサイクル命令の実行が可能となる。また、本実施の形態によれば、プログラムカウンタからのアドレスがアドレスレジスタの値と一致した場合、挿入コードの実行をオリジナルコードの後に実行していた第7の実施の形態に対し、挿入コードの実行をオリジナルコードの前に実行する。
本発明は、上記の実施形態に固定されるものではない。たとえば、コードレジスタ値を特定の値に固定することとしてもよい。これにより、挿入可能なコード種類は限定されるが、レジスタのサイズを縮小可能である。
Claims (17)
- 複数のオリジナルコードを記憶したROMと、
第1の値または第2の値を加算することによって、アドレスを更新するプログラムカウンタと、
少なくとも1つの挿入コードと、前記挿入コードのアドレスを保持したレジスタと、
前記プログラムカウンタのアドレスに応じて、前記レジスタ内の前記プログラムカウンタで指定されるアドレスに対応する挿入コードか、前記ROM内の前記プログラムカウンタで指定されるアドレスのオリジナルコードのいずれかを選択する選択回路と、
前記選択回路で選択されたコードを実行する命令実行部とを備え、
前記複数のオリジナルコードおよび前記挿入コードのうちの少なくとも1つが、マルチサイクル命令であり、
前記プログラムカウンタは、マルチサイクル命令の実行時には、アドレスの更新を停止する、マイクロコンピュータ。 - 前記ROM内の複数のオリジナルコードのアドレスは、最下位から2ビット目以上のビットが有効であり、
前記レジスタは、
前記保持している挿入コードのアドレスの最下位ビットを除くビットと前記プログラムカウンタのアドレスの最下位ビットを除くビットとが一致したときに、第1の信号を出力し、
前記第1の信号を出力し、かつ前記プログラムカウンタのアドレスの最下位ビットが「1」のときに、第2の信号を出力するとともに、前記保持している挿入コードを出力し、
前記プログラムカウンタは、前記第1の信号を受けたときに、最下位ビットに「1」を加算し、前記第1の信号を受けないときに、最下位から2番目のビットに「1」を加算し、
前記選択回路は、前記第2の信号を受けたときに、前記挿入コードを選択し、前記第2の信号を受けなかったときに、前記オリジナルコードを選択する、請求項1に記載のマイクロコンピュータ。 - 前記ROM内の複数のオリジナルコードのアドレスは、最下位から2ビット目以上のビットが有効であり、
前記レジスタは、
前記保持している挿入コードのアドレスの最下位ビットを除くビットと前記プログラムカウンタのアドレスの最下位ビットを除くビットとが一致したときに、第1の信号を出力し、
前記第1の信号を出力し、かつ前記保持している挿入コードのアドレスの最下位ビットと前記プログラムカウンタのアドレスの最下位ビットが一致する
ときに、第2の信号を出力するとともに、前記保持している挿入コードを出力し、
前記プログラムカウンタは、前記第1の信号を受けたときに、最下位ビットに「1」を加算し、前記第1の信号を受けないときに、最下位から2番目のビットに「1」を加算し、
前記選択回路は、前記第2の信号を受けたときに、前記挿入コードを選択し、前記第2の信号を受けなかったときに、前記オリジナルコートを選択する、請求項1に記載のマイクロコンピュータ。 - 前記ROM内の複数のオリジナルコードのアドレスは、最下位からnビット目以上のビットが有効であり、
前記レジスタは、
前記保持している挿入コードのアドレスの最上位ビットを除くビットと前記プログラムカウンタのアドレスの最上位ビットを除くビットとが一致したときに、第1の信号を出力し、
前記第1の信号を出力し、かつ前記プログラムカウンタのアドレスの最上位ビットが「1」のときに、第2の信号を出力するとともに、前記保持している挿入コードを出力し、
前記プログラムカウンタは、前記第1の信号を受けたときに、最上位ビットに「1」を加算し、前記第1の信号を受けないときに、最下位からnビット目に「1」を加算し、
前記選択回路は、前記第2の信号を受けたときに、前記挿入コードを選択し、前記第2の信号を受けなかったときに、前記オリジナルコートを選択する、請求項1に記載のマイクロコンピュータ。 - 前記ROM内の複数のオリジナルコードのアドレスは、最下位からnビット目以上かつ最上位ビットを除くビットが有効であり、
前記レジスタは、
前記保持している挿入コードのアドレスの最上位ビットを除くビットと前記プログラムカウンタのアドレスの最上位ビットを除くビットとが一致し、かつ前記プログラムカウンタのアドレスの最上位ビットが「1」のときに、第1の信号を出力するとともに、前記保持している挿入コードを出力し、
前記プログラムカウンタは、前記第1の信号を受けたときに、最上位ビットに「1」を加算し、前記第1の信号を受けないときに、最下位からnビット目に「1」を加算し、かつ最上位ビットを「0」にし、
前記選択回路は、前記第1の信号を受けたときに、前記挿入コードを選択し、前記第1の信号を受けなかったときに、前記オリジナルコードを選択する、請求項1に記載のマイクロコンピュータ。 - 前記ROM内の複数のオリジナルコードのアドレスは、最下位から(n+1)ビット目以上のビットが有効であり、
前記レジスタは、
最大で2n-1個の挿入コードと、前記挿入コードのアドレスを保持し、
前記保持している挿入コードのアドレスの最下位からn個のビットを除くビットと前記プログラムカウンタのアドレスの最下位からn個のビットを除くビットとが一致したときに、第1の信号を出力し、
前記第1の信号を出力し、かつ前記保持している挿入コードのアドレスの最下位からn個のビットと前記プログラムカウンタのアドレスの最下位からn個のビットとが一致したときに、第2の信号を出力するとともに、前記プログラムカウンタのアドレスに対応する前記保持している挿入コードを出力し、
前記プログラムカウンタは、前記第1の信号を受けたときに、最下位ビットに「1」を加算し、前記第1の信号を受けなかったときに、最下位から(n+1)番目のビットに「1」を加算し、
前記選択回路は、前記第2の信号を受けたときに、前記挿入コードを選択し、前記第2の信号を受けなかったときに、前記オリジナルコードを選択する、請求項1に記載のマイクロコンピュータ。 - 前記レジスタは、
複数の挿入コードを連続して挿入するときに最後の挿入コードを出力する場合には、前記第2の信号を出力するとともに、同時に挿入エンドを示す挿入エンド信号を出力する、請求項6に記載のマイクロコンピュータ。 - 前記プログラムカウンタは、前記挿入エンド信号を受けたときには、前記第1の信号を受けたときでも、最下位から(n+1)番目のビットに「1」を加算し、最下位からn個のビットを「0」にする、請求項7に記載のマイクロコンピュータ。
- 前記プログラムカウンタは、前記挿入エンド信号を受けたときには、最下位からn個のビットを「1」にする、請求項7に記載のマイクロコンピュータ。
- 前記ROM内の複数のオリジナルコードのアドレスは、最下位からmビット目以上のビットが有効であり、
前記レジスタは、
最大で2n-1個の挿入コードと、前記挿入コードのアドレスを保持し、
前記保持している挿入コードのアドレスの最上位からn個のビットを除くビットと前記プログラムカウンタのアドレスの最上位からn個のビットを除くビットとが一致したときに、第1の信号を出力し、
前記第1の信号を出力し、かつ前記保持している挿入コードのアドレスの最上位からn個のビットと前記プログラムカウンタのアドレスの最上位からn個のビットとが一致したときに、第2の信号を出力するとともに、前記プログラムカウンタのアドレスに対応する前記保持している挿入コードを出力し、
前記プログラムカウンタは、前記第1の信号を受けたときに、最上位からn番目のビットに「1」を加算し、前記第1の信号を受けなかったときに、最下位からm番目のビットに「1」を加算し、
前記選択回路は、前記第2の信号を受けたときに、前記挿入コードを選択し、前記第2の信号を受けなかったときに、前記オリジナルコードを選択する、請求項1に記載のマイクロコンピュータ。 - 前記レジスタは、
複数の挿入コードを連続して挿入するときに最後の挿入コードを出力する場合には、前記第2の信号を出力するとともに、同時に挿入エンドを示す挿入エンド信号を出力する、請求項10に記載のマイクロコンピュータ。 - 前記プログラムカウンタは、前記挿入エンド信号を受けたときには、前記第1の信号を受けたときでも、最下位からm番目のビットに「1」を加算し、かつ最上位からn個のビットを「0」にする、請求項11に記載のマイクロコンピュータ。
- 前記ROM内の複数のオリジナルコードのアドレスは、最下位からmビット目以上のビットが有効であり、
前記レジスタは、
最大で2n-1個の挿入コードと、前記挿入コードのアドレスを保持し、
前記保持している挿入コードのアドレスの最上位からn個のビットを除くビットと前記プログラムカウンタのアドレスの最上位からn個のビットを除くビットとが一致し、かつ前記保持している挿入コードのアドレスの最上位からn個のビットと前記プログラムカウンタのアドレスの最上位からn個のビットとが一致したときに、第1の信号を出力するとともに、前記プログラムカウンタのアドレスに対応する前記保持している挿入コードを出力し、
前記プログラムカウンタは、前記第1の信号を受けたときに、最上位からn番目のビットに「1」を加算し、前記第1の信号を受けなかったときに、最下位からm番目のビットに「1」を加算し、かつ最上位からn個のビットを「0」にし、
前記選択回路は、前記第1の信号を受けたときに、前記挿入コードを選択し、前記第1の信号を受けなかったときに、前記オリジナルコードを選択する、請求項1に記載のマイクロコンピュータ。 - 前記レジスタは、ステータスビットを保持し、
前記選択回路は、前記ステータスビットの値が第1の値のときに、前記プログラムカウンタのアドレスに係わらず、前記オリジナルコードを選択する、請求項1に記載のマイクロコンピュータ。 - 半導体基板に電気的に消去および書込みが可能な不揮発性メモリと、前記不揮発性メモリをアクセス可能な中央処理装置と、前記中央処理装置からのアクセスに従い所定のシーケンスで前記不揮発性メモリの制御を行う不揮発性メモリ制御回路を備え、
前記不揮発性メモリ制御回路は、
所定のシーケンスで実行される複数の命令コードがM個の有効ビットで指定されるアドレスに格納されたROMと、
前記ROMに格納された命令コードを選択するアドレス更新するK(>M)ビット出力のプログラムカウンタと、
前記所定のシーケンスで実行される複数の命令コードの間に挿入する挿入コードと前記挿入コードの挿入先を示すアドレスを保持したレジスタ回路と、
前記プログラムカウンタからのアドレスと前記レジスタ回路に保持された挿入コードの挿入先を示すアドレスとの一致検出結果に応じて、前記ROMに格納された命令コードと前記レジスタ回路に保持された挿入コードのいずれかを選択するコード選択回路と、
前記選択回路で選択されたコードを実行する命令実行部とを備え、
前記プログラムカウンタは、コード挿入時に前記M個の有効ビット中の最下位ビットへの1ビット加算を前記M個の有効ビット外の出力ビットへの1ビット加算に切り替える加算値選択回路を備え、
前記命令実行部は、少なくとも1つのマルチサイクル命令を実行可能であり、前記マルチサイクル命令の実行時に前記プログラムカウンタへアドレスの更新停止を指示する、マイクロコンピュータ。 - 前記挿入コードの挿入先を示すアドレスを保持したレジスタは、前記プログラムカウンタの出力と同じビット数(Kビット)のビットデータを保持する、請求項15記載のマイクロコンピュータ。
- 半導体基板に電気的に消去および書込みが可能な不揮発性メモリと、所定のシーケンスで前記不揮発性メモリの制御を行う不揮発性メモリ制御回路を備え、
前記不揮発性メモリ制御回路は、
所定のシーケンスで実行される複数の命令コードがM個の有効ビットで指定されるアドレスに格納されたROMと、
前記ROMに格納された命令コードを選択するアドレス更新するK(>M)ビット出力のプログラムカウンタと、
前記所定のシーケンスで実行される複数の命令コードの間に挿入する挿入コードと前記挿入コードの挿入先を示すアドレスを保持したレジスタ回路と、
前記プログラムカウンタからのアドレスと前記レジスタ回路に保持された挿入コードの挿入先を示すアドレスとの一致検出結果に応じて、前記ROMに格納された命令コードと前記レジスタ回路に保持された挿入コードのいずれかを選択するコード選択回路と、
前記選択回路で選択されたコードを実行する命令実行部とを備え、
前記プログラムカウンタは、コード挿入時に前記M個の有効ビット中の最下位ビットへの1ビット加算を前記M個の有効ビットと異なる出力ビットへの1ビット加算に切り替える加算値選択回路を備え、
前記命令実行部は、少なくとも1つのマルチサイクル命令を実行可能であり、前記マルチサイクル命令の実行時に前記プログラムカウンタへアドレスの更新停止を指示する、不揮発性半導体装置。
Priority Applications (4)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201280071070.5A CN104145247A (zh) | 2012-03-02 | 2012-03-02 | 微型计算机及非易失性半导体装置 |
US14/382,159 US20150301935A1 (en) | 2012-03-02 | 2012-03-02 | Microcomputer and nonvolatile semiconductor device |
PCT/JP2012/055341 WO2013128624A1 (ja) | 2012-03-02 | 2012-03-02 | マイクロコンピュータおよび不揮発性半導体装置 |
JP2014501922A JP5933685B2 (ja) | 2012-03-02 | 2012-03-02 | マイクロコンピュータおよび不揮発性半導体装置 |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/JP2012/055341 WO2013128624A1 (ja) | 2012-03-02 | 2012-03-02 | マイクロコンピュータおよび不揮発性半導体装置 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2013128624A1 true WO2013128624A1 (ja) | 2013-09-06 |
Family
ID=49081868
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/JP2012/055341 WO2013128624A1 (ja) | 2012-03-02 | 2012-03-02 | マイクロコンピュータおよび不揮発性半導体装置 |
Country Status (4)
Country | Link |
---|---|
US (1) | US20150301935A1 (ja) |
JP (1) | JP5933685B2 (ja) |
CN (1) | CN104145247A (ja) |
WO (1) | WO2013128624A1 (ja) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10990384B2 (en) * | 2018-09-27 | 2021-04-27 | Intel Corporation | System, apparatus and method for dynamic update to code stored in a read-only memory (ROM) |
KR102577268B1 (ko) * | 2018-10-15 | 2023-09-12 | 에스케이하이닉스 주식회사 | 메모리 장치 및 이의 동작 방법 |
KR20210012818A (ko) * | 2019-07-26 | 2021-02-03 | 에스케이하이닉스 주식회사 | 메모리 장치 및 그 동작 방법 |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2000259406A (ja) * | 1999-03-04 | 2000-09-22 | Nec Corp | マイクロプロセッサ及び命令romの誤り訂正方法 |
JP2004046318A (ja) * | 2002-07-09 | 2004-02-12 | Fujitsu Ltd | 計算機、集積回路装置、及び計算機における命令実行方法 |
JP2005134987A (ja) * | 2003-10-28 | 2005-05-26 | Seiko Epson Corp | パイプライン演算処理装置 |
JP2011154505A (ja) * | 2010-01-27 | 2011-08-11 | Seiko Epson Corp | 演算処理装置及び演算実行方法 |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
DE69534396T2 (de) * | 1994-11-24 | 2006-03-16 | Sanyo Electric Co., Ltd., Moriguchi | Ein-Chip-Mikrorechner mit eingebautem nichtflüchtigem Speicher |
US6631454B1 (en) * | 1996-11-13 | 2003-10-07 | Intel Corporation | Processor and data cache with data storage unit and tag hit/miss logic operated at a first and second clock frequencies |
JP2001346170A (ja) * | 2000-05-31 | 2001-12-14 | Nec Corp | データ挿入強度調整方法及びデータ挿入回路 |
WO2006085595A1 (ja) * | 2005-02-10 | 2006-08-17 | Matsushita Electric Industrial Co., Ltd. | プログラム変換装置及びプログラム実行装置 |
JP2006293663A (ja) * | 2005-04-11 | 2006-10-26 | Sanyo Electric Co Ltd | メモリアドレス生成装置及びそれを有したプロセッサ、メモリアドレス生成方法 |
-
2012
- 2012-03-02 WO PCT/JP2012/055341 patent/WO2013128624A1/ja active Application Filing
- 2012-03-02 CN CN201280071070.5A patent/CN104145247A/zh active Pending
- 2012-03-02 JP JP2014501922A patent/JP5933685B2/ja not_active Expired - Fee Related
- 2012-03-02 US US14/382,159 patent/US20150301935A1/en not_active Abandoned
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2000259406A (ja) * | 1999-03-04 | 2000-09-22 | Nec Corp | マイクロプロセッサ及び命令romの誤り訂正方法 |
JP2004046318A (ja) * | 2002-07-09 | 2004-02-12 | Fujitsu Ltd | 計算機、集積回路装置、及び計算機における命令実行方法 |
JP2005134987A (ja) * | 2003-10-28 | 2005-05-26 | Seiko Epson Corp | パイプライン演算処理装置 |
JP2011154505A (ja) * | 2010-01-27 | 2011-08-11 | Seiko Epson Corp | 演算処理装置及び演算実行方法 |
Also Published As
Publication number | Publication date |
---|---|
JP5933685B2 (ja) | 2016-06-15 |
JPWO2013128624A1 (ja) | 2015-07-30 |
CN104145247A (zh) | 2014-11-12 |
US20150301935A1 (en) | 2015-10-22 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
KR102451950B1 (ko) | 융합된 단일 사이클 증가-비교-점프를 수행하기 위한 명령어 및 로직 | |
US6865667B2 (en) | Data processing system having redirecting circuitry and method therefor | |
US7480783B2 (en) | Systems for loading unaligned words and methods of operating the same | |
US20090271593A1 (en) | Patching device for patching rom code, method for patching rom code, and electronic device utilizing the same | |
TW201730751A (zh) | 切換影堆疊指標的硬體設備以及方法 | |
US7644223B2 (en) | Circuit and method for patching for program ROM | |
US6891765B2 (en) | Circuit and/or method for implementing a patch mechanism for embedded program ROM | |
JP5933685B2 (ja) | マイクロコンピュータおよび不揮発性半導体装置 | |
JP6073392B2 (ja) | 命令としてデータ値を評価するシステムおよび方法 | |
US10069512B2 (en) | Systems, methods, and apparatuses for decompression using hardware and software | |
US10437598B2 (en) | Method and apparatus for selecting among a plurality of instruction sets to a microprocessor | |
US7308553B2 (en) | Processor device capable of cross-boundary alignment of plural register data and the method thereof | |
US7290120B2 (en) | Microprocessor having a power-saving fetch and decoding unit for fetching and decoding compressed program instructions and having a program instruction sequencer | |
US7895414B2 (en) | Instruction length determination device and method using concatenate bits to determine an instruction length in a multi-mode processor | |
US9619228B2 (en) | Data processor with a load instruction that branches based on a control register value and a bit or bits read from memory | |
US6363469B1 (en) | Address generation apparatus | |
US8255672B2 (en) | Single instruction decode circuit for decoding instruction from memory and instructions from an instruction generation circuit | |
US7308555B2 (en) | Processor-based structure and method for loading unaligned data | |
JP3588951B2 (ja) | マイクロコンピュータのプログラム変更装置 | |
JP2004302827A (ja) | マイクロコントローラ | |
US20060015704A1 (en) | Operation apparatus and instruction code executing method | |
JP2004288203A (ja) | プロセッサコア及びこれを用いたプロセッサ | |
JPH0736694A (ja) | 命令フェッチ方式 | |
JPH08161170A (ja) | マイクロプロセッサとその制御方法 |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 12869828 Country of ref document: EP Kind code of ref document: A1 |
|
ENP | Entry into the national phase |
Ref document number: 2014501922 Country of ref document: JP Kind code of ref document: A |
|
WWE | Wipo information: entry into national phase |
Ref document number: 14382159 Country of ref document: US |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 12869828 Country of ref document: EP Kind code of ref document: A1 |