Claims
- 1. A data processor, comprising:
an instruction execution unit which fetches instructions, decodes thus fetched instructions, and executes thus fetched and decoded instructions; and a bus controller for controlling access to an external bus in response to a command from said instruction execution unit, said bus controller having a plurality of instruction buffers, a flag specific to each of instruction buffers, and a buffer controller circuit; said buffer controller circuit being served for allocating to each of said instruction buffers one of specific values that plural lower bits of an instruction address may take, prefetching instructions to the instruction buffers each corresponding to a respective addresses designated to by said plural lower bits, from the address following a predetermined fetch address, setting the appropriate flag to valid in correspondence with the instruction prefetch, and setting the appropriate flag to invalid in response to the output of instructions prefetched.
- 2. A data processor according to claim 1, wherein:
said buffer controller circuit outputs to said instruction execution unit the instruction in the instruction buffer under the condition that the flag of the corresponding instruction buffer allocated in correspondence with the value of said plural lower bits of the instruction address of the instruction to be fetched by said instruction execution unit is set to valid.
- 3. A data processor according to claim 2, wherein:
said buffer controller circuit enables the instruction prefetch to be performed to the corresponding instruction buffer under the condition that said flag is set to invalid.
- 4. A data processor according to claim 3, wherein:
said buffer controller circuit initializes all of said flags to set to invalid, in response to the instruction by said instruction execution unit of change of the order of execution of sequential instruction addresses.
- 5. A data processor according to any one of claim 4, wherein:
said instruction buffer contains bits as a unit number of instruction fetched by said instruction execution unit.
- 6. A data processor, comprising:
an instruction execution unit which fetches instructions, decodes thus fetched instructions, and executes thus fetched and decoded instructions; and a bus controller which controls access to an external bus in response to the direction by said instruction execution unit, said bus controller having a plurality of instruction buffers each holding bits of an instruction fetched by said instruction execution unit, a flag for each of instruction buffers, and a buffer controller circuit; said buffer controller circuit being served for allocating to each of said instruction buffers one of specific values that plural lower bits of an instruction address may take; prefetching, when an instruction is fetched which has a start address indicated by said plural lower bits, instructions to the instruction buffers corresponding to the address order in the range from the address that follows to the starting instruction address of fetched instruction designated to by said plural lower bits to the final address of instructions indicated by said plural lower bits; prefetching, when an instruction fetch is performed by a branch instruction for an instruction at the branch destination address, instruction to the instruction buffers corresponding to the address order to the addresses in the range from the address following the address of the fetched instruction to the final address indicated by said plural lower bits; setting the appropriate flag to valid in response to the instruction prefetch; outputting to said instruction execution unit the instruction in the instruction buffer under the condition that the flag of the corresponding instruction buffer allocated in correspondence with the value of said plural lower bits of the instruction address of the instruction to be fetched by said instruction execution unit is set to valid.
- 7. A data processor according to claim 6, wherein:
said buffer controller circuit sets to invalid the flag corresponding to the instruction prefetched into an instruction buffer in response to the output thereof, enables the instruction to be prefetched to corresponding instruction buffers under the condition that said flag is set to invalid, and initializes all of said invalid flags in response to an instruction fetch command according to a branch instruction.
- 8. A data processing system, comprising:
a data processor, formed on a single semiconductor chip, including:
an instruction execution unit which fetches instructions, decodes thus fetched instructions, and executes thus fetched and decoded instructions; and a bus controller having a plurality of instruction buffers, a flag for each of instruction buffers, and a buffer controller circuit, for controlling access to an external bus in response to a command from said instruction execution unit; and a memory for storing operation programs for said data processor, said memory being a target of external bus access by said bus controller; said buffer controller circuit being served for allocating to each of said instruction buffers one of specific values that plural lower bits of an instruction address may take; prefetching, when an instruction is fetched which has a start address indicated by said plural lower bits, instructions to the instruction buffers corresponding to the address order in the range from the address that follows to the starting instruction address of fetched instruction designated to by said plural lower bits to the final address of instructions indicated by said plural lower bits; prefetching, when an instruction fetch is performed by a branch instruction for an instruction at the branch destination address, instruction to the instruction buffers corresponding to the address order to the addresses in the range from the address following the address of the fetched instruction to the final address indicated by said plural lower bits; setting the appropriate flag to valid in response to the instruction prefetch; outputting to said instruction execution unit the instruction in the instruction buffer under the condition that the flag of the corresponding instruction buffer allocated in correspondence with the value of said plural lower bits of the instruction address of the instruction to be fetched by said instruction execution unit is set to valid.
- 9. A data processing system, comprising:
a data processor, formed on a single semiconductor chip, including:
an instruction execution unit which fetches instructions, decodes thus fetched instructions, and executes thus fetched and decoded instructions; and a bus controller having a plurality of instruction buffers each holding bits of instructions to be fetched by said instruction execution unit, a flag for each of instruction buffers, and a buffer controller circuit, for controlling access to an external bus in response to a command from said instruction execution unit; and a memory for storing operation programs for said data processor, said memory being a target of external bus access by said bus controller; said buffer controller circuit being served for allocating to each of said instruction buffers one of specific values that plural lower bits of an instruction address may take; prefetching, when an instruction is fetched which has a start address indicated by said plural lower bits, instructions to the instruction buffers corresponding to the address order in the range from the address that follows to the starting instruction address of fetched instruction designated to by said plural lower bits to the final address of instructions indicated by said plural lower bits; prefetching, when an instruction fetch is performed by a branch instruction for an instruction at the branch destination address, instruction to the instruction buffers corresponding to the address order to the addresses in the range from the address following the address of the fetched instruction to the final address indicated by said plural lower bits; setting the appropriate flag to valid in response to the instruction prefetch; outputting to said instruction execution unit the instruction in the instruction buffer under the condition that the flag of the corresponding instruction buffer allocated in correspondence with the value of said plural lower bits of the instruction address of the instruction to be fetched by said instruction execution unit is set to valid, setting to invalid the appropriate flag corresponding to the instruction prefetched into an instruction buffer in response to the output thereof, enabling the instruction to be prefetched to corresponding instruction buffers under the condition that said flag is set to invalid, and initializes all of said flags to invalid in response to an instruction fetch command according to a branch instruction.
- 10. A cellular phone, comprising:
a data processor, a memory, a bus connected to said data processor and to said memory; said memory storing at least programs for protocol handling or system control process; said data processor including:
an instruction execution unit which fetches instructions, decodes thus fetched instructions, and executes thus fetched and decoded instructions; and a bus controller which controls access to a memory in response to a signal from said instruction execution unit, said bus controller having a plurality of instruction buffers, a flag for each of instruction buffers, and a buffer controller circuit; said buffer controller circuit being served for allocating to each of said instruction buffers one of specific values that plural lower bits of an instruction address may take; when an instruction fetch is executed from an instruction address corresponding to the minimal value expressed by the plural lower bits of the instruction address, said buffer controller circuit storing each of instructions having addresses in the range from the address immediately following the one of the instruction fetched to the final instruction address expressed by said plural lower bits into respective instruction buffer each corresponding to an instruction address of said plurality of instruction buffers, and setting flags each corresponding to respective instruction buffer to first state, said buffer controller circuit outputting to said instruction execution unit the instructions stored in the instruction buffers in response to the request of instruction fetch from said instruction execution unit, under the condition that the flags each associated with an instruction buffer corresponding to a value of said plural lower bits of the instruction address output by the instruction execution unit of the instruction to be fetched is set to the first state, and setting the flag to second state.
- 11. A cellular phone according to claim 10, wherein:
when the flags each associated with an instruction buffer corresponding to the plural lower bits of the instruction address output by said instruction execution unit of the instructions to be fetched is in said second state, said buffer controller circuit stores instructions having addresses in the range from the address immediately following the one of the instruction fetched to the final instruction address expressed by said plural lower bits into respective instruction buffer each corresponding to an instruction address of said plurality of instruction buffers, and sets the flags each corresponding to respective instruction buffer to first state.
- 12. A cellular phone according to claim 11, wherein:
either instructions in instruction addresses corresponding to the minimal value expressed by said plural lower bits of the instruction addresses or instructions in the instruction addresses each having a corresponding instruction buffer flag of a value expressed by said plural lower bits of the instruction addresses set to second state, among instructions output by said instruction execution unit of instruction addresses to be fetched are read out from said memory to supply to said instruction execution unit without intervention.
- 13. A cellular phone according to claim 12, wherein:
said instruction execution unit outputs predetermined signals in correspondence with the type of instruction fetched; said buffer controller circuit in response to first signals output from said instruction execution unit sets to second state all of flags each corresponding to respective of said plurality of instruction buffers.
- 14. A cellular phone according to claim 13, wherein:
the instruction causing said instruction execution unit to output said first signals is a branch instruction.
- 15. A data processor comprising:
an instruction execution unit which fetches instructions, decodes thus fetched instructions, and executes thus fetched and decoded instructions; and a bus controller which controls access to an external bus in response to a command from said instruction execution unit, said bus controller having a plurality of instruction buffers, a flag specific to each of instruction buffers, and a buffer controller circuit; said buffer controller circuit being served for allocating to each of said instruction buffers one of specific values that plural lower bits of an instruction address may take, prefetching instructions to the instruction buffers each corresponding to a respective addresses designated to by said plural lower bits, from the address following a predetermined fetch address, setting the appropriate flag to valid in correspondence with the instruction prefetch, and setting the appropriate flag to invalid in response to the output of instructions prefetched to allow the number of instruction buffers for instructions to be prefetched among said plurality of instruction buffers to be variable.
- 16. A data processor according to claim 15, wherein:
the number of said instruction buffers for prefetching instructions is determined based on the information configured in a predefined register.
- 17. A data processor according to claim 15, wherein:
the number of said instruction buffers for prefetching instructions is determined based on the number of non-branch instructions executed prior to the execution of the current branch instruction.
- 18. A data processor, comprising:
an instruction execution unit which fetches instructions, decodes thus fetched instructions, and executes thus fetched and decoded instructions; a bus controller which controls access to an external bus in response to the direction by said instruction execution unit; and an interrupt controller, said bus controller having a plurality of instruction buffers, a flag specific to each of instruction buffers, and a buffer controller circuit; said buffer controller circuit being served for allocating to each of said instruction buffers one of specific values that plural lower bits of an instruction address may take, prefetching instructions to the instruction buffers each corresponding to a respective addresses designated to by said plural lower bits, from the address following a predetermined fetch address, setting the appropriate flag to valid in correspondence with the instruction prefetch, and setting the appropriate flag to invalid in response to the output of instructions prefetched; wherein instruction prefetch to said instruction buffers may be suspended in response to reception of an interrupt by said interrupt controller.
- 19. A data processor according to claim 18, wherein:
instruction prefetch to said instruction buffers may be suspended after receiving an interrupt by said interrupt controller, in response to a branch to an instruction address associated with the interrupt handling by said instruction decoder.
- 20. A data processor, comprising:
an instruction execution unit which fetches instructions, decodes thus fetched instructions, and executes thus fetched and decoded instructions; and a bus controller which controls access to an external bus in response to a command from said instruction execution unit, said bus controller including a first buffer table, a second buffer table, and a buffer controller circuit; each buffer table including a plurality of instruction buffers and a flag specific to each of instruction buffers; said buffer controller circuit being served for allocating to each of said instruction buffers included in each of said buffer tables one of specific values that plural lower bits of an instruction address may take, prefetching instructions to the instruction buffers each corresponding to a respective addresses designated to by said plural lower bits, from the address following a predetermined fetch address, setting the appropriate flag to valid in correspondence with the instruction prefetch, and setting the appropriate flag to invalid in response to the output of instructions prefetched; said buffer controller circuit outputting the instructions prefetched in said instruction buffers included in said second buffer table in response to the output of instructions prefetches in all of instruction buffers included in said first buffer table.
- 21. A data processor according to claim 20, wherein:
said buffer controller circuit suspends instruction prefetch to said first buffer table in response to the instruction decoded in said instruction execution unit belonging to a first type of instruction, and prefetches instructions to the instruction buffers included in said second buffer table on the basis of instruction address supplied from said instruction execution unit.
- 22. A data processor, comprising
an instruction execution unit which fetches instructions, decodes thus fetched instructions, and executes thus fetched and decoded instructions; and a bus controller which controls access to an external bus in response to a command from said instruction execution unit, said bus controller having a plurality of instruction buffers, a flag specific to each of instruction buffers, a buffer controller circuit, and an instruction decoder unit; said buffer controller circuit being served for allocating to each of said instruction buffers one of specific values that plural lower bits of an instruction address may take, prefetching instructions to the instruction buffers each corresponding to a respective addresses designated to by said plural lower bits, from the address following a predetermined fetch address, setting the appropriate flag to valid in correspondence with the instruction prefetch, and setting the appropriate flag to invalid in response to the output of instructions prefetched; said instruction decoder unit decoding instructions to be stored in said instruction buffers; said bus controller suspending instruction prefetch if the instruction decoded belongs to a first type of instruction until said instruction will be output from said instruction buffers.
- 23. A data processor according to claim 22, wherein:
said first type of instruction is a branch instruction.
- 24. A data processor according to claim 23, wherein:
said bus controller further includes an address calculator; said address calculator calculates the target address of branch destination of said branch instruction; and instructions will be prefetched starting from said target address of branch destination.
- 25. A data processor according to claim 24, wherein:
said plurality of instruction buffers as well as flags specific to each of instruction buffers are classified into either a first buffer table or a second buffer table; instructions prior to said branch instruction are prefetched into the instruction buffers included in said first buffer table, while instructions after the branch are prefetched into the instruction buffers included in said second buffer table, starting from said target address of branch destination.
- 26. A data processor according to claim 25, wherein:
instructions up to the one in a predetermined address immediately following said branch instruction are prefetched into the instruction buffers included in said first buffer table, while instructions in the range from the one in the target address of branch destination up to the one in a predetermined address are prefetched into the instruction buffers included in said second buffer table.
- 27. A data processor, comprising:
an instruction execution unit which fetches instructions, decodes thus fetched instructions, and executes thus fetched and decoded instructions; and a bus controller which controls access to an external bus in response to a command from said instruction execution unit, said bus controller having a plurality of instruction buffers, a flag specific to each of instruction buffers, one or more of data buffers, a flag specific to each of said data buffers, an instruction decoder unit, an address calculator unit, and a buffer controller circuit; said buffer controller circuit being served for allocating to each of said instruction buffers one of specific values that plural lower bits of an instruction address may take, prefetching instructions to the instruction buffers each corresponding to a respective addresses designated to by said plural lower bits, from the address following a predetermined fetch address, setting the appropriate flag to valid in correspondence with the instruction prefetch, and setting the appropriate flag to invalid in response to the output of instructions prefetched; said instruction decoder unit decoding instructions to be stored in said instruction buffers; said address calculator calculating a predetermined address if the instruction in question is an instruction belonging to a second type of instruction that requires information for storing in said predetermined address, storing data stored in said predetermined address into said data buffer, setting the specific flag associated with said data buffer to valid, and setting the specific flag to invalid in response to the output of stored data.
- 28. A data processor, wherein:
an instruction execution unit which fetches instructions, decodes thus fetched instructions, and executes thus fetched and decoded instructions; a bus controller which controls access to an external bus in response to a command from said instruction execution unit; and a cache memory, said bus controller having a plurality of instruction buffers, and a buffer controller circuit; said buffer controller circuit prefetching instructions into said instruction buffers, starting from the address succeeding to a predetermined address of instruction to be fetched; said instruction prefetched being equally supplied to said cache memory.
- 29. A data processor according to claim 28, wherein:
said bus controller supplies to said instruction execution unit the instructions stored in said cache memory without executing instruction prefetch when the instructions in the instruction addresses to be fetched are stored in said cache memory.
- 30. A data processor according to claim 29, wherein:
said bus controller further includes a flag specific to each of instruction buffers; said buffer controller circuit being served for allocating to each of said instruction buffers one of specific values that plural lower bits of an instruction address may take, prefetching instructions to the instruction buffers each corresponding to a respective addresses designated to by said plural lower bits, from the address following a predetermined fetch address, setting the appropriate flag to valid in correspondence with the instruction prefetch, and setting the appropriate flag to invalid in response to the output of instructions prefetched.
- 31. A data processor according to claim 28, wherein:
said bus controller further includes an instruction decoder unit and an address calculator unit; said instruction decoder unit decodes prefetched instructions and then said address calculator calculates the target address of branch destination if the decoded instruction is a branch instruction; instruction prefetch will be aborted if said target address of branch destination is an address lower than the instruction address of the instruction being executed in said instruction execution unit; and instruction prefetch will be proceeded if said target address of branch destination is an address higher than the instruction address of the instruction being executed in said instruction execution unit.
- 32. A data processor according to claim 31, wherein:
when said target address of branch destination is a branch to a lower address than the instruction being executed in said instruction execution unit, if the instruction in the target address of branch destination is being stored in the cache memory, said instruction stored in said cache memory will be supplied to said instruction execution unit, whereas if the instruction in the target address of branch destination is not stored in the cache memory, instructions will be prefetched to said instruction buffers.
Priority Claims (1)
Number |
Date |
Country |
Kind |
2000-052245 |
Feb 2000 |
JP |
|
CROSS-REFERENCE TO RELATED APPLICATION
[0001] This application is a continuation of application Ser. No. 09/783,551 filed Feb. 15, 2001.
Continuations (1)
|
Number |
Date |
Country |
Parent |
09783551 |
Feb 2001 |
US |
Child |
09824186 |
Apr 2001 |
US |