This application claims the benefit of Korean Patent Application No. 10-2006-0121615, filed on Dec. 4, 2006, in the Korean Intellectual Property Office, the disclosure of which is incorporated herein in its entirety by reference.
1. Field of the Invention
One or more embodiments of the present invention relate to an operating system for driving an embedded system, such as a mobile device, a multimedia device, or a home device, in which a reconfigurable processor may be used, and more particularly, to a method, medium, and system reducing the overhead of context switching in a multitasking environment of a reconfigurable processor. In one or more embodiments, a plurality of reconfiguration information storage spaces may be provided to store predicted reconfiguration information, thereby reducing the overhead of managing the reconfiguration information.
2. Description of the Related Art
Multitasking can be an indispensable function of the operating systems of computers and embedded systems, allowing them to perform a plurality of tasks concurrently.
In order to implement multitasking, context switching has been used. Context switching is a switch process which assigns the central processing unit (CPU) from one process to another. A most important issue in context switching is to reduce the overhead caused by the context switching.
The context of a task includes a variety of information. In conventional systems using CPUs or digital signal processing (DSP) units, the contents of the processor's registers include the context information. The overhead of context switching is typically proportional to the number of registers that are to be stored and restored. Conventionally, in order to reduce the overhead of context switching, techniques for reducing the contexts of registers have been used. However, systems using a reconfigurable processor must include reconfiguration information and register information of the reconfigurable processor, as well as register information of a processor, in contexts. Since the reconfiguration information and register information of the reconfigurable processor are large, and a separate amount of time is needed to reconfigure the reconfigurable processor when context switching is performed, the overhead of context switching becomes large.
Another conventional technique is to analyze a single task in an environment in which the single task is performed, and pre-load reconfiguration information required to perform the single task. In addition, a technique has been developed of loading required reconfiguration information for a plurality of reconfigurable processors when multi tasking is performed. However, these conventional techniques are very slow when context switching is performed for multitasking. Further, if multiple reconfigurable processors are used in order to resolve such problems, system manufacturing costs increase.
One or more embodiments of the present invention provide a context switch method, medium, and system for a reconfigurable processor that can minimize the time required for multitasking without increasing system manufacturing costs by selectively pre-loading reconfiguration information required for context switching when multitasking is performed.
Additional aspects and/or advantages of the invention will be set forth in part in the description which follows and, in part, will be apparent from the description, or may be learned by practice of the invention.
To achieve the above and/or other aspects and advantages, embodiments of the present invention include a system with context switching for a reconfigurable processor, including a controller with reconfiguration information loading to selectively control a current loading of corresponding reconfiguration information, based upon a particular load command, for the reconfigurable processor for a task from a memory maintaining a plurality of reconfiguration information based upon a determination of whether the corresponding reconfiguration information is pre-stored in at least one of a plurality of reconfiguration information storage units separate from the memory.
To achieve the above and/or other aspects and advantages, embodiments of the present invention include a context switching method, the method including selectively loading, based upon a load command, corresponding reconfiguration information for reconfiguring a reconfigurable processor for a task from a memory maintaining a plurality of reconfiguration information based upon a determination of whether the corresponding reconfiguration information is pre-stored in at least one of a plurality of reconfiguration information storage units separate from the memory, and selecting the corresponding reconfiguration information for context switching of the corresponding reconfiguration information for a next task of the reconfigurable processor.
To achieve the above and/or other aspects and advantages, embodiments of the present invention include a context switching method, including performing context switching of register information for performing a current task of a reconfigurable processor, determining whether corresponding reconfiguration information for the current task for reconfiguring the reconfigurable processor is stored in any of a plurality of reconfiguration information storage units, outputting a load command for loading the corresponding reconfiguration information from a memory maintaining a plurality of reconfiguration information if the corresponding reconfiguration information is determined to not be stored in any of the plurality of reconfiguration information storage units, selectively loading the corresponding reconfiguration information from the memory and storing the corresponding reconfiguration information in one of the plurality of reconfiguration information storage units, separate from the memory, and selecting the corresponding reconfiguration information, as stored in the one of the plurality of reconfiguration information storage units, for context switching of the corresponding reconfiguration information for a current task.
These and/or other aspects and advantages of the invention will become apparent and more readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which:
Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like reference numerals refer to the like elements throughout. Embodiments are described below to explain the present invention by referring to the figures.
Referring to
The CPU 100, for example, may control multiple tasks that are to be performed by the context switch system. In order to control these tasks, the CPU 100 may sequentially command the reconfiguration information loading unit 110 to load reconfiguration information required to perform the plurality of tasks. That is, the CPU 100 may predict reconfiguration information required to perform the next task, e.g., using scheduling information of the tasks, and output a load command for loading the predicted reconfiguration information, to the reconfiguration information loading unit 110. Here, the scheduling information can be managed by a scheduler of an operating system. Thus, in an embodiment, the CPU 100 dynamically predicts reconfiguration information for the next task, which is to be performed after the current task is performed, using the scheduling information.
In the case of fixed-order scheduling information, the CPU 100 may output a load command for loading reconfiguration information corresponding to the task that is to be performed next in sequence, to the reconfiguration information loading unit 110, for example. In the case of time-based scheduling information, the CPU 100 may output a load command for loading reconfiguration information corresponding to the task that is to be performed in the next time period, to the reconfiguration information loading unit 110, again as an example. The load command can be output whenever the scheduling information changes. When a change occurs in the scheduling information, the CPU 100 can dynamically predict reconfiguration information for the next task, and output a load command for loading the predicted reconfiguration information, to the reconfiguration information loading unit 110. Here, the scheduling information is changed in the case where the task order changes when a different task is required by a user while the current task is performed, or in the case where the task order is changed internally to enhance task processing efficiency.
Thus, in such an embodiment, the reconfiguration information loading unit 110 may receive the load command from the CPU 100, and load the corresponding reconfiguration information from the memory 120, for example, in response to the load command. Prior to the loading, the reconfiguration information loading unit 110 may determine whether the reconfiguration information corresponding to the load command of the CPU 100 is stored in the first reconfiguration information storage unit 130 or the second reconfiguration information storage unit 140, for example.
If the reconfiguration information corresponding to the load command of the CPU 100 is stored in either the first reconfiguration information storage unit 130 or the second reconfiguration information storage unit 140, the reconfiguration information loading unit 110 may not load the reconfiguration information corresponding to the load command of the CPU 100. The reconfiguration information may not be loaded because it does not need to be loaded, since it is already stored in the first reconfiguration information storage unit 130 or the second reconfiguration information storage unit 140.
However, if the reconfiguration information corresponding to the load command is not stored or found to be stored in either the first reconfiguration information storage unit 130 or the second reconfiguration information storage unit 140, the reconfiguration information loading unit 110 can load the reconfiguration information corresponding to the load command, from the memory 120, e.g., through the illustrated bus.
In such an embodiment, the memory 120 may store a plurality of pieces of reconfiguration information required to perform multiple tasks for use at a future time, for example, and a plurality of programs required to drive the context switch system. In one embodiment, for example, the memory 120 may be a dynamic random access memory (DRAM). Conversely, the first reconfiguration information storage unit 130 and the second reconfiguration information storage unit 140 may store reconfiguration information that may be for more imminent use.
Thus, here, the memory 120 may receive a load request from the reconfiguration information loading unit 110, and output the corresponding reconfiguration information, to the reconfiguration information loading unit 110 through the bus, e.g., in response to the load request. The reconfiguration information loading unit 110 may further output, or cause to be forwarded, the reconfiguration information loaded from the memory 120 to either the first reconfiguration information storage unit 130 or the second reconfiguration information storage unit 140.
In this example, the first reconfiguration information storage unit 130 and the second reconfiguration information storage unit 140 may store the reconfiguration information loaded by the reconfiguration information loading unit 110. The first reconfiguration information storage unit 130 and the second reconfiguration information storage unit 140 may function as cache memories for allowing the reconfigurable processor 160 to quickly access reconfiguration information. For example, if the first reconfiguration information storage unit 130 stores reconfiguration information for the task that is currently being performed, the second reconfiguration information storage unit 140 may store reconfiguration information for the task that is to be performed next, according to a load command of the CPU 100. Alternatively, if the second reconfiguration information storage unit 140 stores reconfiguration information for the task that is currently being performed, the first reconfiguration information storage unit 130 may store reconfiguration information for the next task.
The reconfiguration information stored in the first reconfiguration information storage unit 130 and the second reconfiguration information storage unit 140 may include unique identifiers for identifying the reconfiguration information, reconfiguration data for reconfiguring programs, and status information indicating whether the reconfiguration information is available, for example.
For context switching of the reconfiguration information for the next task, the reconfiguration information selection unit 150 may select reconfiguration information for the next task. That is, in this example, the reconfiguration information selection unit 150 may select a piece of the reconfiguration information stored in the first and second reconfiguration information storage units 130 and 140, and the reconfiguration processor 160 can operate according to the selected reconfiguration information.
When the reconfiguration information for the next task is selected by the reconfiguration information selection unit 150, e.g., from the first and second reconfiguration information storage units 130 and 140, the reconfigurable processor 160 may reconfigure the corresponding program according to the selected reconfiguration information, and then execute the reconfigured program.
In this example, after the CPU 100 processes the task T2, the reconfigurable processor 160 may reconfigure a program R2 according to the reconfiguration information C2 stored in the second reconfiguration information storage unit 140, and then execute the reconfigured program R2.
In operation 200, a load command may be output for loading reconfiguration information desired for the next task that is to be performed. For example, referring to the above
In operation 200, reconfiguration information for the task that is to be performed next may be predicted, e.g., using scheduling information for tasks, and a load command may be output for loading the predicted reconfiguration information.
In the case of fixed-order scheduling information, a load command may be output for loading reconfiguration information corresponding to the task that is to be performed next in sequence. In the case of time-based scheduling information, a load command may be output for loading reconfiguration information corresponding to the task that is to be performed in the next time period.
The load command may be output whenever scheduling information changes. Further, when scheduling information changes, the CPU 100 may dynamically predict reconfiguration information for the next task, and output a load command for loading the predicted reconfiguration information, e.g., to the reconfiguration information loading unit 110. For example, a load command may be output in the case where the task order changes when a different task is required by a user while the current task is being performed, or in the case where the task order is changed internally in order to enhance task processing efficiency.
After operation 200, in operation 202, reconfiguration information corresponding to the load command may be loaded from a memory, for example, and further stored in one of a plurality of reconfiguration information storage units.
In operation 300, it may be determined whether the reconfiguration information corresponding to the load command is stored in one of the plurality of reconfiguration information storage units. For example, referring to
In this example, if the reconfiguration information corresponding to the load command of the CPU 100 is stored in either the first reconfiguration information storage unit 130 or the second reconfiguration information storage unit 140, the process may proceed to the aforementioned operation 204 of
However, here, if the reconfiguration information corresponding to the load command is not stored in one of the plurality of reconfiguration information storage units, the reconfiguration information corresponding to the load command may be loaded from the memory, in operation 302. For example, referring to
As noted above, the reconfiguration information stored in the plurality of reconfiguration information storage units may include unique identifiers for identifying the reconfiguration information, reconfiguration data for reconfiguring programs, and status information indicating whether the reconfiguration information is available, for example.
Further, here, the identifiers may be used to uniquely represent the reconfiguration information, and set by address information of the memory 120, for example, storing the reconfiguration information, or can be arbitrary values, as another example. The reconfiguration data is data regarding programs that are to be reconfigured to perform tasks. In addition, the status information may indicate whether reconfiguration information stored in a reconfiguration information storage unit is available, or whether current reconfiguration information is currently being loaded and cannot yet be used, for example.
After operation 202, for context switching of the reconfiguration information for the next task, the loaded and stored reconfiguration information may be selected, in operation 204. Referring to
One or more embodiments of the present invention also include at least one medium comprising computer readable code to control at least one processing element to implement a method including generating a load command for loading reconfiguration information required for the next task that is to be performed after the current task, loading reconfiguration information corresponding to the load command from a memory, and storing the reconfiguration information in one of a plurality of reconfiguration information storage units, and executing the loaded and stored reconfiguration information for context switching of the reconfiguration information required for the next task, noting that alternatives are equally available.
First, context switching of register information for performing the current task may be performed, in operation 400. For example, referring to
After operation 400, it may be determined whether reconfiguration information desired for the current task is stored in one of a plurality of reconfiguration information storage units, in operation 402. For example, referring to
If the reconfiguration information for the current task is stored in one of the plurality of reconfiguration information storage units, the reconfiguration information for the current task may not need to be loaded, so the process may proceed to operation 408.
However, if the reconfiguration information for the current task is not stored in one of the plurality of reconfiguration information storage units, a load command may be output for loading the reconfiguration information for the current task, in operation 404. For example, referring to
After operation 404, the reconfiguration information corresponding to the load command may be loaded from a memory, for example, and stored in one of the plurality of reconfiguration information storage units, in operation 406. For example, referring to
After operation 406, for context switching of the reconfiguration information for the current task, the loaded and stored reconfiguration information may be selected, in operation 408. Referring to
One or more embodiments of the present invention also include at least one medium comprising computer readable code to control at least one processing element to implement a method including performing context switching of register information required for performing the current task, determining whether reconfiguration information required for performing the current task is stored in one of a plurality of reconfiguration information storage units while the context switching of the register information is performed, if the reconfiguration information required for performing the current task is not stored in one of the plurality of reconfiguration information storage units, outputting a load command for loading the reconfiguration information required for performing the current task, from a memory, loading the reconfiguration information corresponding to the load command from the memory, and storing the reconfiguration information in one of the plurality of reconfiguration information storage units, and selecting the loaded and stored reconfiguration information for context switching of the reconfiguration information required for performing the current task, noting that alternatives are equally available.
With this in mind, and in addition to the above described embodiments, embodiments of the present invention may thus be implemented through computer readable code/instructions in/on a medium, e.g., a computer readable medium, to control at least one processing element to implement any above described embodiment. The medium can correspond to any medium/media permitting the storing and/or transmission of the computer readable code.
The computer readable code can be recorded/transferred on a medium in a variety of ways, with examples of the medium including recording media, such as magnetic storage media (e.g., ROM, floppy disks, hard disks, etc.) and optical recording media (e.g., CD-ROMs, or DVDs), and transmission media such as carrier waves, as well as through the Internet, for example. Thus, the medium may further be a signal, such as a resultant signal or bitstream, according to embodiments of the present invention. The media may also be a distributed network, so that the computer readable code is stored/transferred and executed in a distributed fashion. Still further, as only an example, the processing element could include a processor or a computer processor, and processing elements may be distributed and/or included in a single device.
Although a few embodiments of the present invention have been shown and described, it would be appreciated by those skilled in the art that changes may be made in these embodiments without departing from the principles and spirit of the invention, the scope of which is defined in the claims and their equivalents.
Number | Date | Country | Kind |
---|---|---|---|
10-2006-0121615 | Dec 2006 | KR | national |