Method and system for providing context switch using multiple register file

Information

  • Patent Application
  • 20070226474
  • Publication Number
    20070226474
  • Date Filed
    March 02, 2007
    17 years ago
  • Date Published
    September 27, 2007
    17 years ago
Abstract
A context switch method capable of promptly switching a context for a dynamically generated task and a dynamic link by converting a state of multiple register files, switching the context, and separately restoring and storing the context. That is, the context switch method includes: maintaining a multiple register files; establishing the multiple register to be in any one of a prefetch state, a current state, and a store state; converting a state of the multiple register files to be in any one of the prefetch state, the current state, and the store state when a context switch occurs; wherein, in the prefetch state, determining a memory address to read a next task context to be subsequently performed by the register file, in the current state, performing a task with the task context of the register file and in the store state, storing the register file in a memory.
Description

BRIEF DESCRIPTION OF THE DRAWINGS

The above and/or other aspects and advantages of the present invention will become apparent and more readily appreciated from the following detailed description, taken in conjunction with the accompanying drawings of which:



FIG. 1 is a diagram illustrating an embodiment dividing a register file by each task in the conventional art;



FIG. 2 is a diagram illustrating a configuration of a context switch system according to an embodiment of the present invention;



FIG. 3 is a diagram illustrating an embodiment of a task performing order performed in each register file according to an embodiment of the present invention;



FIG. 4 is a flowchart illustrating converting procedures of a state of a register file according to an embodiment of the present invention; and



FIG. 5 is a flowchart illustrating an operation procedure of a memory interface module according to an embodiment of the present invention.


Claims
  • 1. A context switch method comprising: converting a state of multiple register files to be in any one of a prefetch state, a current state, and a store state when a context switch occurs;wherein, in the prefetch state, determining a memory address to read a next task context to be subsequently performed, in the current state, performing a task with the task context of the register file, and in the store state, storing the register file in a memory.
  • 2. The context switch method of claim 1, wherein the prefetch state comprises recording a starting number of the memory address to read a next task context to be subsequently performed by the register file in a first context address register.
  • 3. The context switch method of claim 1, wherein the store state comprises recording a starting number of a memory address in a second context address register.
  • 4. The context switch method of claim 1, further comprising: recording state information of the multiple register files in a state register; andupdating a state information of the multiple register files in the state register by changing the state information when a state of the multiple register files is converted.
  • 5. The context switch method of claim 1, wherein the state of each of the multiple register files is independently established.
  • 6. The context switch method of claim 1, when a context switch occurs, the converting a state of the multiple register files to be in any one of the prefetch state, the current state, and the store state comprising: determining, when the context switch occurs, whether a next task context switch to be subsequently performed is stored in the store state of the multiple register files or not; andconverting the register file in the store state into a current state when the task context is stored.
  • 7. The context switch method of claim 1, further comprising: storing the register file in the store state in the memory or determining the memory address to read the next task context to be subsequently performed in the register file in the prefetch state when a memory bus is idle, when the memory bus is determined to be idle.
  • 8. A computer-readable storage medium storing a program for implementing the method of maintaining multiple register files; converting a state of the multiple register files to be in any one of a prefetch state, a current state, and a store state when a context switch occurs; andwherein, in the prefetch state, determining a memory address to read a next task context to be subsequently performed by the register file, in the current state, performing a task with the task context of the register file, and in the store state, storing the register file in a memory.
  • 9. A context switch system comprising: a memory interface module to establish multiple register files to be in any one of a prefetch state, a current state, and a store state and to convert the state of the multiple register files to be in any one of a prefetch state, a current state, and a store state when a context switch occurs,wherein the memory interface module enables the register file in the prefetch state to determine a memory address to read for a next task context to be subsequently performed, and a CPU performs a task with the task context of the register file in the current state and the register file in the store state is stored in a memory.
  • 10. The context switch system of claim 9, wherein the memory interface module records a starting number of the memory address to read a next task context to be subsequently performed by the register file in a first context address register.
  • 11. The context switch system of claim 9, wherein the store state comprises recording a starting number of the memory address to read a next task context to be subsequently performed by the register file in a second context address register.
  • 12. The context switch system of claim 9, wherein the memory interface module records state information of the multiple register files in a state register; and updates a state information of the multiple register files in the state register by changing the state information when a state of the multiple register files is converted.
  • 13. The context switch system of claim 9, wherein the memory interface module establishes each of the multiple register files in a different state independently.
  • 14. The context switch system of claim 9, wherein the memory interface module determines, when the context switch occurs, whether a next task context switch to be subsequently performed by the register file among the multiple register files is stored, and converts the register file in the store state into the current state when the task context is stored.
  • 15. The context switch system of claim 9, wherein the memory interface module, when a memory bus is idle, stores the register file in the store state in the memory, or determines the memory address to read the next task context switch to be subsequently performed in the register file in the prefetch state.
  • 16. A context switch method comprising: checking whether a next task context is stored in a store register file; andconverting the stored register file into a current state.
  • 17. A context switch method comprising: determining whether a memory bus is idle; andstoring a register assembly used by a prior task.
  • 18. The context switch method of claim 17, further comprises prefetching a next task context to be performed by predicting the next task context.
Priority Claims (1)
Number Date Country Kind
10-2006-0020115 Mar 2006 KR national