This non-provisional application claims priority under 35 U.S.C. ยง 119(a) on Patent Application No(s). 94111749 filed in Taiwan, R.O.C. on April 13, 2005 the entire contents of which are hereby incorporated by reference.
1. Field of Invention
The invention relates to processor architecture and, in particular, to a single-core and multi-mode processor and its program execution method.
2. Related Art
Generally, an embedded system processes two kinds of tasks. The former processes the human-machine interface that interacts with the users and the flow control at the system level. The latter performs data processing and conversions, such as the compression and decompression of audio/video (AV) data. The characteristics of the former tasks are the needs for a large amount of decision making and routines that cannot be accurately predicted; that is, the program running is dynamically determined during the task execution. Therefore, the mechanisms as jumping, branching, and interrupts have to be enhanced. The characteristics of the latter tasks are repeated data flow and the requirements of powerful operation abilities.
Therefore, most of conventional embedded systems integrate a reduced instruction set computing (RISC) processor and a digital signal processor (DSP). The former performs the processing tasks of user interactions and program controls. The latter executes multimedia data processing that requires massive operations. This kind of platforms (called the dual-core platforms) uses two processors of different properties to process the tasks of their own expertise. An example is the baseband processor in the cell phone. The processor used in the conventional dual-core platform is mostly used independently in a single-core system. Therefore, the functions of the two processors may have some overlapping. In reality, the two processors will not achieve very high utilization in most applications.
Later on, the architecture of a single-processor with two working modes is proposed to process two kinds of tasks with different properties by switching the working modes. In a conventional dual-mode single-processor architecture, the concept of multi-thread is used to divide the tasks in a system into two threads, the general-purpose thread (e.g. program controls) and the data processing thread. In general, the data operated by the data processing thread are first stored in on-chip memory to avoid cache misses. Therefore, this architecture first executes the general-purpose thread when processing a task. When the processor accesses some data in the external memory, i.e. when the general-purpose thread has a cache miss, it is switched to the data processing thread to perform pure data computing tasks (usually involving a large amount of time). Once the data required by the general-purpose thread are obtained from the external memory, the task is switched from the data processing thread back to the general-purpose thread to continue the original processing (i.e. of the general-purpose thread). This is shown in
In view of the foregoing, an object of the invention is to provide a unified single-core and multi-mode processor and the program execution method thereof to solve various problems and limitations existing in the prior art.
According to the disclosed unified single-core and multi-mode processor and the program execution method thereof, a single instruction stream is randomly arranged with different types of instructions. The system switches to a corresponding mode according to the type of the instruction to process data.
To achieve the above object, the disclosed program execution method of the uimfied single-core and multi-mode processor comprises the following steps. First an instruction stream with multiple instructions, some of which involve more than one instruction type, is received. Afterwards, each instruction in the instruction stream is executed. In particular,- each instruction is executed according to the following steps. An identification (ID) operator in the instruction is identified to obtain the type of the instruction. An execution region of the processor mode is selected from a plurality of execution regions according to the instruction type. The execution regions refer to different modes of the processor and there is a common region in the execution regions. Finally, data processing is performed according to the instruction by the selected execution region. These three steps are repeated to process in sequence the instructions in the instruction stream until the data processing in the instruction stream is finished.
The instruction types include a RISC type and a DSP type. Correspondingly, the execution regions include a RISC mode and a DSP mode. When the instruction type is identified as the RISC type, a corresponding execution region in the processor mode is selected to perform program controls accordingly. When the instruction type is identified as the DSP type, another corresponding execution region in the processor mode is selected to perform data operations accordingly. Here, the execution region for program controls can be the RISC mode and that of the data operations can be the DSP mode.
The invention discloses a unified single-core and multi-mode processor that executes programs using a single instruction stream. The instruction stream contains a plurality of instructions, some of which have more than one instruction type. The processor includes a plurality of processing regions to selectively execute instructions according to their types. They belong to different modes and have a plurality of register files for storing processing data according to the instruction types. Here one of the processing regions is selected according to the instruction type to execute each instruction.
In addition, the processing regions include a first processing region and a second processing region. One of them is selected according to the instruction type to execute each instruction. A common region exists between the first and second processing regions to process data according to the instruction.
The common region includes: a plurality of functional units and a plurality of common register files. The functional unit processes data according to the instruction. The common register file is used as a data exchange region.
Besides, the first processing region can be a processing region of the RISC mode, and the second processing region can be a processing region of the DSP mode. The DSP can be a multi-issue digital signal processor. The second processing region can be installed with an extra register.
The invention will become more fully understood from the detailed description given hereinbelow illustration only, and thus are not limitative of the present invention, and wherein:
In conventional single-processor architecture, there are two instruction streams (i.e. the RISC thread and the DSP thread). When there is a cache miss during the processing of the RISC thread, the thread is switched and the processor mode is changed to execute the DSP instruction. After data are obtained from the external memory, the processor mode is changed back to the RISC mode and the thread is switched back to the RISC thread to continue the RISC instruction. However, the invention uses one single instruction stream for program controls. The instruction stream can be an arbitrary mixture of RISC and DSP instructions. When executing the instruction stream, the processor changes its mode according to the extracted instruction type to accomplish the execution of the instruction stream.
In the following, we refer to an explicit embodiment and the accompanying figures for explaining the contents of the invention. First, an instruction stream with a plurality of instructions, some of which have more than one instruction type, is received (step 10). The identification (ID) operator in each instruction is identified to obtain the instruction type (step 20). According to the instruction type, an execution region of the corresponding processor mode is selected from a plurality of execution regions (step 30). The data processing of the instruction is performed by the selected execution region (step 40). Steps 20 through 40 are repeated to process each instruction in the instruction stream before finishing the instructions (step 50).
When the computing requirement of the processor (e.g. for a DSP instruction), very long instruction words (VLIW's) can be used for instruction coding. Moreover, one can employ coding with a variable length to reduce the use of program memory. Therefore, the parallel operation method can be adopted in step 40 for data processing according to the corresponding instruction.
For simplicity, suppose there are the DSP and RISC two instructions types in an instruction stream, as in
For an instruction stream of instructions with the DSP and RISC types, one may use hardware architecture as in
When receiving the (i+l)th instruction the ID operator enables us to know that it is a DSP instruction. The processor configures itself in the DSP mode, i.e. the second processing region 220. It includes a common region and register files 260, 270. The register files 260, 270 are used to store processing data. The common region has an access unit LS and an arithmetic unit AU, so as to process data using the corresponding functional unit (the access unit LS or the arithmetic unit AU) according to the received instruction. The common region further has several common register units 230, 240 as the data exchange region. Here since the unified DSP processor is a 2-issue DSP, it is accompanied with two register files 260, 270 for storing the processed data when the functional units are processing in parallel.
Although a unified 2-issue DSP is used for the purpose of illustration in this embodiment, one may use a unified multi-issue DSP (i.e. a 3-issue DSP, a 4-issue DSP, . . . , an N-issue DSP). Therefore, the second processing region is correspondingly installed with several extra register files (i.e. the register files outside the common region); that is, two, four, ... or N register files. Here N is a positive integer greater than 2. Moreover, the DSP of the invention can be a VLIW DSP.
For example,
Certain variations would be apparent to those skilled in the art, which variations are considered within the spirit and scope of the claimed invention.
Number | Date | Country | Kind |
---|---|---|---|
94111749 | Apr 2005 | TW | national |