TW200937294A - Task processor - Google Patents

Task processor Download PDF

Info

Publication number
TW200937294A
TW200937294A TW098101355A TW98101355A TW200937294A TW 200937294 A TW200937294 A TW 200937294A TW 098101355 A TW098101355 A TW 098101355A TW 98101355 A TW98101355 A TW 98101355A TW 200937294 A TW200937294 A TW 200937294A
Authority
TW
Taiwan
Prior art keywords
work
circuit
processing
register
auxiliary
Prior art date
Application number
TW098101355A
Other languages
Chinese (zh)
Other versions
TWI476696B (en
Inventor
Naotaka Maruyama
Original Assignee
Netcleus Systems Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Netcleus Systems Corp filed Critical Netcleus Systems Corp
Publication of TW200937294A publication Critical patent/TW200937294A/en
Application granted granted Critical
Publication of TWI476696B publication Critical patent/TWI476696B/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/38Concurrent instruction execution, e.g. pipeline or look ahead
    • G06F9/3836Instruction issuing, e.g. dynamic instruction scheduling or out of order instruction execution
    • G06F9/3851Instruction issuing, e.g. dynamic instruction scheduling or out of order instruction execution from multiple instruction streams, e.g. multistreaming

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Multimedia (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Executing Machine-Instructions (AREA)

Abstract

A task processor (100) comprises a CPU (150), a saving circuit (120) and a task control circuit (200). A plurality of HWF (500) are connected to the task control circuit. When a task requests an auxiliary processing, the task processor (100) instructs HWF (500) of execution of the auxiliary processing and changes setting of the task in the middle of execution from a RUN state to a different state. When the auxiliary processing is completed, a task becoming a next execution object is selected and it is set to the RUN state.

Description

200937294 六、發明說明: 【發明所屬之技術領域】 本發明係關於一種OS(作業系統:Operating System)的 功能’特別是關於一種辅助處理器(co_processor)的控制。 【先前技術】 ❹ ❹ 不限於個人電腦等的汎用機器用〇S,行動電話等的專 用機器用OS亦要求具有高度的功能。特別是,能以丨個 CPU(Central Processing Unit)執行複數個工作的〇s(以下, 將此種類型之OS稱為「多工〇s」)係裝載於大多電子機器。 多工〇s將CPU之處理時間分割成單位時間(時間片 段:Time Slice),將時間片段依序分配至複數個工作。各工 作僅能在被os賦料^段時使用cpu。在各時間片段執 行一個工作。由於對使用者而言時間片段為非常短的時 =因此複數個工作感覺似乎是同時執行。根據此種處理 方法’工作A成為輸入待機狀態而暫時不需要】 能力時,將執行權職予另-個工作…效活用二處: 理能二此1,所謂執行權係與cpu之使用權同義。 工作切換工::時 =執'㈣動作稱為「工作切換」。 牡吁間片段經過時、或在 時產生。多工(^在^ 執仃既疋指令 之工作之上下文資訊儲存於㈣(時將執行中200937294 VI. Description of the Invention: [Technical Field] The present invention relates to a function of an OS (Operating System), particularly regarding control of a co-processor. [Prior Art] ❹ ❹ It is not limited to general-purpose devices such as personal computers, and special-purpose devices such as mobile phones are required to have a high level of functionality. In particular, 〇s (hereinafter, this type of OS is referred to as "multiplex 〇s") that can perform a plurality of operations with one CPU (Central Processing Unit) is mounted on most electronic devices. The multiplexer divides the processing time of the CPU into unit time (time slice: Time Slice), and sequentially allocates time segments to a plurality of jobs. Each work can only use cpu when it is allocated by os. Perform a job at each time segment. Since the time segment is very short for the user = therefore multiple work feelings seem to be performed simultaneously. According to this processing method, 'Work A becomes the input standby state and is temporarily not needed.】 When the ability is executed, the right is executed for another job... The two functions are used: The second is 1, the so-called execution right and the use right of the cpu Synonymous. Work Switcher::Time = The '(4) action is called "work switching". The fragments of the Yuyu are produced at the time of passage or at the time. Multiplexes (^ in the ^ 仃 仃 疋 疋 疋 疋 疋 之 上下文 上下文 上下文 上下文 上下文 上下文 上下文 上下文 上下文 上下文 上下文

Control Block)。上下 徑則區塊:Task 暫存器的資料與工作執糸工作執订時儲存於CPU之 作執仃狀態相關的資料。τ ^ 係為了保 3 200937294 持工作固有的資訊而由記憶體所確保的區域。多工〇s將執 行令之工作之上下文資訊儲存於TCB後,選擇下一個分配 有執行權的工作,從該卫作之TCB讀取上下文資訊,載入 至CPU暫存器。以此方式’各工作以時間片段為單位逐漸 執行本身的處理。 雖多工OS具有能高效率執行複數個工作的優點,但亦 具有新產生上下文資訊之儲存、載入之酬載(overhead)的缺 點。然而’一般而言,即使工作切換伴隨有酬載,多工0S 仍具有許多優點。 專利文獻1 :曰本特開平n — 272480號公報 專利文獻2 :日本特開2001 — 75820號公報 專利文獻3 :日本特開平丨丨_ 2343〇2號公報 專利文獻4:日本特開2000— 1〇8〇3號公報 專利文獻5:日本特開2000- 2763 62號公報 非專利文獻1 .森久直、坂卷佳壽美、重松宏志「用於 箝入式控制系統之即時0S的硬體化(Hardware implementation of a real-time operating system for embedded control system)」、東京都立產業技術研究所研究 報告、曰本、2005年8月4曰、p.55-58 【發明内容】 近年來,嚴格要求在一定時間内完成處理之即時〇s(以 下’稱為「RTOS(Real-Time Operating System)」)以箝入式 系統(Embedded System)為中心逐漸普及。在此種時間要求 200937294 嚴格的RTOS,工作切換時之酬載有可能對系統整體之效能 造成大的影響。 又,亦有很多將工作之一部分交給cpu以外之輔助處 理器的情形。辅助處理器有例如DMAC(直接記憶體存取控 制器 Direct Memory Access Controller)、浮點運算單元 ❹ ❹ (FPU : Floating-point Pr〇cessing Unh)、密碼處理單元等。 以下,將辅助處理器執行處理的動作稱為「輔助處理」。 輔助處理器係特定之輔助處理的專用電路。因此,一般而 言’相較於以CPU執行相同輔助處理,以辅助處理器執行 較快速。然而’在利用CPU與輔助處理器之複數個硬體資 源時會產生特有的酬載。為了進—步提升rtqs的效能,重 要的課題在於抑制辅助處理伴隨的酬載。 本發明人根據上述著眼點而完成本發明,其主要目的 在於提供-種用以於多工處理更高效率執行控制工作的技 術,特別疋提供-種用以使輔助處理高速化的技術。 本發明之形態為工作處理裝置。 此裝置具備處理暫在哭 Λ 斬广哭Μ 暫存資料從記憶體載入至處理 暫存器、依處理暫在哭+次 綠亡欠 ° 料執行工作的執行控制電路, 儲存各工作之狀態資料 .. 狀態暫存态,控制工作之勃杆狀 的工作切換電路,根 擇電路m 據^選擇條件選擇工作的工作選 擇電路〗執仃輔助處理的辅助處理電路。 執行控制電路’當執行系統呼叫指令時,通知工作切 換電路。工作選擇電路, R E A D Y (準備)狀態之 不(機為可執行狀態之 之中選擇成為執行對象的工作。 5 200937294 工作切換電路,藉由系統呼叫指令執行時之工作選擇 =輸出選擇成為下一個執行對象的工作,將處理暫: 之資料保留於既定記憶區域,且設定變更執行中之工作 的,資料,對選擇之工作,將保留於記憶區域之;料: _態,藉此二為更為 助處理時’工作切換電路指,處 算元Γο入至處理暫存器之資料’可為指令(i_ue—與運Control Block). The upper and lower diameter blocks: the data of the Task register and the data stored in the CPU during the work execution. τ ^ is the area that is guaranteed by the memory in order to protect the information inherent to the work of 200937294. The multiplexer stores the context information of the work of the execution order in the TCB, selects the next job with the execution right, reads the context information from the TCB of the guard, and loads it into the CPU register. In this way, each job gradually performs its own processing in units of time segments. Although the multiplexed OS has the advantage of being able to perform a plurality of tasks efficiently, it also has the disadvantage of newly generating contextual information storage and loading overhead. However, in general, multiplexed OS has many advantages even if the work is accompanied by a payload. Patent Document 1: Japanese Patent Laid-Open No. 272-480 Patent Document 2: Japanese Laid-Open Patent Publication No. 2001-75820 Patent Document 3: Japanese Laid-Open Patent Publication No. 2343〇2 Patent Literature 4: Japanese Patent Laid-Open No. 2000-1 〇 〇 〇 〇 专利 2000 2000 2000 2000 2000 2000 2000 2000 2000 2000 2000 2000 2000 2000 2000 2000 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . "The implementation of a real-time operating system for embedded control system", Tokyo Metropolitan Industrial Technology Research Institute, Sakamoto, August 4, 2005, p. 55-58 [Invention] In recent years, strict requirements The instant 〇s (hereinafter referred to as "RTOS (Real-Time Operating System)"), which has been processed in a certain period of time, has been popularized with the embedded system (Embedded System). In this time requirement 200937294 Strict RTOS, the payload of the work switching may have a big impact on the overall performance of the system. In addition, there are many cases where one part of the work is handed over to an auxiliary processor other than the CPU. The auxiliary processor includes, for example, a DMAC (Direct Memory Access Controller), a floating-point arithmetic unit (FPU), a cryptographic processing unit, and the like. Hereinafter, an operation in which the auxiliary processor executes processing is referred to as "auxiliary processing". The auxiliary processor is a dedicated circuit that is specifically assisted in processing. Therefore, in general, the same auxiliary processing is performed by the CPU to assist the processor to execute faster. However, a unique payload is generated when utilizing multiple hardware resources of the CPU and the auxiliary processor. In order to further improve the performance of rtqs, an important issue is to suppress the payload accompanying the auxiliary processing. The present inventors have completed the present invention in light of the above-mentioned points of view, and a main object thereof is to provide a technique for performing control work with higher efficiency in multiplex processing, and in particular to provide a technique for speeding up auxiliary processing. The form of the invention is a work processing device. This device has the processing to temporarily cry, 斩 斩 Μ Μ 暂 暂 暂 暂 暂 暂 暂 暂 暂 暂 暂 暂 暂 暂 暂 暂 暂 暂 暂 暂 暂 暂 暂 暂 暂 暂 暂 暂 暂 暂 暂 暂 暂 暂 暂 暂 暂 暂 暂 暂 暂 暂 暂 暂Data: state temporary state, control work bar-shaped work switching circuit, root selection circuit m according to the selection condition selection work selection circuit 〗 〖Auxiliary processing auxiliary processing circuit. The execution control circuit 'notifies the work switching circuit when the system call instruction is executed. The work selection circuit, READY (preparation) state is not selected (the machine is selected as the execution target among the executable states. 5 200937294 Work switching circuit, work selection by system call instruction execution = output selection becomes the next execution The work of the object will be processed in the established memory area, and the work of setting the change execution, the data, and the selection work will remain in the memory area; material: _ state, thereby taking the second When the processing is assisted, the 'work switching circuit refers to the data of the processing unit Γ 入 into the processing register' can be an instruction (i_ue-and-transport)

Fand)、*具運算元的指令、或程式計數器與堆最 日標等單純的資料。根據此處理方法,由於 / 管理工作的狀態,因此工作 〜存器 電路的, 換電H根據來自工作選擇 作切拖Γ 換。工作要求執行輔助處理時,工 、電路以一維方式接收此執行要求,對 二=助T可。此時,藉由—電路能= *万式管理輔助處理控制。 記錄=:===意組合,或以方法,、 有效。電跑程式表現本發明者’作為本發明之形態亦 行控:據本發明’可於多工處理實現更高效率之工作的執 【實施方式】 首先’將藉由電子電路實現多卫08之工作排程之工 200937294 處理裝置1 〇 〇說明為「基本例」。之後’將對改良例2之 工作處理裝置1 〇〇而言較佳之「雙放入型佇列演算法(後 述)」之硬體構裝說明為「改良例i」。最後,將使輔助處 理高速化之工作處理裝置1 〇〇說明為「改良例2」。 以下’ 「本實施例J之敘述原則上表示「基本例」及 「改良例1」、「改良例2」全部。 (基本例) 本實施例所示之工作處理裝置1 00,以電子電路實現多 Ο 工〇s之工作排程功能。在詳細說明工作處理裝置1 〇〇前, 首先以圖1說明工作的狀態遷移。此處,雖說明一般之多 工0S之工作的狀態遷移,但工作處理裝置100之工作的狀 態遷移亦相同。又’亦概要說明於工作處理裝置1 〇〇所執 行之系統呼叫。除了以圖2及圖3說明一般之多工OS的設 計思想之外,亦以圖4至圖1 〇詳細說明本實施例之工作處 理裝置100的處理方法。再者,亦適當將旗號(Semaphore)、 互斥(Mutex)、及事件等相關處理與一般技術比較來說明工 ® 作處理裝置100的特徵。 (工作的狀態遷移) 圖1係工作的狀態遷移圖。 在多工處理,各工作具有「狀態(State)」。各工作在後 述複數個狀態間遷移,而恆成為任—狀態。狀態遷移之契 機’係「系統呼叫之執行」與「中斷要求訊號之檢測」。 系統哞叫係各工作執行之指令中的特別指令。中斷要求訊 號係按下鍵盤、敲擊滑鼠、接收通訊資料等,從周邊機器 7 200937294 接收既定資料時產生的訊號。當然,分配至各工作的時間 片段經過後亦產生狀態遷移。 工作大致分為「一般工作」與「特殊工作」的2種類。 一般工作係以系統呼叫為契機所執行之通常的工作。特殊 工作係以中斷要求訊號之檢測為契機所執行的工作。即所 謂中斷處理程式(Interrupt Handler)。首先,說明各工作狀 態後,再說明各種系統呼叫指令。 (1) STOP狀態(停止狀態) 表示工作為停止狀態。一般工作與特殊工作皆有可能 成為STOP狀態。以下,將處於STOP狀態之工作稱為「STOP —工作」。 1 — 1. 一般工作 當工作執行指示另一個工作啟動之系統呼叫(以下,稱 為「啟動系統呼叫」)時,處於STOP狀態之一般工作遷移 至後述READY狀態。 1 — 2.特殊工作 特殊工作通常處於STOP狀態。藉由後述工作切換電路 210檢測出中斷要求訊號時,特殊工作從STOP狀態遷移至 後述RUN狀態。此時,原本處於RUN狀態之工作遷移至 READY狀態。 (2) RUN狀態(執行狀態)Fand), * instructions with operands, or simple data such as program counters and heaps. According to this processing method, due to the state of the / management work, the work-reservoir circuit, the power-changing H is changed according to the work selection. When the work requires the execution of auxiliary processing, the worker and the circuit receive the execution request in a one-dimensional manner, and the second=help T is available. At this time, the auxiliary processing control is managed by the circuit capable = * million. Record =:=== combination, or method, valid. The present invention has been implemented as a form of the present invention: according to the present invention, the implementation of the multiplex processing can achieve higher efficiency. [Embodiment] First, the electronic circuit will be implemented by the electronic circuit. Work Schedule Job 200937294 Processing Device 1 〇〇 Description is "Basic Example". Then, the hardware configuration of the "double-input array algorithm (described later)" which is preferable to the work processing apparatus 1 of the second modification is described as "modified example i". Finally, the work processing apparatus 1 which speeds up the auxiliary processing is described as "Modification 2". The following description of the "Example J" indicates in principle "Basic Example", "Modified Example 1" and "Modified Example 2". (Basic Example) The work processing apparatus 100 shown in this embodiment realizes a work scheduling function of a plurality of work s with an electronic circuit. Before explaining the work processing apparatus 1 in detail, first, the state transition of the operation will be described with reference to Fig. 1 . Here, although the state transition of the general multiplex OS operation is described, the state transition of the operation of the work processing apparatus 100 is also the same. Also, the system call executed by the work processing apparatus 1 is also outlined. The processing method of the work processing apparatus 100 of this embodiment will be described in detail with reference to Figs. 4 to 1 in addition to the design concept of a general multiplexed OS as shown in Figs. 2 and 3. Furthermore, the related processing of the Semaphore, the Mutex, and the event is appropriately compared with the general technique to describe the features of the processing apparatus 100. (State transition of work) Figure 1 is a state transition diagram of the work. In multiplex processing, each job has a "state". Each work moves between a plurality of states, and becomes a state-of-state. The state transition mechanism is the "system call execution" and "interrupt request signal detection". System squeak is a special instruction in the instructions for each job execution. The interrupt request signal is a signal generated when the predetermined data is received from the peripheral device 7 200937294 by pressing the keyboard, tapping the mouse, receiving communication data, and the like. Of course, the time segment assigned to each job will also result in a state transition. The work is broadly divided into two categories: "general work" and "special work." The general work is the usual work performed by the system call. The special work is the work performed by the detection of the interrupt request signal. This is called the Interrupt Handler. First, after explaining the various operating states, various system call commands will be described. (1) STOP status (stop status) Indicates that the operation is stopped. Both normal work and special work may become STOP. Hereinafter, the work in the STOP state is referred to as "STOP - Work". 1 — 1. GENERAL OPERATION When the job execution indicates a system call for another job start (hereinafter referred to as “start system call”), the general operation in the STOP state transitions to the READY state described later. 1 — 2. Special work Special work is usually in STOP. When the interrupt request signal is detected by the operation switching circuit 210 described later, the special operation shifts from the STOP state to the RUN state described later. At this time, the work that was originally in the RUN state migrates to the READY state. (2) RUN status (execution status)

表示工作正在執行中。亦即,將時間片段分配給工作 而取得CPU之使用權的狀態。一般工作與特殊工作皆有可 能成為RUN狀態。以下,將處於RUN狀態之工作稱為「RUN 200937294 一工作」。複數個工作中,能成為RUN狀態之工作恆僅有 1個,2個工作無法同時成為RUN狀態。 2 _ 1. —般工作 處於RUN狀態之一般工作,當執行既定系統呼叫時從 RUN狀態遷移至READY狀態或後述WAIT狀態。處於RUN 狀態之一般工作,在時間片段經過後,亦遷移至READY狀 態。不論是何種情形,處於READY狀態之一般工作遷移至 RUN狀態以替換原本處於RUN狀態之一般工作。當檢測出 © 中斷要求訊號時,RUN—工作遷移至READY狀態。此時, 處於STOP狀態之特殊工作遷移至RUN狀態。 當RUN—工作執行使本身結束之系統呼叫(以下,稱為 「結束系統呼叫」)時,RUN—工作遷移至STOP狀態。 2 — 2.特殊工作 因中斷要求訊號而從STOP狀態遷移至RUN狀態的特 殊工作,當結束本身處理時回到STOP狀態。特殊工作有可 能成為的狀態僅為STOP狀態與RUN狀態。 ® (3)READY狀態(可執行狀態) 表示工作為可執行狀態。處於READY狀態之工作,被 0S賦予執行權時皆可遷移至RUN狀態。僅一般工作有可能 成為READY狀態。以下,將處於READY狀態之工作稱為 「READY -工作」。 處於RUN狀態之一般工作藉由系統呼叫之執行而遷移 至RUN狀態以外的狀態時,或處於RUN狀態之特殊工作結 束本身的處理而遷移至STOP狀態時,READY—工作遷移 9 200937294 至RUN狀態。一般工作僅從READY狀態遷移至RUN狀態。 當處於READY狀態之工作有複數個時,根據上下文資訊之 一部分的工作優先順序,其中一個 READY —工作遷移至 RUN狀態。當工作優先順序相同之READY —工作有複數個 時,最早移至READY狀態之工作遷移至RUN狀態。 (4)WAIT狀態(待機狀態) 表示工作正在等待既定WAIT解除條件成立的狀態。 當WAIT解除條件成立時,處於WAIT狀態之工作遷移至 READY狀態。僅一般工作有可能成為WAIT狀態。以下, 〇 將處於WAIT狀態之工作稱為「WAIT —工作」。關於WAIT 解除條件將在之後詳細說明。 綜合上述,各工作僅能在處於RUN狀態時使用CPU執 行本身的處理。RTOS —邊管理複數個工作的狀態,一邊適 當切換RUN—工作。據此,可實現CPU隨時執行任一工作 的處理形態。 (系統呼叫) 接著,說明系統呼叫。系統呼叫大致分為「啟動系統」、 ® 「WAIT系統」、「SET系統」的3種類。 (1)啟動系統系統呼叫 STOP狀態與READY狀態之間之遷移相關的系統呼叫。 1 — 1.啟動系統呼叫Indicates that work is in progress. That is, a state in which a time segment is allocated to a job and a usage right of the CPU is obtained. Both normal work and special work may become RUN. Hereinafter, the work in the RUN state is referred to as "RUN 200937294 One Work". In a plurality of jobs, there is only one job that can be in the RUN state, and two jobs cannot be in the RUN state at the same time. 2 _ 1. General operation The general work in the RUN state, when the scheduled system call is executed, transitions from the RUN state to the READY state or the WAIT state described later. The general work in the RUN state also migrates to the READY state after the time segment has elapsed. In either case, the general work in the READY state transitions to the RUN state to replace the normal work that was originally in the RUN state. When the © interrupt request signal is detected, RUN—work transitions to the READY state. At this time, the special work in the STOP state transitions to the RUN state. When RUN-work performs a system call that ends itself (hereinafter referred to as "end system call"), RUN-work transitions to the STOP state. 2 — 2. Special operation The special operation of transitioning from the STOP state to the RUN state due to the interrupt request signal returns to the STOP state when the processing itself is finished. The state in which special work may become is only the STOP state and the RUN state. ® (3) READY state (executable state) Indicates that the job is in an executable state. The work in the READY state can be migrated to the RUN state when the execution right is given by the 0S. Only general work may become a READY state. Hereinafter, the work in the READY state is referred to as "READY - Work". READY—Work transition 9 200937294 to RUN state when the general operation in the RUN state transitions to a state other than the RUN state by the execution of the system call, or when the special operation completion in the RUN state is processed to the STOP state. Normal work only moves from the READY state to the RUN state. When there are multiple jobs in the READY state, according to the work priority of a part of the context information, one of the READYs - the work migrates to the RUN state. When the work priority is the same as READY—there are multiple jobs, the work that was moved to the READY state at the earliest moves to the RUN state. (4) WAIT state (standby state) Indicates that the operation is waiting for the state in which the predetermined WAIT release condition is established. When the WAIT release condition is established, the work in the WAIT state transitions to the READY state. Only general work may become a WAIT state. Hereinafter, 工作 The work in the WAIT state is called "WAIT - Work". The WAIT release conditions will be described in detail later. In summary, each job can only use the CPU to perform its own processing when it is in the RUN state. RTOS—Manages the status of multiple jobs while properly switching RUN—work. According to this, it is possible to realize a processing form in which the CPU executes any work at any time. (System Call) Next, the system call is explained. System calls are roughly classified into three types: "Startup System", ® "WAIT System", and "SET System". (1) Start system system call System call related to the migration between STOP status and READY status. 1 — 1. Start system call

RUN —工作之工作A使另一個一般工作B啟動的系統 呼叫。此時,處於STOP狀態之一般工作B遷移至READY 狀態。 10 200937294 1 — 2.結束系統呼叫 ,執行此系統呼叫之工作,結束本身的處理,從围狀 態遷移至STOP狀態。結束統啤叫亦可為某個工作使另一 個工作結束的指令。 (2)WAIT系統系統呼叫 R u N狀態與W Α ί τ狀態之間之遷移相關的系統呼叫。 2 — 1.待幾旗號系統呼叫 要求獲得旗號(後述)的系統呼叫。 2 — 2 ·待幾互斥系統呼叫 要求獲得互斥(後述)的系統呼叫。 2 — 3.待幾事件系統呼叫 等待事件(後述)成立的系統呼叫。除了事件ID之外, 待幾旗標類型(後述)與旗標條件(後述)亦作為變數執行。 不論是何種情形,均藉由WAIT系統系統呼叫設定各 種WAIT解除條件。當WAIT系統系統呼叫執行時,在 解除條件已成立之狀況下,執行系統呼叫之—工作遷 移至READY狀態。另一方面,當WAIT解除條件不成立時, UN工作遷移至4待WAIT解除條件成立的WAIT狀態。 (3)SET系統系統呼叫 WAIT狀態與READY狀態之間之遷移相關的系統呼 叫。SET系統系統呼叫之執行為WAIT解除條件的成立契 機。 3 — 1.解除旗號系統呼叫 解除旗说的系統呼·叫。 11 200937294 3 — 2.解除互斥系統呼叫 解除互斥的系統呼叫。 3—3.設定事件系統呼叫 設定事件之現行旗標類型(後述)的系統呼叫。 3 — 4.清除旗標系統呼叫 用以將現行旗標類型清除為零的系統呼叫。 於本實施例,以上述合計9種類之系統呼叫為對象進 行說明,但除此以外當然亦可構裝各種系統呼叫。 (一般RTOS的設計思想) 圖2係一般RTOS的概念圖。 此RTOS係多工OS。一般RTOS係實現為軟體。以將 RUN —工作從工作A切換至工作B之情形為例進行說明。 由於工作A佔有CPU,因此RTOS對CPU發出中斷,從工 作A拿回CPU之使用權。此外,將工作A之上下文資訊儲 存於TCB。RTOS選擇工作B作為下一個RUN—工作,將 上下文資訊從工作B之TCB載入至CPU的暫存器。當載入 結束時,RTOS將CPU之使用權交給工作B。以此方式,藉 由RTOS暫時取得CPU之使用權,執行工作A至工作B之 工作切換。關於特殊工作的執行亦相同。此時,將RUN — 工作之上下文資訊儲存於TCB後,將CPU之使用權交給特 殊工作以實現工作切換。 由於RTOS係實現為軟體,因此為了執行本身之處理必 須要CPU之使用權。亦即,RTOS與工作在CPU之使用上 為競爭關係。以下,將以此方式藉由軟體實現之RTOS稱為 200937294 「軟體 RTOSj。 rP=t:RTOS所執行之-般cpu的電路圖。 執行控制電路二統體存取與指令之執行等的 碎仔工作之上下文眘 理暫存器92、及執扞.£ fa 〇等各種貝料的處 及執仃運算的運算電路94。 係複數種類之暫存考的隹 處理暫存器92 用暫存哭86 σ ,大致分為特殊暫存器88與汎 用暫存器86。特殊暫存器_ 』 ❹ ❹ 旗標箄的塹;了租叭數器、堆疊指標、 旗標相暫存&amp;。㈣暫存㈣係 存器,包含R0〜Rl5的合計16個勒/菜用之㈣的暫 88有使用者用I备 暫存器。雖特殊暫存器 有使用者用與系統用的二種,但況用暫存器%僅有— 種。以下’將儲存於處理暫存器 贅孖器92的資料稱為「處理資料」。 執行控制電路90,藉由斟於山艰加 藉由對輸出選擇器98的控制訊號 (CTRL),將處理暫存器92中 人节存器的處理資料輸出 運算電路94。運算電路94依處理資料、亦即指令盘變數 :行運算。運算結果係輸出至輸入選擇器%。執行控制電 路%’藉由對輸入選擇器96的控制訊號(ctrl),將運算結 果輸入至處理暫存器92中之所欲暫存器。 又’執行控制電路90,透過cpu資料匯流排從記怜體 讀取資料’透過輸入選擇器96適當载入至處理暫存器&amp; 執行控制電路90,同樣地透過CPU資料匯流排將處理資料 適當紀錄於記憶體。執行控制電路9〇 一邊更新特殊暫存器 88的程式計數器一邊執行工作。 當產生工作切換時,執行控制電路9〇將處理資料儲存 於記憶體上之區域的TCB。假設工作A執行系統呼叫,產 13 200937294 生從工作A至工作B的工作切換。由於RTOS以系統呼叫 執行為契機而取得CPU的使用權,因此CPU84暫時依RT0S 用的程式執行動作。其處理過程如下述。 (工作A之上下文資訊的儲存) 1. 執行控制電路90,將特殊暫存器88從使用者用切換 至系統用。RT0S處理用之處理資料係載入至系統用的特殊 暫存器88。 2. 執行控制電路90,將汎用暫存器86之資料儲存於未 圖示的堆疊。 3. 執行控制電路90,將RTOS用之處理資料從未圖示 之記憶媒體、例如另一個暫存器載入至汎用暫存器86。在 此階段,處理暫存器92之處理資料完全替換成RTOS用之 處理資料。 4. RTOS自記憶體檢測工作A之TCB,將儲存於堆疊的 處理資料寫入TCB。又,使用者用特殊暫存器88之處理資 料亦作為上下文資訊的一部分而寫入TCB。以此方式,將 工作A之處理資料儲存於TCB。RTOS將工作A從「RUN」 狀態遷移至「READY(或WAIT)」的動作儲存於工作A之 TCB。 (工作B之上下文資訊的載入) 1.RTOS自記憶體檢測工作B之TCB,將TCB之上下 文資訊寫入堆疊與使用者用特殊暫存器88。RTOS將工作B 從「READY」狀態遷移至「RUN」的動作記錄於工作B之 TCB。 14 200937294 未圖干之9S:RT〇S處理用之資料從托用暫存器86儲存至 禾圖不之記錄媒體。 3.執行控制電路9〇 ’ ^ iL 〈上下文資訊载入至汎用 暫存器86。執行控制電路 E , 將特殊暫存器88從系統用 切換至使用者用。以此方式 ^ ^ ^ ^ 式將作B之處理資料載入至 處理暫存器92。 經由以上處理過程可實現工作切換。一般而言,由於 ❹ 況用暫存器86僅有-種,因此為了切換工作用之處理資料 與RTOS用之處理資料而使用堆疊。若汎用暫存器%亦具 有二種’則不需透過堆疊儲存、栽人,因此可執行更快速 的工作切換。 於本實施例,藉由進一步依各工作設置保留暫存器 1 ,可實現更快速的工作切換。以圖5詳細說明使用保留 暫存器110的工作切換。可知在以圖3說明之CPU84與一 般軟體RTOS之情形,當工作切換時,頻繁產生對TCB的 存取。在上述假設例,雖以從工作A工作切換至工作B為 則題進行說明,但實際上,RT〇s為選擇下一個待執行之工 作B ’亦須執行多數指令❶此時,RTOS頻繁地存取記憶體。 本實施例之工作處理裝置100,為了使後述工作控制電路 200專用於工作選擇處理,實現更快速的工作切換。 (工作處理裝置1〇〇之RT〇S的硬體化) 圖4係本實施例之RT〇s的概念圖。RUN—Working Work A causes another general work B to start a system call. At this time, the general work B in the STOP state transitions to the READY state. 10 200937294 1 — 2. End system call, perform the work of this system call, end its own processing, and move from the surrounding state to the STOP state. Ending a beer can also be an instruction to end another job for a job. (2) WAIT system system calls the system call related to the migration between the R u N state and the W Α ί τ state. 2 — 1. Waiting for a few flag system calls Ask for a system call with a flag (described later). 2 — 2 • Several Mutually Exclusive System Calls Request a system call that is mutually exclusive (described later). 2 — 3. Waiting for several events The system calls a system call that is awaiting an event (described later). In addition to the event ID, the flag type (described later) and the flag condition (described later) are also executed as variables. In either case, various WAIT release conditions are set by the WAIT system system call. When the WAIT system system call is executed, the system call is performed to the READY state when the release condition is established. On the other hand, when the WAIT release condition is not established, the UN job migrates to the WAIT state in which the WAIT release condition is established. (3) The SET system system calls the system call related to the migration between the WAIT state and the READY state. The execution of the SET system system call is the establishment of the WAIT release condition. 3 — 1. Release the system call of the flag. 11 200937294 3 — 2. Unring Mutual System Calls Unbind system calls. 3—3. Setting the Event System Call Set the system call for the current flag type (described later) of the event. 3 — 4. Clear Flag System Call A system call used to clear the current flag type to zero. In the present embodiment, a description will be given of the total of nine types of system calls, but it is of course possible to construct various system calls. (General RTOS design idea) Figure 2 is a conceptual diagram of a general RTOS. This RTOS is a multiplexed OS. The general RTOS is implemented as software. The case where the RUN_work is switched from the work A to the work B will be described as an example. Since the work A occupies the CPU, the RTOS issues an interrupt to the CPU and takes back the CPU usage right from the work A. In addition, the context information of Work A is stored in the TCB. The RTOS selects Work B as the next RUN-work, loading context information from the TCB of Work B to the scratchpad of the CPU. At the end of the load, the RTOS hands over the use of the CPU to Work B. In this way, the RTOS temporarily acquires the usage rights of the CPU, and performs the work switching from work A to work B. The implementation of special work is also the same. At this time, the RUN-work context information is stored in the TCB, and the CPU usage right is given to the special work to achieve the work switching. Since the RTOS is implemented as software, it is necessary to use the CPU in order to perform its own processing. That is, the RTOS competes with the use of the CPU in its work. In the following, the RTOS implemented by software in this way is called 200937294 "Software RTOSj. rP=t: Circuit diagram of the general CPU executed by the RTOS. Execution control circuit 2 system access and execution of instructions, etc. The context of the register 92, and the operation of the various types of bedding, such as the 捍 £ fa 及 及 及 及 运算 。 。 。 。 。 。 。 。 。 。 86 86 86 86 86 86 86 86 86 86 86 σ , roughly divided into special register 88 and general register 86. Special register _ 』 ❹ 旗 flag 箄 了; leased number, stack indicator, flag phase temporary storage &amp; (4) The memory (4) memory, including the total of 16 R/R5 for R0~Rl5 (4), has a user-supplied I-storage register. Although the special register has two types for the user and the system, The state of the temporary register is only one type. The following data is stored in the processing register 92 as "processing data". The execution control circuit 90 outputs the processing data of the human memory in the processing register 92 to the arithmetic circuit 94 by means of a control signal (CTRL) to the output selector 98. The arithmetic circuit 94 operates on the data, that is, the command disk variable: row operation. The result of the operation is output to the input selector %. The execution control circuit %' inputs the operation result to the desired register in the processing register 92 by the control signal (ctrl) to the input selector 96. Further, the 'execution control circuit 90 reads the data from the memory through the cpu data bus' through the input selector 96 and appropriately loads it into the processing register &amp; the execution control circuit 90, and similarly processes the data through the CPU data bus. Properly recorded in memory. The execution control circuit 9 执行 performs the work while updating the program counter of the special register 88. When a work switching is generated, the execution control circuit 9 stores the processing data in the TCB of the area on the memory. Suppose Work A performs a system call, and the work is switched from Work A to Work B. Since the RTOS acquires the right to use the CPU by taking the system call execution as an opportunity, the CPU 84 temporarily performs an operation in accordance with the program for the RT0S. The process is as follows. (Storage of context information of job A) 1. The control circuit 90 is executed to switch the special register 88 from the user to the system. The processing data for RT0S processing is loaded into the special register 88 for the system. 2. Execution control circuit 90 stores the data of general purpose register 86 in a stack (not shown). 3. Execution control circuit 90 loads the processing data for the RTOS into a general purpose register 86 from a memory medium, such as another temporary memory, not shown. At this stage, the processing data of the processing register 92 is completely replaced with the processing data for the RTOS. 4. The RTOS self-memory detects the TCB of the work A, and writes the processing data stored in the stack to the TCB. In addition, the user uses the processing data of the special register 88 to write to the TCB as part of the context information. In this way, the processing data of job A is stored in the TCB. The action of the RTOS to move the work A from the "RUN" state to the "READY (or WAIT)" is stored in the TCB of the work A. (Loading of context information of work B) 1. The RTOS self-memory detects the TCB of the work B, and writes the following information on the TCB to the stack and the user-specific special register 88. The action of the RTOS to move the work B from the "READY" state to the "RUN" state is recorded in the TCB of the work B. 14 200937294 Unsuccessful 9S: The data used for RT〇S processing is stored from the storage register 86 to the recording medium of the map. 3. Execution control circuit 9 〇 ' ^ iL <Context information is loaded into the general-purpose register 86. The control circuit E is executed to switch the special register 88 from the system to the user. In this way, the processing data of B is loaded into the processing register 92. Work switching can be achieved through the above process. In general, since there are only a few types of registers 86, the stacking is used to switch the processing data for the work and the processing data for the RTOS. If the universal register % has two types, then there is no need to store and plant people through the stack, so a faster work switching can be performed. In this embodiment, by further retaining the register 1 according to each work setting, a faster work switching can be realized. The operation switching using the reserved register 110 is explained in detail with reference to FIG. It can be seen that in the case of the CPU 84 and the general software RTOS illustrated in Fig. 3, access to the TCB is frequently generated when the operation is switched. In the above hypothetical example, although the problem is switched from work A to work B, in practice, RT〇s is required to execute the majority of the instructions for selecting the next work to be performed. At this time, the RTOS frequently Access memory. The work processing apparatus 100 of the present embodiment realizes faster work switching in order to make the operation control circuit 200 described later dedicated to the work selection processing. (Hardification of RT〇S of Work Processing Apparatus 1) Fig. 4 is a conceptual diagram of RT〇s of the present embodiment.

與一般軟體RTOS不同,本實施例之RTOS主要實現為 與CPU不同之另一個硬體。以下,將藉由硬體實現之RTOS 15 200937294 稱為「硬體RT0S」。由於本實施例之Rtgs主要為與CPU 不同之另一個硬體,因此執行本身的處理時實質上幾乎不 需要CPU的使用權。亦即,RTOS與工作在CPU之使用上 幾乎不會成為競爭關係。圖2所示之一般軟體RT0S之情 形,CPU為工作執行用電路亦為RT〇s執行用電路。相對 於此,本實施例之硬體RT0S之情形,CPU明確地為工作 執行用電路,工作排程功能能以後述儲存電路120與工作 控制電路200為中心實現。 圖5係本實施例之工作處理裝置1〇〇的電路圖。 〇 工作處理裝置100除了 CPU15()之外亦包含儲存電路 120與工作控制電路2〇〇。cpui5〇係工作的執行主體,儲 存電路120與工作控制電路2〇〇係具有圖*所示之RT〇s 之功此的電路。工作排程處理,係藉由工作控制電路2⑼ 主導。 CPU 150包含執行控制電路152、處理暫存器154、及 運算電路160。CPU150亦可為以圖3說明之一般cpu。然 而’本實施例之CPU150與圖3所示之cpu84,在訊號線之 ❹ 連接方法等有一些變更。以下一個圖6詳細說明具體電路 構成。 工作控制電路200包含工作切換電路21〇、旗號表 212、事件表214'工作選擇電路23〇、及狀態記憶部22〇。 以圖13之後詳細說明旗號表2丨2與事件表2丨4。狀態記憶 部220係與各工作相對應的單元。以下,將與工作a對應 之狀態記憶部220表記為「狀態記憶部22〇_A」。各狀態記 16 200937294 ❹Unlike the general software RTOS, the RTOS of this embodiment is mainly implemented as another hardware different from the CPU. Hereinafter, the RTOS 15 200937294 implemented by hardware is referred to as "hardware RT0S". Since the Rtgs of this embodiment is mainly another hardware different from the CPU, substantially no CPU usage right is required to execute the processing itself. That is, the RTOS and the work on the CPU will hardly become a competitive relationship. The general software RT0S shown in Fig. 2, the CPU for the work execution circuit is also the RT〇s execution circuit. On the other hand, in the case of the hardware RT0S of the present embodiment, the CPU is clearly a work execution circuit, and the work scheduling function can be realized centering on the storage circuit 120 and the work control circuit 200 which will be described later. Fig. 5 is a circuit diagram of the work processing apparatus 1A of the present embodiment. The work processing apparatus 100 includes a storage circuit 120 and a work control circuit 2 in addition to the CPU 15 (). The execution body of the cpui5 system, the storage circuit 120 and the work control circuit 2 are circuits having the function of RT 〇 s shown in FIG. Work scheduling is dominated by the work control circuit 2 (9). The CPU 150 includes an execution control circuit 152, a processing register 154, and an arithmetic circuit 160. The CPU 150 can also be a general CPU as illustrated in FIG. However, the CPU 150 of the present embodiment and the cpu 84 shown in Fig. 3 have some changes in the connection method of the signal line. The following Figure 6 details the specific circuit configuration. The work control circuit 200 includes a work switching circuit 21A, a flag table 212, an event table 214' work selection circuit 23A, and a state memory portion 22A. The flag table 2丨2 and the event table 2丨4 will be described in detail later in FIG. The state memory unit 220 is a unit corresponding to each operation. Hereinafter, the state memory unit 220 corresponding to the job a is referred to as "state memory unit 22A_A". Each status record 16 200937294 ❹

憶部220保持工作的狀態資料。狀態資料,係上下文資訊 中,特別是表示工作優先順序與狀態等工作屬性的資訊。 Z料細說明具體資料的内容。所有工作之所有狀態資 枓係從各狀態記憶部220隨時輸出至工作選擇電路跡工 作選擇電路23〇,係根據各工作的狀態資料執行run一工 作之選擇等各種工作選擇的電路。亦以圖之後詳細說明 乍選擇電路230。工作切換電路21〇,當檢測出從執行控 制電路152接收之系統啤叫訊號(sc)與來自外部裝置之中 斷要求訊號(INTR)時,執行工作切換。 執行控制電路152,當系統呼叫執行時,料統呼叫訊 號(SC)傳至工作切換電路21Gm切換電路21〇檢 測出中斷要求訊號(INTR)時,工作切換電s 21G對執行控 制電路152傳送停止要求訊號(HR)。執行控制電路,當 CPUU0之動作停止時,將停止結束訊號(HC)傳至工作切ς 電路2IG。藉由此等3種類的訊號,CPU15G與JL作控制電 路200產生連動動作。 儲存電路120包含載入選擇電路112及複數個保留暫 存器110。保留暫存器110亦為與各工作相對應的單元,為 用以儲存處理暫存器154之處理資料的暫存器。是以,保 留暫存器110具有與處理暫存器154相同、或處理暫存器 154以上的資料容量。以下,將與工作A對應之保留暫存器 110表記為「保留暫存器110一A」。载入選擇電路ιΐ2,當 接受工作切換電路210的指示時,將任一個保留暫存器} ι〇 的資料(以下,將保留暫存器11〇保持的資料稱為「儲存資 17 200937294 料」)載入至處理暫存器154。 選擇=存::將個…存資料隨_至載人 =:二 換電路210將指定…之工作 選擇訊號(TS)輸入至載入選擇 ⑴將與指定之工作對應之保留暫存器12^,“選擇電路 至處理暫存器154。再者,當工作切拖之儲存資料輸出 iiisd於电 田 刀換電路21〇對處理暫存 器⑸輸入寫入訊號(WT)時,該 理暫存器154。 付賞際上載入至處 ❹ 出至處理暫存器154之所有處理資料亦隨時輸 ==留暫存器&quot;&quot;工作切換電路η。對所欲保留 ❹ 4寫人訊續T)時,處理資料儲存於該保留 暫存器&quot;ο。此處,連接處理暫存器154與各保留暫存器 =匯流排一次可傳送的位元數,係設定成可平行傳送處 =料。因此,工作切換…10僅將寫入訊號傳至保留 110 —次’即可將處理資料-次寫入保留暫存器 10又,連接保留暫存器u〇與載入選擇電路112、及連 入選擇電路112與CPU15G之匯流排的位元數亦同樣地 以下,分別對系統呼叫與令斷要求訊號說明工 的執行方法。 (1)系統呼叫執行 當CPU150之執行控制電路152執行系統呼叫時執行 控制電路152使CPU150之時脈(以下,稱為「CPU時脈 (CLK)」)停止。之後以圖7等詳細說明具體停止方法。執 18 200937294 订控制電路152 ’將表示系統呼叫之執行的系統呼叫訊號 (sc)傳至工作控制電路2〇〇的工作切換電路21〇。又當 κ之停止〜束時,執行控制電路i 52將停止結束訊號(HC) 傳至工作切換電路2 10。 ❹ 在CPU150與工作切換電路21〇之間連接有用以傳送系 統呼Η訊號的9條訊號線。9條訊號線與上述9種類的系統 呼叫對應。執行控制電路152,依執行之系统呼叫的種類, 在任一條系統呼叫訊號線傳送數位脈衝。工作切換電路 21〇’能依從9條系㈣叫訊號線中哪—條訊號線檢測出數 位脈衝,立即檢測出執行之系統,叫的種類。工作切換電 路210 ’依系㈣叫的種類’從工作選擇電路2川之輸出資 料選擇必要的資料,執行系統呼叫所指示的處理。此處理 係以HC被傳送為條件執行。以圖1〇詳細說明工作切換電 路210與工作選擇電路23〇的關係。此外,系統呼叫之參 數與回傳值,係寫入處理暫存器154中之既定汎用暫存器 158。工作切換電路21()能對㈣暫存器158執行參數讀取 與回傳值寫入。此處,假設RUN—工作之工作Α執行待機 旗號系統呼叫。是以,首先,必需儲存工作A的處理資料。 (工作A之上下文資訊的儲存) 執行控制電路152,將表示待機旗號系統呼叫之SC訊 號輸入至工作切換電路21〇。執行控制電路M2使咖停 止,停止結束時傳送HCe工作切換電路21〇,除了對工作 選擇電路230所内建之各種選擇電路令之後述旗號選擇電 路234輸出待機對象之旗號的旗號m之外,亦選擇下—個 19 200937294 待執行的工作B。工作切換電路210,對狀態記憶部22〇 A 寫入既定資料。例如’將工作A之狀態從「RUN」變更設 定成「READY」或「WAIT」。更具體而言’工作切換電路 210,除了將「WAIT」輸出至所有狀態記憶部220以作為 表示狀態資料中之工作狀態的資料外,亦將寫入訊號 (WT_A)僅輸入至狀態記憶部220_A。以此方式,變更工作 A之狀態設定。 接著’工作切換電路210,對保留暫存器11〇_a輸出寫 入訊號(WT)。由於處理暫存器154之處理資料隨時輸出至 ❹ 各保留暫存器110’因此藉由此寫入訊號(WT)儲存於工作A 的保留暫存器11〇_Α。 (工作B之上下文資訊的載入) 當工作切換電路2 1 〇結束工作a之狀態資料的變更、 處理資料的儲存時,將指定工作B之工作選擇訊號(Ts B) 輸出至載入選擇電路112。據此,保留暫存器u 〇—B之儲存 資料係輸出至處理暫存器154β當工作切換電路21〇將寫入 訊號(WT)輸出至處理暫存器154時,工作Β之儲存資料係 ◎ 載入至處理暫存器154。又,工作切換電路21〇,對工作β 之狀態記憶部220寫入既定資料。例如,將工作Β之狀熊 從「READY」冑更設定成「咖」。當結束以上處理時: 執打控制電路152再開始CPU時脈eCpui5〇係藉由再開始 之cpu時脈開始工作B的執行。之後以圖8⑻說明處理方 法之更進一步的細節。 (2)中斷要求訊號的產生 20 200937294 工作切換電路210檢測來自周邊機器的令斷要求訊號 (職)。更具體而言’中斷要求訊號(intr),係從未圖示 之中斷控制器傳至工作切換電路210。表示令斷要求訊號 (INTR)之等級的參數,係紀錄於_斷控㈣内建的暫存 =工作切換電路21G將停止要求訊號_傳至執行控制 電路152’執行控制電路152使⑽時脈停止。與系統呼 叫執行時相同,工作切換電路21〇將RUn—工 ❹The memory unit 220 maintains the status data of the work. Status data, which is context information, especially information about work attributes such as work priorities and status. The Z material details the contents of the specific materials. All of the state resources of all the jobs are output from the state memory unit 220 to the work selection circuit track selection circuit 23, and various types of work selection circuits such as the selection of the run operation are executed based on the state data of each job. The selection circuit 230 will be described in detail later. The work switching circuit 21 执行 performs a work switching when detecting the system beer call signal (sc) received from the execution control circuit 152 and the external device interrupt request signal (INTR). Execution control circuit 152, when the system call is executed, when the system call signal (SC) is transmitted to the work switching circuit 21Gm switching circuit 21 and the interrupt request signal (INTR) is detected, the work switching power s 21G stops transmitting to the execution control circuit 152. Request signal (HR). The control circuit is executed, and when the operation of the CPUU0 is stopped, the stop end signal (HC) is transmitted to the work switching circuit 2IG. By the three types of signals, the CPU 15G and JL act as control circuits 200 to generate interlocking actions. The storage circuit 120 includes a load selection circuit 112 and a plurality of reserved registers 110. The reserved register 110 is also a unit corresponding to each work, and is a register for storing processing data of the processing register 154. Therefore, the reservation register 110 has the same data capacity as the processing register 154 or the processing register 154 or more. Hereinafter, the reservation register 110 corresponding to the job A is referred to as "reserved register 110-A". The selection circuit ιΐ2 is loaded, and when the instruction of the work switching circuit 210 is accepted, any data of the reserved register} ι〇 (hereinafter, the data held by the holding buffer 11 is referred to as “storage 17 200937294 material”). Loaded into the processing register 154. Select=Save::Save...Save data with _ to manned=:Two switch circuit 210 inputs the work selection signal (TS) of the specified... to the load selection (1) The reserved register 12^ corresponding to the specified work "Selecting the circuit to the processing register 154. Further, when the stored data output iiisd of the work cut is input to the processing register (5) and the write signal (WT) is input to the processing register (5), the temporary storage 154. Loading all the processing data to the processing register 154 is also available at any time. ==Retaining the register&quot;&quot;Working circuit η. For the desired reservation 写 4 Writer When T) is continued, the processing data is stored in the reserved register &quot; ο. Here, the number of bits that can be transmitted by the connection processing register 154 and each reserved register = bus is set to be parallelizable. Therefore, the work switch...10 only transfers the write signal to the reserved 110-times' to process the data-write to the reserved register 10, and then connects the reserved register u〇 with the load selection circuit. 112, and the number of bits connected to the bus bar of the selection circuit 112 and the CPU 15G are also the same as below, respectively (1) System Call Execution When the execution control circuit 152 of the CPU 150 executes a system call, the execution control circuit 152 causes the clock of the CPU 150 (hereinafter, referred to as "CPU clock ( CLK)") stops. The specific stopping method will be described in detail later with reference to FIG. 7 and the like. The control circuit 152' transmits a system call signal (sc) indicating the execution of the system call to the work switching circuit 21A of the work control circuit 2A. Further, when κ is stopped to the bundle, the execution control circuit i 52 transmits the stop end signal (HC) to the operation switching circuit 2 10 . 9 9 signal lines for transmitting system call signals are connected between the CPU 150 and the work switching circuit 21A. The nine signal lines correspond to the above nine types of system calls. The execution control circuit 152 transmits a digital pulse on any of the system call signal lines depending on the type of system call being executed. The working switching circuit 21〇' can detect the digital pulse according to which of the 9 lines (four) called the signal line, and immediately detects the type of the system being executed. The work switching circuit 210' selects the necessary information from the output data of the work selection circuit 2 to perform the processing instructed by the system call. This processing is performed on condition that the HC is transmitted. The relationship between the work switching circuit 210 and the operation selection circuit 23A will be described in detail with reference to FIG. In addition, the system call parameters and return values are written to the predetermined general purpose register 158 in the processing register 154. The work switching circuit 21() can perform parameter reading and return value writing to the (4) register 158. Here, it is assumed that the RUN-work operation Α performs a standby flag system call. Therefore, first, it is necessary to store the processing data of the work A. (Storage of Context Information of Work A) The execution control circuit 152 inputs an SC signal indicating a call of the standby flag system to the work switching circuit 21A. The execution control circuit M2 stops the coffee, and transmits the HCe operation switching circuit 21A at the end of the stop, except that the various selection circuits built in the operation selection circuit 230 cause the flag selection circuit 234 to output the flag m of the flag of the standby object, Also choose the next - 19 200937294 pending work B. The work switching circuit 210 writes the predetermined data to the state memory unit 22A. For example, 'Change the status of job A from "RUN" to "READY" or "WAIT". More specifically, the 'work switching circuit 210' outputs the write signal (WT_A) only to the state memory unit 220_A in addition to outputting "WAIT" to all of the state memory units 220 as data indicating the operation state in the status data. . In this way, the status setting of the job A is changed. Next, the job switching circuit 210 outputs a write signal (WT) to the reserved register 11A_a. Since the processing data of the processing register 154 is output to the respective reserved registers 110' at any time, it is stored in the reserved register 11〇_Α of the work A by the write signal (WT). (Loading of context information of job B) When the work switching circuit 2 1 ends the change of the state data of the work a and the storage of the processing data, the work selection signal (Ts B) of the designated job B is output to the load selection circuit. 112. Accordingly, the stored data of the reserved register u 〇 B is output to the processing register 154β. When the working switching circuit 21 outputs the write signal (WT) to the processing register 154, the stored data of the working memory is ◎ is loaded into the processing register 154. Further, the work switching circuit 21A writes the predetermined data to the state memory unit 220 of the operation β. For example, set the Β 熊 从 from "READY" to "咖". When the above processing is ended: The execution control circuit 152 restarts the CPU clock eCpui5 to start the execution of the operation B by restarting the cpu clock. Further details of the processing method will be described later with reference to Fig. 8(8). (2) Generation of the interrupt request signal 20 200937294 The work switching circuit 210 detects the request signal (job) from the peripheral device. More specifically, the interrupt request signal (intr) is transmitted to the operation switching circuit 210 from an interrupt controller not shown. The parameter indicating the level of the interrupt request signal (INTR) is recorded in the _discontinued (four) built-in temporary storage = the work switching circuit 21G stops the request signal _ is transmitted to the execution control circuit 152' to execute the control circuit 152 to make the (10) clock stop. The same as the system call execution, the work switching circuit 21 will be the RUn-worker

Q :儲存於保留暫存器,接著,工作切換電路2二 ^工作。不論中斷要表訊號之參數如何,啟動之特殊工作 =種類。特殊工作從中斷控制器的内建暫存器讀取贿 ::數,依參數執行處理。特殊工作執行之處理有可能為 二^件系統呼叫或設定旗號系統呼叫的執行,亦有可能 殊的Γ W的啟動。依據參數特殊工作有可能未執行特 於特殊理Ϊ結束。依據職的參數,執行何種處理係取決 、工^工作的構裝。當特紅作之執行結束時,從处庸 —工作之中選擇下一個run—工作。 的處換電路21G將與特殊卫作對應之保留暫存器110 作所;時ί入至cpul50e此種從一般工作切換至特殊工 傳至執订控制電路152後,工作切換電路21 3=定時脈分時,工作切換電路210為了解除cpu 脈的停止而停止僂 ^ Λ 送HRB… 控制電路152被停止傳 之從-般時脈。此時,結束工作切換電路210 特殊工作的工作切換。之後以圖8⑷說明處 21 200937294 理方法的細節。 不論是何種情形, (A) 處理資料之儲存、載入 (B) 工作的狀態遷移及RUN —工作的選擇 等工作切換的核心處理係藉由硬體實現。關於(A)及 (B) ’即使不需要存取記憶體上之TCB亦有助於工作切換的 高速化。又,為實現工作處理裝置1〇〇,對cpui5()僅追加 停止及再開始CPU時脈的功能即可。此外,此等功能皆藉Q: Stored in the reserved scratchpad, and then the work switching circuit 2 works. Regardless of the parameters of the interrupt signal, the special work to start = type. The special work reads the bribe from the built-in register of the interrupt controller, and performs processing according to the parameters. The handling of special work execution may be the execution of a two-piece system call or setting a flag system call, or it may be a special start. Special work based on parameters may not be performed without special care. According to the parameters of the job, what kind of processing is performed depends on the construction of the work. When the execution of the special red work ends, choose the next run-work from the mediocrity-work. The switching circuit 21G will hold the register 110 corresponding to the special guard; when the switch is switched from the normal work to the special work to the binding control circuit 152, the work switching circuit 21 3 = timing At the time of the pulse division, the work switching circuit 210 stops the transmission of the HRB in order to cancel the stop of the cpu pulse... The control circuit 152 is stopped from transmitting the normal clock. At this time, the work switching of the special operation of the work switching circuit 210 is ended. Then, the details of the method of 21 200937294 are explained in Fig. 8(4). In either case, (A) processing of data storage, loading (B) state transition of work, and RUN-work selection, the core processing of work switching is achieved by hardware. Regarding (A) and (B) ', even if it is not necessary to access the TCB on the memory, the speed of the work switching is facilitated. Further, in order to realize the work processing apparatus 1, only the function of stopping and restarting the CPU clock may be added to cpui5(). In addition, these functions are borrowed

由硬體實現,並未限定本發明的範圍。例如,藉由硬體實 現(A)或(B)的主要功能,為了辅助硬體功能,亦能以軟體實 現RT0S的-部分功能,此為本發明所屬技術領域中具有通 常知識者所應理解之事。 圖6係圖5之CPU 150的電路圖。The invention is implemented by hardware and does not limit the scope of the invention. For example, by implementing the main functions of (A) or (B) by hardware, in order to assist the hardware function, the -part function of the RTOS can also be implemented in software, which is understood by those having ordinary knowledge in the technical field to which the present invention pertains. Things. 6 is a circuit diagram of the CPU 150 of FIG.

與圖3之CPU84不同,於處理暫存器154,特殊暫 器156與況用暫存器158皆僅有一種。於處理暫存器 分別追加來自載入選擇電路112的輸入匯流排、至保留』 存器no的輸出匯流排、及來自工作切換電路21/ 訊號(wt)用的訊號線。執行控制電路152,藉由對輸 器164的控制訊號(CTRL),將處理暫存器92中之 器的資料輸人至運算電路⑽。運算結果成為至輸入選擇: ⑹的輸入。執行控制電路152,藉由對輸 、:: 控制訊號(CTRL),將運算妹果&amp;Λ + 62 έ “he 至處理暫存器154中』 所欲暫存器。執行控制電路152 _邊 / 的程式計數器一邊執行工作。 沐皙存器15 22 ❹ ❹ 200937294 處理資料並非儲存於記憶體上 留暫存器110。處理資料隨時從處理 存於保 存=:上:資料在何時序储存於何保留暫 存器U0,如上返係藉由工作切換電路21〇所控制。 並非從記憶體上之TCB,而是 存資料載入至處理暫存器154上、:器110將餘 暫存器處理資料載入,如::俜=時序將何保留 21〇所控制。 相Μ玉作切換電路 連接處理暫存器154與載入選擇電路u2、及連接處理 暫存器154與保留暫存器110的匯流排,係能-次平行傳 :處理資料之位元數的匯流排。因此,藉由工作切換電路 210之寫入訊號(WT),能,取與寫入。-般軟體RT0S, 备工作切換時,必須暫時佔有處理暫存器154,相對於此, 本實施例之硬體RTOS’不需將用於工作切換處理的特別處Unlike the CPU 84 of FIG. 3, there is only one type of special register 156 and special register 158 in the processing register 154. In the processing register, an input bus from the load selection circuit 112, an output bus to the reserved memory no, and a signal line from the operation switching circuit 21/signal (wt) are added. The execution control circuit 152 inputs the data of the processor in the processing register 92 to the arithmetic circuit (10) by the control signal (CTRL) to the inverter 164. The result of the operation becomes the input to the input selection: (6). Execution control circuit 152, by means of the input, :: control signal (CTRL), the operation of the sister &amp; Λ + 62 έ "he into the processing register 154" desired register. Execution control circuit 152 _ side / The program counter performs the work on the side. The memory device 15 22 ❹ ❹ 200937294 The processing data is not stored in the memory and the temporary register 110. The processing data is stored at any time from the processing =: on: when the data is stored in the sequence The register U0 is reserved, and the above is controlled by the work switching circuit 21. Instead of loading the data from the TCB on the memory, the data is loaded into the processing register 154, and the device 110 processes the remaining register. The data is loaded, such as: 俜 = timing, which is controlled by 21 。. The switch is connected to the processing register register 154 and the load selection circuit u2, and the connection processing register 154 and the reserved register 110. The bus, the parallel-transmission: the bus that processes the number of bits of the data. Therefore, by the write signal (WT) of the work switching circuit 210, it can be fetched and written. The general software RT0S, When the work is switched, the processing register 154 must be temporarily occupied. In contrast, The hardware RTOS' of this embodiment does not need to be specially used for work switching processing.

理資料載入至處理暫存器154。當從工作A切換至工作B 時,由於儲存工作A的處理資料後僅載入工作B的處理資 料’因此不需要將處理暫存胃154分成系統用與使用者用 的2種、或執行透過堆疊之資料的替換處理。 圖7係顯示執行控制電路152使cpu時脈停止之構造 的電路圖。 &amp; 第2AND閘174的輸入係原時脈(CLK〇)與第ΐΑΝβ閘 172的輸出,後者係負邏輯。第1AND閘172的輸出係停止 結束訊號(HC)。由於停止結束訊號(HC)通常為〇,因此第 2AND閉174將輸入之原時脈(CLK0)直接輸出以作為cpu 23 200937294 時脈(CLK)。CPU150接收第2AND閘174輸出之CPU時脈 而動作。當第1AND閘172的輸出為「1」時,亦即,當停 止結束訊號(HC) = 1時,第2AND閘174之輸出固定為0, CPU時脈(CLK)停止。 第1 AND閘172的輸入係OR閘176的輸出與CPU忙 碌訊號(CBUSY)的輸出,後者係負邏輯。CBUSY,係從產 生CPU 150之内部周期的既知狀態機器輸出的訊號,當 CPU 150為可停止之狀態時為「1」的訊號。例如,運算電 路94使執行中之單一指令或被鎖定之複數個指令的最後指 令結束,當CPU為可停止之狀態時、或CPU時脈之供應已 停止時為「0」。 OR閘176的輸入,係指令解碼器170的輸出 (SC_DETECT)與來自工作切換電路210的停止要求訊號 (HR)。指令解碼器170内建有保持SC_DETECT的鎖存器電 路。指令解碼器170,以從CPU 150讀取的資料(FD)為輸入, 當FD為系統呼叫指令時輸出SC_DETECT = 1。藉由内建鎖 存器電路,即使之後FD變化,指令解碼器1 70亦隨時輸出 SC_DETECT= 1。工作切換電路210對處理暫存器154之寫 入訊號(WT)亦輸入至指令解碼器170。當WT從0變成1 時,如上述執行將儲存資料載入至處理暫存器154的動作。 此WT係在既定時間後從1回到0的脈衝訊號。當WT從1 變成〇時,指令解碼器170的鎖存器電路被重設,指令解 碼器 170停止傳送 SC_DETECT。以圖 8(b)詳細說明 SC_DETECT與寫入訊號(WT)的關係。本實施例之指令解碼 200937294 ;170’係為了判定執行對象指令是否為系統呼叫而專門⑼ :執打控制電路152的裳置。作為變形例,指令解碼器二 /擔虽CPU150之解碼步驟❸cpu解碼器共通化亦可。此 時’心令解碼器17G ’可藉由在cpu解碼器追加當解碼之 資料為系統啤叫指令時輸出SC_DETECT=1的功能來實 現0 备產生中斷要求訊號UNTR)時,工作切換電路21〇將 停止要求訊號(HR)傳至執行控制電路152。亦即,當執行系 ©統呼叫時、或傳送停止要求訊號(HR)時,GR閉176的輸出 為「1」。 紅上所述,當執行系統呼叫或產生中斷要求訊號,且 CPU忙碌訊號為「〇」時,第1AND閘172的輸出為「i」, CPU時脈不會從第2AND閘1 74輸出。 圖8(a)係顯示中斷要求訊號產生時之各種訊號之關係 的時序圖。 圖8(a)中,首先,在時刻t0,工作切換電路210檢測 出來自外部的中斷要求訊號(Intr)。工作切換電路210,為 執行特殊工作’將停止要求訊號(HR)傳至執行控制電路 152。輸入時序tl ’係與檢測時序t〇大致同時。在時刻tl, CPU150之狀態機器係「工作執行中」、CBUSY==丨。由於 HR= 1,因此OR閘176輸出「1」,但因CBUSY = 1故CPU150 不停止。因此,即使輸入HR= 1,CPU時脈(CLK)亦暫時與 原時脈(CLK)同步輸出。The data is loaded into the processing register 154. When switching from job A to job B, only the processing data of job B is loaded after the processing data of job A is stored. Therefore, it is not necessary to divide the process temporary stomach 154 into two types for system use and user use, or to perform transmission. Replacement processing of stacked data. Fig. 7 is a circuit diagram showing a configuration in which the execution control circuit 152 stops the cpu clock. &amp; The input of the second AND gate 174 is the output of the original clock (CLK〇) and the ΐΑΝβ gate 172, the latter being negative logic. The output of the first AND gate 172 stops the end signal (HC). Since the stop end signal (HC) is normally 〇, the second AND 174 turns the input original clock (CLK0) directly as the cpu 23 200937294 clock (CLK). The CPU 150 operates by receiving the CPU clock output from the second AND gate 174. When the output of the first AND gate 172 is "1", that is, when the stop end signal (HC) = 1, the output of the second AND gate 174 is fixed to 0, and the CPU clock (CLK) is stopped. The input of the first AND gate 172 is the output of the OR gate 176 and the output of the CPU busy signal (CBUSY), which is negative logic. CBUSY is a signal output from a known state machine that generates an internal cycle of the CPU 150, and is a signal of "1" when the CPU 150 is in a stop state. For example, the arithmetic circuit 94 ends the execution of the single instruction in execution or the last instruction of the locked plurality of instructions, and is "0" when the CPU is in a stop state or when the supply of the CPU clock has stopped. The input of the OR gate 176 is the output of the command decoder 170 (SC_DETECT) and the stop request signal (HR) from the work switching circuit 210. The instruction decoder 170 has a built-in latch circuit that holds SC_DETECT. The instruction decoder 170 takes as input the data (FD) read from the CPU 150, and outputs SC_DETECT = 1 when the FD is a system call instruction. With the built-in latch circuit, the instruction decoder 1 70 outputs SC_DETECT = 1 at any time even after the FD changes. The write signal (WT) of the work switching circuit 210 to the processing register 154 is also input to the instruction decoder 170. When the WT changes from 0 to 1, the action of loading the stored data into the processing register 154 is performed as described above. This WT is a pulse signal that returns from 1 to 0 after a predetermined time. When the WT changes from 1 to 〇, the latch circuit of the instruction decoder 170 is reset, and the instruction decoder 170 stops transmitting SC_DETECT. The relationship between SC_DETECT and the write signal (WT) is explained in detail in Fig. 8(b). The instruction decoding 200937294; 170' of this embodiment is specifically (9) for determining whether the execution target instruction is a system call: the execution of the control circuit 152 is performed. As a modification, the command decoder 2/load may be shared by the CPU 150 in the decoding step ❸cpu decoder. At this time, the 'heart order decoder 17G' can be operated by the cpu decoder to add the function of SC_DETECT=1 when the decoded data is the system beer call command to realize the interrupt generation request signal (UNTR). The stop request signal (HR) is passed to the execution control circuit 152. That is, when the system is called, or the stop request signal (HR) is transmitted, the output of the GR close 176 is "1". As described above, when a system call or an interrupt request signal is generated and the CPU busy signal is "〇", the output of the first AND gate 172 is "i", and the CPU clock is not output from the second AND gate 1 74. Fig. 8(a) is a timing chart showing the relationship of various signals when the interrupt request signal is generated. In Fig. 8(a), first, at time t0, the operation switching circuit 210 detects an interrupt request signal (Intr) from the outside. The work switching circuit 210 transmits a stop request signal (HR) to the execution control circuit 152 for performing special work. The input timing t' is approximately the same as the detection timing t〇. At time t1, the state machine of the CPU 150 is "work in progress" and CBUSY==丨. Since HR = 1, the OR gate 176 outputs "1", but since CBUSY = 1, the CPU 150 does not stop. Therefore, even if the input HR = 1, the CPU clock (CLK) is temporarily output in synchronization with the original clock (CLK).

時間經過後’在時刻t2變化成CBUSY = 0。由於已HR 25 200937294 =卜因此第1AND閘172輸出HC = 1,從第2AND閘174 輸出之CPU時脈固定為0。另一方面,工作切換電路210, 以HC被傳送為契機,開始從一般工作至特殊工作的工作切 換。其詳細後述,但此工作切換所需時間以工作控制電路 200的動作時脈需數次。從HC被傳送起,以工作控制電路 200的動作時脈變化既定次數為條件(時刻t3),工作控制電 路200停止傳送停止要求訊號(HR)。由於HR=0,因此執 行控制電路152使CPU時脈(CLK)再開始。當CPU 150再開 始處理時,CPU150使CBUSY從0變成1(時刻t4)。以此方 © 式,從CPU時脈停止的時刻t2至時刻t3之間,執行從一 般工作至特殊工作的工作切換。 此外,另一個處理方法,取代工作控制電路200的動 作時脈變化既定次數的條件,以工作控制電路200結束工 作切換為條件,停止傳送HR亦可。又,執行控制電路1 52, 以HR被停止傳送為條件,停止傳送HC亦可。當HC == 0 時,執行控制電路152使CPU時脈(CLK)再開始。以此方 式使工作的執行再開始亦可。 Ο 圖8(b)係顯示系統呼叫執行時之各種訊號之關係的時 序圖。 圖8(b)中,首先,在時刻t0,指令解碼器170檢測出 系統呼叫,使SC—DETECT從0變成1。在時刻t0,CPU150 之狀態機器係「工作執行中」、CBUSY = 1。由於SC_DETECT =1,因此OR閘176輸出「1」,但因CBUSY = 1故CPU150 不停止。因此,即使輸出SC_DETECT = 1,CPU時脈(CLK) 26 200937294 亦暫時與原時脈(CLK0)同步輸出。 時間經過後,在時刻 tl變化成 CBUSY = 0。由於 SC_DETECT= 1 且 CBUSY= 1,因此 HC 被停止傳送,CPU 時脈停止。工作切換電路210,當輸入HC = 0時,開始工 作切換處理,將寫入訊號(WT)輸出至CPU 150。在WT從0 變成1之時刻t2,儲存資料係載入至處理暫存器1 54。寫入 訊號(WT),因脈衝訊號在既定時間經過後的時刻t3變成 WT= 0。藉由此WT : 1— 0的下降檢測,鎖存於指令解碼器 〇 170之SC—DETECT被重設(時刻t4)。此時,CBUSY從0變 成1。由於CBUSY = 1,因此HC = 0,再開始CPU時脈。 從CPU時脈停止的時刻tl至時刻t4之間,執行工作切換。 此外,另一個處理方法,取代WT : 1-&gt; 0的下降檢測條 件,以工作控制電路200結束工作切換,停止傳送HR為條 件,執行控制電路152停止傳送HC亦可。以HC = 0為條 件,重設SC—DETECT。執行控制電路152使CPU時脈(CLK) 再開始,CBUSY從0變成1。 〇 不論是何種情形,CPU 150皆不需在CPU時脈停止期間 辨識RUN —工作之切換的執行。由於工作切換電路210, 在CPU時脈停止,亦即CPU 150凍結(Freeze)的期間執行工 作切換處理,因此CPU 150之處理與工作控制電路200之處 理在程序控制上係分離。 圖9係用以說明管線處理之CPU時脈之停止時序的示 意圖。 CPU1 50 —邊將複數個指令從記憶體依序讀取至處理暫 27 200937294 此工作之執行單位的指 存器154 —邊執行,以執行工作 7可分解成以下4個階段。 l.F(Fetch :讀取):從記憶體取出指令。 2‘D(Decode :解碼):解釋指令。 3. E(Execution :執行):執行指令。 4. WB(Write Back :寫入):將執 制*仃知果寫入記憶體。 某個工作依序從指令丨執行 時在執行指令 之F至WB之後,執行指令2&lt;f 圭#— 亦了然而,為了高纪After the passage of time, it changes to CBUSY = 0 at time t2. Since HR 25 200937294 = Bu, the 1st AND gate 172 outputs HC = 1, and the CPU clock output from the 2nd AND gate 174 is fixed to 0. On the other hand, the work switching circuit 210 starts the work switching from the normal work to the special work with the HC being transmitted as an opportunity. The details will be described later, but the time required for the operation switching is required to be several times in the operation clock of the operation control circuit 200. When the HC is transmitted, the operation control circuit 200 stops the transmission stop request signal (HR) on the condition that the operation clock circuit changes the predetermined number of times of the operation control circuit 200 (time t3). Since HR = 0, the execution control circuit 152 restarts the CPU clock (CLK). When the CPU 150 restarts the processing, the CPU 150 changes CBUSY from 0 to 1 (time t4). In this way, from the time t2 to the time t3 when the CPU clock is stopped, the work switching from the normal work to the special work is performed. Further, another processing method replaces the condition that the operation clock of the operation control circuit 200 changes by a predetermined number of times, and the operation control circuit 200 ends the operation switching condition, and the transmission of the HR is also stopped. Further, the control circuit 1 52 is executed, and the transmission of the HC may be stopped on the condition that the HR is stopped. When HC == 0, the execution control circuit 152 restarts the CPU clock (CLK). In this way, the execution of the work can be resumed. Ο Figure 8(b) is a timing diagram showing the relationship of various signals when the system calls are executed. In Fig. 8(b), first, at time t0, the command decoder 170 detects a system call and changes SC_DETECT from 0 to 1. At time t0, the state machine of the CPU 150 is "work in progress" and CBUSY = 1. Since SC_DETECT =1, the OR gate 176 outputs "1", but since CBUSY = 1, the CPU 150 does not stop. Therefore, even if the output SC_DETECT = 1, the CPU clock (CLK) 26 200937294 is temporarily output synchronously with the original clock (CLK0). After the elapse of time, it changes to CBUSY = 0 at time tl. Since SC_DETECT= 1 and CBUSY= 1, HC is stopped and the CPU clock is stopped. The work switching circuit 210 starts the work switching process when the input HC = 0, and outputs the write signal (WT) to the CPU 150. At time t2 when the WT changes from 0 to 1, the stored data is loaded into the processing register 1 54. The write signal (WT) is changed to WT = 0 at the time t3 after the pulse signal has passed at a predetermined time. With the falling detection of WT : 1 - 0, the SC-DETECT latched in the instruction decoder 〇 170 is reset (time t4). At this time, CBUSY changes from 0 to 1. Since CBUSY = 1, HC = 0, and then start the CPU clock. The operation switching is performed from time t1 to time t4 at which the CPU clock is stopped. Further, another processing method, instead of the falling detection condition of WT: 1-&gt; 0, ends the operation switching by the operation control circuit 200, stops the transmission of HR as a condition, and the execution control circuit 152 stops transmitting the HC. Reset SC-DETECT with HC = 0. The execution control circuit 152 restarts the CPU clock (CLK) and changes CBUSY from 0 to 1.不论 Regardless of the situation, the CPU 150 does not need to recognize the execution of the RUN-work switching during the CPU clock stop. Since the work switching circuit 210 performs the work switching process while the CPU clock is stopped, that is, the CPU 150 freezes (Freeze), the processing of the CPU 150 is separated from the work control circuit 200 by program control. Fig. 9 is a diagram for explaining the stop timing of the CPU clock of the pipeline processing. The CPU1 50 - sequentially reads a plurality of instructions from the memory to the processing temporary 27 200937294 The execution unit of the job 154 is executed to perform the work 7 and can be decomposed into the following four stages. l.F (Fetch: Read): Take the instruction from the memory. 2 'D (Decode: Decode): Interpret the instruction. 3. E (Execution: Execution): Execute the instruction. 4. WB (Write Back: Write): Write the command* into the memory. When a certain operation is executed from the instruction 丨 in the execution of the instruction F to WB, the instruction 2&lt;f 圭#- is also used, however, for the Gaoji

率執饤,大多在指令1執行中即開 |阀始扣令2的執行。此泡 理方法稱為管線處理。例如’當指令i執行至D階段時 開始指令2之F階段。當指合〗批&gt; ” r ㈣1執仃至E階段時,執行相 :了階段、指令…階段。以此方式,藉由增加每 卓位時間所執行之指令數,可減少每個王作的執行時間。 再者’亦可將各階段細分成2個階段。例如,將F階 段分離成F1:F2的2個階段。當指令!執行至ρ2階段時 開始指令2之^階段。當指令i執行至⑴階段時,又執行The rate is stubborn, and most of them are executed during the execution of the command. This method of foaming is called pipeline processing. For example, 'F phase of instruction 2 is started when instruction i is executed to stage D. When the referral batch > ” r (4) 1 is executed to the E stage, the execution phase: the phase, the instruction... phase. In this way, each instruction can be reduced by increasing the number of instructions executed per bit time. The execution time. In addition, the stages can be subdivided into two phases. For example, the F phase is separated into two phases of F1:F2. When the instruction! is executed to the ρ2 phase, the phase of the instruction 2 is started. When i executes to stage (1), it executes again

指令…2階段、指令階段。藉由將階段細分, 可更高效率地利用CPU15G之計算„。圖9係說明在將各 階段細分《2個階段而進行之管線處理,產生系統啤叫時 的CPU時脈停止時序^ 圖9中,指令!在咖時脈「G」的時序開始處理。在 CPU時脈4」的時序,結束指令i的解碼。假設指令1為 系統呼叫。指令解碼器170使SC_DETECT &amp; 〇變成!。接 著’SC一DETECT】回到〇的條件,係從工作切換電路川 28 200937294 至處理暫存器1S4的寫入訊號(WT)&amp; i變成〇。即使 SC—DETECT^,由於指令2〜5已執行中或已執行開始, 因此cBUSY=1。因此,第2AND閑174跟著cpu時脈開 始輸出。然而,執行控制電路152,當sc—detect= i時, 暫時停止程式計數器的更新以使新的指令不會被讀取。是 以’指令6以後不會從記憶體讀取被讀取。 ❹ ❹ 人雖在CPU時脈「8」的時序指令i執行結束,但由於指 令2〜5在執行中,因此CPU忙碌訊號維持「丨」。至^^。 時脈「12」的時序時指令5執行結束。此時,CPU忙碌訊 號為「〇」。之後,依圖8(b)之處理,停止cpu時脈的供應。 工作切換電路210,將指令5結束為止之階段的處理資料儲 存於保留暫存器110。依據此種停止方法,可不浪費系統呼 =行後之指令的執行結果執行工作切換。當工作切換結 日…CPU忙碌訊號再讀設定成「丨」,指令解碼器⑺ 的處理亦再開始。以此方式’再次供應CPU時脈。 此另-個處理方法’在系統呼叫指令執行結束之 可此^CPU忙碌訊號為「〇」,停止CPU時脈的供應亦 二;止::統呼叫指令同時執行之其他指令在執行途 二止之指令的中間處理結果記錄於處理 …54後,儲存於保留暫存器11〇。Command... 2 stages, command stage. By subdividing the stages, the calculation of the CPU 15G can be utilized more efficiently. Fig. 9 is a diagram showing the CPU clock stop timing when the pipeline processing is performed by subdividing each stage into two stages, and the CPU clock stop timing is generated. In the command, the processing starts at the timing of the coffee time "G". At the timing of the CPU clock 4", the decoding of the command i is ended. Assume that Command 1 is a system call. The instruction decoder 170 causes SC_DETECT &amp; 〇 to become! . Next, the condition of "SC-DETECT" is returned to 〇, and the write signal (WT) &amp; i from the work switching circuit Chuan 28 200937294 to the processing register 1S4 becomes 〇. Even if SC_DETECT^, cBUSY=1 because instruction 2~5 has been executed or has been executed. Therefore, the 2nd idle 174 starts outputting along with the cpu clock. However, the execution control circuit 152, when sc_detect = i, temporarily stops the update of the program counter so that the new instruction is not read. Yes It will not be read from the memory after the instruction 6 is read. ❹ 虽 Although the execution of the timing command i of the CPU clock "8" is completed, since the commands 2 to 5 are being executed, the CPU busy signal remains "丨". To ^^. The execution of the command 5 is completed at the timing of the clock "12". At this time, the CPU busy signal is "〇". Thereafter, according to the processing of FIG. 8(b), the supply of the cpu clock is stopped. The work switching circuit 210 stores the processing data at the stage until the end of the instruction 5 in the reservation register 110. According to this stop method, the work switching can be performed without wasting the execution result of the instruction after the system call = line. When the work switching is completed, the CPU busy signal is read and set to "丨", and the processing of the command decoder (7) is resumed. In this way, the CPU clock is supplied again. The other processing method 'At the end of the execution of the system call instruction, the CPU busy signal is "〇", and the supply of the CPU clock is stopped; the other instructions of the system call instruction are executed at the same time. The intermediate processing result of the instruction is recorded in the processing 54 and stored in the reserved register 11A.

Rim—工作時,執 卞下-人成為 茸伽a ”子止之指令的後續處理。例如, 某則&quot;在結束讀取之階段中途停止時,將從 之指令或運算元儲存於保留暫存器u 再;讀取 保留暫存器U。的資料係載入至處理暫存器154,從解:步 29 200937294 驟執行後續處理。 圖10係顯示狀態記憶部220與工作切換電路21〇之關 係的電路圖。 狀態記憶部220包含狀態暫存器25〇與計時器252,狀 態記憶部220保持工作的狀態資料。又,計時器252,係工 作遷移至READY狀態或WAIT狀態時開始的計時器。將工 作遷移至READY狀態後經過的時間稱為「READY經過時 間」,將工作遷移至WAIT狀態後經過的時間稱為「 經過時間」。計時器252之值係作為TIM訊號而隨時輸出。Q 工作切換電路210,當執行工作切換時,某個工作變成 READY狀態或WAIT狀態時,驅動此工作之計時器252再 開始時間測量。 狀態記憶部220係以下所示暫存器的集合。 (A) 工作ID暫存器254 :保持工作ID。表示工作id之 ID訊號係從工作id暫存器254隨時輸出至工作選擇電路 230。以下’將從工作a之工作ID暫存器254輸出至工作 選擇電路230的ID訊號表記為「ID_A訊號」。從狀態記 〇 憶部220輸出之其他訊號亦相同。 (B) 工作優先順序暫存器256 :保持工作優先順序。表 示工作優先順序之PR訊號係從工作優先順序暫存器256隨 時輸出。「0」為最高優先順序,值愈大表示工作優先順序 愈低。 (C) 工作狀態暫存器258 ·•表示工作狀態。STOP、 READY、RUN、WAIT、IDLE其中之一係作為ST訊號而隨 30 200937294 時輸出此外’ IDLE係工作初始化之前的狀態。 (D)工作啟動位址暫存器26〇:表示記憶體中工作之 TCB位址。輸出為AD訊號。 一 (E)待機理由暫存器262:當工作為髓丁狀態時,表 不WAIT解除條件之—部分的待機理由。待機理由為「旗 號等待」、「事件等待」、「互斥等待」其中之-。輸出 為WR訊號。 % (F) 旗號i d暫在哭。&lt; / . a ❹ Ο WAIT H時,㈣f ^、解料理由處於 味、从 對象之旗號(以下,稱為「待機旗 …」)的旗號ID。輸出為sm訊號。 (G) 互斥ID暫存、 WMT狀態時,料料^之作/互斥料為理由處於 ._ '、轉待對象之互斥(以下,稱為「待機互 斥」)的互斥ID。輪出為MID訊號。 事二1D暫存器266:工作以事件等待為理由處於 Γ:二持等待對象之事件(以下,稱為「待機事 」的事件IE^輪出為EID訊號。 WAir狀待ΓΓ標暫存11 268:工作以事件等待為理由處於 持待機旗標類型。“為FL訊號。 WAIT狀=件暫存11 27G:卫作以事件等待為理由處於 Γ旗:=,保持旗標條件。輸出訊號。關於待 機旗払類型與旗標條件將於後述。 (K) 旗標初始化暫 型的資料。輸出為FU訊號。 表示有無待機旗標類 (L) 暫停計數器274:於WAITU統呼叫暫停值被指 31 200937294 ,為變數。暫停計數器274保持暫停值。工作切換電路2i〇 疋期減y各暫停什數器274的暫停值。輸出為τ〇訊號。取 代工作切換電路210減少暫停值,暫停計數器274本身自 律地定期減少本身的暫停值亦可。 工作選擇電路230根據從各狀態記憶部22〇輸出的各 種訊號,執行工作的選擇。工作選擇電路23〇包含以下所 不電路。 (Α)執行選擇電路232:當工作切換時,選擇下一個run 一工作。執行選擇電路232,藉由從狀態記憶部220隨時輸 出之狀態資料恆選擇任一個工作作為RUN —工作。執行選 擇電路232之輸入訊號為ID、ST、PR、TIM的4種類。輸 出為下一個RUN—工作的工作ID »以圖12詳細說明詳細 的電路構成。 (B) 旗號選擇電路234 :藉由解除旗號系統呼叫的執 行’選擇待從WAIT狀態遷移至READY狀態的工作。藉由 解除旗號系統呼叫解除之旗號(以下,稱為「解除旗號」) 的旗號ID係從工作切換電路2 1 〇輸入。來自狀態記憶部22〇 的輸入訊號為ID、ST、WR、PR、SID、TIM的6種類。輸 出訊號為從WAIT狀態遷移至READY狀態之工作的工作 ID。該工作不存在時,輸出_ι等的既定值。以圖Η詳細 說明更具體的電路構成。 (C) 事件選擇電路236 :藉由設定事件系統呼叫的執 行,選擇從WAIT狀態遷移至READY狀態的工作》藉由設 定事件系統呼叫設定之事件(以下,稱為「設定事件」)的事 200937294 件ID係從工作切換電路2 1 0輸入。來自狀態記憶部220的 輸入訊號為ID、ST、WR、EID、FL、FLC的6種類。輸出 訊號為從WAIT狀態遷移至READY狀態之工作的工作ID、 及該工作的FL、FLC。 (D) 暫停檢測電路238 :檢測WAIT狀態之工作中、暫 停計數器274之暫停值為0的工作。暫停檢測電路238每 於更新暫停值時被驅動。暫停檢測電路238的輸入訊號為 ID、ST、TO的3種類。輸出訊號為該工作的工作ID。該 〇 工作不存在時,輸出一1等的既定值。 (E) 互斥電路240 :藉由解除互斥系統呼叫的執行,選 擇從WAIT狀態遷移至READY狀態的工作。藉由解除互斥 系統呼叫解除之互斥(以下,稱為「解除互斥」)的互斥ID 係從工作切換電路2 10輸入。來自狀態記憶部220的輸入 訊號為ID、ST、WR、PR、SID、TIM的6種類。輸出訊號 為從WAIT狀態遷移至READY狀態之工作的工作ID。該 工作不存在時,輸出一1等的既定值。Rim—When you work, you will be able to follow the instructions of the instruction that the person becomes a gamma a. For example, if you stop at the end of the reading phase, the instructions or operands will be stored in the reserved temporary. The memory u is read; the data of the read retention register U is loaded into the processing register 154, and the subsequent processing is executed from the solution: step 29 200937294. Fig. 10 shows the state memory unit 220 and the work switching circuit 21 The state memory unit 220 includes a state register 25 and a timer 252, and the state memory unit 220 holds the status data of the operation. Further, the timer 252 is the time when the operation transitions to the READY state or the WAIT state. The time elapsed after the work is moved to the READY state is called "READY elapsed time", and the elapsed time after the work is migrated to the WAIT state is called "elapsed time". The value of the timer 252 is output as a TIM signal at any time. The Q work switching circuit 210, when a job is switched to a READY state or a WAIT state when a work switching is performed, the timer 252 that drives the operation restarts the time measurement. The state memory unit 220 is a set of registers shown below. (A) Work ID register 254: Keep the work ID. The ID signal indicating the work id is output from the work id register 254 to the work selection circuit 230 at any time. Hereinafter, the ID signal output from the job ID register 254 of the job a to the job selection circuit 230 is referred to as "ID_A signal". The other signals output from the status memory unit 220 are also the same. (B) Work Priority Order 256: Keep work priority. The PR signal indicating the priority of the work is output from the work priority register 256 at any time. "0" is the highest priority, and a larger value indicates a lower priority for work. (C) Working status Register 258 ·• indicates the working status. One of STOP, READY, RUN, WAIT, and IDLE is used as the ST signal and is output with 30 200937294 in addition to the state before the IDLE system is initialized. (D) Work Start Address Register 26〇: Indicates the TCB address of the work in the memory. The output is an AD signal. (E) Standby reason register 262: When the operation is in the state of the puncture, it indicates the reason for the standby of the WAIT release condition. The reason for standby is "flag waiting", "event waiting", and "mutual exclusion". The output is the WR signal. % (F) The flag i d is crying. &lt; / . a ❹ Ο WAIT H, (4) f ^, the nickname ID of the recipe for the taste and the object (hereinafter referred to as "standby flag ..."). The output is the sm signal. (G) Mutually exclusive ID for temporary storage and WMT status, the mutual exclusion ID of the material that is in the ._ ', mutual exclusion of the object (hereinafter referred to as "standby mutual exclusion") . Turn out for the MID signal.事二1D register 266: The work is based on the event waiting for the reason: the event of waiting for the object (hereinafter, the event IE^ called "standby" is the EID signal. WAir waits for the temporary storage 11 268: The work is in the standby flag type for the reason of event waiting. "For the FL signal. WAIT-like = piece temporary storage 11 27G: The guard is in the flag for the event waiting: =, keep the flag condition. Output signal. The standby flag type and flag conditions will be described later. (K) The flag initializes the temporary data. The output is FU signal. Indicates whether there is a standby flag class (L). Suspend counter 274: The WAITU call pause value is referred to 31 200937294, is a variable. The pause counter 274 holds the pause value. The work switching circuit 2i periodically reduces the pause value of each pause counter 274. The output is a τ〇 signal. Instead of the work switching circuit 210, the pause value is decreased, and the counter 274 is paused. The self-discipline itself may periodically reduce its own pause value. The work selection circuit 230 performs work selection based on various signals output from the respective state memory units 22. The work selection circuit 23 includes the following circuits. (Α) Execution selection circuit 232: When the operation is switched, the next run is selected. The execution selection circuit 232 selects any one of the operations from the state memory unit 220 to select any one of the operations as RUN-operation. The input signals of 232 are 4 types of ID, ST, PR, and TIM. The output is the next RUN-working work ID. The detailed circuit configuration is detailed in Fig. 12. (B) Flag selection circuit 234: by releasing the flag system The execution of the call 'selects the work to be moved from the WAIT state to the READY state. The flag ID of the flag for canceling the flag system call release (hereinafter referred to as "release flag") is input from the work switching circuit 2 1 . The input signals of the memory unit 22 are 6 types of ID, ST, WR, PR, SID, and TIM. The output signal is the work ID of the work from the WAIT state to the READY state. When the job does not exist, the output is The specified value is described in more detail in the figure. (C) Event selection circuit 236: Selecting the transition from the WAIT state to the READY state by setting the execution of the event system call In the case of setting an event system call setting event (hereinafter referred to as "setting event"), the 200937294 piece ID is input from the work switching circuit 2 1 0. The input signals from the state memory unit 220 are ID, ST, WR. 6 types of EID, FL, and FLC. The output signal is the work ID of the work from the WAIT state to the READY state, and the FL and FLC of the operation. (D) Suspend detection circuit 238: In the operation of detecting the WAIT state, pause The counter 274 has a pause value of 0. The pause detection circuit 238 is driven every time the pause value is updated. The input signals of the pause detection circuit 238 are three types of ID, ST, and TO. The output signal is the work ID of the job. When the 〇 job does not exist, a predetermined value of one or the like is output. (E) Mutual exclusion circuit 240: Selects the operation from the WAIT state to the READY state by releasing the execution of the mutex system call. The mutual exclusion ID of the mutual exclusion system call release (hereinafter referred to as "disarming") is input from the work switching circuit 2 10 . The input signals from the state memory unit 220 are six types of ID, ST, WR, PR, SID, and TIM. Output Signal The job ID of the job that migrated from the WAIT state to the READY state. When the job does not exist, a predetermined value of one is output.

〇 (F)檢索電路242 :當從工作切換電路210輸入工作ID 時,輸出該工作的所有狀態資料。 以下,說明工作切換相關之RUN —工作選擇、旗號、 事件、互斥、暫停,特別是以工作選擇電路230之處理為 中心,與一般技術比較並說明。 (RUN —工作選擇) (1)一般軟體RTOS之RUN—工作的選擇 圖11係顯示一般RTOS之RUN—工作選擇時所利用之 33 200937294 工作準備串列的圖。 工作準備串列’係形成於記憶體上、以指標連結各 READY -工作之TCB的串列。優先順序指標280,係按各 工作優先順序設置、表示該工作優先順序之工作之TCB的 前端位址。圖11中之工作準備串列的情形,工作優先順序 「〇」之優先順序指標280指向工作A之TCB的位址,工 作優先順序「1」之優先順序指標280指向工作B之TCB 的位址。工作A之TCB進一步指向工作D之TCB的位址。 一般軟體RTOS —邊掃描此工作準備串列一邊選擇下 ❹ 一個RUN —工作。此時’ RTOS執行下述2階段的處理。 A. 將RUN —工作從RUN狀態遷移至READY » B. 選擇下一個RUN —工作,將此工作之工作狀態從 READY狀態遷移至run。 若分解軟體RTOS之各處理則如下所示。 (RUN-工作之狀態遷移) 此處’ RUN —工作係以工作j說明。〇 (F) Retrieval circuit 242: When a job ID is input from the work switching circuit 210, all state data of the job is output. Hereinafter, the RUN-work selection, flag, event, mutual exclusion, and pause associated with the work switching will be described, and in particular, the processing of the work selection circuit 230 will be centered and compared with the general technique. (RUN - Operation Selection) (1) RUN-Working Selection of General Software RTOS Figure 11 is a diagram showing the RUN-operation selection of the general RTOS. The work preparation sequence is formed on the memory, and the READY-working TCB is linked by an index. The priority indicator 280 is a front end address of the TCB that is set in accordance with each work priority order and indicates the work priority order. In the case of the work preparation sequence in FIG. 11, the priority order indicator 280 of the work priority order "指向" points to the address of the TCB of the work A, and the priority order indicator 280 of the work priority order "1" points to the address of the TCB of the work B. . The TCB of Work A further points to the address of the TCB of Work D. General software RTOS - while scanning this work, prepare the list and select the next RUN - work. At this time, the RTOS performs the following two stages of processing. A. Migrate RUN—work from RUN to READY » B. Select Next RUN—Work to migrate the working state of this job from READY to run. The processing of the decomposed software RTOS is as follows. (RUN-work state transition) Here's RUN—the job is described in job j.

Al· RTOS將RUN—工作之工作ID保持於記憶體。根 〇 據此工作ID取得工作J之TCB的位址。 A2.存取TCB,取得工作j之工作優先順序。假設工作 優先順序為「〇」。 A3.取得圖11所示之工作準備串列中、與工作j之工作 優先順序對應的優先順序指標 280 〇 A4·檢測取得之優先順序指標280所表示的TCB。此處 檢測出工作A之TCB。 34 200937294 A5.順著工作A之TCB具有的指標檢測最後端的TCB。 圖11中,工作F為最後端。 A6.將工作F之TCB的指標設定成指向工作J之TCB 的位址。以此方式,工作J之TCB追加至工作準備串列。 A7.將工作J之TCB設定成「READY」。又,將處理 資料複製至TCB的暫存器儲存區。 (READY -工作之狀態遷移) B 1 .RTOS檢測工作優先順序「0」之優先順序指標280 © 表示哪一個TCB。未找到TCB時,檢測工作優先順序「1」 之優先順序指標280表示哪一個TCB。在找到TCB之前, 一邊降低工作優先順序一邊特定任一個工作。圖1 1中,特 定工作A。 B2.將工作A從工作準備串列移除。具體而言,將工作 優先順序「〇」之優先順序指標280覆寫成不是指向工作A 而是指向工作D之TCB的位址。又,將工作A之指標設定 成NULL以不指向工作D的位址。以此方式,將工作A之 © TCB從工作準備串列移除。 B3.將工作A之TCB設定成「RUN」。又,將儲存於工 作A之TCB之暫存器儲存區的處理資料載入至處理暫存 器。 一般軟體RTOS,藉由此種工作準備串列執行工作切 換。亦即,RTOS從複數個READY—工作中選擇RUN—工 作的規則如下。 1.為READY —工作(第1條件)。 35 200937294 2. 為READY —工作中工作優先順序最高的工作(第2條 件)。 3. 當工作優先順序最高的工作存在複數個時,為變成 READY狀態時間最早的工作(第3條件)。 將此等3個條件總稱為「RUN工作選擇條件」。工作 處理裝置100之執行選擇電路232,藉由硬體實現此種RTOS 之工作排程功能。 (2)本實施例之硬體RTOS之RUN—工作的選擇 圖12係執行選擇電路232的電路圖。 此處,說明從工作0〜工作7的8個工作選擇RUN — 工作。執行選擇電路23 2包含4個第1比較電路290(290a 〜290d)、2個第2比較電路292(292a, 292b)、1個第3比較 電路294。又,亦包含8個判定電路296(296a〜296h)。 判定電路296以表示工作狀態的ST訊號為輸入,輸出 READY時表示「1」、READY以外時表示「0」的CID訊 號。判定電路296根據上述RUN工作選擇條件中的第1條 件進行判定。第1比較電路290以2個工作的ID、PR、TIM、 及來自判定電路296的CID訊號為輸入。 著眼於第1比較電路290a來說明。第1比較電路290a 比較工作〇與工作1,根據上述RUN工作選擇條件選擇較 佳的工作。 第1判定:首先,比較分別從判定電路296a與判定電 路296b輸出的CID訊號。其中一者為「1」時,亦即,僅 其中一者之工作為READY狀態時,第1比較電路290a輸 200937294 TIM。皆為「〇」時,亦即,任一工作Al·RTOS keeps the RUN-work ID in memory. Root 取得 Get the address of the TCB of job J based on this work ID. A2. Access the TCB and get the work priority of the job j. Assume that the work priority is "〇". A3. The priority index corresponding to the priority of the work of the job j in the work preparation sequence shown in Fig. 11 is obtained. 280 A4 The TCB indicated by the priority index 280 obtained by the detection is obtained. The TCB of job A is detected here. 34 200937294 A5. Detect the last TCB along the indicator of the TCB of Work A. In Figure 11, the work F is the last end. A6. Set the indicator of the TCB of the work F to the address of the TCB pointing to the work J. In this way, the TCB of job J is appended to the work preparation list. A7. Set the TCB of job J to "READY". Also, the processing data is copied to the register storage area of the TCB. (READY - State transition of the job) B 1. The priority order indicator 280 of the RTOS detection work priority "0" © indicates which TCB. When the TCB is not found, the priority index 280 of the detection work priority "1" indicates which TCB. Before you find the TCB, you can work at a specific level while reducing your work priorities. In Figure 11, the specific work A. B2. Remove Work A from the work preparation list. Specifically, the priority order indicator 280 of the work priority order "〇" is overwritten with the address of the TCB that does not point to the work A but to the work D. Also, the indicator of job A is set to NULL so as not to point to the address of job D. In this way, the © TCB of job A is removed from the work preparation list. B3. Set the TCB of job A to "RUN". Further, the processing data stored in the scratchpad storage area of the TCB of the work A is loaded into the processing register. The general software RTOS, through this type of work preparation, performs work switching. That is, the RTOS selects RUN from a plurality of READY-work--the rules of the work are as follows. 1. READY - work (1st condition). 35 200937294 2. For READY - work with the highest priority in work (Article 2). 3. When there are a plurality of jobs with the highest work priority order, the work that becomes the READY state is the earliest (the third condition). These three conditions are collectively referred to as "RUN work selection conditions". The execution selection circuit 232 of the work processing apparatus 100 implements the work scheduling function of such an RTOS by hardware. (2) Selection of RUN-Operation of Hardware RTOS of the Present Embodiment FIG. 12 is a circuit diagram of the execution selection circuit 232. Here, it is explained that RUN_operation is selected from eight jobs of work 0 to work 7. The execution selection circuit 23 2 includes four first comparison circuits 290 (290a to 290d), two second comparison circuits 292 (292a, 292b), and one third comparison circuit 294. Further, eight determination circuits 296 (296a to 296h) are also included. The determination circuit 296 takes an ST signal indicating the operation state as an input, and outputs a READY indicating "1" or a CID signal indicating "0" when the READY is other than READY. The determination circuit 296 makes a determination based on the first condition in the above-described RUN operation selection condition. The first comparison circuit 290 inputs the ID, PR, TIM, and CID signal from the decision circuit 296 of two operations. The first comparison circuit 290a will be described with a focus. The first comparison circuit 290a compares the operation 工作 with the operation 1, and selects a better operation based on the RUN operation selection condition described above. First determination: First, the CID signals output from the determination circuit 296a and the determination circuit 296b are compared. When one of them is "1", that is, when only one of the operations is in the READY state, the first comparison circuit 290a inputs the 200937294 TIM. When they are all "〇", that is, any work

出該工作之ID、pR 音非READY狀態時,第J比較電路2術輸出⑴二pR = τιμ = NULL。此係表示任—卫作皆未被選擇。皆為「1」時, 亦即任工作皆為READY狀態時,進行接下來的第2判 定。When the ID of the job and the pR tone are not in the READY state, the Jth comparison circuit 2 outputs (1) two pR = τιμ = NULL. This department indicates that Ren Wei Wei has not been selected. When all are "1", that is, when the work is in the READY state, the next second determination is made.

第2判疋.比較工作〇的pR訊號與工作丨的pR訊號, 選擇工作優先順序③的卫作。例如,卫作α的卫作優先順 序為1」、工作1的工作優先順序為「2」時,輸出工作〇 之ID、PR、TIM。藉由第2判定,可選擇工作優先順序高 的工作作為RUN-I作的候補。工作G與工作丨之工作優 先順序相同時,進行接下來的第3判定。 第3判定:比較工作〇的TIM訊號與工作i的耵^訊 號,選擇READY經過時間長的工作。READY經過時間相 同時,假設選擇工作〇。由於僅比較經過時間的大小即可判 疋’因此不需要工作準備串列般的Tcb順序管理。 以此方式,藉由RUN工作選擇條件分別比較工作〇 工作1、工作2與工作3、工作4與工作5、工作6與工 7。第2比較電路292,藉由2個第i比較電路29〇的輪 進一步篩選RUN—工作的候補。第2比較電路292&amp;,藉 第1比較電路290a與第1比較電路290b的輸出執行工作 擇。因此,第2比較電路292a輸出工作〇〜工柞α丄 j中最 合RUN工作選擇條件之工作的id、Pr、TIM。 J比較 路294亦相同,第3比較電路294輸出工作〇〜工 *r 7 一工作的工作ID。 37 200937294 依據此種處理方法,能以硬體實現RUN工作選擇條 件。雖一般軟體RTOS —邊存取工作準備串列一邊選擇run -工作,但本實施例之執行選擇電路232,藉由從狀態記憶 部220隨時輸出之狀態資料選擇RUN—工作。综合執行選 擇電路232的處理則如下述。 、 (RUN —工作的狀態遷移) 此處,RUN —工作係以工作j說明。 A1.工作切換電路21〇將工作j之工作狀態暫存器258 設定成「READY」。 A2.工作切換電路21〇設定工作】之計時器252開始測 量READY經過時間。 以此方式,工作j從RUN狀態遷移至READY。如上述, 將處理資料儲存於工作j之保留暫存器11〇。由於連接處理 暫存器154與保留暫存器11〇的匯流排可平行傳送處理資 料,因此可在1個時脈時間執行A1與A2的處理。 (READY —工作的狀態遷移) B1.工作切換電路21〇,當工作j之狀態遷移結束時, 從執行選擇電路232輸出之工作ID特定RUN —工作。將此 工作之工作狀態暫存器258設定成「run」。 以此方式,特定之工作從REady狀態遷移至RUN。將 特疋之工作之處理資料從保留暫存器11〇載入至處理暫存 器154。由於連接保留暫存器110與處理暫存器154的匯流 排亦為可平行傳送處理資料的位元數,因此可在1個時脈 時間執行B 1的處理。 38 200937294 軟體簡,當工作切換時,由於對工作準備串列的存 取,4費較多CPU的CPU時脈時間。相對於此,本 之工作控制電路靡,能以些微時間結束工作切換。由於: 態記憶部22G將狀態資料隨時輸出至執行選擇電路m 此執行選擇電路232隨時輸出任一工作之工作m。並不b 在產生工作切換後開始刪_工作的選擇處理,而是在: 生工作切換時以執行選擇電路232之輸出執行_ — ❹ 的選擇,此點亦有助於增加卫作切換的速度。此處, 明工作為8個’但藉由增加比較電路的段數,亦可對應更 多的工作》 ’ (旗號處理) 圖13係顯示一般_之旗號處理所利用之待機 串列的圖。 在說明待機旗號串列之前,先簡單說明旗號。在旗號 表212 ’旗號ID與旗號計數器係相對應紀錄。旗號計數器 〇 之初始值係δ又定成有限數。例如,假設設定成旗號ID = 4、 旗號汁數器-3。當任一工作以旗號1〇=4之旗號作為待機 旗號執行待機旗號系統呼叫時,工作切換電路21〇減少待 機旗號的旗號计數器。旗號計數器,係每當因待機旗號系 、,呼叫而被要求獲得時減少,變成〇時則無法獲得。以旗 號。十數器為〇之旗號作為待機旗號執行待機旗號系統呼叫 的工作,狀態遷移至WAIT狀態。 另 ^^ 方面 木 ’當任一工作以旗號ID = 4之旗號作為解除 號執行解除旗號*系統呼叫時,工作切換電路210增加旗 39 200937294 號表212的旗號計數器。綜合來說, 旗號計數器&gt;0時··執行待機旗號系統呼叫的工作從 RUN遷移至READY。此時,減少旗號計數器。 旗號計數器=〇時:執行待機旗號系統呼叫的工作從 RUN遷移至WAITe不減少旗號計數器。 執行待機旗號系統呼叫的卫作為了從Wait狀態遷移 UEADY狀態’另—個工作必須執行解除旗號系統呼叫。 (1)一般軟體RTOS之旗號處理 一般軟體RT〇S藉由待機旗號串列管理以旗號等待為 理由而處於㈣丁狀態之工作(以下,特別稱為「旗號等待 工作」)的TCB。待機旗號串列係與圖u之工作準備串列带 狀相同的串列,形成於記憶體上。各旗號等待工作的咖 係藉由指標連結。優先順序指標28()指向該卫作優先順序 之旗號等待工作之TCB的前端位址。 一般軟體RTOS’當執行解除旗號系統啤叫時,一邊 描此待機旗號串列-邊選擇待從WAIT狀態遷移至肛撕 狀態的旗號等待工作。待機旗號系統呼叫及解除旗號系统 呼叫執行時之Rtos的處理係如下述。 (待機旗號系統呼叫的執行) 此處,RUN —工作係以工作j說明。 A1.RT0s將麵—工作的工作①保持在記憶體。根據 此工作ID取得工作j之TCB的位址。 ★ A2·檢測於待機旗號系統呼叫指定之待機旗號的旗號 汁數器。以下,依旗號計數器的值處理產生分歧。 200937294 (旗號計數器&gt; 0時) A3.RTOS減少待機旗號的旗號計數器。 Α4.將工作J之TCB設定成「READY」。此時,工作j 之TCB追加至工作準備串列。 (旗號計數器=0時) A3.存取TCB以取得工作】的工作優先順序。假設工作 優先順序為「〇」。The second judgment. Compare the pR signal of the work 与 with the pR signal of the work ,, and select the work order of work priority 3. For example, when the priority of the guardship α is 1" and the priority of the work 1 is "2", the ID, PR, and TIM of the work order are output. According to the second determination, the work with a high priority of work can be selected as a candidate for RUN-I. When the work G and the job work are in the same priority order, the next third decision is made. The third judgment: comparing the TIM signal of the work 与 with the 耵^ signal of the work i, and selecting the READY to work for a long time. The READY elapsed time is the same, assuming that the work is selected. Since only the elapsed time is compared, it can be judged that 'there is no need to work in tandem Tcb order management. In this way, work 〇 work 1, work 2 and work 3, work 4 and work 5, work 6 and work 7 are respectively compared by the RUN work selection condition. The second comparison circuit 292 further filters the candidates for the RUN-operation by the wheels of the two ith comparison circuits 29A. The second comparison circuit 292 &amp; performs the operation by the outputs of the first comparison circuit 290a and the first comparison circuit 290b. Therefore, the second comparison circuit 292a outputs the id, Pr, and TIM of the operation of the most RUN operation selection condition among the work 〇 to the work 柞 α 丄 j. The J comparison circuit 294 is also the same, and the third comparison circuit 294 outputs the work ID of the work 〇~工*r 7 . 37 200937294 According to this processing method, the RUN operation selection condition can be realized by hardware. Although the general software RTOS - side access operation preparation sequence selects the run - operation, the execution selection circuit 232 of the present embodiment selects RUN - operation by the status data output from the status memory unit 220 at any time. The processing of the integrated execution selection circuit 232 is as follows. , (RUN - state transition of work) Here, RUN - the work is described by job j. A1. The work switching circuit 21 sets the operation state register 258 of the job j to "READY". A2. The operation switching circuit 21 〇 setting operation timer 252 starts measuring the READY elapsed time. In this way, job j migrates from the RUN state to READY. As described above, the processing data is stored in the reserved register 11 of the job j. Since the connection processing register 154 and the bus bar of the reserved register 11 are capable of transmitting the processing data in parallel, the processing of A1 and A2 can be performed at one clock time. (READY - State transition of operation) B1. The job switching circuit 21A, when the state transition of the job j is completed, the job ID specified from the execution selection circuit 232 is specified to be RUN-operated. The work status register 258 of this job is set to "run". In this way, the specific work is moved from the REady state to the RUN. The processing data of the special work is loaded from the reservation register 11 to the processing register 154. Since the bus pool connecting the reservation register 110 and the processing register 154 is also the number of bits in which the processing data can be transferred in parallel, the processing of B 1 can be performed at one clock time. 38 200937294 Software simplification, when the work is switched, due to the access to the work preparation string, 4 CPU CPU clock time is more. In contrast, the work control circuit 本 can end the work switching with a slight time. Since the state memory unit 22G outputs the state data to the execution selection circuit m at any time, the execution selection circuit 232 outputs the work m of any work at any time. The b does not start the deletion process after the work switching is started, but the execution of the selection circuit 232 is performed at the time of the work switching to perform the selection of the __❹, which also helps to increase the speed of the switching. . Here, the operation is 8 ', but by increasing the number of segments of the comparison circuit, it is also possible to correspond to more work" (flag processing). Fig. 13 is a diagram showing the standby sequence used for the general flag processing. Before describing the standby flag sequence, simply explain the flag. In the flag table 212 ‘flag ID corresponds to the flag counter. The initial value δ of the flag counter 〇 is also determined to be a finite number. For example, assume that the flag ID = 4, the flag number -3 is set. When any job performs the standby flag system call with the flag of flag = 1 = 4 as the standby flag, the work switching circuit 21 reduces the flag counter of the standby flag. The flag counter is reduced when it is requested to be acquired due to the standby flag number, and is not available when it becomes 〇. Take the flag. The tensor is used as the standby flag to perform the standby flag system call, and the state transitions to the WAIT state. In addition, when the work is performed with the flag of the flag ID = 4 as the release number, the work switching circuit 210 increases the flag counter of the table No. 29 200937294. In summary, the flag counter &gt; 0 ····································· At this point, reduce the flag counter. Flag Counter = 〇: The job of executing the standby flag system call from RUN to WAITe does not reduce the flag counter. The guard performing the standby flag system call migrated from the Wait state to the UEADY state. Another job must perform the un-flag system call. (1) General software RTOS flag processing The general software RT〇S manages the TCB in the (four) state (hereinafter, particularly referred to as "flag waiting work") by waiting for the flag to wait for the reason of the flag waiting. The standby flag series is formed in the same memory as the series prepared in the figure u, and is formed on the memory. The cafés that are waiting for work are linked by indicators. The priority indicator 28() points to the front-end address of the TCB waiting for the flag of the guard priority. The general software RTOS' waits for the flag to be moved from the WAIT state to the anal tear state while performing the unloading of the flag system. Standby flag system call and release flag system The processing of Rtos during call execution is as follows. (Execution of standby flag system call) Here, RUN—work is described by job j. A1.RT0s keeps the face-work work 1 in memory. According to this work ID, the address of the TCB of the job j is obtained. ★ A2·Detected in the standby flag system call the designated flag of the standby flag. In the following, the difference is handled by the value processing of the flag counter. 200937294 (Flag counter &gt; 0) A3.RTOS reduces the flag counter of the standby flag. Α 4. Set the TCB of job J to "READY". At this time, the TCB of the job j is added to the work preparation sequence. (When the flag counter = 0) A3. Access the TCB to get the job priority. Assume that the work priority is "〇".

A4.取得待機旗號串列中、與工作;的工作優先順序對 應的優先順序指標。 A5.檢測取得之優先順序指標表示的tcb。此處,檢測 出工作A的TCB。 A6JI員著工作八之TCB具有的指標檢測最後端的τα。 圖13中,工作F為最後端。A4. Obtain the priority index corresponding to the work priority order in the standby flag series. A5. Detect the tcb indicated by the priority indicator obtained. Here, the TCB of the work A is detected. The A6JI is working on the TCB of the work VIII to detect the τα at the last end. In Figure 13, the work F is the last end.

A7·將工作F之TCB的指標設定成指向I作;之TCB 的位址。以此方式,工们之TCB追加至待機旗號串列。 A8.將工作j之TCB設定成「」。 機旗號的旗號IDe 又疋得 (解除旗號系統的執行) 除旗序順著卫作優先順序「G」的卫作檢索以解 除旗就為待機旗號的旗號等 去順庠Γ1 ^ Ύ不存在時,以工作優 號為待隸\為檢索對象。依據是魏測4以解除旗 號為待機旗柄旗㈣待卫作,處理產生分歧。 (檢測出時) 乂檢測出之工作為工作Ε來說明。將工作Ε之 41 200937294 設定成「READΥ」。又,清除待機旗號的旗號ID。 B3.將工作E之TCB從待機旗號串列移除。 B4.將解除旗號之工作的狀態從RUN狀態遷移至 READY 〇將此工作之TCB追加至工作準備串列。 (未檢測出時) B2.增加旗號計數器。 B3.將解除旗號之工作的狀態從RUN狀態遷移至 READY。將此工作之TCB追加至工作準備串列。 一般軟體RTOS,藉由管理此種待機旗號串列,執行旗 號相關處理。當解除旗號時,RTOS從複數個WAIT—工作 中選擇READY _工作的規則如下。 1. 為WAIT —工作(第1條件)。 2. 為WAIT—工作中以解除旗號為待機旗號的工作(第2 條件)。 3. 當此種工作存在複數個時,為工作優先順序最高的工 作(第3條件)。 4. 當工作優先順序最高的工作存在複數個時,為變成 WAIT狀態時間最早的工作(第4條件)。 將此等4個條件總稱為「旗號待機解除條件」。工作 處理裝置100之旗號選擇電路234,藉由硬體實現此種RTOS 之工作排程功能。 (2)本實施例之硬體RTOS之旗號處理 圖14係旗號選擇電路234的電路圖。 此處,亦說明工作0〜工作7的8個工作。旗號選擇電 42 200937294 路234包含4個第工比較電路3〇〇(3〇〇a〜3〇〇d)、2個第2 比較電路302(302a,302b)、i個第3比較電路3〇4。又亦 包含8個判定電路306(306a〜306h)。 ❹ ❹ 判定電路306,係以來自狀態記憶部22〇之打、魏、 SID訊號與來自卫作切換電路21()之表示旗號⑴之訊號為 輸入的電路。此處輸入之旗號ID,係解除旗號的旗號^ 判定電路306㈣為以解除旗號為待機旗號的旗號等待工 作時表示M」、不是以解除旗號為待機旗號的旗號等待工 作時表示「〇』CID訊號。判定電路3〇6,係輸出上述旗 號待機解除條件中之第i條件與第2條件相關之判定结果 的電路。第!比較電路鳩以2個工作的m pRH 來自判定電路306的CID訊號為輸入。 第1比較電路,麵行㈣錢解除條件中之第3 條件與第4條件相關之判定的電路。第2比較電路與 第3比較電路304亦相同。如上述,刪工作選擇條件之 条牛及第3條件,與旗號待機解除條件之第3條件及 第4條件相同。執行選擇電路叫之各比較電路,係比較 =作之狀態資料(PR、TIM)的電路。另一方面,旗號選擇電 234之各比較電路亦為比較工作之狀態資料㈣、τ 的電路。1以’執行選擇電路232之第i比較電路29〇與 :號選擇電路234之第1比較電路3〇〇,係内建相同邏輯的 路可加以共通化。各工作除了被判定電路306以第1 2與第2條件判定外,亦被傳至第!比較電⑬綱的判 &amp;理之後,藉由與執行選擇電路232相同的判定處理, 43 200937294 從第3比較電路304輸出任-…。待機旗號系統呼叫 與解除旗號系統呼叫執行時之處理如下述。 (待機旗號系統呼叫的執行) 此處,RUN—工作係以工作j說明 212檢測於待機旗號系 以下,依旗號計數器的 A1.工作切換電路21〇從旗號表 統呼叫指疋之旗说的旗號計數器。 值,處理產生分歧。 (旗號計數器&gt;0時)A7· Set the indicator of TCB of work F to point to I; the address of TCB. In this way, the workers' TCBs are added to the standby flag series. A8. Set the TCB of job j to "". The flag of the flag is IDe and it is won (the execution of the flag system is removed). In addition to the flag order, the Guardian of the priority order "G" is searched to release the flag, and the flag of the standby flag is shun 1 ^ Ύ does not exist. , with the job ID as the subject of retrieval. According to Wei Test 4, the flag is released as the standby flag flag (4), and the handling is divided. (When detected) 乂 The work detected is the work Ε to explain. Set the work 41 41 200937294 to "READ Υ". Also, the flag ID of the standby flag is cleared. B3. Remove the TCB of the work E from the standby flag series. B4. Move the status of the work to release the flag from the RUN state to READY. Add the TCB of this job to the job preparation sequence. (When not detected) B2. Increase the flag counter. B3. Move the status of the work to remove the flag from the RUN state to READY. Add the TCB of this job to the work preparation list. The general software RTOS performs flag correlation processing by managing such a standby flag sequence. When the flag is removed, the RTOS selects the READY_work from a plurality of WAIT-work rules as follows. 1. Work for WAIT (1st condition). 2. For WAIT - work to release the flag as the standby flag (2nd condition). 3. When there are multiple such jobs, the work with the highest priority of work (the third condition). 4. When there are a plurality of jobs with the highest work priority order, the work that becomes the earliest in the WAIT state time (the fourth condition). These four conditions are collectively referred to as "flag standby cancellation conditions". The flag selection circuit 234 of the work processing apparatus 100 implements the work scheduling function of such an RTOS by hardware. (2) Flag processing of the hardware RTOS of the present embodiment Fig. 14 is a circuit diagram of the flag selection circuit 234. Here, eight jobs from work 0 to work 7 are also explained. Flag selection power 42 200937294 Road 234 includes four comparator comparison circuits 3〇〇(3〇〇a~3〇〇d), two second comparison circuits 302 (302a, 302b), and i third comparison circuits 3〇 4. Eight decision circuits 306 (306a to 306h) are also included. The 判定 判定 determination circuit 306 is a circuit that inputs signals from the state memory unit 22, the Wei, SID signal, and the signal (1) from the guard switching circuit 21 (). The flag ID entered here is the flag of the unloaded flag. ^ The decision circuit 306 (4) indicates that the flag is the flag of the standby flag when the flag is released, and the flag is called "M", and the flag is not the flag of the standby flag. The determination circuit 3〇6 is a circuit that outputs a determination result related to the i-th condition and the second condition in the flag standby cancellation condition. The comparison control circuit m the CID signal from the determination circuit 306 with m pRH of two operations is The first comparison circuit is a circuit that determines the third condition and the fourth condition in the money cancellation condition. The second comparison circuit is the same as the third comparison circuit 304. As described above, the work selection condition is deleted. The third condition and the fourth condition are the same as the third condition and the fourth condition of the flag standby cancellation condition. The comparison circuit for executing the selection circuit is a circuit for comparing the status data (PR, TIM) of the flag. Each of the comparison circuits of the selection power 234 is also a circuit for comparing the status data (4) and τ of the operation. 1 is the first ratio of the ith comparison circuit 29A and the number selection circuit 234 of the execution selection circuit 232. Compared with the circuit 3, the same logic can be shared. The work is judged by the decision circuit 306 under the conditions of the first and second conditions, and is also passed to the first! After that, by the same determination process as the execution selection circuit 232, 43 200937294 outputs any -... from the third comparison circuit 304. The processing of the standby flag system call and the release flag system call execution is as follows. (Standby flag system call Execution) Here, the RUN-work is detected by the job j 212 below the standby flag number, according to the flag counter A1. The work switching circuit 21〇 calls the flag counter from the flag of the flag list. Divergence. (Flag counter &gt; 0)

A2.工作切換電路21()減少旗號表212的旗號計數器。 A3·將工作J之工作i態暫存器258設定成「ready」。 此時’工作切換電路21〇設定咖―工作之計時器⑸, 開始測量READY經過時間。 (旗號計數器=〇時) A2.工作切換電路21G,將U之工作狀態暫存器258 設定成「W·」、待機理由暫存器262設定成「旗號等待」、A2. The work switching circuit 21 () reduces the flag counter of the flag table 212. A3. Set the working state i state register 258 of the job J to "ready". At this time, the "work switching circuit 21" sets the timer of the coffee-operation (5), and starts measuring the READY elapsed time. (A flag counter = 〇) A2. The operation switching circuit 21G sets the U operating state register 258 to "W·", and the standby reason register 262 is set to "flag waiting",

旗號1D暫存器264設定成待機旗號的旗號ID,設定計時器 252,開始測量WAIT經過時間。 以此方 &lt;,執行待機旗號系統呼叫的工作從RUN狀態 遷移至READY或WAIT。 (解除旗號系統呼叫的執行) B1.工作切換電路210將解除旗號的旗號ID輸入至各 判疋電路3G6。各判定電路3G6以此旗號m為對象判定旗 號解除條件中之第1條件及帛2條件是否成立。是以,各 第1比較電路則根據第3條件及第4條件選擇工作。 44 200937294 第3比較電路304 (任一個判定電路306輪出Γι」 輸出任一個工作ID時) 「B2.將檢測出之工作之工作狀態暫存器258設定成 READY」’清除待機理由暫存器如與旗號⑴暫存器 264,以計時器252測量READY經過時間。 B 3 .將執行系統呼叫之工作 ,,Γ〇ϋΑ 作之工作狀態暫存器258設定 成ready」,開始測量REady經過時間。 ❹ ❹ 3咐任未定電路306皆未輸出Γι」、第3比較電路 3〇4亦未輸出任—個工作m時) =切換電路210增加旗號表212的旗號計數器。 READY。订系統呼叫之工作之狀態從RUN狀態遷移至 電路記憶,220將狀態資料隨時輸出至旗號選擇 =時:當工作切換電路210將旗號⑴輸人至判定 電路306時,旗號選擇電路2 卩執仃選擇處理。 互斥亦與旗號相同,利用工作間之 旗號在以下幾點不同。 步處理。互斥與 I旗號計數器可設定成上的整數。 係旗號計數器為i或〇㈣殊、;,互斥 上時,2個以上的工作可獲得相同旗號^^數器為2以 可獲得某個互斥的工作怪僅有⑽。…、而,當互斥時, 2.可藉由解除旗號㈣呼叫解除旗 藉由待機旗㈣料㈣得㈣的卫作 作’並不限於 7相對於此,可藉 45 200937294 由解除互斥系統呼叫解除互斥的工作,僅為藉由待機互斥 系統呼叫獲得互斥的工作。 當解除互斥時,從複數個WA.工作中_ READY 一工作的規則如下。 1.為WAIT —工作(第i條件)。 條件)2^魏卜工作中以解除互斥為待貞互斥的工作(第2 為工作優先順序最高的工 3.當此種工作存在複數個時, 作(第3條件)。The flag 1D register 264 is set to the flag ID of the standby flag, and the timer 252 is set to start measuring the WAIT elapsed time. With this side, the work of executing the standby flag system call is moved from the RUN state to READY or WAIT. (Release execution of the flag system call) B1. The work switching circuit 210 inputs the flag ID of the release flag to each of the decision circuits 3G6. Each of the determination circuits 3G6 determines whether or not the first condition and the 帛2 condition in the flag release condition are satisfied by the flag m. Therefore, each of the first comparison circuits selects an operation based on the third condition and the fourth condition. 44 200937294 The third comparison circuit 304 (when any of the determination circuits 306 is rotated by 」" to output any of the job IDs) "B2. Set the detected operation state register 258 to READY" "Clear the standby reason register" As with the flag (1) register 264, the READY elapsed time is measured by the timer 252. B 3. The system call will be executed, and the working state register 258 is set to ready, and the eady elapsed time is measured. ❹ ❹ 3 未 未 未 306 306 306 306 、 、 、 、 、 、 、 、 、 、 、 、 、 、 、 、 、 、 、 、 、 、 、 = = = = = = = = = = = = = = = = READY. The status of the system call job is transferred from the RUN state to the circuit memory, and the status data is output to the flag selection at any time. When the work switching circuit 210 inputs the flag (1) to the decision circuit 306, the flag selection circuit 2 is executed. Choose to process. The mutual exclusion is also the same as the flag, and the use of the banner of the workplace differs in the following points. Step processing. The mutual exclusion and I flag counters can be set to the upper integer. The flag number counter is i or 〇(4), and, when mutually exclusive, more than two jobs can obtain the same flag. The number of devices is 2 to obtain a mutually exclusive work blame only (10). ..., and, when mutually exclusive, 2. Can be removed by the flag (4) to cancel the flag by the standby flag (four) material (four) to get the (four) of the work of the 'four is not limited to this, can be borrowed 45 200937294 by the mutual exclusion The system calls the demutation work only to obtain mutually exclusive work by calling the mutual exclusion system call. When the mutual exclusion is removed, the rules for working from _ READY from multiple WA. are as follows. 1. Work for WAIT (I-condition). Condition) 2^Wei Bu work to remove mutual exclusion as the work of mutual exclusion (the second is the work with the highest priority of work 3. When there are multiple such work, do (the third condition).

4·當工作優先順序最高的玉作存在複數個時,為變成 AIT狀態時間最早的工作(第4條件)。 將此等4個條件總稱為「互斥待機解除條件」。 是以,待機互斥系統呼叫及解除互斥系統呼叫執行時 :本實施例之硬體RT〇S的處理如下述。在旗號表212,互4. When there are a plurality of jade works with the highest priority of work, it is the earliest work in the AIT state (the fourth condition). These four conditions are collectively referred to as "mutual exclusion standby cancellation conditions". Therefore, when the standby mutual exclusion system calls and releases the mutual exclusion system call execution: the processing of the hardware RT〇S of the present embodiment is as follows. In the flag table 212, mutual

相對康與表7該互斥疋否佔有任一個工作的佔有狀態資料係 十應保持。佔有狀態資料,當未佔有時為「〇」、去佔 時為佔有互斥之工作的工作ID。 (待機互斥系統呼叫的執行) 此處,RUN —工作係以工作j說明。 二.工作切換電路21〇檢測是否佔有於待機互斥系統 «疋的互斥。以下,依互斥的佔有狀態,處理產生分屯 (未佔有互斥時)Relative to Kang and Table 7, the mutual exclusion, whether the possession status data of any job is ten should be maintained. Occupation status data, when not occupied, is sometimes "〇", and is occupied as the work ID of the work that is mutually exclusive. (Execution of Standby Mutual System Call) Here, RUN—work is described by job j. 2. The work switching circuit 21 detects whether it is occupied by the standby mutual exclusion system «疋 mutual exclusion. In the following, according to the exclusive state of the exclusive state, the processing generates a branch (when the exclusive exclusion is not occupied)

ID A工作切換電路21G記錄執行线呼叫之工作的 以作為互斥的佔有資料。 46 200937294 A3.將工作J之工作狀態暫存器258設定成「rEady」。 此時’工作切換電路21 〇設定run —工作之計時器252, 開始測量READY經過時間。 (佔有互斥時) A2.工作切換電路21〇,將工作j之工作狀態暫存器258 設定成「WAIT」、待機理由暫存器262設定成「互斥等待」、 互斥ID暫存器265設定成待機互斥的互斥ID,設定計時器 252,間始測量WAIT經過時間。 (解除互斥系統呼叫的執行) B1.工作切換電路21〇,以執行系統呼叫之工作佔有解 除互斥為條件,將解除旗號1〇輸入至互斥電路24〇。互斥 電路240亦與圖14相同,包含多段連接的比較電路與判定 f斥待機解除條件中之第i條件及第2條件是否成立的判 疋電路。此判疋電路,以此互斥為對象,僅於互斥待機解 $條件中之第&quot;条件及第2條件皆成立時輸出「…此外, 〇 當未佔有解除互斥之工作執行解除互斥系統呼叫時,將該 工作之狀態從RUN狀態遷移至ready。 (任個判定電路輸出「1」、互斥電路240輪出任一個 工作ID時) 「 B2.將檢測出之工作之工作狀態暫存器258設定成 J凊除待機理由暫存器262與互斥id暫存器 265,以計時器252測量REady經過時間。 、 將執行系統呼叫之工作之工作狀態暫存器258設定 成「READY」’開始測量READY經過時間。 47 200937294 (任-個判定電路皆未輪出 出任一個工作⑴時) 立汴電路240亦未輸 B2·工作切換電路21〇 佔有狀態。 、旗號表212,將互斥設定成非 B3.將執行系統呼叫 READY。 作之狀態從RUN狀態遷移至 (事件處理) 簡單說明本實施例之事件The ID A work switching circuit 21G records the work of performing the line call as the exclusive possession data. 46 200937294 A3. Set the working state register 258 of the job J to "rEady". At this time, the "work switching circuit 21" sets the run-operating timer 252 to start measuring the READY elapsed time. (when the exclusive exclusion is performed) A2. The work switching circuit 21A sets the operation state register 258 of the job j to "WAIT", and the standby reason register 262 is set to "mutual exclusion wait" and the exclusive ID register. 265 is set to the mutually exclusive mutual exclusion ID, the timer 252 is set, and the WAIT elapsed time is measured. (Release the execution of the mutual exclusion system call) B1. The work switching circuit 21〇 inputs the release flag 1〇 to the exclusive circuit 24〇 on the condition that the work of the system call is performed to remove the mutual exclusion. Similarly to Fig. 14, the exclusive circuit 240 includes a comparison circuit for multi-segment connection and a determination circuit for determining whether or not the i-th condition and the second condition in the standby cancellation condition are satisfied. The discriminating circuit is based on the mutual exclusion, and outputs "only when the condition "and the condition" and the second condition are satisfied in the mutually exclusive standby solution $ condition. In addition, when the non-existing mutual exclusion is performed, the execution of the mutual exclusion is performed. When the system call is rejected, the state of the operation is shifted from the RUN state to the ready state. (Any decision circuit outputs "1", and the mutex circuit 240 rotates any work ID) "B2. Temporarily detects the working state of the work. The memory 258 is set to J. In addition to the standby reason register 262 and the exclusive id register 265, the REady elapsed time is measured by the timer 252. The operation status register 258 for performing the system call operation is set to "READY". "' Start measuring the READY elapsed time." 47 200937294 (When any of the determination circuits are not turned out, when one of the operations (1) is performed), the vertical circuit 240 is not output, and the B2·operation switching circuit 21 is in the occupied state. , flag table 212, set the mutual exclusion to non-B3. The system call READY will be executed. The state of the transition from the RUN state to (event processing) briefly describes the event of this embodiment

斑姐择齠*卜 尹1干s理。在事件表214,事件ID ❹ 與旗標類型(以下,稱為「現 旗標類型传8 # _ ' 」)係相對應記錄。 示艰1俅8位兀的位元類型。 ,定事件系統呼叫,係變更現行 統呼叫,以事件10與旗標類型 二^疋的系 為參數。當執…… 冉為設定旗標類型」) 標類型變更成盥执令油拉細, 現仃旗 Μ Μ「Λ ㈣輯和。例如,當現行旗 m ^ 」、权疋旗標類型為「00000101」時, 現仃旗標類型變成^0001 1 」吁 從左依庠魈以下,對各旗標類型, 〇 = 位元、第1位元、…、第7位元。 寺機事件“呼叫H巧待待機 類型滿足既定條件的系統現订旗標 下,&amp; 以事件ID、旗標類型(以 ::機旗標類型」)、旗標條件為參數。 ==叫時’判定在現行旗標類型與待機旗標類型 之間旗標條件是否成立。旗標條件係邏 =機:旗广_輯積(,…解除= 係就待機旗標類型為…的所有位元,現行旗標類型之該 48Spotted sister chooses 卜* Bu Yin 1 dry s reason. In the event table 214, the event ID ❹ is recorded in correspondence with the flag type (hereinafter referred to as "current flag type transmission 8 # _ '"). The type of bit that shows the difficulty of 1俅8 digits. The event system call is changed, and the current system call is changed, and the event 10 and the flag type are used as parameters. When the ...... 设定 设定 设定 设定 设定 设定 」 ) ) ) ) ) ) 盥 盥 盥 盥 盥 盥 盥 盥 盥 盥 盥 盥 盥 盥 盥 盥 盥 盥 盥 盥 盥 盥 盥 盥 盥 盥 盥 盥 盥 盥 盥 盥 盥 盥 盥 。 。 。 When 00000101", the current flag type becomes ^0001 1 "" from the left to the following, for each flag type, 〇 = bit, first bit, ..., 7th bit. The temple machine event "Call H is waiting for standby type. Under the current flag of the system that meets the established conditions, &amp; the event ID, the flag type (with the ::machine flag type), and the flag condition are parameters. ==call time' determines whether the flag condition is true between the current flag type and the standby flag type. The flag condition is logic = machine: flag wide_accumulation (,...release = all bits in the standby flag type is..., the current flag type of the 48

200937294 為Fl」。當旗標條件4邏輯和(GR)時,㈣τ解 除條件,係就待機旗標類型為「 解 類型之誃付-故「, I的任一位兀’現行旗榡 「〇咖; 例如,當現行旗標類型為 〇lj 、待機旗標類型為「000000U」、旗桿停 為「邏輯和(OR)」時,由於锆地始』 领標條件 ..^ ; f由於待機旗標類型之第6位元及第7 兀中,現行旗標類型之第7 她室姓么 111 70為M」,因此,此時待 =系統呼叫之WAiT解除條件成立。另-方面,當旗 為「邏輯積(AND)」時,由於現行旗標類型之第6仇 &quot;°為〇」,因此WAIT解除條件不成立。 d)—般軟體RTOS之事件處理 待機事件系統啤叫及設定事件系統呼叫執 ㈣S的處理如下述。—般RT〇s為了管理事件,將事件: ^持通在體上。於此事件表,不僅事件1D、現行旗標類 ^以此事件為待機事件之處於WAIT狀態之工作(以 下,稱為「事件等待工作」)的卫作m、待機旗標類型 標條件係相對應保持。 (待機事件系統呼叫的執行) A1.RTOS從事件表讀取於系統呼叫指定之事 旗標類型。 見行 A2·依旗標條件比較現行旗標類型與待機旗標類型 定WAIT解除條件是否成立。 (WAIT解除條件成立時) A3.將執行系统啤叫之工作之工作狀態從r 移至 READY。 49 200937294 (WAIT解除條件不成立時) A3.在事件表記錄執行系統呼叫之工作的工作ID。 A4.在事件表記錄待機旗標類型。 A5.在事件表記錄旗標條件。 A6.將執行系統呼叫之工作之工作狀態從RUN狀態遷 移至WAIT。 (設定事件系統呼叫的執行) B 1 .RTOS就系統呼叫指定之設定事件,從事件表讀取 現行旗標類型、工作ID、待機旗標類型、旗標條件。 B2.將現行旗標類型與設定旗標類型的邏輯和記錄成新 的現行旗標類型。 (設定事件不存在事件等待工作時,或即使存在、依據 待機旗標類型與旗標條件WAIT解除條件亦不成立時) B3.將執行系統呼叫之工作之工作狀態從RUN狀態遷 移至READY。 (設定事件存在事件等待工作、WAIT解除條件成立時) B3.將待機事件之工作之工作狀態從WAIT狀態遷移至 READY。 B4.清除事件表之待機工作ID、待機旗標類型、旗標條 件。 B5.將執行系統呼叫之工作之工作狀態從RUN狀態遷 移至READY。且執行RUN —工作的選擇。 當執行設定事件系統呼叫時,從複數個WAIT —工作中 選擇READY —工作的規則如下。 50 200937294 工作(第1條件)。 工作中以設定事件為待機事件的工作(第2 WAT二為比較待機旗標類型、現行旗標類型、旗標條件後, 解除條件成立的工作(第3條件}。 將此等3個條件總稱為「事件待機解除條件」。 (2)本實施例之硬體RT〇s之事件處理 Ο 1. 為 WAIT — 2. 為 WAIT-~ 條件)。 乍處理裝置100之待機事件系統呼叫及設定事件系 統呼叫執行時之處理如下述H處理裝置ΠΗ)内建之 號表2 1 2事件ID與現行旗標類型係相對應。待機工作 ID與待機旗^類型等的資訊係儲存於狀態記憶部。 (待機事件系統呼叫的執行) 作切換電路210從事件表214讀取現行旗標類 型。 A2.工作切換電路21〇依旗標條件比較現行旗標類型與 待機旗標類型,判定WAIT解除條件是W立。 、 (WAIT解除條件成立時) A3·將執行系統呼叫之工作之工作狀態暫存器258設 成「READY」。 (WAIT解除條件不成立時) A3.工作切換電路21〇,分別將執行系統呼叫之工作之 工作狀態暫存器258設定成「WAIT」、待機理由暫存器262 設定成「事件等待」、事件ID暫存器266設定成待機事件 的事件ID、待機旗標暫存器268設定成待機旗標類型、旗 51 200937294 標條件暫存器270設定成旗標條件。 (設定事件系統呼叫的執行) 也丨日作切換電$21G從事件表214讀取現行旗標類 ’將於系統啤叫指定之設定事件的事件m輸入至 選擇電路236。 作切換電路210 ’將設定旗標類型邏輯累加至1 件表214的現行旗標類型。 B3.事件選擇電路236,就輸入之 機條件成立的工作。此時,V楚擇事“200937294 is Fl". When the flag condition 4 logical sum (GR), (4) τ release condition, the standby flag type is "the type of the solution - so ", any of the I 兀 'current flag 榡 " 〇 ;; for example, when When the current flag type is 〇lj, the standby flag type is "000000U", and the flagpole is "logical" (OR), the zirconium is the starting condition.. ^ ; f is the 6th of the standby flag type. In the bit and the seventh, the current flag type of the 7th room name 111 70 is M", therefore, the WAiT release condition of the system call is established at this time. On the other hand, when the flag is "AND", the WAIT cancellation condition is not established because the sixth flag of the current flag type is "〇". d) Event processing of the general software RTOS Standby event system beer call and set event system call execution (4) S processing is as follows. In general, in order to manage the incident, the event: ^ is held on the body. In this event table, not only the event 1D, the current flag class ^ is the event of the standby event in the WAIT state (hereinafter, referred to as "event waiting for work"), the maintenance m, the standby flag type standard condition Corresponding to keep. (Execution of standby event system call) A1. The RTOS reads the event type specified from the event table. See line A2. Compare the current flag type and the standby flag type according to the flag condition. Determine whether the WAIT cancellation condition is established. (When the WAIT release condition is established) A3. Move the work status of the execution of the system beer call from r to READY. 49 200937294 (When the WAIT release condition is not established) A3. Record the work ID of the work of executing the system call in the event table. A4. Record the standby flag type in the event table. A5. Record the flag conditions in the event table. A6. Move the working status of the work performing the system call from the RUN state to the WAIT. (Setting the execution of the event system call) B 1. The RTOS reads the current flag type, work ID, standby flag type, and flag condition from the event table for the specified event of the system call. B2. Record the logical sum of the current flag type and the set flag type into a new current flag type. (When the setting event does not exist, the event waits for work, or even if it exists, according to the standby flag type and the flag condition WAIT release condition is not established) B3. Move the working state of the system call operation from the RUN state to READY. (When the event is set to wait for an event and the WAIT release condition is established) B3. The operation status of the standby event is moved from the WAIT state to READY. B4. Clear the standby work ID, standby flag type, and flag condition of the event table. B5. Move the working state of the work of performing the system call from the RUN state to READY. And execute RUN - the choice of work. When performing a set event system call, select READY from multiple WAITs - Work - the rules for working are as follows. 50 200937294 Work (1st condition). In the work, the event is set as the standby event (the second WAT 2 is the comparison of the standby flag type, the current flag type, and the flag condition, and the cancellation condition is established (the third condition}. These three conditions are collectively called It is "event standby release condition". (2) Event processing of hardware RT〇s in this embodiment Ο 1. WAIT — 2. is WAIT-~ condition) 待机 Processing device 100 standby event system call and setting event The processing of the system call execution is as follows. The H processor ΠΗ) built-in number table 2 1 2 event ID corresponds to the current flag type. Information such as the standby work ID and the standby flag type is stored in the status memory. (Execution of Standby Event System Call) The switching circuit 210 reads the current flag type from the event table 214. A2. The work switching circuit 21 compares the current flag type with the standby flag type according to the flag condition, and determines that the WAIT release condition is W. (When the WAIT release condition is satisfied) A3. The work status register 258 that performs the system call operation is set to "READY". (When the WAIT release condition is not satisfied) A3. The work switching circuit 21A sets the work state register 258 for performing the system call operation to "WAIT", and the standby reason register 262 is set to "event wait" and event ID. The register 266 is set to the event ID of the standby event, the standby flag register 268 is set to the standby flag type, and the flag 51 200937294 conditional register 270 is set to the flag condition. (Setting the execution of the event system call) The current flag $214 is read from the event table 214. The event m of the set event designated by the system beer is input to the selection circuit 236. The switching circuit 210' accumulates the set flag type logic to the current flag type of the one-piece table 214. B3. Event selection circuit 236, the work for which the input condition is established. At this time, V Chu chooses things "

此時不細工作優先順序與WAIT q 過時間如何,選擇複數個工作亦可。 (滿足事件待機解除條件的工作存在時) 「Β4.將事件等待工作之工作狀態暫存器258設定成 旗智’广事件1D暫存器266、待機旗標暫存器跡 旗標條件暫存器270。 Β5.將執行系統呼叫之玉作之工作狀 移至READY。 狀態遷At this time, do not work fine and WAIT q how long, choose a number of jobs. (When the job that satisfies the event standby cancellation condition exists) Β4. Set the event status register 258 of the event waiting operation to the flag wise' wide event 1D register 266, the standby flag temporary register flag condition temporary storage 270. Β 5. Move the work of performing the system call to READY.

(滿足事件待機解除條件的工作不存在時)(When the job that satisfies the event standby cancellation condition does not exist)

Run狀態遷 則.將執行系統呼叫之工作之工作狀態從 移至READY。 t胥怦恿理) 移至WAIT狀態之卫作’當WAn^除條件成立時 至READY狀態。然而’ *於某些外部因素或應用程式 誤(Bug),而妨礙WAIT解除條件成立 ―狀態。因此,一般而言,將工作遷移至二 52 200937294 設定暫停值。暫停值係定期減少,當成為0時,即使WAIT 解除條件不成立,工作亦可從WAIT狀態遷移至READY狀 態。亦即,可防止工作停止在WAIT狀態暫停值以上的時 間。 (1) 一般軟體RTOS之暫停處理 軟體構成之一般RTOS之情形,在WAIT狀態之工作的 TCB設定暫停值,此暫停值係定期減少。RTOS周期性對 CPU之處理發出中斷,檢查所有TCB,檢測出暫停值成為0 的WAIT —工作。當檢測出此種工作時,RTOS將該工作之 工作狀態從WAIT狀態遷移至READY。 (2) 本實施例之硬體RTOS之暫停處理 另一方面,本實施例之情形,工作切換電路2 10定期 減少各暫停計數器274的暫停值。暫停值,當執行WAIT 系系統呼叫時係設定為參數,工作切換電路2 1 0在執行該 系統呼叫之工作的暫停計數器274設定暫停值。Run state moves. Moves the work status of the system call to READY. t胥怦恿) Move to the WAIT state's work' when WAn^ is in the READY state except when the condition is met. However, * is subject to certain external factors or application bugs, which prevent the WAIT release condition from being established. Therefore, in general, move the work to 2 52 200937294 to set the pause value. The pause value is periodically decreased. When it is 0, the job can be moved from the WAIT state to the READY state even if the WAIT release condition is not established. That is, it is possible to prevent the work from being stopped above the WAIT state pause value. (1) Suspend processing of general software RTOS In the case of a general RTOS composed of software, the TCB in the WAIT state is set to a pause value, which is periodically reduced. The RTOS periodically issues an interrupt to the processing of the CPU, checks all TCBs, and detects WAITs that have a pause value of 0. When such a job is detected, the RTOS migrates the working state of the job from the WAIT state to READY. (2) Suspend processing of the hardware RTOS of the present embodiment On the other hand, in the case of the present embodiment, the work switching circuit 2 10 periodically reduces the pause value of each pause counter 274. The pause value is set as a parameter when the WAIT system call is executed, and the work switching circuit 210 sets a pause value in the pause counter 274 that performs the operation of the system call.

由於CPU 1 50不介入暫停值的減少處理,因此工作切換 電路2 10能與工作執行處理獨立,更新暫停值。因此,即 使CPU1 50正執行工作時,在工作控制電路200亦自律地執 行暫停值的更新。由於狀態資料係隨時輸入至暫停檢測電 路23 8,因此暫停檢測電路23 8,能以與暫停值更新時序大 致相同的時序,檢測暫停值成為0的工作。暫停檢測電路 238輸出此種工作的工作ID。工作切換電路210,當從暫停 檢測電路238輸入工作ID時,認知產生暫停,傳送HC以 停止供應CPU時脈。工作控制電路200將產生暫停之WAIT 53 200937294 一工作遷移至READY狀態,且將run—工作遷移至READY 狀態。工作切換電路210從READY —工作之中選擇下___個 待執行工作。又,工作切換電路21〇再啟動產生暫停之工 作的計時器252,測量READY經過時間。 依據此種處理方法,當工作執行中,亦即,當Cpu時 脈動作中產生暫停時,可即時對CPU15〇發出中斷,執行工 作切換。又,在工作執行中,工作切換電路2丨〇不需借助 CPU150的處理能力即可獨立執行暫停值的更新處理。Since the CPU 150 does not intervene in the reduction processing of the pause value, the work switching circuit 2 10 can update the pause value independently of the job execution processing. Therefore, even if the CPU 1 50 is performing work, the work control circuit 200 also autonomously performs the update of the pause value. Since the status data is input to the pause detecting circuit 23 8 at any time, the pause detecting circuit 23 8 can detect that the pause value becomes 0 at the same timing as the pause value update timing. The pause detection circuit 238 outputs the job ID of such work. The work switching circuit 210, when inputting the work ID from the suspension detecting circuit 238, recognizes that a pause has occurred, and transmits HC to stop supplying the CPU clock. The work control circuit 200 migrates the WAIT 53 200937294, which has a pause, to the READY state, and migrates the run-work to the READY state. The work switching circuit 210 selects the next ___ to be executed from the READY - work. Further, the work switching circuit 21 restarts the timer 252 which generates the pause operation, and measures the READY elapsed time. According to this processing method, when the work is being executed, that is, when a pause occurs in the CPU clock operation, the CPU 15 can immediately issue an interrupt to perform the work switching. Further, in the work execution, the work switching circuit 2 can independently perform the update processing of the pause value without the processing capability of the CPU 150.

(有限狀態機器之工作切換電路21〇) Q 圖15係工作切換電路21 〇的狀態遷移圖。 於初始化處理(A1),所有工作處於IDLE狀態。當初始 化處理結束時(sίο),任一個工作成為RTJN—工作、而成為 工作執行狀態(A2)。當檢測出中斷要求訊號時(s丨2),特殊 工作成為RUN —工作、執行中斷處理(A3)。當中斷處理結 束時(S14),工作切換電路21〇從一般工作選擇RUN—工 作,遷移至A2。 又,於工作執行中(A2),當執行系統呼叫時(S16),執 〇 行系統呼叫處理(A4)。當未產生工作切換、亦即RUN—工 作的切換時(S18)’返回A2。另一方面,當藉由系統呼叫處 理(A4)產生工作切換時(S2〇),工作切換電路根據執行 選擇電路232的輸出執行RUN—工作的選擇(A5)。當工作 切換結束時(S22),處理狀態移至a2。 最後,說明僅構裝工作處理裝置100之主要元件之儲 存電路120與工作控制電路2〇〇之其中一者的情形。 54 200937294 1不教戰工作控制電 圖】6係圖5之工作處理裝置__ 2處理裝置_ 電路200之工作處理裝置⑽的電路未裝裁工作控制 替代未裝b作㈣電路咖,追加 路322與處理資料保持部32〇。由 ^換控制電 200,因此工作排程 、裝载工作控制電路 卫作切換時由!體1&quot;^實現。是以,當 ❹ ❹ 而言,處理資饵保捭' 取传CPU150的使用權。-般 處理貝科保持部320保持RT0 RTOS取得CPUl5〇 们處理資枓。當 處理資料… 使用權時,處理資料保持部320替換 156之Γ 0之RT0S用的處理資料與特殊暫存器 作用的處理資料。以下,以從工作A至工作B的 工作切換說明其處理過程。 A1.當工作A執行系統呼叫時,將系統呼叫之變數與系 統呼叫之1D記錄於汎用暫存器158的一部分。 、 A2·暫存器切換控制電路322將工作a之處理資料移至 處理資料保持部32G’將處理資料保持部32()之RT〇s用處 理資料載人至處理暫存器154。在此階段,RT〇s取得 CPU 150的使用權。 A3.暫存器切換控制電路322將寫入訊號輸入至保留暫 存器1 l〇a,將處理資料保持部32〇之工作A用處理資料儲 存至保留暫存器110。 A4.RTOS根據記錄於汎用暫存器158之系統呼叫的變 數與ID,執行對應於系統呼叫的處理。又,將工作a之tcb 之工作狀態資料設定成「READY」,在工作準備串列追加 55 200937294 工作A之TCB。(The operation switching circuit 21 of the finite state machine) Q Fig. 15 is a state transition diagram of the operation switching circuit 21 〇. In the initialization process (A1), all jobs are in the IDLE state. When the initialization process ends (sίο), any one of the jobs becomes RTJN-work and becomes the work execution state (A2). When the interrupt request signal is detected (s丨2), the special operation becomes RUN-work, and the interrupt processing (A3) is executed. When the interrupt processing ends (S14), the work switching circuit 21 selects the RUN-work from the normal operation and shifts to A2. Further, during the execution of the work (A2), when the system call is executed (S16), the system call processing (A4) is executed. When no work switching, that is, RUN-work switching is not generated (S18)', A2 is returned. On the other hand, when the work switching is generated by the system call processing (A4) (S2), the work switching circuit performs the RUN-operation selection (A5) in accordance with the output of the execution selection circuit 232. When the work switching ends (S22), the processing state moves to a2. Finally, the case where only one of the storage circuit 120 and the operation control circuit 2 of the main components of the work processing apparatus 100 is constructed will be described. 54 200937294 1Do not teach the work control electric diagram] 6 series of the work processing device of Figure 5 __ 2 processing device _ circuit 200 of the work processing device (10) circuit is not installed work control instead of not installed b (four) circuit coffee, additional road 322 and processing data holding unit 32〇. The control power 200 is changed by ^, so the work schedule and the load work control circuit are switched by the body 1&quot; Therefore, in the case of ❹ ,, the processing of the bait protects the right to use the CPU 150. - The processing of the Beco holding unit 320 maintains the RT0 RTOS to obtain the CPUl5 processing resources. When the data is used, the processing data holding unit 320 replaces the processing data for the RT0S of 156 and the processing data for the special register. In the following, the processing is explained by the work switching from work A to work B. A1. When Work A performs a system call, the system call variable and the system call 1D are recorded in a portion of the general purpose register 158. The A2· scratchpad switching control circuit 322 shifts the processing data of the job a to the processing data holding unit 32G' to carry the RT〇s processing data of the processing data holding unit 32() to the processing register 154. At this stage, RT〇s takes the right to use the CPU 150. A3. The register switching control circuit 322 inputs the write signal to the reserved register 1 l〇a, and stores the processing data for the work A of the processed data holding unit 32 to the reserved register 110. A4. The RTOS performs processing corresponding to the system call based on the variables and IDs of the system calls recorded in the general purpose register 158. In addition, the work status data of the tcb of the work a is set to "READY", and the TCB of the work A is added to the work preparation list.

Β1·接著,RTOS依據上述RUN工作選擇條件選擇RUN —工作’此處’選擇工作B。 B2.RTOS指示暫存器切換控制電路322,將指定工作b 之工作選擇訊號輸入至載入選擇電路112。將處理資料從保 留暫存器110b移至處理資料保持部32〇。 B3.暫存器切換控制電路322替換處理資料保持部Β1· Next, the RTOS selects RUN_Working 'here' to select the job B according to the above RUN job selection condition. The B2.RTOS instructs the scratchpad switching control circuit 322 to input the job selection signal of the designated job b to the load selection circuit 112. The processing data is moved from the retention register 110b to the processing data holding unit 32A. B3. The register switching control circuit 322 replaces the processing data holding unit

之工作Β用處理資料與處理暫存器154之RT0S用處理, 料。據此’工作B取得CPU150的使用權。The work is processed by the processing data and the RT0S of the processing register 154. According to this, the work B obtains the right to use the CPU 150.

依據此種處理方法,相較於裝載工作控制電路2〇〇 ^ 圖5的工作處理裝置可縮小工作處理裝置1〇〇整體备 電路尺寸。雖RTOS實現為軟體,但能以來自暫存器切換相 制電路322之訊號硬體地控制處理資料的載入、儲存。網 刀別連接處理暫存器154、處理資料保持部32〇、載入選揭 電路112、保留暫存器11〇之匯流排設定成可平行傳送處理 '料的位7L數時,相較於將處理資料儲存至了⑶及從TC£ 载入處理資料,可實現高速的工作切換。 (未裝載儲存電路120之類型的工作處理裝置副) 圖17係圖5之工作處理裝置1〇〇中未裝載儲存電路 之工作處理裝置100的電路圖。 於去肚弋未裝載儲存電路120,追加中斷介面電路324。由 處理2儲存電路120,處理資料係儲存於記憶體的TCB。 料的栽入、儲存係藉由軟體庫的RT0S實現。是以, 換時’RTQS&amp;須暫時取得mmo的使用權。以 56 200937294 下’以從工作A至卫作B的卫作切換說明其處理過程。 當藉由執行系統呼叫產生工作切換時,首先,軟體 RTOS將工作A的處理眘粗神产# 理貝科儲存於工作A的TCB。接著, 將RTOS用的處理資料載入至虑 七、t t、 科戰入至處理暫存器I54。此時的處理 方法’與以圖3說明之内容相同。 ❹ ❹ 軟體RTOS將系統呼叫之參數寫入中斷介面電路似。 執行控制電路152停止cp則時脈。t斷介面電 路324使工作控制電路200執行工作切換。首先,工作切 換電路210將工# A之工作狀態暫存器258設定成 READY,藉由來自工作選擇電路23〇的輸出選擇下一個 RUN-工作之工作B。工作切換電路21。指示中斷介面電路 324以載入工作B的處理資料。此處,中斷介面電路如 使執行控制電路152再開始CPU時脈。又,中斷介面電路 324通知軟體RT0S工作被選擇。軟體rt〇s#取工作 B的TCB,將工作B的處理資料栽入至處理暫存器15[ 依據此種處理方法,相較於裝载儲存電路12〇之圖$ 的工作處理裝置可縮W作處理裝置⑽整體的電路 尺寸。雖RTOS之功能的-部分係、實現為軟體,但工作選擇 處理能藉由工作控制電路200實現。 相較於圖2及圖3所說明之軟體RT〇s,圖16及圖p 之工作處理裝置100,皆能使RT〇s之功能的一部分硬體 化。如圖16所說明,由於存在健存電路12〇,因此處理資 料的健存、載入不需存$ TCB。因此,能藉由暫存器切換 控制電路322執行處理資料的儲存、載入處理。又,如圖 57 200937294 么所說月’由於存在工作控制電路,因此軟體RT〇s 忐將工作選擇功能讓給工作控制電路·。 圖5所說明’裝載儲存電路與工作控制電路靡 2作處理裝置1GG的情形,可將RT〇s之工作排程功能完 體化由於g工作切換時不需存取記憶體的TCB,因 此作切換處理可更快速。依據本發明人的實驗,相較於 圖3等所說明之—般軟體RT〇s,確認本實施例之卫作處理 裝置100能以大約1〇〇倍的速度動作。According to this processing method, the overall processing circuit size of the work processing apparatus 1 can be reduced as compared with the load processing control circuit 2 〇〇 ^. Although the RTOS is implemented as a software, the loading and storing of the processing data can be controlled by the signal from the register switching control circuit 322. When the network knife is connected to the processing register 154, the processing data holding unit 32, the loading and unloading circuit 112, and the holding buffer 11 is set to be parallel to the processing, the number of bits 7L of the processing is compared with The processing data is stored in (3) and the processing data is loaded from the TC £, enabling high-speed work switching. (Work processing device pair of the type in which the storage circuit 120 is not loaded) Fig. 17 is a circuit diagram of the work processing device 100 in which the storage circuit is not loaded in the work processing device 1A of Fig. 5. The interrupt interface circuit 324 is added to the unloaded storage circuit 120. From the processing 2 storage circuit 120, the processing data is stored in the TCB of the memory. The planting and storage of the material is realized by the RTOS of the software library. Therefore, in time, 'RTQS&amp; must temporarily obtain the right to use mmo. The process of switching from Work A to Guard B is explained in 56 200937294. When a work switching is performed by executing a system call, first, the software RTOS stores the processing of the work A in the TCB of the work A. Next, the processing data for the RTOS is loaded into the processing, and the processing is entered into the processing register I54. The processing method at this time is the same as that described with reference to Fig. 3. ❹ ❹ The software RTOS writes the parameters of the system call to the interrupt interface circuit. The execution control circuit 152 stops the cp clock. The t-break interface circuit 324 causes the work control circuit 200 to perform an operation switch. First, the work switching circuit 210 sets the work state register 258 of the worker #A to READY, and selects the next RUN-work job B by the output from the work selection circuit 23A. The work switching circuit 21 is provided. The interrupt interface circuit 324 is instructed to load the processing data of the job B. Here, the interrupt interface circuit restarts the CPU clock if the execution control circuit 152 is started. Also, the interrupt interface circuit 324 notifies the software RT0S that the operation is selected. The software rt〇s# takes the TCB of the work B, and the processing data of the work B is loaded into the processing register 15 [according to this processing method, the working processing device of the figure $ of the loading storage circuit 12 is shrinkable W is the overall circuit size of the processing device (10). Although the function of the RTOS is partially implemented as software, the work selection process can be implemented by the work control circuit 200. Compared with the software RT〇s illustrated in Figs. 2 and 3, the work processing apparatus 100 of Figs. 16 and p can harden a part of the function of the RT〇s. As illustrated in Fig. 16, since there is a load circuit 12, there is no need to store $TCB for the storage and loading of the processing data. Therefore, the storage and loading processing of the processing data can be performed by the scratchpad switching control circuit 322. Moreover, as shown in Fig. 57, 200937294, because of the existence of the work control circuit, the software RT〇s 让 gives the work selection function to the work control circuit. FIG. 5 illustrates the case where the load storage circuit and the work control circuit 靡2 are used as the processing device 1GG, and the work scheduling function of the RT〇s can be completed. Since the TCB of the memory is not required to be switched when the g operation is switched, the operation is performed. Switching processing can be faster. According to the experiment of the present inventors, it was confirmed that the satellite processing apparatus 100 of the present embodiment can operate at a speed of about 1 相 as compared with the general software RT 〇s explained in Fig. 3 and the like.

(改良例1) 在作成電腦程式時’「仔列(Queue)」係較使用且使 用頻率高的演算法。因K宁列處理之高速化,有助於電 腦程式之處理速度的提升。然而,即使是F㈣(先進先出:(Modification 1) When creating a computer program, "Queue" is an algorithm that is used and used at a high frequency. Due to the high speed of K-Ning's processing, it helps to improve the processing speed of computer programs. However, even F (four) (first in, first out:

Fim-In First_0ut)之佇列,視情形有時亦會有欲進行 刪(後進先出:Last_In Fim_〇ut)之動作的情形或者, 有時亦會有以LIFO為基本而欲進行FIF〇之動作的情形。 於改良例i,肖亦可對應LIF〇之特殊仔列的;寅算法(以下,Fim-In First_0ut), depending on the situation, there may be occasions when you want to delete (Last_In Fim_〇ut) or sometimes you want to use LIFO as the basic FIF〇 The situation of the action. In the improved example i, Xiao can also correspond to the special series of LIF〇; 寅 algorithm (below,

稱為「雙放入型佇列演算法」)之硬體構裝之工作處理裝置 100進行說明。 土本 之工作處理裝置丨〇〇,裝載根據計時器管理之工 作排程功能。基本例之工作排程,係「只有在工作優先順 序相同時’優先將執行權分配至等待時間長的工作」之演 算法。以下’將此種工作排程稱為「公平型工作排程」。The work processing apparatus 100 of the hardware configuration called "double insertion type array algorithm" will be described. The work processing device of the mine is loaded with the work scheduling function according to the timer management. The basic work schedule is an algorithm that "only assigns execution rights to work with long wait time when the work priority order is the same". The following 'refers to this work schedule as a "fair work schedule."

圖11中’說明了根據公平型工作排程之概念之工作準 備串列的管理方法。當RUN—工作之工作J返回READM 58 200937294 態時,係連結至最後端之工作F之後。由於在工作)之後是 工作A成為RUN—工作,因此各工作之TCB,依工作D、…、 工作F、工作J之順序連結至工作優先順序「〇」的優先順 序扣私280。工作j,至少在工作F之執行結束前不會被賦 予執行權&amp;平型工作排程之處理方法,近似於FiF〇,亦 即佇列之演算法。由於為時間管理之演算法,因此可藉由 計時器管理將公平型工作排程進行硬體構裝。 ❹ ❹ 另一方面,於軟體OS,亦大多採用「只有在工作優先 順序相同時,優先將執行權分配至暫時成為RUN—工作的 工作」的工作排程。以下’將此種工作排程稱為「再執行 優先型工作排程」。於再執行優先型工作排程,t RUN-工作之工作j返回READY狀態時,不是連結至最後端,而 是插入至前端。由於在工作j之後是工作A成為麵—工 作’因此各工作之TCB,依工作】、工作D、…、工作?之 順序連結至工作優先順序「〇」的優先順序指標·。工作 在工作A結束後,在工作D、工作F之前再次被賦予執 灯。當存在有暫時被賦予執行權後,僅可能總合執行之 =的工作時,再執行優先型工作排程是有效的。再執行In Fig. 11, 'the management method of the work-prepared tandem according to the concept of fair work schedule is explained. When the RUN-work job J returns to the REDM 58 200937294 state, it is connected to the last-end work F. Since work A becomes RUN-work after work, the TCB of each job is linked to the priority order of work priority "〇" in the order of work D, ..., work F, and work J. Work j, at least until the end of the execution of work F, will not be assigned to the execution of the &amp; flat work schedule, which is similar to FiF〇, which is the algorithm of the queue. Because of the time management algorithm, the fair work schedule can be hardware-built by timer management. ❹ ❹ On the other hand, in the software OS, most of the work schedules of "only when the work priorities are the same, the execution rights are preferentially assigned to work that is temporarily RUN-work" are used. The following 'this work schedule is called 're-execution priority work schedule'. When the priority work schedule is executed again, when t RUN-work j returns to the READY state, it is not connected to the last end but inserted to the front end. Since after work j is work A becomes face-work', so the TCB of each job, according to work, work D, ..., work? The order is linked to the priority index of the work priority order "〇". Work After the end of work A, the lights are again given before work D and work F. It is effective to execute the priority work schedule when there is a work that is temporarily assigned the execution right and only the total execution =. Execute again

優先型工作挑寂,勺人TTt?M A匕3 UF〇,亦即堆疊的演算法。於改良 算:由以_為基本、亦可對應UF〇之雙放入型仔 U算法之硬體構裝,來實現再執行優先型工作排程。 演二,不限於再執行優先型工作排程’雙放入型符列 法之硬體構亦有用。因此,雙放入型㈣演算 體構裝’於k昇各種電腦程式之處理速度上是有效 59 200937294 的0 ❹ 圖18係改良例1之工作處理裝置ι00的電路圖β 改良例1之工作處理裝置100,亦包含CPU150、儲存 電路120、及工作控電路200。然而,改良例1之工作切換 電路210,包含主電路400、寫入電路402、佇列控制電路 404、及最大值選擇電路406。主電路400 ’係具備與基本 例之工作切換電路210大致相同功能的電路。因此,改良 例1之工作切換電路210之構成,係作為基本例之工作切 換電路210之主電路400外追加寫入電路402、佇列控制電 路404、及最大值選擇電路406。所有工作之所有狀態資料, 從各狀態記憶部220不僅隨時輸出至工作選擇電路23〇,亦 隨時輸出至最大值選擇電路406或佇列控制電路4〇4。 圖19係改良例i之工作控制電路2〇〇之一部分的電路 圖。 工作控制電路200之基本構成,與圖1〇所示之電路構 成大致相同。對應各工作之狀態暫存器25〇,包含工作⑴The priority work is quiet, and the spoon TTt?M A匕3 UF〇, which is the stacking algorithm. In the improvement calculation: the hardware configuration of the U algorithm, which is based on _, can also be used to implement the priority work scheduling. Second, it is not limited to re-execute the priority work schedule. The hardware structure of the double-input type is also useful. Therefore, the double-input type (four) calculus structure is effective in processing speed of various computer programs. 59 200937294 0 ❹ FIG. 18 is a circuit diagram of the work processing apparatus ι00 of the modified example 1. The working processing apparatus of the modified example 1 100 also includes a CPU 150, a storage circuit 120, and a work control circuit 200. However, the operation switching circuit 210 of the first modification includes the main circuit 400, the write circuit 402, the array control circuit 404, and the maximum value selection circuit 406. The main circuit 400' has a circuit having substantially the same function as the basic operation switching circuit 210. Therefore, the configuration of the operation switching circuit 210 of the first modification is a write circuit 402, a line control circuit 404, and a maximum value selection circuit 406 which are added to the main circuit 400 of the operation switching circuit 210 as a basic example. All state data of all the operations are outputted from the state memory unit 220 to the operation selection circuit 23A at any time, and are output to the maximum value selection circuit 406 or the queue control circuit 4〇4 at any time. Fig. 19 is a circuit diagram showing a part of the operation control circuit 2 of the modification i. The basic configuration of the work control circuit 200 is substantially the same as that of the circuit shown in Fig. 1A. Corresponding to the status register of each job 25〇, including work (1)

暫存器410、工作優先順序暫存器412、仔列順序暫存器 414、及仵列辨別暫存器416。狀態暫存器25()亦可包含直 他暫存器,但此處以雙放入型佇列演算法相關之暫存器群 組為中心來說明。 (A) 工作ID暫存器410:作為要素⑴的一種,儲 作ID與基本例所不之卫作m暫存器…相同。從 暫存器410隨時輪出表示…的⑽_S訊號。 (B) 工作優先順序暫存器412:儲存工作優先順序(PR) 60 200937294 隨時輸出 與基本例所示之工作優先順序暫存器相同 PR_S訊號。 ()仔列順序暫存器414 :儲存表示對後述虛擬仔列之 放入順序的「順序值(〇DR)」1序值愈大,表示放入至虛 擬仔列愈深’詳細後述。順序值,係作為〇dr_s訊號而隨 時輸出。 (D)佇列辨別暫存器416:儲存用以辨別虛擬佇列之「佇 列ID(QID)」。作為QID_S訊號而隨時輸出。 工作優先順序暫存器412、佇列順序暫存器414、及佇 列辨別暫存器416’特別具有用以管理虛擬佇列之佇列暫存 器的功能》 虛擬仔列係對應工作狀態之仵列。例如,qid = 〇之虛 擬知列(以下,表s己為「虛擬仔列(〇)」)對應READ γ狀態, 虛擬佇列(1)對應旗號等待狀態,虛擬佇列(2)對應互斥等待 狀態。或者,虛擬佇列(1)對應旗號ID=〇的旗號等待狀態, 虛擬佇列(2)對應旗號ID = 1的旗號等待狀態。qID與工作 狀態之對應,以軟體任意設定即可。 當工作A為READY狀態時,在仵列辨別暫存器416_A s史定對應READY狀悲之虛擬仔列的qid。工作選擇電路230 或佇列控制電路404,藉由參照各佇列辨別暫存器4丨6,可 判別各工作的工作狀態。因此,仵列辨別暫存器416,具有 與基本例之工作狀態暫存器258、待機理由暫存器262、旗 號ID暫存器264、及互斥ID暫存器265、事件id暫存器 266等相同的功能。 61 200937294 虛擬符列並非物理上存在,係藉由仔列順序暫存器4i4 或知列辨別暫存器416之設㈣容而想像之概綠符列, 此點非常重要。例如,掛夂俨 广紅士 d 士各^丁列辨別暫存器416與佇列順 序暫存器414進行下述設定時, 工作 A : QID = 〇、〇DR= 〇 工作 B : Qid = 〇、〇DR= 1 工作 c : QID= 〇、〇DR= 2 工作 D : QID = 1、〇DR= 〇The register 410, the work priority register 412, the queue sequential register 414, and the queue identification register 416. The state register 25() may also contain a direct register, but here the center is described centering on the register group associated with the dual-input queue algorithm. (A) Work ID register 410: As one type of element (1), the storage ID is the same as the guard register m of the basic example. The (10)_S signal indicating ... is rotated from the register 410 at any time. (B) Work Priority Order Register 412: Store Work Priority (PR) 60 200937294 Read-out at the same time The PR_S signal is the same as the work priority register shown in the basic example. () The sequence register 414: stores the "order value (〇DR)" indicating the order of insertion of the dummy string to be described later. The larger the sequence value is, the larger the value is placed in the virtual row, and the details will be described later. The sequence value is output as a 〇dr_s signal at any time. (D) Array Discriminating Register 416: Stores the "Queue ID (QID)" for identifying the virtual queue. It is output as a QID_S signal at any time. The work priority register 412, the queue sequential register 414, and the queue identification register 416' have the function of managing the queue register of the virtual queue. Queue. For example, the virtual knowledge column of qid = 〇 (hereinafter, the table s is "virtual child column (〇)") corresponds to the READ γ state, the virtual queue (1) corresponds to the flag waiting state, and the virtual queue (2) corresponds to the mutual exclusion. Waiting state. Alternatively, the virtual queue (1) corresponds to the flag waiting state of the flag ID=〇, and the virtual queue (2) corresponds to the flag waiting state of the flag ID=1. The correspondence between the qID and the working status can be arbitrarily set by the software. When the work A is in the READY state, the queue identifying the register 416_A s corresponds to the qid of the READY-shaped vain virtual queue. The operation selection circuit 230 or the array control circuit 404 can determine the operation state of each operation by referring to each of the array identification registers 4 to 6. Therefore, the queue identifying buffer 416 has a working state register 258, a standby reason register 262, a flag ID register 264, a mutually exclusive ID register 265, and an event id register. 266 and other similar functions. 61 200937294 The virtual character string does not exist physically. It is very important to imagine the green character column by the sequence register 4i4 or the identification of the register 416. For example, when the following settings are made by the 夂俨 夂俨 红 d 辨 辨 辨 416 416 416 416 416 416 416 416 414 414 414 414 414 414 414 , 工作 工作 工作 工作 工作 工作 = = = = = = = = 〇 〇 〇 〇 〇 〇 〇 〇 〇 〇 〇 〇 , 〇DR= 1 Work c: QID= 〇, 〇DR= 2 Work D: QID = 1, 〇DR= 〇

表示在虛擬符列(G)依序放人卫作c、B、A,在虛擬作 列(1)僅放入工作D。根據QID與〇DR之數值範圍可彈性變 更虛擬彳宁列之數量與尺寸。It means that the virtual character column (G) is placed in the order of c, B, and A, and the virtual column (1) is placed only in the work D. According to the numerical range of QID and 〇DR, the number and size of the virtual Suining column can be flexibly changed.

二工作選擇電路230,根據從狀態暫存器25〇輸出之狀態 資料’選擇待狀態遷移之卫作。主電路侧將CND訊號輸 入至工作選擇電路230。CND係表示工作選擇條件的訊號, 包含表示佇列⑴之表示工作優先順序之pR c。 T如,從虛擬佇列(0)欲取出工作時,主電路4〇〇在cnd設 定QID_C — 〇。工作選擇電路23〇,將指定之虛擬佇列⑺)中 成為取出對象之工作(以下,簡稱為「取出工作」)之工作ι〇 輪出至 EID—A1,傳送 EIDA1EN。又,在 pRA1、〇DR—乂, 輸出取出工作之工作優先順序與順序值。以此方式,主電 路400,指定QID—c=Qn並詢問工作選擇電路23〇,藉此 仵知虛擬佇列(Qn)的取出工作。工作選擇電路23〇具有選擇 取出工作之取出候補電路的功能。更詳細以圖32後述。 CND訊號從主電路4〇〇輸入至最大值選擇電路4〇6。 62 200937294 最大值選擇電路406,當以CND指定QID_C=Qn時,將虛 擬佇列(Qn)之最大順序值輸出至 ODR_A2,傳送 EID_A2_EN。更詳細以圖28後述。 佇列控制電路404,藉由設定各狀態暫存器250的狀態 資料,控制各工作之狀態遷移。從主電路400將CMD及 EID_C輸入至佇列控制電路404,除此之外,亦輸入 CND(QID_C、PR_C)、0DR_A1、ODR_A2、ODR_A2_EN 與 各狀態暫存器250的狀態資料。 〇 CMD係表示用以操作虛擬佇列的指令。CMD之對象之 虛擬佇列的佇列ID、工作的工作ID、工作優先順序,係分 別藉由 QID_C、EID—C、PR_C指定。指令係ENQ—TL、 ENQ—TP、DEQ之3種類中的一種。 當輸入順向放入指令ENQ_TL時,從虛擬佇列之最後 端放入EID_C訊號所指定之工作。以下,將從佇列之最後 端之放入稱為「順向放入」。當輸入取出指令DEQ時,從 虛擬佇列之前端取出工作。藉由ENQ_TL與DEQ,執行FIFO ^ 的佇列控制。當輸入逆向放入指令ENQ_TP時,從虛擬佇 列之前端放入EID_C訊號所指定之工作。以下,將此種從 佇列之前端之放入稱為「逆向放入」。逆向放入,不是FIFO 之放入,為特殊的放入方法。 從主電路400輸入CMD時,寫入電路402傳送WT, 執行佇列控制電路404所輸出之各資料至狀態暫存器250 的寫入。佇列控制電路404、寫入電路402、工作選擇電路 230、最大值選擇電路406等,具有用以控制虛擬佇列之虛 63 200937294 擬佇列處理電路的功能。 以接下來之圖20詳細說明佇列控制電路404之電路構 成。 圖20係佇列控制電路404的電路圖。 佇列控制電路404,係複數個暫存器值產生電路420的 集合體。各暫存器值產生電路420為相同電路。暫存器值 產生電路420係對應各工作。亦可說為對應各狀態暫存器 250。暫存器值產生電路420_EN,對應工作ID= En的工作 (以下,表記為「工作(En)」)。該工作之工作ID係作為 ELM—ID訊號而固定輸入至暫存器值產生電路420。 ODR—S、QID—S、PR—S,係從狀態暫存器250輸出之 狀態資料,分別表示順序值、佇列ID、工作優先順序。工 作(En)之順序值、佇列ID、工作優先順序分別作為 ODR_S_En、QID_S_En、PR_S_En 而輸入至對應工作(En) 之暫存器值產生電路420_EN。CMD、EID_C係從主電路400 輸入。ODR_A2_EN與ODR_A2係從最大值選擇電路406輸 入。表示最大順序值之〇DR_A2,當傳送ODR_A2_EN時成 為有效的輸入。0DR_A1係從工作選擇電路230輸入。 ODR—A1係表示取出工作的工作ID。QID_C與PR_C係從 主電路400輸入之CND訊號,分別表示作為工作選擇條件 的QID與PR。 暫存器值產生電路420_EN,將工作(En)之順序值、佇 列ID、工作優先順序分別輸出為QID_N_En、ODR_N—En、 PR_N_En,當寫入電路402傳送WT時,寫入至狀態暫存器 200937294 250_Εη 〇 當寫入電路4〇2傳送WT B#,所古jw· — 1矸所有暫存器值產生電路 420 之 QID N En、〇dr n En、PR μ p 成办 - ~ Ν-·^η、PR-N-En係寫人至所有狀 態暫存器250。因CMD而受到影響之工作相關之暫存器值 產生電路’將後述演算法所指定之新的資料寫入至狀態 暫存器250。另-方面,不因CMD而受到影響之工作相關 之暫存器值產生電路420’亦再次輸出與寫入至狀態暫存器 250之資料相同的資料’以執行寫入。 此外’暫存難產生電路42〇之WT,直接輸入仔列控 制電路404而非各狀態暫存器25〇亦可。此時’内建於佇 列控制電路404之暫存器值產生電路42〇之中,僅因 而待狀態變更之工作相關之暫存器值產生電路42〇,將新的 資料寫入至狀態暫存器250亦可。 暫存器值產生電路420之具體處理内容於後述。 圖21係顯示虛擬佇列與工作之關係的概念圖。 此處,假設虛擬佇列(Q0)與虛擬佇列(Q1)的2個虛擬佇 列。虛擬彳丁列(Q0),係用以放入工作優先順序pR = 〇之工 作之優先佇列(以下,表記為「優先佇列(Q〇 : 〇)」)與用以 放入工作優先順序PR=i之工作之優先佇列(Q〇:丨)之2個 優先佇列的集合。虛擬佇列亦相同,假設實質上有4 個優先佇列。例如,虛擬佇列(Q〇)對應READY狀態,虛擬 佇列(Q1)對應WAIT狀態亦可。 各虛擬佇列,係面向圖示左側為放入口,右側為取出 口的佇列。於順向放入從左侧放入工作,於逆向放入從右 65 200937294 侧放入工作。取出工作則恆從右側。 同圖中,將工作ID= EO、El、E2、E3之4個工作放入 虛擬佇列。工作(EO)與工作(E2)、工作(E3)係放入虛擬佇列 (Q0)。之中,由於工作(EO)與工作(E3)係工作優先順序PR =0之工作’因此放入優先佇列(q〇 : 〇)。由於工作(E2)係 PR== 1之工作’因此放入優先佇列(q〇 :丨)。放入虛擬佇列 (Q0)之工作(E3)、工作(E2)、工作(EO)之順序值ODR為2、 1、0。工作優先順序PR=: 〇之工作(E1),係放入虛擬佇列 (Q1)。ODR 為「〇」。 © 圖22係對應圖21之狀態暫存器250的資料結構圖。 圖21所示之對虛擬佇列之各工作的放入狀態,係藉由 狀態暫存器250之設定來表現。圖21所示之狀態,工作(E〇) 〜工作(E7)之中,放入虛擬仔列者為工作(E0)〜工作(E3)。 因此’其他工作之佇列辨別暫存器416係設定成表示未放 入的「Non」。放入虛擬佇列(q〇)之工作(E〇)、工作(E3)、 工作(E2)之狩列辨別暫存器416係設定成「q〇」。又,放 入虛擬仵列(Q1)之工作(E1)之佇列辨別暫存器416係設定 ❹ 成「Q1」。藉由佇列辨別暫存器416的設定内容,表現哪 個工作放入哪個虛擬佇列。 放入虛擬佇列(Q0)之3個工作(E〇)、工作(E3)、工作(E2) 之佇列順序暫存器414 ’分別設定〇、2、1作為〇DR。放 入虛擬佇列(Q1)之工作,由於僅有工作(E丨),因此順序值設 定成最小的「0」。藉由仔列順序暫存器414的設定内容’ 表現各工作在虛擬佇列的位置。 66 200937294 工作(E0)、工作(E1)、工作(E3)之工作優先順序PR為 〇」°因此’在該等工作之工作優先順序暫存器412設定 0」°由於工作(E2)之工作優先順序PR為「1」,因此在 工作優先順序暫存器412_E2設定「1」。藉由工作優先順 序暫存器412的設定’表現各工作放入哪個優先佇列。 根據以上設定,詳細說明順向放入、逆向放入、取出 之處理内容。 (順向放入) 圖23係將工作(E4)順向放入圖21之虛擬佇列時的概念 圖。 此處’說明將工作優先順序PR=〇之工作(E4)順向放 入虛擬仵列(Q 1)的情形。主電路4〇〇,CMD = ENQ_TL(順向 放入指令)’設定 EID_C=E4、QID—C=Q1、PR—C=0。内 建於仔列控制電路404之暫存器值產生電路420_E4,檢測 ❹ 到 EID_c=ELM_ID=E4 時,輸出 qid_n_E4=QID_C = Ql、ODR_N_E4 = 〇、PR_n一E4 = PR_C = 0。QID N—E4 係工 作(E4)之放入對象之虛擬佇列的qID、〇DR_N_E4係放入時 的順序值、PR_N_E4係工作(E4)的工作優先順序》順向放 入之工作相關之ODR_N,恆設定為「〇」。此係表示對佇列 之最新放入的順序值。 不僅暫存器值產生電路420_E4,亦會反應到QID_S_En =QID_C= Q1之暫存器值產生電路42〇_En。暫存器值產生 電路 420_En ’ 輸出 ODR_N—En= 〇DR_S_En + 1。此處,暫 存器值產生電路420_E1檢測到qid_s_E1 = QID_C= Q1, 67 200937294 輸出ODR一Ν_Ε1 = 〇+ 1= !。〇DR_N—E1係卫作⑻)放入後 的順序值。已經放入工作(E4)之順向放入對象之虛擬佇列 (Q1)之工作,其順序值受到影響。經過此種處理過程,調整 虛擬佇列(Q1)之要素之工作(E4)與工作(E1)的狀態資料。 圖24係對應圖23之狀態暫存器25〇的資料結構圖。 同圖中’附加底線之部分,為圖22所示之狀態暫存器 250之a曼疋内容改變的部位。由於工作(E4)對虛擬佇列⑴】) 之順向放入’因此佇列辨別暫存器4丨6_E4係藉由qID_n_E4 设定成「Q1」。工作(E4)之〇DR為「〇」,PR為「〇」。由 ❹ 於工作(E4)之順向放入,已放入虛擬佇列(q〗)之工作(E1)之 ODR從「〇」增加為「丨」。藉由變更後之狀態暫存器25〇 的設定内容,表現圖23所示之虛擬佇列(q 1)的狀態。 圖25係將工作(E5)順向放入圖23之虛擬佇列時的概念 圖。 此處’說明將工作優先順序PR = i之工作(E5)順向放 入虛擬佇列(Q0)的情形。主電路400,CMD= ENQ_TL(順向 放入指令),設定 EID_C = E5、QID_C = Q〇、PR C = 1。暫 〇 存器值產生電路420_E5,輸出QID_n_E5 = QID C = Q0、 ODR N—E5 = 0、PR N E5 = PR C = 1 〇 — — __ 鼉 不僅暫存器值產生電路420 E5,QID_C= QID_S En = Q0之暫存器值產生電路420_En,檢測到qid—C= QID_S_En 時,輸出ODR_N_En= ODR_S_En + 1。此例中,為對應工 作(E0)、工作(E2)、工作(E3)之暫存器值產生電路420。如 此’調整虛擬仔列(Q0)之要素之工作(E5)與工作(E0)、工作 68 200937294 (E2)、工作(E3)的狀態資料。 圖26係對應圖25之狀態暫存器250的資料結構圖。 同圖中,附加底線之部分,為圖24所示之狀態暫存器 250之設定内容改變的部位。首先,由於工作(E5)對虛擬佇 列(Q0)之順向放入,因此佇列辨別暫存器4丨6_E5係新設定 成「Q0」。工作(E5)之ODR為「〇」,PR為M」。由於工 作(E5)之順向放入,已放入虛擬佇列(q〇)之工作(E〇)、工作 (E1)、工作(E3)之〇dr分別增加。 圖27係顯示順向放入之處理過程的流程圖。 主電路400 ’設定順向放入之工作(以下,稱為「順向 放入工作」)相關之放入條件(s 1 〇)。具體而言,CMD = ENQ TL ’ 6又疋 EID C、QID_c、PR_C。仵列控制電路 404 之中,對應順向放入工作之暫存器值產生電路42〇,將順向 放入工作之工作優先順序暫存器412、佇列順序暫存器 414、佇列辨別暫存器416分別設定成pr_c、〇、qid c(s12)。 虛擬佇列(QID_C)已放入其他工作時(S14之是),對已 放入之各工作增加ODR(S16)e圖25所示之例之情形,對 工作(別)、工作(E2)、工作(E3)增加〇DR。su、sm、si6 之處理在時間上大致同時執行。 (逆向放入) 圖28係最大值選擇電路4〇6之一部分的電路圖。 取大值選擇電路406,係用以進行逆向放入處理而由主 電路400驅動的電路。最大值選擇電路4〇6,當輸入 一 Qn作為CND訊號時,將虛擬佇列(Qn)之最大順序值輸出 69 200937294 至ODR_A2,傳送ODR_A2_EN。最大值選擇電路406,與 基本例所示之執行選擇電路232與旗號選擇電路234相 同,係由複數段之比較電路構成。最大值選擇電路406,包 含4個第1比較電路422(422a, 422b等)、2個第2比較電 路424(424a等)、1個第3比較電路(未圖示)。又,包含8 個判定電路 426(426a,426b,426c,426d 等)。 著眼於第1比較電路422a進行說明。第1比較電路422a 比較工作〇與工作1,兩者皆放入虛擬佇列(Qn)時,選擇順 序值大的工作。工作0與工作1的工作ID與順序值作為 〇 EID_S、ODR_S而輸入至第1比較電路422a。 第1判定:判定電路426a,若工作〇已放入虛擬仵列 (Qn),則傳送EID一11A_EN。判定電路426b,若工作1已 放入虛擬佇列(Qn)’則傳送EID_11B一EN。第1比較電路 422a,首先,參照分別從判定電路426a與判定電路426b 輸出之EID_11_EN訊號。其中一者為「j」時,僅其中一者 之工作已放入虛擬佇列(Qn)。此時,第!比較電路422&amp;, 將已放入虛擬佇列(Qn)之工作之工作ID(EID_S)與順序值 ◎ (ODR_S)分別輸出作為EID—21A、〇DR_21A,傳送 EID_21A_EN。 判定電路426a與判定電路42补皆輸出「〇」時,兩個 工作皆未放入虛擬佇列(Qn)。此時,停止傳送 EID 21A EN,以後,工作〇盘丁从,fch π上、A从 一 一 奸υ輿工作1皆不成為第2比較電 路424a的考慮對象。 判定電路426a與判定電路426b皆輸出「丨」時兩個 70 200937294 工作皆已放入虛擬佇列(Qn),此時,執行接下來的第2判定。 第2判定:比較工作〇之〇DR_S_0與工作1之 〇DR-S_i ’選擇順序值大的工作。第i比較電路422a,將 順序值大的工作的工作ID(EID_S)與順序值(〇DR-S)分別輸 出作為 EID—21A、〇DR_21A,傳送 EID_21A_EN。The second work selection circuit 230 selects the state transition to the state based on the state data 'outputted from the state register 25'. The main circuit side inputs the CND signal to the work selection circuit 230. The CND is a signal indicating a job selection condition, and includes a pR c indicating a work priority order of the queue (1). For example, when the virtual queue (0) is to be taken out of the work, the main circuit 4 sets QID_C_〇 at cnd. The work selection circuit 23 轮 rotates the work of the designated virtual queue (7) into the operation (hereinafter, simply referred to as "take-out operation") to EID-A1, and transmits EIDA1EN. Further, in pRA1, 〇DR_乂, the work priority order and the sequence value of the fetch job are output. In this manner, the main circuit 400, designating QID - c = Qn and inquiring the work selection circuit 23, thereby knowing the fetch operation of the virtual queue (Qn). The work selection circuit 23 has a function of selecting a take-out candidate circuit for taking out the work. More details will be described later with reference to FIG. The CND signal is input from the main circuit 4〇〇 to the maximum value selection circuit 4〇6. 62 200937294 The maximum value selection circuit 406 outputs the maximum sequence value of the virtual queue (Qn) to ODR_A2 and transmits EID_A2_EN when QID_C=Qn is specified by CND. More details will be described later with reference to FIG. 28. The queue control circuit 404 controls the state transition of each operation by setting the state data of each state register 250. The CMD and EID_C are input from the main circuit 400 to the array control circuit 404, and in addition, CND (QID_C, PR_C), 0DR_A1, ODR_A2, ODR_A2_EN and status data of each state register 250 are also input. 〇 CMD is an instruction to operate a virtual queue. The queue ID of the virtual queue, the job ID of the job, and the work priority are specified by QID_C, EID-C, and PR_C, respectively. The command is one of three types of ENQ-TL, ENQ-TP, and DEQ. When the input is placed in the instruction ENQ_TL, the job specified by the EID_C signal is placed from the last end of the virtual queue. Hereinafter, the placement from the last end of the queue is referred to as "positive insertion". When the fetch instruction DEQ is input, the work is taken out from the front end of the virtual queue. The queue control of FIFO ^ is performed by ENQ_TL and DEQ. When the reverse input command ENQ_TP is input, the job specified by the EID_C signal is placed from the front of the virtual queue. Hereinafter, the insertion from the front end of the array is referred to as "reverse insertion". Reverse insertion, not a FIFO, is a special placement method. When the CMD is input from the main circuit 400, the write circuit 402 transmits the WT, and executes the writing of each of the data output from the array control circuit 404 to the state register 250. The array control circuit 404, the write circuit 402, the operation selection circuit 230, the maximum value selection circuit 406, and the like have functions for controlling the virtual matrix of the virtual circuit. The circuit configuration of the array control circuit 404 will be described in detail with reference to Fig. 20 next. FIG. 20 is a circuit diagram of the train control circuit 404. The queue control circuit 404 is an aggregate of a plurality of register value generating circuits 420. Each of the register value generating circuits 420 is the same circuit. The register value generating circuit 420 corresponds to each operation. It can also be said to correspond to each state register 250. The register value generating circuit 420_EN corresponds to the operation of the work ID = En (hereinafter, referred to as "operation (En)"). The job ID of the job is fixedly input to the scratchpad value generating circuit 420 as an ELM_ID signal. ODR_S, QID_S, and PR_S are state data outputted from the state register 250, which respectively represent the sequence value, the queue ID, and the work priority. The order value, the queue ID, and the job priority of the operation (En) are input to the register value generation circuit 420_EN of the corresponding operation (En) as ODR_S_En, QID_S_En, and PR_S_En, respectively. CMD and EID_C are input from the main circuit 400. ODR_A2_EN and ODR_A2 are input from the maximum value selection circuit 406. 〇DR_A2, which represents the maximum sequence value, becomes a valid input when ODR_A2_EN is transmitted. 0DR_A1 is input from the work selection circuit 230. ODR-A1 indicates the work ID of the work to be taken out. QID_C and PR_C are CND signals input from the main circuit 400, respectively indicating QID and PR as job selection conditions. The register value generating circuit 420_EN outputs the order value, the queue ID, and the work priority of the operation (En) as QID_N_En, ODR_N_En, and PR_N_En, respectively, and writes to the state temporary storage when the write circuit 402 transmits the WT.器200937294 250_Εη 〇When the write circuit 4〇2 transmits WT B#, the Qj·-1矸 of all the register value generation circuits 420 QID N En, 〇dr n En, PR μ p is done - ~ Ν-· ^η, PR-N-En is written to all state registers 250. The scratchpad value generating circuit associated with the work affected by the CMD writes new data designated by the algorithm described later to the state register 250. On the other hand, the work-related scratchpad value generating circuit 420' which is not affected by the CMD also outputs the same material as the data written to the state register 250 again to perform writing. Further, the WT which temporarily stores the hard-to-generate circuit 42 is directly input to the slave train control circuit 404 instead of the state register 25. At this time, the register value generating circuit 42 is built in the register value generating circuit 404, and only the work register value generating circuit 42 corresponding to the change of the state is changed, and the new data is written to the state. The memory 250 is also available. The specific processing contents of the register value generating circuit 420 will be described later. Figure 21 is a conceptual diagram showing the relationship between a virtual queue and work. Here, it is assumed that there are two virtual queues of the virtual queue (Q0) and the virtual queue (Q1). The virtual tenant column (Q0) is used to put the work priority list pR = 伫 work priority column (hereinafter, the table is marked as "priority queue (Q〇: 〇)") and used to put work priority The set of the two priority queues of the priority queue (Q〇:丨) of the work of PR=i. The virtual queue is also the same, assuming there are essentially four priority queues. For example, the virtual queue (Q〇) corresponds to the READY state, and the virtual queue (Q1) corresponds to the WAIT state. For each virtual queue, the left side of the figure is the entrance and the right side is the queue of the extraction port. Put it into the work from the left side in the forward direction, and put it into the work from the side of the right 65 200937294 in the reverse direction. Take out the work and keep it from the right side. In the same figure, four jobs with job ID=EO, El, E2, and E3 are placed in the virtual queue. Work (EO) and work (E2), work (E3) are placed in the virtual queue (Q0). Among them, work (EO) and work (E3) work in the order of priority PR =0, so the priority queue (q〇 : 〇) is placed. Since the work (E2) is the work of PR== 1 ', the priority queue (q〇 :丨) is placed. The order value ODR of the work (E3), work (E2), and work (EO) placed in the virtual queue (Q0) is 2, 1, and 0. The work priority PR=: 工作 work (E1) is placed in the virtual queue (Q1). The ODR is "〇". © Fig. 22 is a data structure diagram corresponding to the state register 250 of Fig. 21. The put-in state of each job for the virtual queue shown in Fig. 21 is represented by the setting of the state register 250. In the state shown in Fig. 21, in the work (E〇)~Work (E7), the virtual queue is placed for work (E0)~work (E3). Therefore, the "other work" list discriminator 416 is set to indicate "Non" which is not placed. The job list discriminator 416 of the work (E〇), work (E3), and work (E2) placed in the virtual queue (q〇) is set to "q〇". Further, the queue discrimination register 416 of the operation (E1) placed in the virtual queue (Q1) is set to "Q1". By identifying the setting contents of the register 416, it is indicated which work is placed in which virtual queue. The three sequence (E〇), the work (E3), and the work (E2) queues 412 ’ placed in the virtual queue (Q0) are set to 〇, 2, and 1, respectively. The work of placing the virtual queue (Q1), because there is only work (E丨), the sequence value is set to the minimum "0". The position of each of the virtual queues is represented by the setting contents of the sequence register 414. 66 200937294 Work (E0), work (E1), work (E3) work priority PR is 〇" ° so 'the work priority register 412 is set to 0 in these jobs" ° due to work (E2) work Since the priority PR is "1", "1" is set in the work priority register 412_E2. The priority of the job is placed by the setting of the job priority sequence register 412. According to the above settings, the processing contents of the forward insertion, the reverse insertion, and the removal are described in detail. (Follow-in) Fig. 23 is a conceptual diagram when the work (E4) is placed in the virtual queue of Fig. 21 in the forward direction. Here, the case where the work priority order PR=〇 work (E4) is placed in the virtual queue (Q 1) will be described. The main circuit 4〇〇, CMD = ENQ_TL (forward put command) is set to EID_C=E4, QID_C=Q1, and PR_C=0. The register value generating circuit 420_E4 built in the slave column control circuit 404 outputs Qid_n_E4=QID_C = Q1, ODR_N_E4 = 〇, PR_n_E4 = PR_C = 0 when detecting E to EID_c=ELM_ID=E4. QID N-E4 system work (E4) The qID of the virtual queue to be placed, the order value when 〇DR_N_E4 is placed, and the work priority of PR_N_E4 system work (E4)" ODR_N related to the work of the forward insertion , the constant setting is "〇". This is the order value for the most recent placement of the queue. Not only the scratchpad value generating circuit 420_E4 but also the register value generating circuit 42A_En of QID_S_En = QID_C = Q1. The register value generating circuit 420_En 'outputs ODR_N_En = 〇DR_S_En + 1. Here, the register value generating circuit 420_E1 detects that qid_s_E1 = QID_C = Q1, 67 200937294 outputs ODR_Ν_Ε1 = 〇+ 1= !. 〇DR_N—E1 is the order value after the insertion (8)). The work that has been placed in the work (E4) is placed in the virtual queue (Q1) of the object, and the order value is affected. After this process, the status data of the work (E4) and work (E1) of the elements of the virtual queue (Q1) are adjusted. Figure 24 is a data structure diagram corresponding to the state register 25A of Figure 23. In the same figure, the portion of the add-on bottom line is the portion of the state register 250 shown in Fig. 22 where the content of the 疋 。 is changed. Since the work (E4) puts the forward direction of the virtual queue (1)]), the queue identification register 4丨6_E4 is set to "Q1" by qID_n_E4. After work (E4), DR is "〇" and PR is "〇". From the forward direction of work (E4), the ODR of the work (E1) that has been placed in the virtual queue (q) is increased from "〇" to "丨". The state of the virtual queue (q 1) shown in Fig. 23 is expressed by the setting contents of the changed state register 25A. Fig. 25 is a conceptual diagram when the work (E5) is placed in the virtual queue of Fig. 23 in the forward direction. Here, the case where the work priority (PR) of the work priority order PR = i is placed in the virtual queue (Q0) will be described. The main circuit 400, CMD = ENQ_TL (direct input command), sets EID_C = E5, QID_C = Q〇, PR C = 1. The temporary buffer value generating circuit 420_E5, the output QID_n_E5 = QID C = Q0, ODR N - E5 = 0, PR N E5 = PR C = 1 〇 - __ 鼍 not only the register value generating circuit 420 E5, QID_C = QID_S The register value generation circuit 420_En of En = Q0 outputs ODR_N_En = ODR_S_En + 1 when qid_C = QID_S_En is detected. In this example, it is a register value generating circuit 420 corresponding to the work (E0), the work (E2), and the work (E3). For example, the status data of the work (E5) and work (E0), work 68 200937294 (E2), and work (E3) of the elements of the virtual train (Q0) are adjusted. FIG. 26 is a data structure diagram corresponding to the state register 250 of FIG. 25. In the same figure, the portion to which the bottom line is attached is the portion where the setting contents of the state register 250 shown in Fig. 24 are changed. First, since the work (E5) puts the virtual queue (Q0) in the forward direction, the queue identification register 4丨6_E5 is newly set to "Q0". The ODR of the work (E5) is "〇" and the PR is M". Due to the forward placement of the work (E5), the work (E〇), work (E1), and work (E3) that have been placed in the virtual queue (q〇) are increased respectively. Figure 27 is a flow chart showing the processing of the forward insertion. The main circuit 400' sets the insertion condition (s 1 〇) associated with the forward insertion operation (hereinafter referred to as "forward placement work"). Specifically, CMD = ENQ TL '6 and 疋 EID C, QID_c, PR_C. Among the array control circuit 404, the register value generating circuit 42A corresponding to the forward direction is placed in the work priority order register 412, the queue sequential register 414, and the column identification. The register 416 is set to pr_c, 〇, qid c (s12), respectively. When the virtual queue (QID_C) has been put into other work (Yes in S14), the ODR (S16)e is added to the work that has been placed, and the example shown in Fig. 25 is performed, and the work (others) and work (E2) are performed. Work (E3) increases 〇DR. The processing of su, sm, and si6 is performed substantially simultaneously in time. (Reverse Insertion) FIG. 28 is a circuit diagram of a portion of the maximum value selection circuit 4〇6. The large value selection circuit 406 is a circuit for performing the reverse insertion processing and being driven by the main circuit 400. The maximum value selection circuit 4〇6, when a Qn is input as the CND signal, outputs the maximum order value of the virtual queue (Qn) to 69200937294 to ODR_A2, and transmits ODR_A2_EN. The maximum value selection circuit 406 is the same as the execution selection circuit 232 and the flag selection circuit 234 shown in the basic example, and is constituted by a comparison circuit of a plurality of stages. The maximum value selection circuit 406 includes four first comparison circuits 422 (422a, 422b, etc.), two second comparison circuits 424 (424a, etc.), and one third comparison circuit (not shown). Further, eight decision circuits 426 (426a, 426b, 426c, 426d, etc.) are included. The description will be focused on the first comparison circuit 422a. The first comparison circuit 422a compares the operation 工作 with the job 1, and when both are placed in the virtual queue (Qn), the operation with a large sequential value is selected. The job ID and the sequence value of the job 0 and the job 1 are input to the first comparison circuit 422a as 〇 EID_S and ODR_S. First determination: The determination circuit 426a transmits the EID-11A_EN if the operation is placed in the virtual queue (Qn). The decision circuit 426b transmits EID_11B-EN if the job 1 has been placed in the virtual queue (Qn). The first comparison circuit 422a first refers to the EID_11_EN signals output from the determination circuit 426a and the determination circuit 426b, respectively. When one of them is "j", only one of the jobs has been placed in the virtual queue (Qn). At this time, the first! The comparison circuit 422 &amp; outputs the work ID (EID_S) and the order value ◎ (ODR_S) of the work placed in the virtual queue (Qn) as EID-21A, 〇DR_21A, and transmits EID_21A_EN. When both the decision circuit 426a and the decision circuit 42 output "〇", neither of the two jobs are placed in the virtual queue (Qn). At this time, the transmission of the EID 21A EN is stopped, and thereafter, the work is not considered to be the object of the second comparison circuit 424a, fch π, and A from the scam. When both the determination circuit 426a and the determination circuit 426b output "丨", the two 70 200937294 jobs are placed in the virtual queue (Qn), and at this time, the next second determination is executed. The second determination is to compare the work 〇 DR_S_0 with the work 1 〇 DR-S_i ’ selection order value. The i-th comparison circuit 422a outputs an operation ID (EID_S) and a sequence value (〇DR-S) of the operation having a large sequence value as EID-21A and 〇DR_21A, respectively, and transmits EID_21A_EN.

其他之第1比較電路422之處理内容亦相同,分別比 較工作0與工作1、工作2與工作3、工作4與工作5、工 作6與工作7。第2比較電路424,從來自2個第1比較電 路422的輸出,進一步選擇順序值大的工作。著眼於第2 比較電路424a進行說明。第2比較電路424a比較第i比較 電路422a的輸出訊號與第i比較電路㈣的輸出訊號選 擇順序值大的卫作。從第i比較電路咖與第U較電路 422b分別輸入EID一2卜〇DR_2丨、eid_en至第2比較電路 424a。f 2比較電路424,選擇工作g〜工作3之中,在虛 擬仔列(Qn)之中順序值最大的卫作^他之第2比較電路 424亦相同,最後,將虛擬仵列(Qn)之最大順序值輸出作為 ODR—A2訊號。當選擇任—個卫作時傳送麵—Μ,,當 任一個工作皆不存在;^ _ 4 个仔杜於虛擬佇列(Qn)時停止傳送 ODR A2 EN。The processing contents of the other first comparison circuit 422 are also the same, respectively comparing work 0 with work 1, work 2 and work 3, work 4 and work 5, work 6 and work 7. The second comparison circuit 424 further selects an operation having a large sequence value from the outputs from the two first comparison circuits 422. The second comparison circuit 424a will be described with a focus. The second comparison circuit 424a compares the output signal of the ith comparison circuit 422a with the output signal selection order value of the ith comparison circuit (4). EID-2 〇DR_2丨, eid_en are input from the ith comparison circuit and the U comparison circuit 422b to the second comparison circuit 424a, respectively. The f 2 comparison circuit 424 selects the work g to the work 3, and the second comparison circuit 424 having the largest order value among the virtual queues (Qn) is also the same, and finally, the virtual queue (Qn) The maximum sequential value output is used as the ODR-A2 signal. When you select any of the guards, the transfer surface—Μ, does not exist for any work; ^ _ 4 stops when the virtual queue (Qn) stops transmitting ODR A2 EN.

此外,用以使優先順序判定I 疋…、效化之PR無效訊號亦可 輸入至第1比較電路422、第9 士私&amp; 乐2比較電路424、第3比較電 路。當傳送PR無效訊號時,各士私办 &amp;比較電路將優先順序從判定 條件除去來選擇工作。圖32a 巧不之各比較電路亦相同。 圖29係將工作(Ε6)逆向玫入 囫25之虛擬仔列時的概念 71 200937294 圖。 此處,說明將工作優先順序PR=1之工作(E6)逆向放 入虛擬佇列(Q0)之情形。首先,主電路400,藉由QID_C 訊號將放入對象之QID= Q0輸入至最大值選擇電路406。 最大值選擇電路406,將虛擬佇列(Q0)之最大順序值作為 ODR_A2輸出至佇列控制電路404,傳送ODR_A2_EN。如 圖25所示,由於虛擬佇列(Q0)之最大順序值為工作(E3)的 「3」,因此 ODR_A2 = 3。 接著,主電路400,CMD= ENQ_TP(逆向放入指令), 設定 EID—C = E6、QID_C = Q0、PR_C = 1。此時,内建於仔 列控制電路404之暫存器值產生電路420_E6,檢測到EID_C =ELM_ID = E6 時,輸出 QID—N—E6 = QID_C = Q0、 ODR_N_E6= ODR_A2 + 1 = 3 + 1 = 4、PR_N_E6= PR_C= 1。 CMD=ENQ_TP(逆向放入指令)時,僅對應EID—C所指 定之工作之暫存器值產生電路420會動作。因此,僅逆向 放入之工作(E6)之狀態資料會設定變更。 圖30係對應圖29之狀態暫存器250的資料結構圖。 同圖中,附加底線之部分,為圖26所示之狀態暫存器 250之設定内容改變的部位。首先,由於工作(E6)對虛擬佇 列(Q0)之逆向放入,因此佇列辨別暫存器416_E6係新設定 成「Q0」。工作(E6)之ODR為「4」,PR為「1」。由於工 作(E6)之逆向放入,其他工作之狀態資料不受影響。 圖3 1係顯示逆向放入之處理過程的流程圖。Further, the PR invalid signal for determining the priority order I 疋 ... can also be input to the first comparison circuit 422, the ninth private &amp; music 2 comparison circuit 424, and the third comparison circuit. When the PR invalid signal is transmitted, each of the private &amp; comparison circuits removes the priority order from the decision condition to select a job. Figure 32a is also the same for each comparison circuit. Figure 29 is a concept when the work (Ε6) is reversed into the virtual row of 囫25. 71 200937294 Figure. Here, a case where the work (E6) of the work priority order PR = 1 is reversely placed in the virtual queue (Q0) will be described. First, the main circuit 400 inputs the QID=Q0 of the placed object to the maximum value selection circuit 406 by the QID_C signal. The maximum value selection circuit 406 outputs the maximum sequence value of the virtual matrix (Q0) as the ODR_A2 to the array control circuit 404, and transmits the ODR_A2_EN. As shown in Fig. 25, since the maximum order value of the virtual queue (Q0) is "3" of the operation (E3), ODR_A2 = 3. Next, the main circuit 400, CMD = ENQ_TP (reverse input command), sets EID - C = E6, QID_C = Q0, PR_C = 1. At this time, the register value generating circuit 420_E6 built in the slave column control circuit 404 outputs QID_N_E6 = QID_C = Q0, ODR_N_E6 = ODR_A2 + 1 = 3 + 1 = when EID_C = ELM_ID = E6 is detected. 4. PR_N_E6= PR_C= 1. When CMD = ENQ_TP (reverse input command), only the register value generating circuit 420 corresponding to the operation specified by EID-C operates. Therefore, only the status data of the work (E6) placed in the reverse direction is changed. FIG. 30 is a data structure diagram corresponding to the state register 250 of FIG. In the same figure, the portion to which the bottom line is attached is the portion where the setting contents of the state register 250 shown in Fig. 26 are changed. First, since the work (E6) is placed in the reverse direction of the virtual queue (Q0), the queue identifying buffer 416_E6 is newly set to "Q0". The ODR of the work (E6) is "4" and the PR is "1". Due to the reverse placement of work (E6), the status data of other jobs is not affected. Figure 3 is a flow chart showing the process of reverse insertion.

主電路400,首先,將逆向放入對象之虛擬佇列之QID 200937294 =Qn輸入至最大值選擇電路406(S20)。主電路400,將虛 擬佇列(Qn)之最大順序值輸出至佇列控制電路4〇4(S22)。主 電路400,設定逆向放入之工作(以下,稱為「逆向放入工 作」)相關之放入條件(S24)。具體而言,CMD= ENQ TP(逆 向放入指令)’設定EID_C、QID—C、PR_C。佇列控制電路 404之中,對應逆向放入工作之暫存器值產生電路42〇,分 別在逆向放入工作之工作優先順序暫存器412、佇列順序暫 存器414、佇列辨別暫存器416設定pR_c、最大順序值+卜 ® QID-C(S26)。然而,當最大順序值=0、停止傳送 ODR—A2—EN時’亦即’當工作未放入虛擬仵列(Qn)時,在 仔列順序暫存器414設定表示初放入的順序值「〇」。 如上述,在順向放入時,有可能產生其他工作之順序 值的調整但在逆向放入時不需要此種調整。以FIF〇為前 提觀察虛擬仵列時,愈早放入之工作設定愈大的順序值。 亦即’放入虛擬符列愈深的工作順序值愈大。相反地,亦 ❹可叹疋為放入虛擬仔列愈深的工作順序值愈小。此時,在 順向放入時,不需要其他工作之順序值的調整,但在逆向 放入時有可能產生其他工作之順序值的調整。 (取出) 圖32係工作選擇電路23〇之—部分的電路圖。 工作選擇電路230之基本構成,如圖㈣明之基本 例。改良例1丁 J/p ·*ςε ^ Λ 、擇電路23〇,當接受來自主電路400 的S旬問時,特定取屮 从 、 作。此處,說明用以特定此取出工 作之構造相關的雷政JLtt Vs 電路構成。工作選擇電路230,當輸入 73 200937294 QID—c = Qn作為CND訊號時,於虛擬佇列(Qn),從工作優 先順序最高的優先仔列選擇取出工作,將取出工作之工作 ID工作優先順序、順序值分別輸出至EID一A1、PR_A1、 〇DR_A1,傳送EID—A1_EN。工作選擇電路一23〇,與基本例 所不之執行選擇電路232及旗號選擇電路234相同,係由 複數段之比較電路構成。工作選擇電路23〇,包含4個第i 比較電路43G(43Ga,4鳩等)、2個第2比較電路432(4仏 等)、1㈣第3比較電路(未圖示)。又,包含8個判定電路 434(434a,434b,434c,434d 等)。 著眼於第!比較電路43〇a進行說明。第!比較電路43〇&amp; 比較工作〇與工作〗’兩者皆放入虛擬佇列㈧η)時,選擇工 作優先順序高的工作。工作優先順序相同時,選擇順序值 大的工作。工# 〇與工作i的工作m、工作優先順序、順 序值作為EID_S、PR_S、0DR_S而輸入至帛1比較電路 430a ° 第1判定:判定電路434a,若工作0已放入虛擬佇列 (Qn),則傳送EID_1 1 A_EN。判定電路434b,若工作i已 © 放入虛擬佇列(Qn),則傳送EID_UB_EN。第1比較電路 430a,首先,參照分別從判定電路434汪與判定電路434b 輸出之EID 一 n_EN訊號。其中一者為Γι」時,僅其中一者 之工作已放入虛擬佇列(Qn)。此時,第i比較電路43〇a, 將已放入虛擬佇列(Qn)之工作之工作ID(EID—s)、工作優先 順序(PR_S)、順序值(ODR_s)分別輸出作為eid_21A、 PR一11A、ODR_21 A,傳送 EID 21A ΕΝ。 74 200937294 判定電路434a與判定電路434b皆輪出「〇」時,兩個 工作皆未放入虛擬佇列(Qn)。此時,停止傳送 EID_21A_ENm 不成為第2比較電 路432a的考慮對象。 判定電路434a與判定電路434b皆輸出「丨」時,兩個 工作皆已放入虛擬佇列(Qn),此時,執行接下來的第2判定。 ❹ Ο 第2判定:比較工作〇之pR—s 〇與工作ι之pR一, 選擇工作優先順序高’,亦即’ pR—s小的工作。帛工比較電 路430a’將工作優先順序高之工作之工作出(⑽』、工作 優先順序(PR一S)、順序值(〇DR_s)分別輸出作為eid—2 i A、 PR—21A、〇DR_21A,傳送eid_21a—EN。兩個工作之工作 優先順序相同時,執行接下來的第3判定》 第3判定:比較工作〇之〇DR—s—〇與工作丄之 ODR—S」,選擇順序值大的工作。帛i比較電路他,將 順序值大的工作的工WD(EID_S)、工作優先順序(pR S)、 順序值(ODR_S)分別輸出作為eid_2ia、pR HA、 〇DR_21A,傳送 eiD 21a_en。 — 其他之第1比較電路430之處理内容亦相同,分別比 較工作0與工作卜工作2與工作3、工作4與工作5、工 作6與工作7。第2比較電路切,從來自2個第,比較電 H的輸出’進一步鎖定取出工作的候補。最後,從虛 擬仔列伽)中之工作優先順序最高的優先㈣,選擇取出工 :。當選擇任一個工作時傳$⑽―A,,當任一個工作 皆不存在於虛擬仔列(Qn)時停止㈣EID_A〔en。 75 200937294 圖33係從圖29之虛擬佇列取出工作(E3)時的概念圖。 此處,以從虛擬佇列(Q0)取出1個工作之情形進行說 明。主電路400,將QID_C= Q0輸入至工作選擇電路230。 如圖29所示,在對應虛擬佇列(Q0)之中之最高優先順序的 優先佇列(Q0 : 0),放入順序值「1」的工作(E0)與順序值「3」 的工作(E3)。工作選擇電路230,選擇順序值大的工作(E3) 作為取出工作。工作選擇電路230,設EID_A1 = E3、PR_A1 =0、ODR_Al = 3,傳送 EID_A1_EN。 接著,主電路400,CMD= DEQ(取出指令),設定EID_C =EID_A1 = E3、QID_C= Q0。暫存器值產生電路 420—E3, 輸出 QID_N_E3= Non、ODR_N_E3= 0(重設)、PR_N_E3 = 〇(重設)。以此方式,在狀態暫存器250解除工作(E3)與虛 擬佇列(Q0)的關係。 不僅暫存器值產生電路420_E3,QID_S_En= QID_C = Q0之暫存器值產生電路420_En,當檢測出 QID—C = QID_S_En 時,判定為 ODR_S_En&gt; ODR_Al。此處,ODR_Al 係取出工作(E3)之取出前的順序值。若 ODR_S_En &gt; ODR—A1,亦即,順序值較取出工作之順序值大之工作(En) 的暫存器值產生電路420_En,輸出ODR_N_En= ODR_S_En —1。圖29所示之例,相當於工作(E6)之暫存器值產生電路 420_E6。暫存器值產生電路420_E6,輸出 ODR_N_E6 = ODR_S—E6 - 1 = 4 - 1 = 3。以此方式,調整虛擬佇列(Q0)之 要素之工作(E6)的狀態資料。 圖34係對應圖33之狀態暫存器250的資料結構圖。 200937294 同圖中’附加底線之部分’為圖3〇所示之狀態暫存器 250之設定内容改變的部位。首先,由於從虛擬佇列⑷〇)取 出工作(E3),因此在佇列辨別暫存器416_E3新設定「N〇n」。 又,在佇列順序暫存器414與工作優先順序暫存器412分 別设定「〇」作為重設值。由於取出工作(E3),因此原本放 入虛擬佇列(Q0)之工作(E〇)、工作(E2)、工作(E5)、工作 之中,順序值較取出工作(E3)大的工作(E6)的〇DR減少。 圖35係顯示取出之處理過程的流程圖。 主電路400’首先,將取出對象之虛擬佇列之Qm=Qn 輸入至工作選擇電路23〇(S3〇)。工作選擇電路23〇,從虛擬 仔列(Qn)選擇取出工作(S32)。主電路4〇〇,將取出工作之工 作ID En輸入至分列控制電路4〇4時,仔列控制電路扣4, 從取出工作(En)之狀態資料清除QID=Qn(S34)。此時,將 PR與ODR重設成「〇」,但亦可不重設。 在虛擬佇列(Qn)亦放入其他工作(S36之是),〇DR_s En &gt;〇dr_a1之工作存在時(S38之是),減少該工作的順序值 (S4〇h此外,從S3〇至S4〇所示之處理不一定要序列執行, 在時間上並行執行亦可。 在構裝上,亦可從虛擬佇列之途中取出工作。例如’ 圖33中,產生要從虛擬佇列(Q0)之正中央取出工作(E2)的 必要性。工作(E2),係以某旗標A設定為導通為條件而可 動作的卫作。此旗標A斷開時,產生要從虛擬符列(Q〇)之 途中取出工作(摩必要性。或者’工作(E2)預先設定之等 待時間暫停時,亦產生要從虛擬仔列(Qq)之途中取出工作 77 200937294 (E2)的必要性。此時,清除工作(E2)的⑽藉由減少順序 ^較工作(E2)之順序值「2」大的工作的咖,亦可從虛擬 仔列(Q0)之途中取出工作(Ε2)β圖33之情形,工作⑽)的 ODR成為「2」。由於虛擬㈣係形成為不受硬體的物理性 限制,因此亦可從佇列途中進行放入、取出處理。The main circuit 400 first inputs QID 200937294 = Qn, which is placed in the virtual queue of the object, to the maximum value selection circuit 406 (S20). The main circuit 400 outputs the maximum order value of the virtual matrix (Qn) to the array control circuit 4〇4 (S22). The main circuit 400 sets the insertion condition (S24) associated with the reverse insertion operation (hereinafter referred to as "reverse insertion work"). Specifically, CMD = ENQ TP (Reverse Insertion Command)' sets EID_C, QID_C, and PR_C. Among the queue control circuit 404, the register value generating circuit 42A corresponding to the reverse insertion operation is respectively placed in the work priority register 412, the queue sequential register 414, and the queue identification The register 416 sets pR_c, maximum order value + Bu® QID-C (S26). However, when the maximum order value = 0 and the transmission of ODR_A2 - EN is stopped, that is, when the work is not placed in the virtual queue (Qn), the sequence order register 414 is set to indicate the order value of the initial insertion. "〇". As described above, when placed in the forward direction, it is possible to produce an adjustment of the order value of other work, but such adjustment is not required in the reverse insertion. When FIF〇 is used to observe the virtual queue, the earlier the work is set, the larger the order value is. That is, the deeper the work order value is, the deeper it is placed into the virtual character column. Conversely, it is also sighing that the deeper the work order value is, the smaller the value is placed. At this time, when the forward direction is placed, the adjustment of the order value of other work is not required, but the adjustment of the order value of other work may occur in the reverse insertion. (Removal) Fig. 32 is a circuit diagram of a portion of the operation selection circuit 23. The basic configuration of the work selection circuit 230 is as shown in the basic example of (4). The modified example 1 is J/p · * ς ε ^ Λ , and the circuit 23 is selected. When receiving the S from the main circuit 400, the specific sampling is performed. Here, the configuration of the Lei Zheng JLtt Vs circuit for specifying the structure of the take-out work will be described. The work selection circuit 230, when inputting 73 200937294 QID_c = Qn as the CND signal, selects the work in the virtual queue (Qn) from the highest priority column of the work priority order, and takes the job ID work priority order, The sequence values are output to EID-A1, PR_A1, 〇DR_A1, respectively, and EID-A1_EN is transmitted. The operation selection circuit 23 is the same as the basic selection control circuit 232 and the flag selection circuit 234, and is composed of a plurality of comparison circuits. The operation selection circuit 23A includes four ith comparison circuits 43G (43Ga, 4鸠, etc.), two second comparison circuits 432 (4 仏, etc.), and 1 (four) third comparison circuits (not shown). Further, eight decision circuits 434 (434a, 434b, 434c, 434d, etc.) are included. Focus on the first! The comparison circuit 43A will be described. The first! When the comparison circuit 43 〇 &amp; comparison work 〇 and work 〗 〖 are placed in the virtual queue (8) η), the work with high priority is selected. When the work priorities are the same, select a job with a large order value. The work m and work i, the work priority, and the sequence value are input to the 帛1 comparison circuit 430a as EID_S, PR_S, and 0DR_S. The first determination: the determination circuit 434a, if the operation 0 has been placed in the virtual queue (Qn) ), then send EID_1 1 A_EN. The decision circuit 434b transmits EID_UB_EN if the job i has been placed in the virtual queue (Qn). The first comparison circuit 430a first refers to the EID-n_EN signals output from the determination circuit 434 and the determination circuit 434b, respectively. When one of them is Γι, only one of the jobs has been placed in the virtual queue (Qn). At this time, the i-th comparison circuit 43Aa outputs the work ID (EID_s), the work priority order (PR_S), and the order value (ODR_s) of the work placed in the virtual queue (Qn) as eid_21A, PR, respectively. One 11A, ODR_21 A, transmits EID 21A ΕΝ. 74 200937294 When both the decision circuit 434a and the decision circuit 434b turn "〇", neither work is placed in the virtual queue (Qn). At this time, the stop transmission EID_21A_ENm is not considered as the second comparison circuit 432a. When both the determination circuit 434a and the determination circuit 434b output "丨", both jobs are placed in the virtual queue (Qn), and at this time, the next second determination is executed. ❹ Ο 2nd judgment: Comparing pR_s of work 〇 with pR of work ι, select work with high priority, ie, 'pR-s is small. The completion comparison circuit 430a' outputs the work priority ((10)", the work priority order (PR_S), and the sequence value (〇DR_s) of the work with high priority order as eid-2 i A, PR-21A, 〇DR_21A, respectively. , Eid_21a-EN is transmitted. When the work priorities of the two jobs are the same, the next third judgment is executed. The third judgment: comparing the work 〇 DR_s_〇 and the work 丄 ODR_S, select the order value Large work. 帛i compares the circuit, and outputs the work WD (EID_S), work priority (pR S), and sequence value (ODR_S) of the sequence value as eid_2ia, pR HA, 〇DR_21A, respectively, and transmits eiD 21a_en - The processing contents of the other first comparison circuit 430 are also the same, respectively comparing the work 0 with the work work 2 and the work 3, the work 4 and the work 5, the work 6 and the work 7. The second comparison circuit is cut, from the 2 First, compare the output of the electric H 'to further lock the candidate for the fetching work. Finally, from the virtual crayin to the highest priority in the work priority order (four), select the work out:. When you select any job, pass $(10)-A, and stop when any work does not exist in the virtual queue (Qn). (4) EID_A[en. 75 200937294 Fig. 33 is a conceptual diagram when the work (E3) is taken out from the virtual queue of Fig. 29. Here, a description will be given of a case where one job is taken out from the virtual queue (Q0). The main circuit 400 inputs QID_C = Q0 to the operation selection circuit 230. As shown in FIG. 29, in the priority queue (Q0: 0) corresponding to the highest priority among the virtual queues (Q0), the work of the order value "1" (E0) and the order value "3" are placed. (E3). The work selection circuit 230 selects the work (E3) having a large sequence value as the take-out work. The operation selection circuit 230 sets EID_A1 = E3, PR_A1 =0, ODR_Al = 3, and transmits EID_A1_EN. Next, the main circuit 400, CMD = DEQ (fetch instruction), sets EID_C = EID_A1 = E3, QID_C = Q0. Register value generation circuit 420-E3, output QID_N_E3= Non, ODR_N_E3=0 (reset), PR_N_E3 = 〇 (reset). In this manner, the state register 250 deactivates the relationship between the operation (E3) and the virtual queue (Q0). Not only the scratchpad value generating circuit 420_E3, QID_S_En = QID_C = Q0, the scratchpad value generating circuit 420_En, when detecting QID_C = QID_S_En, it is determined to be ODR_S_En &gt; ODR_Al. Here, ODR_Al is the order value before the take-out operation (E3) is taken out. If ODR_S_En &gt; ODR_A1, that is, the register value generating circuit 420_En of the operation (En) whose sequence value is larger than the order value of the fetch operation, the output ODR_N_En = ODR_S_En-1. The example shown in Fig. 29 corresponds to the register value generating circuit 420_E6 of the operation (E6). The register value generating circuit 420_E6 outputs ODR_N_E6 = ODR_S_E6 - 1 = 4 - 1 = 3. In this way, the status data of the work (E6) of the elements of the virtual queue (Q0) is adjusted. FIG. 34 is a data structure diagram corresponding to the state register 250 of FIG. 200937294 The portion of the 'attachment of the bottom line' in the same figure is the portion where the setting contents of the state register 250 shown in Fig. 3A are changed. First, since the operation (E3) is taken from the virtual queue (4), the "N〇n" is newly set in the queue identifying buffer 416_E3. Further, "伫" is set as the reset value in the queue sequential register 414 and the work priority register 412, respectively. Due to the removal work (E3), the work that was originally placed in the virtual queue (Q0) (E〇), work (E2), work (E5), and work, the order value is larger than the work (E3). The 〇DR of E6) is reduced. Figure 35 is a flow chart showing the process of taking out. The main circuit 400' first inputs Qm = Qn of the virtual queue of the extracted object to the work selection circuit 23 (S3). The job selection circuit 23A selects the fetch operation from the virtual chopping block (Qn) (S32). The main circuit 4〇〇, when the work ID ID of the take-out operation is input to the sorting control circuit 4〇4, the control circuit buckle 4 is cut, and the state data of the take-out operation (En) is cleared QID=Qn (S34). At this time, PR and ODR are reset to "〇", but they may not be reset. In the virtual queue (Qn) is also put into other work (S36 is), when the work of DR_s En &gt; 〇dr_a1 exists (S38 is), the order value of the work is reduced (S4〇h, in addition, from S3〇 The processing shown in S4〇 does not have to be performed in sequence, and can be performed in parallel in time. In the configuration, the work can also be taken out from the virtual queue. For example, in Figure 33, the generation is to be from the virtual queue ( Q0) The necessity of taking out the work (E2) in the center of the work. (E2) is a work that can be operated under the condition that a flag A is set to be on. When the flag A is disconnected, it is generated from the virtual character. When the job is taken out on the way (Q〇) (the necessity or the waiting time of the work (E2) is paused, the necessity of taking out the work 77 200937294 (E2) from the virtual queue (Qq) is also generated. At this time, (10) of the clearing work (E2) can also take out the work (Ε2) β from the way of the virtual train (Q0) by reducing the work of the order which is larger than the order value "2" of the work (E2). In the case of Fig. 33, the ODR of the work (10) is "2". Since the virtual (four) system is formed to be free from the physical limit of the hardware. Therefore also be carried out on the way into the queue, fetch process.

根據以上所示虛擬佇列控制,可藉由硬體邏輯實現以 FIFO為基本,且實現LIF〇動作的特殊佇列。若以軟體構 裝雙放入型佇列演算法,則通常為連結_列的構裝。然而, 只要是軟體進行的處理,則必定會產生對記憶體之存取與 位址之管理所伴隨的酬載。相對於此,改良例丨所示之虛 擬佇列控制,由於藉由硬體邏輯實現,因此可實現特別簡 單且高速的控制。特別是,於時間要求嚴格的RT〇s,將雙 放入型佇列演算法進行硬體構裝的意義非常大。接著,說 明藉由上述虛擬佇列控制方法實現再執行優先型工作排程 的形態。 圖36係顯示再執行優先型工作排程中之虛擬仔列與工 作之關係的第1概念圖。 此處’假設對應READT狀態之虛擬佇列(q0)與對應 WAIT旗號狀態之虛擬佇列(qi)的2個虛擬佇列。虛擬符列 (Q0),係用以放入工作優先順序PR= 〇之工作的優先作列 (以下’表記成「優先佇列(Q0 : 〇)」)與用以放入工作優先 順序PR= 1之工作的優先佇列(Q〇 : 1)之2個優先佇列的集 合體。虛擬佇列(Q1)亦相同,假設實質上有4個優先仔列。 同圖中,PR= 1之工作(E1)為RUN狀態,同樣PR=丄 78 200937294 之工作(E0)、工作(E2),在優先佇列(QO : 1)以READY狀態 待機。又,PR=0之工作(E3)在優先佇列(Q1 : 0)以 WAIT 旗號狀態待機。此處,設工作(El)為一執行後即集中優先執 行的工作。 首先,RUN狀態之工作(E1)執行解除旗號系統呼叫, 返回READY狀態(S1)。由於工作(E1)為僅快再執行的工 作,因此「逆向放入」優先佇列(Q0 : 1)。另一方面,藉由 解除旗號系統呼叫,工作(E3)之WAIT解除條件成立。從優 Ο 先佇列(Q1 : 〇)取出工作(E3),順向放入優先佇列(Q0 : 0)(S2)。接著,工作選擇電路23 0選擇新的RUN —工作。工 作選擇電路230,從READY狀態之工作之中,選擇工作優 先順序最高的工作(E3)作為取出工作。以此方式,從WAIT 狀態移至READY狀態之工作(E3),從優先佇列(Q0 : 0)被 取出而成為新的RUN—工作。根據此種工作排程,工作優 先順序高的工作,WAIT解除條件成立時可較快取得執行 權。 ® 圖37係顯示再執行優先型工作排程中之虛擬佇列與工 作之關係的第2概念圖。 工作(E3)執行待機旗號系統呼叫時,工作(E3)被順向放 入優先佇列(Q1 : 〇)(S4)。接著,工作選擇電路230選擇新 的RUN —工作。工作選擇電路230,從READY狀態之工作 之中,選擇工作優先順序最高的工作,但此處工作(E0)、工 作(E2)、工作(E1)之工作優先順序相同。此時,從優先佇列 (Q0 : 1)取出工作(E1)(S5)。工作(E1)成為新的RUN —工作。 79 200937294 根據此種處理方法,雖不致像設定成工作優先順序PR = 0, 但可對應一執行後即僅可能連續執行的工作(El)。 於再執行優先型工作排程,依據執行狀況與工作種類 分別使用順向放入與逆向放入,藉此可控制工作的執行順 序。因此,可維持基本例所示之工作處理裝置100的高速 處理性能的特徵,並可實現更精緻的工作排程。 (改良例2) 接著,作為改良例2,說明工作處理裝置100之輔助處 理的高速化。於改良例2之工作處理裝置100,HWF(硬體 功能模組:Hardware Function Module)執行輔助處理。此處 所謂HWF,係所謂輔助處理器,具有辅助處理電路的功能。 輔助處理係執行為工作的一部分,例如浮點運算、DMA傳 輸、加密解密處理、3D影像之座標計算等,有各種處理内 容。 首先,說明軟體OS之一般輔助處理的控制方法。之後, 說明改良例2之工作處理裝置1 00之輔助處理的控制方法。 圖38係顯示藉由軟體OS執行輔助處理時之一般電路 構成的圖。 CPU84係透過CPU匯流排512與未圖示之記憶體與 HWF500連接。又,CPU84連接有中斷控制器502 〇中斷控 制器502,從HWF500等接收各種中斷訊號,將中斷訊號 (INTR)傳至CPU84。CPU84接收中斷訊號(INTR)後,適當 藉由特殊工作執行對應中斷訊號(INTR)的處理。 如圖2所示,藉由CPU84執行軟體OS,在其上位階層 200937294 執行一般工作或特殊工作。 J與「並列型辅 ’在執行申無法 即使在執行中亦 辅助處理可大分為「串列型辅助處理 助處理」的2種。串列型輔助處理之情形 執行其他工作。並列型輔助處理之情形, 可並列執行其 他工作。 圓 圖39 係顯示 一般串列型輔助處 理之控制方法的時序According to the virtual queue control shown above, a special array based on FIFO and implementing LIF〇 operation can be realized by hardware logic. If the double-input type array algorithm is configured in software, it is usually the structure of the link_column. However, as long as it is handled by the software, it is necessary to generate a payload accompanying the management of the access and address of the memory. On the other hand, the virtual matrix control shown in the modified example is realized by hardware logic, so that particularly simple and high-speed control can be realized. In particular, in the time-critical RT〇s, it is very important to put the double-input type array algorithm into the hardware assembly. Next, the form of re-execution of the priority work schedule is realized by the above-described virtual queue control method. Fig. 36 is a first conceptual diagram showing the relationship between the virtual queue and the work in the re-execution of the priority work schedule. Here, it is assumed that two virtual queues of the virtual queue (q0) corresponding to the READT state and the virtual queue (qi) corresponding to the state of the WAIT flag are assumed. The virtual character column (Q0) is used to put the priority of the job with the work priority PR= ( (the following table is marked as “priority queue (Q0: 〇))) and used to put the work priority PR= The priority queue of the work of 1 (Q〇: 1) is a collection of two priority queues. The virtual queue (Q1) is also the same, assuming that there are essentially four priority queues. In the same figure, the work of PR=1 (E1) is in the RUN state, and the same work of PR=丄 78 200937294 (E0) and work (E2), and the priority queue (QO: 1) stands by in the READY state. Also, the work of PR=0 (E3) stands by in the priority queue (Q1: 0) in the WAIT flag state. Here, it is assumed that the work (El) is a work that is collectively prioritized after execution. First, the RUN state operation (E1) performs the canceling of the flag system call and returns to the READY state (S1). Since the job (E1) is a work that is performed only quickly, the "reverse put" priority queue (Q0: 1). On the other hand, by releasing the flag system call, the WAIT release condition of the work (E3) is established. Take the work (E3) from the priority queue (Q1: 〇) and put the priority queue (Q0: 0) (S2) in the forward direction. Next, the work selection circuit 230 selects a new RUN_work. The work selection circuit 230 selects the work (E3) having the highest priority in the work from the READY state as the take-out work. In this way, the work from the WAIT state to the READY state (E3) is taken out from the priority queue (Q0: 0) to become the new RUN-work. According to this work schedule, work with a high priority order can be executed quickly when the WAIT release condition is established. ® Figure 37 shows the second conceptual diagram showing the relationship between the virtual queue and the work in the re-execution of the priority work schedule. When the work (E3) executes the standby flag system call, the work (E3) is placed in the priority queue (Q1: 〇) (S4). Next, the work selection circuit 230 selects a new RUN-work. The work selection circuit 230 selects the work having the highest work priority from the work of the READY state, but the work priorities of the work (E0), the work (E2), and the work (E1) are the same. At this time, the work (E1) (S5) is taken out from the priority queue (Q0: 1). Work (E1) becomes the new RUN-work. 79 200937294 According to this processing method, although it is not set to the work priority order PR = 0, it can correspond to the work (El) which is only possible to be continuously executed after execution. The priority work schedule is re-executed, and the forward and reverse insertions are used according to the execution status and the work type, thereby controlling the execution order of the work. Therefore, the characteristics of the high-speed processing performance of the work processing apparatus 100 shown in the basic example can be maintained, and a more refined work schedule can be realized. (Modified Example 2) Next, as an improvement example 2, the speed of the auxiliary processing of the work processing apparatus 100 will be described. In the work processing apparatus 100 of the second modification, the HWF (Hardware Function Module) performs auxiliary processing. Here, the HWF is a so-called auxiliary processor and has a function of an auxiliary processing circuit. Auxiliary processing is performed as part of the work, such as floating point arithmetic, DMA transfer, encryption and decryption processing, coordinate calculation of 3D images, etc., and has various processing contents. First, a control method of the general auxiliary processing of the software OS will be described. Next, a control method of the auxiliary processing of the work processing apparatus 100 of the second modification will be described. Fig. 38 is a view showing the configuration of a general circuit when the auxiliary processing is executed by the software OS. The CPU 84 is connected to the HWF 500 via a CPU bus 512 and a memory (not shown). Further, the CPU 84 is connected to the interrupt controller 502, the interrupt controller 502, receives various interrupt signals from the HWF 500 or the like, and transmits an interrupt signal (INTR) to the CPU 84. After receiving the interrupt signal (INTR), the CPU 84 appropriately performs the processing of the corresponding interrupt signal (INTR) by special work. As shown in Fig. 2, the CPU 84 executes the software OS, and performs general work or special work at its upper level 200937294. J and "parallel auxiliary" are not available for execution. Even in the course of execution, the auxiliary processing can be divided into two types: "serial-type auxiliary processing and processing". In the case of tandem auxiliary processing Perform other work. In the case of side-by-side auxiliary processing, other work can be performed in parallel. Figure 39 shows the timing of the control method for general serial auxiliary processing.

首先,工作A發出「中斷禁止指令」作為用以佔有 hWF500的系統呼叫(sl〇〇)。此處,成為對象之膽·, 係設為FPU(浮點運算單元)。發出「中斷禁止指令」後,在 後述「中斷解除指令」發出之前,停止工作切換。以下, 將藉由中斷禁止指令設定成中斷禁錢,至藉 指令解除令斷禁止為止的期間 ” J朗间栴為中斷禁止期間」。在 中斷禁止期間中即使輸人中斷訊號(INtr),特殊工作亦不 會起動。在中斷禁止期間中,工作A獨佔CPU84的使用權。 是以’工作A以外之工作亦不會存取hwf5〇〇、料卿。 軟體0S设定中斷禁止後’工作A返回處理⑻〇2)。工 作A對HWF500指示執行辅助處理(sl〇4)。為了抑制輔助 處理控制所伴隨的酬載,工作A不透過軟體⑽將參數直接 寫入至HWF500的内建暫存器,指示執行輔助處理。 HWF500,執行工作A所指示的輔助處理。 工作A,一邊定期檢查hwf5〇〇的内建暫存器,一邊 等待辅助處理結束。檢測出辅助處理結束後(S106),工作A 發出中斷解除指令(S 1〇8)。軟體〇s接收中斷解除指令後, 81 200937294 解除中斷禁止⑻斗以此方式結束中斷 os執行工作切換,撰 a間軟體 顧m ^ 待執行的工作,例如工作 ()。之後,將執行權分配至工作Β。工 同樣方法利用HWF500。 措田 由工作Α之委託Hwf则執行輔助處理時, 另個工作,例如特殊工作覆寫hwfsdo认π» 則工你Am 的内建暫存器, 作A無法接收正確的處理結果。因此,有 排他方式控制HWF5。。的佔有權 '然而,各 = 過軟體os亦可存取HWF5〇〇。例如,在si〇4,工作j 透過軟體os直接存取HWF500First, the job A issues an "interrupt prohibition command" as a system call (sl〇〇) for occupying the hWF500. Here, the target is the FPU (Floating Point Unit). When the "interrupt prohibition command" is issued, the operation switching is stopped before the "interrupt release command" is issued later. In the following, the interrupt prohibition command is set to interrupt the money, and the period until the command is released is "J Lang is the interrupt prohibition period". Special work does not start even if the input interrupt signal (INtr) is lost during the interrupt prohibition period. In the interrupt prohibition period, the work A monopolizes the use right of the CPU 84. Therefore, work outside of Work A will not access hwf5〇〇, Secretary. After the software 0S sets the interrupt prohibition, the 'work A return processing (8) 〇 2). Work A instructs the HWF 500 to perform an auxiliary process (sl〇4). In order to suppress the payload associated with the auxiliary processing control, the work A does not directly write the parameters to the built-in register of the HWF 500 through the software (10), instructing the execution of the auxiliary processing. The HWF 500 performs the auxiliary processing indicated by the work A. Work A, while periodically checking the built-in scratchpad of hwf5〇〇 while waiting for the auxiliary processing to end. After the completion of the auxiliary processing is detected (S106), the operation A issues an interrupt release command (S1〇8). After the software 〇s receives the interrupt release command, 81 200937294 cancels the interrupt prohibition (8) bucket ends the interrupt in this way. os performs the work switching, and writes a software to be executed, such as work (). After that, the execution rights are assigned to the work Β. The same method uses the HWF500. When the work is commissioned by Hwf to perform auxiliary processing, another work, such as special work overwriting hwfsdo recognizes π», you can't receive the correct processing result. Therefore, there is an exclusive way to control HWF5. . The possession 'however, each = software os can also access HWF5〇〇. For example, in si〇4, work j directly accesses HWF500 through software os

正確管理HWF500的佔有描# 為了能使軟體〇S 有權,對工作發出「中斷禁止指令」 、斷解除指令」。軟體0S,藉由中斷禁止指令可預先 防止在輔助處理中發♦工你+”她 用__吐 此方式’工作A在使 冑’不會有其他工作獲得CPU84的使用權,干 〆HWF500的情形。圖39之情形,從㈣2之時序至川〇 之時序為止成為中斷禁止期間。 ❹ 串列型輔助處理之情形’於中斷禁止期間中,實質上 其他工作。亦即,於串列型輔助處理,在輔助處 般較短_ =作無法取得CPU84的使用權。因此,浮點運算 較時間可結束之辅助處理,以串列型輔助處理為佳。 圖40係顯示一般並列型輔助處理之控制方法的時序 圖0 先工作A以HWF500的使用權為等待條件,發出 待機旗號系統呼叫或待機互斥系統呼叫等&lt; ㈣丁系系統 82 200937294 呼叫(S 120)。此處,以待機互斥系統呼叫為對象來說明。此 待機互斥系統呼叫,係發出為用以要求佔有HWF500的指 令。又,此處成為對象之HWF500,係設為DMAC(DMA控 制器)。軟體OS接收待機互斥系統呼叫時,藉由互斥,存 取工作 A以外之工作的 HWF500,亦即,設定禁止存取 DMAC(S122)。以此方式,HWF500暫時被工作A佔有。軟 體OS選擇下一個待執行的工作。此處,以再次選擇工作A 來繼續說明。工作A對HWF500指示執行輔助處理(S124)。 〇 此處,工作A亦不透過軟體OS對HWF500直接指示執行輔 助處理。HWF5 00執行指示的輔助處理。 工作A以輔助處理結束為待機條件,發出待機事件系 統呼叫等之WAIT系系統呼叫(S 126)。工作A遷移至WAIT 狀態。軟體OS執行工作切換,選擇下一個RUN _工作,例 如工作B(S128)。工作B與輔助處理並行執行。然而,由於 HWF500被工作A佔有,工作B無法使用HWF500。 HWF500,當輔助處理結束後傳送中斷訊號 〇 (INTR)(S130)。軟體0S檢測出中斷訊號(INTR)時,起動作 為中斷處理程式的特殊工作(S 132)。特殊工作,首先,藉由 設定事件系統呼叫等之SET系系統呼叫,將辅助處理結束 進行事件通知(S 134)。以此方式,工作A發出之待機事件系 統呼叫的待機條件成立。再次,執行權從軟體0S移至特殊 工作(S 13 6)。特殊工作執行剩餘的處理後,遷移至STOP狀 態(S 13 8)。軟體0S再次取得執行權,使特殊工作結束後, 執行工作切換(S 140)。此處,再次選擇工作A。 83 200937294 由於工作A委託之辅助處理已結束,工作A從HWF500 的内建暫存器讀取處理結果(S142)。或,工作A讀取HWF5〇〇 寫入至記憶趙之既定區域之處理結果亦可。工作A發出解 除互斥系統呼叫(S144)。軟體〇S接收解除互斥系統呼叫 後,解除工作A對HWF5〇〇的佔有權(3146)。軟體〇s執行 工作切換,選擇下一個待執行的工作,例如工# C⑻48)。 以後’執仃權分配至工作C。由於HWF5〇〇的佔有權已解 除’工作C亦可藉由同樣方法利用HWF5〇〇。Proper management of HWF500's possession description # In order to enable the software 〇S to have the right, an "interrupt prohibition command" and a break release command are issued for the job. Software 0S, by interrupting the prohibition command, it can be prevented in advance from the auxiliary processing. You can use the __ 吐 this way to work A. In the case of 胄', there will be no other work to obtain the right to use the CPU 84, dry the HWF500. In the case of Fig. 39, the period from the timing of (4) 2 to the timing of Chuanxiong becomes the interrupt prohibition period. ❹ The case of the tandem type auxiliary processing 'is substantially other work during the interrupt prohibition period. That is, in the tandem type auxiliary The processing is as short as the auxiliary _ = the usage right of the CPU 84 cannot be obtained. Therefore, the auxiliary processing in which the floating point operation can be completed over time is preferably the serial type auxiliary processing. Fig. 40 shows the general parallel type auxiliary processing. Timing diagram of control method 0 First work A takes the use right of HWF500 as the waiting condition, and issues a standby flag system call or standby mutual exclusion system call, etc. &lt; (4) Ding system 82 200937294 call (S 120). Here, standby The system call is used as an object. This standby mutex system call is issued as an instruction to request the possession of the HWF500. In addition, the HWF500 which is the object here is set to DMAC (DMA controller). When the software OS receives the standby mutex system call, the HWF 500 that works outside the work A is accessed by mutual exclusion, that is, the DMAC is prohibited from being accessed (S122). In this way, the HWF 500 is temporarily occupied by the work A. The OS selects the next work to be performed. Here, the description is continued by selecting the work A again. The work A instructs the HWF 500 to perform the auxiliary processing (S124). Here, the work A also directly performs the auxiliary instruction to the HWF 500 through the software OS. Processing. HWF5 00 performs the indicated auxiliary processing. Work A ends the auxiliary processing as a standby condition, and issues a WAIT system call such as a standby event system call (S 126). Work A moves to the WAIT state. The software OS performs work switching, selecting The next RUN_work, for example, work B (S128). Work B is executed in parallel with the auxiliary processing. However, since HWF500 is occupied by work A, work B cannot use HWF500. HWF500, transmits interrupt signal INT (INTR) when auxiliary processing ends (S130) When the software 0S detects the interrupt signal (INTR), the special operation as the interrupt processing program is started (S132). Special work, first, by setting The SET system call such as the event system call, and the auxiliary processing ends the event notification (S134). In this way, the standby condition of the standby event system call issued by the work A is established. Again, the execution right is moved from the software 0S to the special work. (S 13 6). After the special work has executed the remaining processing, it moves to the STOP state (S 13 8). The software 0S acquires the execution right again, and after the special work is finished, the work switching is performed (S 140). Here, select again. Work A. 83 200937294 Since the auxiliary processing of the work A delegation has ended, the work A reads the processing result from the built-in register of the HWF500 (S142). Or, the work A reads the HWF5〇〇 and writes the result to the predetermined area of the memory Zhao. Work A issues a repelling system call (S144). After the software 〇S receives the call to release the mutual exclusion system, the work A is released from the HWF5 ( (3146). The software 〇s performs a work switch and selects the next work to be performed, such as worker # C(8) 48). In the future, the right to hold is assigned to work C. Since the possession of HWF5〇〇 has been removed, 'Work C can also use HWF5〇〇 in the same way.

P使於並列型,一般工作直接存取HwF5〇〇之點亦與 串列型相同。於並列型輔助處理,雖輔助處理中其他工作 無法使用HWF500,作其#工你诉 θ 彳-具他工作取得CPU84之使用權本 疋可能的。以此方式,工祚A ^ '作A在使用HWF500時,其他工 作不會干涉HWF500。 π亚列型補助處 而’由於_或8134的系統呼叫:特殊: 〇 ==”=::助處理的酬載更“此、 、曰1之輔助處理,以並列型輔助處理為佳。 :39所示之串列型輔助處理之情形 次發出系統呼叫。X,輔助處理開始後頁二2 貞測輔助處理是否 助^期檢查 與工__助處理結束之時序二 其、,=果,處理效率降低。 差J, 圖40所示之並列型輔助處 4次發出系統呼叫。再者,輔助處理結束時,: = :: 84P is in parallel type, and the point of direct access to HwF5 in general work is also the same as the serial type. For the side-by-side auxiliary processing, although the HWF500 cannot be used for other work in the auxiliary processing, it is possible for him to work for the CPU 84. In this way, when working with the HWF500, other work does not interfere with the HWF500. π sub-column type subsidy and 'system call due to _ or 8134: special: 〇 ==”=:: help processing the payload is more "this, 曰1 auxiliary processing, parallel-type auxiliary processing is better. The case of the tandem type auxiliary processing shown in :39 issues a system call. X, after the start of the auxiliary processing, page 2 2 Detecting whether the auxiliary processing is assisted or not, and the timing of the completion of the processing __ assist processing is 2, and =, the processing efficiency is lowered. Difference J, the side-by-side auxiliary shown in Figure 40, makes a system call 4 times. Furthermore, at the end of the auxiliary processing,: =: 84

❹ 200937294 通知輔助處理結束,必須起動特殊工作。 -❹言’m㈣叫花f 5⑽〜咖次程度之咖 =。輔助處耗執行頻率高的處理,料間要件嚴格之 =〇S而言’能將此種酬载抑制到何種程度為重要的設計課 圖41係顯示藉由基本例之工作虚挪壯班 作處理裝置100實現圖38 至圖40所不之輔助處理控制時之電路構成的圖。 如基本例所說明,工作處理裝置1〇〇主要 c削〇、儲存電路120、及工作控制電路鹰。圖38所: 之-般電路構成的情形,CPU84執行軟體〇s與工作的兩 者相對於此,於工作處理裝置100,CPU150執行工作, 〇s之功能係藉由儲存電路12〇及工作控制電路_實現。 f由使〇s之功能自CP_外部化,整體之處理效率大幅 提升之點如基本例所說明。圖41中,cpui5Q亦透過CPU 匯流排512與HWF500連接。 工作處理裝置100之硬體OS之情形,系統呼叫執行, 特別疋作切換與軟體〇s相較大幅地高速化。工作處理裝 置1〇〇為了執行1次系統呼叫,CPU時脈僅需12時脈程度。 因此,即使以圖41之電路構成,藉由工作處理裝置1〇〇執 仃圖39 &amp;目40所示之輔助處理控弟J,亦彳大幅抑制輔助 處理所伴隨的酬載。 於改良例2 ’藉由重新檢視工作處理裝置1〇〇與 HWF5〇〇,特別是CPU150與HWF500的關係,能使辅助虚 理進一步高速化。 85 200937294 圖42係顯示於改良例2工作處理裝置100與HWF500 之關係的電路構成圖。 同圖中,複數個 HWF500(HWF500—0、...、HWF 500_k : k為任意自然數),不與CPU1 50連接而是與工作控制電路 200連接。各HWF500係分別與不同輔助處理對應設計的專 用電路。例如,HWF500_0 為 FPU、HWF500_1 為 DMAC 亦可。各HWF500,係藉由0〜k之範圍之HWFID —意辨識。 以CPU 150執行之工作,透過工作控制電路200,使各 HWF500執行輔助處理。工作無法直接存取HWF500的内建 ❹ 暫存器。於改良例 2,工作控制電路200 —元管理各 HWF500。 圖43係顯示改良例2之狀態記憶部220與工作切換電 路210之關係的電路圖。 在改良例2之工作選擇電路230追加HWF待機選擇電 路510。又,在工作切換電路210新連接有複數個HWF500。 工作控制電路200之基本構成,與圖10所示之基本例 之電路構成大致相同。各工作所對應之狀態暫存器250,除 〇 了工作ID暫存器254、工作優先順序暫存器256等之外, 追加HWFID暫存器504、佇列順序暫存器506、及佇列辨 別暫存器508。 (A)HWFID暫存器504:當某個工作指示執行輔助處理 時,設定該輔助處理之執行主體之HWF500的HWFID。 HWFID係作為HID_S訊號隨時輸出。於改良例2,在HWFID 暫存器504,僅並列型輔助處理時寫入HWFID。 86 200937294 (B)佇列順序暫存器506 :儲存表示對虛擬佇列之工作 之放入順序的「順序值(ODR)」。順序值愈大,表示放入至 虛擬佇列愈深。順序值,係作為〇DR_s訊號而隨時輸出。 改良例2之順序值〇dr,與改良例丨說明之「順序值〇DR」 為同一概念。 (CM宁列辨別暫存器508 :儲存用以辨別虛擬佇列之「仔 列ID(QID)」。作為qid_S訊號而隨時輸出。仔列id,與 改良例1說明之「佇列ID(QID)」為同一概念。 © 虛擬佇列,與改良例1所示之虛擬佇列相同,係工作 狀態所對應的虛擬佇列。以此方式,佇列ID與工作狀態之 對應無須固定化為硬體構裝。工作選擇電路23〇藉由參照 各佇列辨別暫存器508,可判別各工作的工作狀態。 工作選擇電路230,根據從狀態暫存器250輸出之狀態 資料’選擇待狀態遷移的工作。工作切換電路2丨〇將hwfid 輸入至HWF待機選擇電路510後,H WF待機選擇電路5 ! 〇 將該HWFID對應之HWFID暫存器5〇4所設定之工作的工 ® 作ID輸出。亦即’將「等待指定之HWF500之處理結束之 工作」通知至工作切換電路210。若指定之HWF500未處理 中’亦即’任一工作皆未委託處理,則Hwf待機選擇電路 510輸出「一 1」等的既定值。 各HWF500係與工作切換電路210直接連接。各 HWF500,係藉由工作切換電路2丨〇與以下所示6種訊號線 連接。以下,設i為0〜k的任意數。 a.HFi_REQ :工作切換電路210,對HWF500」指示執 87 200937294 行輔助處理時,傳送HFi_REQ » b. HFi_ARG[m- 1 : 0]:傳送輔助處理的參數。根據輔 助處理的内容有各種HFi_ARG[m— 1 : 0]的尺寸,亦有各種 參數的個數。當傳送HFi_REQ時,將HFi_ARG[m— 1 : 0] 寫入至HWF500_i的内建暫存器。 c. HFi_RQACK :傳送 HFi_REQ,寫入 HFi_ARG[m— 1 : 〇]後,HWF500_i開始輔助處理。輔助處理開始時,HWF500_i 傳送HFi_RQACK。藉由HFi_RQACK,工作切換電路210 認知開始輔助處理。 d. HFi_CMPLT :輔助處理結束後,HWF500」除了將輔 助處理的結果寫入至内建暫存器之外,傳送HFi_CMPLT。 藉由HFi_CMPLT,工作切換電路210認知結束輔助處理。 e. HFi_RSLT[m — 1: 〇]:表示輔助處理的結果的回傳 值。根據輔助處理的内容有各種HFi_ RSLT [m — 1 : 0]的尺 寸,亦有各種回傳值的個數。對HWF500」的内建暫存器傳 送寫入的回傳值。工作切換電路210,在傳送HFi_CMPLT 後,取得HFi_ RSLT [m— 1 : 0]的回傳值。 f. HFi_CMPACK :工作切換電路210,在取得回傳值後’ 傳送 HFi_CMPACK。藉由 HFi_CMPACK,HWF500—i 認知 正常取得回傳值。 圖44係顯示改良例2之串列型輔助處理之控制方法的 時序圖。 改良例2之工作處理裝置1〇〇,除了基本例說明之9個 系統呼叫之外,追加「HWF呼叫」。「HWF呼叫」,係工 200937294 作指示執行輔助處理的系統呼叫。 首先,工作A以成為對象之輔助處理之種類為參數發 出HWF呼叫(S 1 00)。例如,藉由浮點運算指令、DMA傳輸 指令、加密處理指令等指定輔助處理之種類。工作切換電 路210,根據指定為參數之輔助處理,選擇成為對象之 HWF500,特定該HWFID 〇此外,將HWFID本身作為參數 發出HWF呼叫亦可。此處,以特定HWFID = i來說明。作 為HWF呼叫之參數,指定輔助處理之引數亦可。此種參數, 〇 係寫入至CPU150之既定汎用暫存器158。工作切換電路 210,接收HWF呼叫時,從汎用暫存器158讀取該等參數。 工作切換電路210,對HWF500_i指示執行輔助處理 (S 102)。工作切換電路210,藉由HC訊號使CPU 150停止。 因此,工作A在RUN狀態下被迫停止。 於S102,並非如圖39般工作A存取HWF500,而是工 作切換電路210對HWF500指示執行輔助處理。具體而言, 在 HFi_ARG[m — 1 : 0]設定引數且傳送 HFi_REQ。 © HWF500_i,開始辅助處理,傳送HFi_RQACK。由於CPU150 已停止,因此輔助處理中工作A不會被執行。當然,包含 特殊工作之其他工作亦不會被執行。 辅助處理結束後,HWF500_i對HFi_RSLT[m- 1 : 0] 輸出回傳值,傳送HFi_CMPLT。工作切換電路210,接收 回傳值,傳送HFi_CMPACK(S104)。工作切換電路210,將 回傳值記錄在處理暫存器92。工作切換電路2 10,停止傳 送停止要求訊號(HR),再次開始工作A的執行(S 106)。 89 200937294 改良例2之串列型辅助處理之情形,僅需卜欠系統呼 叫。又,由於在輔助處理執行中使cpui5〇停止因此可抑 制耗電。再者’委託辅助處理之工作A’不需對讀5〇〇 詢問辅助處理之結束時序,因此輔助處理結束之時序與工 作處理裝置10(M貞測到輔助處理結束之時序幾乎不產生偏 差。 ❹ 於改良例2’ 作無法直接存取Hw觸而是工作切 換電路210存取聊500。因此’藉由中斷禁止指令或中斷 解除指令’工作不需要用以對〇s控制中斷禁止期間的處 理。工作處理裝置⑽,接收HWF啤叫後,僅藉由停止要 求訊號(HR)控制CPU時脈之停止、再次開始。工作處理裝 置1〇〇,將輔助處理之結果作為回傳值寫入至處理暫存器 92’因此委託輔助處理之工作A,在執行再次開始時已成為 取得輔助處理之結果的狀態。由於工作A不需對刪谓 或工作控制料2G〇詢問辅助處理之結果,因此不僅處理 效率提升,工作A之程式碼亦可簡化。 〇 圖45係顯示改良例2之並列型辅助處理之控制方法的 時序圖。 此處,設成為對象之HWF5〇〇為Fpu(浮點運算單元)。 又,設相當於FPU之HWF500的HWFID為「匕。首先, 工作A以FPU之使用權為等待條件,發出待機互斥系統呼 叫(S120)。藉由互斥與旗號管理各HWF的佔有權。不需要 互斥等之賺的排他控制。例如’只要是僅使用特定工作 之HWF,則不需要排他控制。 90 200937294 若未設定成HWF500_i由互斥佔有中,則工作處理裝置 100 藉由互斥設定工作 A 以外之工作禁止存取 HWF500_i(S122)。 以此方式,HWF500」暫時被工作A佔有。接著,工作 A發出HWF呼叫(S 124)。工作A從RUN狀態遷移至WAIT 狀態。WAIT解除的條件,係HWF500_i之輔助處理結束。 工作切換電路2 1 0,接收HWF呼叫時,對工作A之HWFID 暫存器504設定HWFID= i。 〇 於改良例2,並非如圖40般執行權返回工作A,工作 切換電路210本身對HWF500指示開始輔助處理(S126)。 HWF500_i開始輔助處理。工作切換電路210選擇下一個 RUN—工作,例如工作B(S 128)。工作B與輔助處理並列執 行。然而,工作B無法使用HWF500_i。其原因在於,工作 A藉由互斥確保HWF500_i的佔有權。 輔助處理結束後,HWF500_i對HFi_ RSLT [m— 1 : 0] 輸出回傳值,傳送HFi_CMPLT。工作切換電路210,接收 〇 回傳值,傳送HFi_CMPACK(S130)。工作B從RUN狀態遷 移至READY狀態。具體而言,工作處理裝置100傳送停止 要求訊號(HR)以要求停止CPU時脈,等待停止結束訊號(HC) 的傳送,將工作B之處理資料保留至保留暫存器。工作B 被逆向放入至與READY狀態對應的虛擬佇列。工作切換電 路210,將HWFID = i輸入至HWF待機選擇電路510,取 得對HWF5 00_i委託輔助處理之工作A的工作ID。接著, 將表示輔助處理之結果的回傳值記錄在與工作A對應的保 91 200937294❹ 200937294 Notification of the end of the auxiliary processing, special work must be started. - Proverbs 'm (four) called flower f 5 (10) ~ coffee degree degree =. Auxiliary department consumes a high frequency of processing, and the requirements between the materials are strict = 〇S, 'How much can this kind of payload be suppressed? The design is important. Figure 41 shows the work of the basic example. A diagram showing the circuit configuration when the processing device 100 realizes the auxiliary processing control as shown in FIGS. 38 to 40. As explained in the basic example, the work processing apparatus 1 is mainly c-cut, the storage circuit 120, and the work control circuit eagle. 38: In the case of the general circuit configuration, the CPU 84 executes both the software 〇s and the operation. In the work processing apparatus 100, the CPU 150 performs the operation, and the function of the 〇s is performed by the storage circuit 12 and the operation control. Circuit_implementation. f The external processing of the function of 〇s from CP_, the overall processing efficiency is greatly improved as explained in the basic example. In Fig. 41, cpui5Q is also connected to the HWF 500 through the CPU bus 512. In the case of the hardware OS of the work processing apparatus 100, the system call is executed, and the switching is performed at a relatively large speed with the software 〇s. Work Processing Unit 1 In order to perform 1 system call, the CPU clock only needs 12 clocks. Therefore, even with the circuit configuration of Fig. 41, by the work processing apparatus 1 executing the auxiliary processing controller J shown in Fig. 39 &amp; 40, the payload accompanying the auxiliary processing is greatly suppressed. In the second modification, the relationship between the work processing apparatus 1 and the HWF 5, in particular, the relationship between the CPU 150 and the HWF 500, can further increase the speed of the auxiliary virtual memory. 85 200937294 Fig. 42 is a circuit configuration diagram showing the relationship between the work processing apparatus 100 and the HWF 500 of the second modification. In the figure, a plurality of HWFs 500 (HWF500-0, ..., HWF 500_k: k are arbitrary natural numbers) are not connected to the CPU 1 50 but to the work control circuit 200. Each HWF500 is a dedicated circuit designed for different auxiliary processing. For example, HWF500_0 is FPU and HWF500_1 is DMAC. Each HWF 500 is identified by HWFID in the range of 0 to k. With the work performed by the CPU 150, the HWF 500 is caused to perform auxiliary processing through the work control circuit 200. Work cannot directly access the built-in 暂 register of the HWF500. In the second modification, the work control circuit 200 manages each HWF 500. Fig. 43 is a circuit diagram showing the relationship between the state memory unit 220 and the operation switching circuit 210 of the second modification. The HWF standby selection circuit 510 is added to the operation selection circuit 230 of the second modification. Further, a plurality of HWFs 500 are newly connected to the work switching circuit 210. The basic configuration of the operation control circuit 200 is substantially the same as that of the basic example shown in Fig. 10. The state register 250 corresponding to each work includes the HWFID register 504, the queue sequential register 506, and the queue in addition to the work ID register 254, the work priority register 256, and the like. The register 508 is identified. (A) HWFID register 504: When a certain work instruction performs auxiliary processing, the HWFID of the HWF 500 of the execution subject of the auxiliary processing is set. The HWFID is output as a HID_S signal at any time. In the second modification, in the HWFID register 504, the HWFID is written only in the parallel type auxiliary processing. 86 200937294 (B) Array Sequence Register 506: Stores the "Order Value (ODR)" indicating the order in which the work of the virtual queue is placed. The larger the order value, the deeper the placement into the virtual queue. The sequence value is output as a 〇DR_s signal at any time. The order value 〇dr of the modified example 2 is the same as the "order value 〇DR" described in the modified example. (CM 辨 辨 暂 暂 508 508 储存 储存 储存 储存 储存 储存 储存 储存 储存 储存 储存 储存 储存 储存 储存 储存 储存 储存 储存 储存 储存 储存 储存 储存 储存 储存 储存 储存 储存 508 储存 508 508 508 508 508 508 508 508 508 508 508 508 508 508 508 508 508 508 508 The same concept is used. The virtual queue is the same as the virtual array shown in the modified example 1, and is a virtual queue corresponding to the working state. In this way, the correspondence between the queue ID and the working state need not be fixed to be hard. The work selection circuit 23 can determine the operating state of each job by referring to each of the queues identifying the register 508. The work selection circuit 230 selects the state transition based on the state data output from the state register 250. The work switching circuit 2 丨〇 inputs hwfid to the HWF standby selection circuit 510, and the H WF standby selection circuit 5 〇 outputs the work ID set by the HWFID register 5〇4 corresponding to the HWFID. That is, the operation of "waiting for the end of the processing of the designated HWF 500" is notified to the work switching circuit 210. If the designated HWF 500 is not processed, that is, the processing is not requested, the Hwf standby selection circuit 510 outputs " One 1" Each HWF 500 is directly connected to the operation switching circuit 210. Each of the HWFs 500 is connected to the following six kinds of signal lines by the operation switching circuit 2 。. Hereinafter, i is an arbitrary number of 0 to k. HFi_REQ: The work switching circuit 210 transmits the HFi_REQ » b. HFi_ARG[m - 1 : 0]: the parameters of the transmission auxiliary processing when the HWF500 is instructed to perform the auxiliary processing of the 200937294 line. There are various HFi_ARG[m- according to the contents of the auxiliary processing. The size of 1 : 0] also has the number of various parameters. When transmitting HFi_REQ, write HFi_ARG[m-1 : 0] to the built-in register of HWF500_i. c. HFi_RQACK : Transfer HFi_REQ, write HFi_ARG After [m-1: 〇], the HWF500_i starts the auxiliary processing. When the auxiliary processing starts, the HWF500_i transmits the HFi_RQACK. With the HFi_RQACK, the work switching circuit 210 recognizes that the auxiliary processing is started. d. HFi_CMPLT: After the auxiliary processing ends, the HWF500" The result of the processing is written to the outside of the built-in register, and HFi_CMPLT is transmitted. By HFi_CMPLT, the work switching circuit 210 recognizes the end of the auxiliary processing. e. HFi_RSLT[m - 1: 〇]: indicates the return of the result of the auxiliary processing There RSLT [m - 1: 0] based on the contents of various auxiliary processing HFi_ number of dimensions, also a variety of built-in return value registers HWF500 "the transfer of the return value is written. The work switching circuit 210 obtains a return value of HFi_RSLT [m-1: 0] after transmitting HFi_CMPLT. f. HFi_CMPACK: The work switching circuit 210 transmits HFi_CMPACK after obtaining the return value. With HFi_CMPACK, HWF500-i recognizes that the return value is normally obtained. Fig. 44 is a timing chart showing a control method of the tandem type auxiliary processing of the second modification. In the work processing apparatus of the second modification, the "HWF call" is added in addition to the nine system calls described in the basic example. "HWF Call", Departmental 200937294 Indicates a system call that performs auxiliary processing. First, the job A issues an HWF call (S 1 00) with the type of the auxiliary processing to be the object as a parameter. For example, the type of the auxiliary processing is specified by a floating point arithmetic instruction, a DMA transfer instruction, an encryption processing instruction, or the like. The work switching circuit 210 selects the HWF 500 to be the target according to the auxiliary processing designated as the parameter, and specifies the HWFID. In addition, the HWFID itself may be used as a parameter to issue an HWF call. Here, the description is made with a specific HWFID = i. As a parameter of the HWF call, the arguments for the auxiliary processing can also be specified. Such parameters are written to the defined general purpose register 158 of the CPU 150. The work switching circuit 210 reads the parameters from the general purpose register 158 when receiving the HWF call. The work switching circuit 210 instructs the HWF 500_i to perform auxiliary processing (S102). The work switching circuit 210 stops the CPU 150 by the HC signal. Therefore, the work A is forced to stop in the RUN state. In S102, instead of operating A to access the HWF 500 as shown in FIG. 39, the work switching circuit 210 instructs the HWF 500 to perform auxiliary processing. Specifically, the argument is set in HFi_ARG[m - 1 : 0] and HFi_REQ is transmitted. © HWF500_i, start the auxiliary processing and transmit HFi_RQACK. Since the CPU 150 has stopped, the work A in the auxiliary processing will not be executed. Of course, other work that includes special work will not be performed. After the auxiliary processing ends, the HWF500_i outputs a return value to HFi_RSLT[m- 1 : 0] and transmits HFi_CMPLT. The work switching circuit 210 receives the return value and transmits HFi_CMPACK (S104). The work switching circuit 210 records the return value in the processing register 92. The work switching circuit 2 10 stops transmitting the stop request signal (HR) and starts the execution of the work A again (S 106). 89 200937294 In the case of the tandem type auxiliary processing of the modified example 2, only the system call is required. Further, since cpui5 is stopped during the execution of the auxiliary processing, power consumption can be suppressed. Further, the operation A of the request assist processing does not need to read the end timing of the auxiliary processing, so the timing of the completion of the auxiliary processing is hardly deviated from the timing of the completion of the auxiliary processing by the work processing apparatus 10 (M贞).改良 In the improved example 2', the Hw touch is not directly accessible, but the work switching circuit 210 accesses the chat 500. Therefore, the operation by the interrupt disable command or the interrupt release command does not need to be used to control the interrupt during the interrupt prohibition period. After receiving the HWF beer call, the work processing device (10) controls the CPU clock to stop and restarts only by stopping the request signal (HR). The work processing device 1〇〇 writes the result of the auxiliary processing as a return value to The processing register 92' thus requests the work A of the auxiliary processing to become the state of obtaining the auxiliary processing when the execution is restarted. Since the work A does not need to query the result of the auxiliary processing for the deletion or the work control material 2G, Not only the processing efficiency is improved, but also the code of the work A can be simplified. Fig. 45 is a timing chart showing the control method of the parallel type auxiliary processing of the modified example 2. The HWF5 that is the target is the Fpu (floating point unit). The HWFID of the HWF500 corresponding to the FPU is "匕. First, the work A sends a standby mutex system call with the use right of the FPU as a waiting condition ( S120). The ownership of each HWF is managed by mutual exclusion and flag. There is no need for exclusivity control such as exclusive exclusion. For example, 'as long as it is only using HWF for specific work, no exclusive control is required. 90 200937294 If not set to When the HWF 500_i is occupied by the exclusive exclusion, the work processing apparatus 100 prohibits access to the HWF 500_i by the work other than the exclusive setting work A (S122). In this way, the HWF 500 is temporarily occupied by the work A. Then, the work A issues an HWF call ( S 124). Work A transitions from the RUN state to the WAIT state. The WAIT release condition is terminated by the HWF500_i auxiliary processing. The work switching circuit 2 1 0, when receiving the HWF call, sets the HWFID to the HWFID register 504 of the work A. i. In the second modification, the execution right return operation A is not performed as shown in FIG. 40, and the work switching circuit 210 itself instructs the HWF 500 to start the auxiliary processing (S126). The HWF500_i starts the auxiliary processing. 210 selects the next RUN-work, such as work B (S 128). Work B and auxiliary processing are performed side by side. However, work B cannot use HWF500_i. The reason is that work A ensures the possession of HWF500_i by mutual exclusion. After the end, the HWF 500_i outputs a return value to HFi_RSLT [m-1: 0], and transmits HFi_CMPLT. The work switching circuit 210 receives the round-trip value and transmits HFi_CMPACK (S130). Work B moves from the RUN state to the READY state. Specifically, the work processing apparatus 100 transmits a stop request signal (HR) to stop the CPU clock, waits for the stop end signal (HC) transmission, and retains the processing data of the work B to the reserved register. Work B is reversed into the virtual queue corresponding to the READY state. The work switching circuit 210 inputs HWFID = i to the HWF standby selection circuit 510, and obtains the work ID of the job A that is entrusted to the HWF5 00_i. Next, the return value indicating the result of the auxiliary processing is recorded in the insurance corresponding to the work A 91 200937294

留暫存器’將工作A設定在READY狀態。此處,如改良例 1所示,將工作A逆向放入至與READY狀態對應的虛擬狩 列亦可。工作切換電路21〇,選擇下一個待執行的工作,例 如工作A(S 132)。以後,將執行權分配至工作a。輔助處理 結束時,一定選擇委託該輔助處理之工作A亦可。根據此 種工作切換規則,可提升委託辅助處理之工作的效率。工 作A,藉由解除互斥系統呼叫,解除hwf5〇〇—丨的佔有權 (S134)。工作處理裝置1〇〇,再次執行工作切換,選擇下一 個待執行的工作,例如在sl28〜su〇執行的工作B(sn6)。 以後,將執行權分配至工作B。由於解除HWF5〇〇」的佔有 權,工作B亦可藉由同樣方法利用。The hold register 'sets the work A to the READY state. Here, as shown in the first modification, the operation A may be reversely placed in the virtual hunting corresponding to the READY state. The work switching circuit 21 〇 selects the next job to be executed, for example, job A (S 132). In the future, the execution rights are assigned to work a. At the end of the auxiliary processing, the work A that has entrusted the auxiliary processing must be selected. According to such a work switching rule, the efficiency of the work of the entrusted auxiliary processing can be improved. In operation A, by canceling the mutual exclusion system call, the possession of hwf5〇〇-丨 is released (S134). The work processing apparatus 1 〇〇 performs the work switching again, and selects the next work to be executed, for example, the work B (sn6) executed at sl28~su〇. In the future, the execution rights are assigned to work B. Work B can also be utilized in the same way due to the disclaimer of HWF5.

於圖40所示之並列型辅助處理,#出合計“欠的系統 :叫。相對於此’改良W 2之並列型輔助處理之系統啤叫 ,數為「待機互斥系統啤叫」、「解除互斥系統呼叫」、 HWF啤叫」的3次。因此,根據改良例2,可1次押制 ^統呼叫所伴隨的酬載。又,不需執行特殊工作。藉:將 回傳值寫入至保留暫存器,工作A不需對hwf_或工作 控制電路200詢問輔助處理的結果。 以往,為了高速執行包含〇S之軟體,嘗試各種方法 ^述嘗試大多4 CPU時脈數的增加、記憶體容量或暫存; ,量的增加、或複數個CPU之平行處理、再者為網路分: 理等大規模化、複雜化者。 ★相對於此,本實施例所示之工作處理裝置1〇〇之情形 藉由在既有之CPU15G外追加儲存作控制電與 92 200937294 細,大幅提升處理效率。軟體〇s之情形,為了實現原本 欲執仃之工作切換等的處理,必須執行tcb或工作準備串 列之管理等附加處理。相制_认&amp; ^ ^ ^ 蛟理相對於此,工作處理裝置100,由於 藉由硬體邏輯實現工作切換、工作之狀態管理、中斷處理, 因此可解除此種軟體特有的酬載。以,可構成抑制耗電 與成本增加、且實現高速化的理想系統。 再者,根據改良例2所示之輔助處理控制,可大幅抑 制輔助處理所伴隨的酬載。以往,為了高速執行DMA傳輸 等的辅助處理大多提供不透過軟體〇s,直接操作刚〇 的内建暫存器的程式。《而,此種程式產生缺陷時,系統 整體的動作會變不穩定。In the side-by-side auxiliary processing shown in Fig. 40, the total number of "systems that are owed is called: in contrast to the system of the side-by-side auxiliary processing that improves W2, the number is "standby mutual exclusion system beer", " Disarmed the system call "HWF beer call" three times. Therefore, according to the modified example 2, the payload accompanying the call can be made one time. Also, no special work is required. Borrow: Write the return value to the reserved register, and the work A does not need to query the hwf_ or the work control circuit 200 for the result of the auxiliary processing. In the past, in order to execute the software including 〇S at high speed, try various methods to try to increase the number of clocks of most 4 CPUs, memory capacity or temporary storage; increase the amount, or parallel processing of multiple CPUs, and then network Road points: Large-scale, complicated people. On the other hand, in the case of the work processing apparatus 1 shown in the present embodiment, the processing power is additionally increased by the addition of the existing CPU 15G as control power and 92 200937294, thereby greatly improving the processing efficiency. In the case of the software 〇s, in order to realize the processing such as the work switching that is originally intended to be performed, it is necessary to perform additional processing such as management of tcb or work preparation series. In contrast, the work processing apparatus 100 can realize the work switching, the state management of the operation, and the interrupt processing by the hardware logic, so that the payload unique to the software can be released. Therefore, it is possible to construct an ideal system that suppresses power consumption and cost increase and achieves high speed. Further, according to the auxiliary processing control shown in the second modification, the payload associated with the auxiliary processing can be greatly suppressed. In the past, in order to perform high-speed DMA transfer and other auxiliary processing, it is often provided to directly operate the built-in register of the device without the software 〇s. "When such a program generates a defect, the overall operation of the system becomes unstable.

於改良例2之工作處理裝置1〇〇,工作直接操作 HWF500的動作成為物理上不可能的構成。藉由工作處理裝 置100本身的高速處理性能與系統呼叫次數的減少等,即 使是工作對工作處理裝置1〇〇委託辅助處理的構成,亦可 實現高速的輔助處理。根據改良例2之工作處理裝置1〇〇, 能使辅助處理控制具有安全性且高速化。 以上,根據實施例說明本發明。實施形態係例示,此 等各構成要素與各處理步驟的組合能有各種變形例,且此 等變形例亦在本發明的範圍内,此為本發明所屬技術領域 中具有通常知識者應當理解之事。 請求項記載之各構成元件應達成的功能,係藉由本實 施例所示之各功能方塊的單體、或此等的連動而實現,此 亦為本發明所屬技術領域中具有通常知識者應當理解之 93 200937294 事。 此外,以圖12、团,&lt; m 固、圖14、圖28、圖32說明各種判定電 路。此等判定電路,係藉由比較電路群選擇成為比較、選 擇對象的工作。 〇如圖12之執行選擇電路232,係用以選擇run_ 作的電路,但能成為RUN-工作者為READY-工作。因 此’圖12之判定電路携,以為ready—工作為條件輸 出CH)訊號…。執行選擇電路232的比較電路群,僅以 成為CID訊號「1 认 以 lj的工作、亦即ready狀態的工作為對In the work processing apparatus 1 of the second modification, the operation of directly operating the HWF 500 becomes a physically impossible configuration. By the high-speed processing performance of the work processing apparatus 100 itself and the reduction in the number of system calls, it is possible to realize high-speed auxiliary processing even if the work is configured to the auxiliary processing of the work processing apparatus. According to the work processing apparatus 1 of the second modification, the auxiliary processing control can be made safe and high speed. Hereinabove, the present invention has been described based on the embodiments. The embodiment is exemplified, and various modifications can be made to the combination of these components and the respective processing steps, and such modifications are also within the scope of the present invention, which should be understood by those having ordinary knowledge in the technical field to which the present invention pertains. thing. The functions to be achieved by the respective constituent elements described in the claims are achieved by the single elements of the functional blocks shown in the present embodiment, or the linkages thereof, which are also understood by those having ordinary knowledge in the technical field to which the present invention pertains. 93 200937294 things. Further, various determination circuits will be described with reference to Fig. 12, group, &lt; m solid, Fig. 14, Fig. 28, and Fig. 32. These determination circuits select the operation to be compared and selected by the comparison circuit group. The execution selection circuit 232 of FIG. 12 is used to select the circuit for run_, but can be RUN-worker for READY-operation. Therefore, the decision circuit of Fig. 12 carries the signal that the CH_ signal is output as ready-working. The comparison circuit group that executes the selection circuit 232 is only in the operation of the CID signal "1", which is the work of the lj, that is, the ready state.

,根據工作優先順序pRst READY經過時間TI 下一個RUN—工作。 ❹ 圖14之旗號選擇電路234,係於旗號解除時,用 =待解除旗號等待之卫作的電路。解除旗料待之工作, 係以解除旗號為待機旗號而處於WAIT狀態的工作。因此, 圖二之:定電路306,以為解除旗號為待機旗號之麵 :為條件’輸出⑽訊號…。旗號選擇電路⑶的 :電路群,僅以成為CID訊號、的工作、亦即 承旗號為待機旗號之WAIT 一工作 PR或WAIT經過時間™’選擇待解除 若變更判定電路的邏輯,則執行選擇 選擇電路234可共有比較電路群。對互 〃、旗號 同。對圖28之最大值選擇電路406、圖32或事件而言亦相 23〇而言亦相同。以此方式,料加、 工作選擇電路 燹更判又電路的邏輯, 94 200937294 則以共有比較電路群之形式,可構裝各種選擇邏輯。以下, 舉2例說明。 1.旋轉系統呼叫 此系統呼叫’係用以變更與READY狀態對應之虛擬佇 列的工作群、亦即READY—工作的順序值(ODR)的系統呼 叫。例如’如圖29所示,在與rEadY狀態對應之虛擬佇 列(Q0),以工作(E6)、工作(E3)、工作、工作(E0)、工 作(E5)之順序放入5個工作。此處,RUN —工作指定工作優 © 先順序PR= 1發出旋轉系統呼叫。 接著,與PR= 1對應之優先佇列(Q〇 : 1)之前端的工作 (E6)暫時被取出,順向放入至工作(E5)之後。亦即,工作(E6) 的順序值(ODR)成為「〇」,其他工作之順序值亦配合調整。 旋轉系統呼叫’係對與藉由參數所指定之工作優先順 序PR — 1對應之優先仔列(q〇 : i),將前端工作之順序變更 成最後端的系統呼叫《根據旋轉系統呼叫,可從外部控制 放入至虛擬佇列(Q0)之工作的順序值(ODR)。 用以實現旋轉系統呼叫的判定電路,只要以為「ready 狀態,且指定之工作優先順序pR的工作」為條件輸出「丄」 即可。接著,藉由比較電路群,從判定電路之輸出訊號成 為「1」之該工作之中,將順序值(〇DR)最大之工作選擇為 旋轉的對象即可。 2·與WAIT狀態對應之虛擬佇列的功能擴充 一般而言,解除某個旗號時,於與旗號等待對應之虛 擬佇列(Qn),從工作優先順序pR最高之優先佇列⑴^ : 95 200937294 之中’選擇待獲得該旗號的工作。然而,與工作優先順序 PR無關,藉由順序值(0DR)最大之工作設定待獲得之特殊 旗號(以下,稱為「特殊旗號」)亦可。 為了構裝特殊旗號,為「WAIT狀態,且以解除旗號為 待機旗號之工作」時,準備輸出「1」之判定電路即可。圖According to the work priority pRst READY elapses time TI next RUN-work.旗 The flag selection circuit 234 of Fig. 14 is a circuit for waiting for the flag to be released when the flag is released. To cancel the work of the flag, the work of releasing the flag as the standby flag and in the WAIT state. Therefore, in Fig. 2: the fixed circuit 306, in order to release the flag as the face of the standby flag: for the condition 'output (10) signal.... The flag selection circuit (3): the circuit group, only the work that becomes the CID signal, that is, the WAIT with the flag as the standby flag, the working PR or the WAIT elapsed time TM' selects the logic to be released if the decision circuit is to be canceled, then performs the selection selection. Circuitry 234 can share a comparison circuit group. For each other, the same flag. The same is true for the maximum value selection circuit 406, Fig. 32, or event of Fig. 28. In this way, the material addition, the work selection circuit, and the logic of the circuit, 94 200937294 can form various selection logics in the form of a common comparison circuit group. Below, two examples are given. 1. Rotating System Call This system call is used to change the system group of the virtual queue corresponding to the READY state, that is, the READY-Operational Order Value (ODR) system call. For example, as shown in FIG. 29, in the virtual queue (Q0) corresponding to the rEadY state, five jobs are placed in the order of work (E6), work (E3), work, work (E0), and work (E5). . Here, RUN - job specified work priority © first sequence PR = 1 to issue a rotating system call. Next, the operation (E6) at the front end of the priority queue (Q〇: 1) corresponding to PR = 1 is temporarily taken out, and is placed in the forward direction (E5). That is, the order value (ODR) of the work (E6) becomes "〇", and the order values of other jobs are also adjusted. The rotating system call 'pairs the priority sequence (q〇: i) corresponding to the work priority order PR-1 specified by the parameter, and changes the order of the front-end work to the last-end system call. The external control places the order value (ODR) of the work into the virtual queue (Q0). The determination circuit for realizing the call of the rotating system may output "丄" as a condition of "ready state and operation of the designated work priority pR". Then, by comparing the circuit group, the operation of the maximum value of the sequence value (〇DR) is selected as the object of rotation from the operation in which the output signal of the determination circuit becomes "1". 2. Function expansion of the virtual queue corresponding to the WAIT state In general, when a certain flag is released, the virtual queue (Qn) corresponding to the flag waits with the highest priority from the work priority pR (1)^ : 95 In 200937294, 'choose the work to be acquired. However, regardless of the work priority PR, the special flag to be obtained (hereinafter, referred to as "special flag") may be set by the work with the highest order value (0DR). In order to construct a special flag, the "WAIT state, and the work of releasing the flag as the standby flag" is prepared to output a determination circuit of "1". Figure

判疋電路434 ’係qid_S、CND輸入、輸出EID—EN 訊號的電路。將此變更,假設為除了 qid_s、CND外亦輸 入工:優先順4 PR_S’輸出EID_EN肖pR_A的判定電路。The circuit 434' is a circuit that inputs qid_S, CND, and outputs an EID-EN signal. This change is assumed to be a decision circuit that outputs EID_EN Xiao pR_A in addition to qid_s and CND.

電路於解除特殊旗號時,對PR_A輸出既定值χ, 於解除通常旗料,直接輸出PR_S作為PR Α。因此,比 較電路群,於解除特殊旗料,將各工作之王作優先順序 PR全部辨識為既定值χ。其結果,比較電路群,與各工作 之,作優先順序PR無關,從判定電路之輸出訊號成為「1」 之該工作之中,選擇順序值(ODR)最小之工作。When the circuit cancels the special flag, the output value of PR_A is χ, and the normal flag is released, and PR_S is directly output as PR Α. Therefore, in the comparison circuit group, the special flag is released, and the priority PR of each work is recognized as a predetermined value. As a result, the comparison circuit group is selected so that the priority value (ODR) is the smallest among the operations in which the output signal of the determination circuit becomes "1" regardless of the priority PR.

a將從以土實施形態及變形例所掌握之發明的各種形 。 已揭不於申請專利範圍者例示如下。從改良例1可 認知以下發明。 ^裡座擬佇列處理電路’其特徵在於,具備: U㈣Μ ’對藉由㈣ID來辨別之複數種類之 擬分列’控制藉由要素„3來辨別之複數個要素之放入盘 出;以及 複數個佇列暫存 象之虛擬仔列之仵列 保持; 器,係對應各要素而設置,使放入對 ID與表示放入順序之順序值相對應而 96 200937294 該佇列控制電路, 當輸入指定要素iD及佇列ID之順向放入指令時,對 該指定之要素ID之該佇列暫存器,設定表示對與該指定之 仵列ID對應之虛擬㈣之末端放人的末端順序值與該指定 之佇列ID ; 當輸入指定要素ID及佇列m之逆向放入指令時,對 該指定之要素ID之該件列暫存器,設定表示對與該指定之 ❹ ❹ 知列ID對應之虛擬仵列之前端放人的前端順序值與該指定 之佇列ID ; 當輸入指定仵列ID之取出指令時,從館存該指定之仔 歹J ID及則端順序值之件列暫存器清除仔列①,藉由以該要 素作為取出對象’根據各仔列暫存器之設定資訊來管理該 複數種類之虛擬佇列。 C2·如C1記載之虛擬佇列處理電路,其中,該佇 制電路,當輸入該順向放入指令或該逆向放入指令其中2 一時’藉由指令調整儲在如$ + &gt; 的順序值。㈣料“之㈣①之其騎列暫存器 。.如C1記載之虛擬佇列處理電路,其 出候補電路,兮孢山你、士而 ’ 爾取 分 絲出候補電路,當指定佇列ID時,參昭你 該複數個佇列暫存薄单於#山 麥…從 J暫存器千仃輸出之仔列ID與順序值 應該指^之仔列ID及前端順序值的要素 該仔列控制電路’從該取出候補電路 之該㈣暫存器清时列IDe 1〇 以.如Q記載之虛擬仵列處理電路,其中,虛擬侍列 97 200937294 係進一步依據取出之優先度被定義成複數個優先佇列的集 合; 該仔列暫存器亦儲存用以特定優先佇列的優先度; 該佇列控制電路, 當輸入指定要素ID、佇列ID、及優先度之順向放入指 •r時,對该指定之要素ID之該佇列暫存器,亦設定該指定 之優先度; 當輸入指定要素ID、佇列ID、及優先度之逆向放入指 令時’對該指定之要素ID之該作列暫存器,亦設定該指定❹ 之優先度; 當輸入指定佇列ID之取出指令時’儲存該指定之佇列 ID’從其中設^最高之優先度,且其中設^最接近前端之 順序值之佇列暫存器清除佇列ID。 C5 ·如C4記載之虛擬佇列處理電路,其中,該佇列控 ,電=,輸入指定仔列⑴之該取出指令時,調整儲存該指 疋之佇列ID之其他佇列暫存器的順序值。 C6.如C5記載之虛擬佇列處理電路,其進一步具備取 0 出候補電路,該取出候補電路,當指定佇列①時,根據從 該複數個仵列暫存器平行輸出之仔列ID、順序值、及優先 度’儲存該指定之佇列ID’輸出對應其中設定最高之優先 ^且其中儲存最接近前端之順序值之佇列暫存器的要素 ID ; ' 該仔列控制電路,從該取出候補電路所輸出之要素 之該仔列暫存器清除佇列ID。 98 200937294 C7.—種工作處理裝置,其特徵在於,具備: 處理暫存器,暫時儲存用以執行工作的資料; 執行控制電路,將指令及運算元從記憶體載入至該處 理暫存器’依該處理暫存器之指令及運算元執行工作; 複數個狀態暫存器,係用以儲存工作排程之狀態資料 的暫存器,與複數個工作分別相對應; 工作切換轉,對與卫作之執行I態相對應之複數種 類之虛擬佇列,控制藉由工作ID來辨別之複數個工作之放 © 人與取出’以管理工作的執行狀態;以及 工作選擇電路,以從複數個該狀態暫存器平行輸出之 狀態資料作為輸入,藉由既定選擇條件來選擇工作; 忒狀態暫存器,使對應該工作之執行狀態之虛擬佇列 之仵列ID與表示對虛擬㈣之放人順序之順序值相對應而 保持’以作為狀態資料的一部分; 該執行控制電路,當執行中之第丨工作執行既定系統 呼叫指令時,將既定系統呼叫訊號傳至該工作切換電路,· ^ 該工作選擇電路,特定儲存對應READY(準備)狀態之 虛擬佇列之準備佇列之佇列ID及表示該準備佇列之前端位 置之前端順序值的狀態暫存器,將對應該特定之狀態暫存 器的第2工作選擇作為下一個執行對象; 該工作切換電路,在接收該系統呼叫訊號時,從該第2 工作之狀態暫存器清除佇列ID,對該第丨工作之狀態暫存 器,設定與RUN狀態不同之其他執行狀態所對應之虛擬佇 列的佇列ID與順序值,使該處理暫存器之資料保留在既定 99 200937294 記憶區域’且將該帛2 I作相關之保留在該記憶區域之資 料載入至該處理暫存器。 C8.如C7記載之工作處理裝置,其中,該工作切換電 路,使該第1工作移至READY狀態以作為該其他執行狀態 時,對該第1工作之狀態暫存器設定該準備佇列之佇列出 及前端順序值。 C9.如C7記載之工作處理裝置’其中,該工作選擇電 路,當設定待機佇列作為對應WAIT解除條件之成立待機 狀態之WAIT狀態之虛擬仔列時,該WAIT解除條件成立 時,在儲存該待機佇列之佇列ID及前端順序值之狀態暫存 器選擇該工作; 該工作切換電路,對該選擇之工作之狀態暫存器,設 定準備佇列之佇列山及表示對該準備佇列之末端放入之末 端順序值。 C1〇.如C7記載之工作處理裝置,其中,該狀態暫存器, 儲存工作優先度作為狀態資料的一部分; 該工作選擇電路,於切換工作之際,設定為準備佇列 〇 之佇列ID之工作有複數個時,將該等之中設定最高之工作 優先度,且該等之中設定最接近前端之順序值之工作選擇 作為執行對象。 根據本發明,可於多工處理實現更高效率之工作的執 行控制。 【圖式簡單說明】 100 200937294 圖1係工作的狀態遷移圖。 圖2係一般RTOS的概念圖。 圖3係軟體RTOS所執行之一般CPU的電路圖。 圖4係本實施例之rt〇s的概念圖。 圖5係本實施例之工作處理裝置的電路圖。 圖6係圖5之CPU的電路圖。 ❹ 圖7係顯示執行控制電路丨52使cpu時脈停止之構造 的電路圖。 圖8(a)係顯示中斷要求訊號產生時之各種訊號之關係 的時序圖。 、 序圖 意圖 ❹ 圖 圖8(b)係顯示系統呼叫執行時之各種訊號之關係的時 〇 圖9係用以說明管線處理之cpu時脈之停止時序的示 〇 圖10係顯示狀態記憶部與工作切換電路之關係的電路 圖11係顯示一般RTOS之RUN — 工作準備串列的圖。 圖12係執行選擇電路的電路圖。 圖係顯示一般rt〇s夕# # * •列的圖。般卿之旗號處理所利用之待機旗號 圖14係旗號選擇電路的電路圖。 圖15係工作切換電路的狀態遷移圖。 工作選擇時所利用 之 圖16係圖5 之工作處理裝置令,未裝栽工作控制電 路 101 200937294 之工作處理裝置的電路圖。 圖17係圖5之工作處理裝置中,未裝載儲存電路之工 作處理裝置的電路圖。 圖18係改良例1之工作處理裝置的電路圖。 圖19係改良例1之工作控制電路之一部分的電路圖。 圖20係佇列控制電路的電路圖。 圖21係顯不虛擬佇列與工作之關係的概念圖。 圖22係對應圖2 1之狀態暫存器的資料結構圖。 圖23係將工作(E4)順向放入圖21之虛擬佇列時的概念 ◎ 圖。 圖24係對應圖23之狀態暫存器的資料結構圖。 圖25係將工作(E5)順向放入圖23之虛擬佇列時的概念 圖。 圖26係對應圖25之狀態暫存器的資料結構圖。 圖27係顯示順向放入之處理過程的流程圖。 圖28係最大值選擇電路之一部分的電路圖。 圖29係將工作(E6)逆向放入圖25之虛擬佇列時的概念 ◎ 圏。 圖30係對應圖29之狀態暫存器的資料結構圖。 圖31係顯示逆向放入之處理過程的流程圖。 圖32係工作選擇電路之一部分的電路圖。 圖33係從圖29之虛擬佇列取出工作(E3)時的概念圖。 圖34係對應圖33之狀態暫存器的資料結構圖。 圖35係顯示取出之處理過程的流程圖。 102 200937294 圖36係顯示再執行優先型玉作排程中之虛擬仔列與工 作之關係的第1概念圖。 圖37係顯示再執行優先型卫作排程中之虛擬仔列與工 作之關係的第2概念圖。 糸顯示藉由軟體0S執行輔助處理時之一般電路 構成的圖。 圖39相示一般串列型輔助處理之控制方法的時序 圖40係顯示一般並列型輔助處理之控制方法的時序 圖。 圖41係顯示藉由基本例之工作處理裝置實現圖38至 圖40所不之輔助處理控制時之電路構成的圖。 圖42係顯示於改良例2工作處理裝置與hwf之關係 的電路構成圖。 圖43係顯示改良例2之狀態記憶部與工作切換電路之 關係的電路圖。 圖44係顯示改良例2之串列型輔助處理之控制方法 時序圖。 圖45係顯示改良例2之並列型輔助處理之控制方法 時序圖。 【主要元件符號說明】a Various forms of the invention to be grasped by the soil embodiment and the modification. Those who have not disclosed the scope of the patent application are exemplified as follows. The following invention can be recognized from the modification 1. The inner-side processing circuit 'is characterized by: U(four) Μ 'the pseudo-column of the plural types discriminated by the (four) ID 'controls the plurality of elements identified by the element „3; A plurality of queues of the virtual queues of the temporary storage array are held; the device is set corresponding to each element, so that the input pair ID corresponds to the order value of the presentation order. 96 200937294 The queue control circuit, when When the forward input command of the specified element iD and the queue ID is input, the end of the virtual element (four) corresponding to the specified queue ID is set to the end register of the specified element ID. The sequence value and the specified queue ID; when the reverse input instruction of the specified element ID and the queue m is input, the pair of the specified element ID is set to indicate the pair and the specified The front end order value of the virtual queue corresponding to the column ID and the specified queue ID; when the fetch instruction of the specified queue ID is input, the designated J ID and the end order value are stored from the library. The column register clears the queue 1 by using the As the object to be extracted, the virtual queue of the plural type is managed according to the setting information of each of the queues. C2. The virtual array processing circuit described in C1, wherein the control circuit inputs the forward direction The input instruction or the reverse input instruction is one of the following: 'The order value stored in the order such as $+ &gt; is adjusted by the instruction. (4) The material "(4) 1 of its riding column register. As shown in C1, the virtual queue processing circuit, the candidate circuit, the Fusui Mountain, you and the squirrel take the candidate circuit, when you specify the queue ID, you can see the multiple temporary storage thin Single ##山麦... From the J register, the output of the ID and the order value should refer to the element of the ID and the front-end order value. The control circuit of the slave line is temporarily stored from the candidate circuit. The virtual queue column processing circuit of IDe 1 is described by Q, wherein the virtual queue 97 200937294 is further defined as a set of a plurality of priority queues according to the priority of the extraction; The priority for the specific priority queue is also stored; the queue control circuit inputs the specified element ID, the queue ID, and the priority direction of the pointer to the specified element ID. The column register also sets the priority of the designation; when the specified element ID, the column ID, and the reverse direction of the priority command are input, 'the column ID of the specified element ID is also set. Specify the priority of ❹; when entering the fetch instruction specifying the queue ID The 'store the specified queue ID' is set to the highest priority from which the highest priority is set, and the queue register with the sequence value closest to the front end is set to clear the queue ID. C5. The virtual queue processing circuit as described in C4, wherein the queue control, power=, when inputting the fetch instruction of the specified queue (1), adjusting the other queue register storing the queue ID of the indicator Order value. C6. The virtual queue processing circuit according to C5, further comprising: a zero-out candidate circuit, wherein when the queue 1 is specified, the array ID is output in parallel from the plurality of queue registers, The order value and the priority 'storage the specified queue ID' output correspond to the element ID of the queue register in which the highest priority is set and the order value closest to the front end is stored; 'the train control circuit, from The queue register of the elements output by the take-out candidate circuit clears the queue ID. 98 200937294 C7. A work processing apparatus, comprising: processing a temporary register to temporarily store data for performing work; and executing a control circuit to load instructions and operands from a memory to the processing register 'According to the instruction of the temporary register and the operation of the operation unit; a plurality of state registers, which are used to store the state data of the work schedule, corresponding to a plurality of jobs respectively; a virtual array of plural types corresponding to the execution state I of the guard, controlling the work of the plurality of jobs by the work ID to determine the execution state of the work and the work selection circuit, and the work selection circuit to The state data of the parallel output of the state register is input as an input, and the work is selected by the predetermined selection condition; the state register is set to make the virtual ID of the execution state corresponding to the execution state of the queue and the representation virtual (4) The sequence order of the release order is maintained as 'as part of the status data; the execution control circuit, when performing the third job, performs the scheduled system call In order to transmit the predetermined system call signal to the work switching circuit, the work selection circuit specifically stores the queue ID of the preparation queue corresponding to the virtual state of the READY state and indicates the front end of the preparation queue The status register of the previous order value of the position, the second operation selection corresponding to the specific status register is taken as the next execution target; the work switching circuit receives the system call signal from the second work The state register clears the queue ID, and sets the queue ID and sequence value of the virtual queue corresponding to the other execution states different from the RUN state to the state register of the third job, so that the processing register is The data is retained in the established 99 200937294 memory area' and the data retained in the memory area associated with the data is loaded into the processing register. C8. The work processing apparatus according to C7, wherein the operation switching circuit sets the preparation queue to the state register of the first operation when the first operation is moved to the READY state to be the other execution state.伫 List and front-end order values. C9. The work processing apparatus according to C7, wherein the operation selection circuit stores the standby queue as a virtual queue of a WAIT state in a standby state corresponding to a WAIT release condition, and when the WAIT release condition is satisfied, storing the The status register of the queue ID and the front end order value of the standby queue selects the operation; the work switching circuit sets the preparation state queue for the selected state register and indicates the preparation 伫The end sequence value at the end of the column. C1〇. The work processing device according to C7, wherein the state register stores a work priority as part of the state data; and the work selection circuit sets the queue ID of the queue after the switch operation When there are a plurality of jobs, the highest work priority is set among the above, and the work selection in which the order value closest to the front end is set among the objects is selected as the execution target. According to the present invention, the execution control of the work of higher efficiency can be realized in the multiplex processing. [Simple diagram of the diagram] 100 200937294 Figure 1 is a state transition diagram of the work. Figure 2 is a conceptual diagram of a general RTOS. Figure 3 is a circuit diagram of a general CPU executed by the software RTOS. Fig. 4 is a conceptual diagram of rt〇s of the present embodiment. Fig. 5 is a circuit diagram of the work processing apparatus of the embodiment. Figure 6 is a circuit diagram of the CPU of Figure 5. ❹ Fig. 7 is a circuit diagram showing a configuration in which the execution control circuit 丨52 stops the cpu clock. Fig. 8(a) is a timing chart showing the relationship of various signals when the interrupt request signal is generated. Figure 8 (b) shows the relationship between various signals when the system calls execution. Figure 9 is a diagram for explaining the stop timing of the cpu clock of the pipeline processing. Figure 10 shows the state memory. Circuit diagram 11 relating to the duty switching circuit is a diagram showing the RUN of the general RTOS - the work preparation sequence. Figure 12 is a circuit diagram of a selection circuit. The figure shows the general rt〇s eve # # * • column diagram. The standby flag used in the processing of the flag of the Qingqing Figure 14 is the circuit diagram of the flag selection circuit. Figure 15 is a state transition diagram of the work switching circuit. Figure 16 is a circuit diagram of the work processing apparatus of Figure 5, the work processing apparatus of the unloaded work control circuit 101 200937294. Figure 17 is a circuit diagram of a work processing apparatus in which the storage circuit is not loaded in the work processing apparatus of Figure 5. Fig. 18 is a circuit diagram of the work processing apparatus of the first modification. Fig. 19 is a circuit diagram showing a part of the operation control circuit of the first modification. Figure 20 is a circuit diagram of a train control circuit. Figure 21 is a conceptual diagram showing the relationship between virtual queues and work. Figure 22 is a data structure diagram corresponding to the state register of Figure 21. Fig. 23 is a diagram showing the concept of placing the work (E4) in the virtual queue of Fig. 21 ◎. Figure 24 is a data structure diagram corresponding to the state register of Figure 23. Fig. 25 is a conceptual diagram when the work (E5) is placed in the virtual queue of Fig. 23 in the forward direction. Figure 26 is a data structure diagram corresponding to the state register of Figure 25. Figure 27 is a flow chart showing the processing of the forward insertion. Figure 28 is a circuit diagram of a portion of the maximum selection circuit. Figure 29 is a concept of placing the work (E6) in the reverse direction of the virtual array of Figure 25 ◎ 圏. Figure 30 is a data structure diagram corresponding to the state register of Figure 29. Figure 31 is a flow chart showing the processing of the reverse insertion. Figure 32 is a circuit diagram of a portion of the operational selection circuit. Fig. 33 is a conceptual diagram when the work (E3) is taken out from the virtual queue of Fig. 29. Figure 34 is a data structure diagram corresponding to the state register of Figure 33. Figure 35 is a flow chart showing the process of taking out. 102 200937294 Figure 36 is the first conceptual diagram showing the relationship between the virtual train and the work in the execution of the priority jade schedule. Fig. 37 is a second conceptual diagram showing the relationship between the virtual train and the work in the execution of the prioritized work schedule.糸 A diagram showing the general circuit configuration when the auxiliary processing is executed by the software 0S. Fig. 39 is a timing chart showing the control method of the general serial type auxiliary processing. Fig. 40 is a timing chart showing the control method of the general parallel type auxiliary processing. Fig. 41 is a view showing the circuit configuration when the auxiliary processing control shown in Figs. 38 to 40 is realized by the work processing apparatus of the basic example. Fig. 42 is a circuit diagram showing the relationship between the work processing apparatus of the modified example 2 and hwf. Fig. 43 is a circuit diagram showing the relationship between the state memory portion and the operation switching circuit of the second modification. Fig. 44 is a timing chart showing the control method of the tandem type auxiliary processing of the second modification. Fig. 45 is a timing chart showing the control method of the parallel type auxiliary processing of the second modification. [Main component symbol description]

84 CPU 86 汎用暫存器 103 200937294 88 特殊暫存器 90 執行控制電路 92 處理暫存器 94 運算電路 96 輸入選擇器 98 輸出選擇器 100 工作處理裝置 110 保留暫存器 110— _0〜110_n 保留 112 載入選擇電路 120 儲存電路 150 CPU 152 執行控制電路 154 處理暫存器 156 特殊暫存器 158 汎用暫存器 160 運算電路 162 輸入選擇器 164 輸出選擇器 170 指令解碼器 172 第1 AND閘 174 第2AND閘 176 OR閘 200 工作控制電路84 CPU 86 Universal Register 103 200937294 88 Special Register 90 Execution Control Circuit 92 Processing Register 94 Operation Circuit 96 Input Selector 98 Output Selector 100 Work Processing Unit 110 Reserved Register 110 - _0~110_n Reserved 112 Load selection circuit 120 storage circuit 150 CPU 152 execution control circuit 154 processing register 156 special register 158 general purpose register 160 arithmetic circuit 162 input selector 164 output selector 170 instruction decoder 172 first AND gate 174 2AND gate 176 OR gate 200 working control circuit

104 200937294104 200937294

210 工作切換電路 212 旗號表 214 事件表 220 狀態記憶部 220_ _0〜220_n 狀態記憶部 230 工作選擇電路 232 執行選擇電路 234 旗號選擇電路 236 事件選擇電路 238 暫停檢測電路 240 互斥電路 242 檢測電路 250, 250_0, 250_1, 250_2, 250 252 計時 254 工作ID暫存器 256 工作優先順序暫存器 258 工作狀態暫存器 260 工作啟動位址暫存器 262 待機理由暫存器 264 旗號ID暫存器 265 互斥ID暫存器 266 事件ID暫存器 268 待機旗標暫存器 270 旗標條件暫存器 狀態暫存器 105 200937294 272 旗標初始化暫存器 274 暫停計數器 280 優先順序指標 290a〜290d 第1比較電路 292a, 292b 第2比較電路 294 第3比較電路 296a〜296h 判定電路 300a〜300d 第1比較電路 302a, 302b 第2比較電路 304 第3比較•電路 306a〜306h 判定電路 320 處理資料保持部 322 暫存器切換控制電路 324 中斷介面電路 400 主電路 402 寫入電路 404 仵列控制電路 406 最大值選擇電路 410_0, 410_1, 4102, 410_3 412_0, 412_1, 412 2, 412 3 4140, 4141, 414 2, 414 3 416_0, 416_1, 416 2, 416 3 420_0, 420_1 暫存器值產生 422a, 422b 第1比較電路210 work switching circuit 212 flag table 214 event table 220 state memory unit 220__0~220_n state memory unit 230 operation selection circuit 232 execution selection circuit 234 flag selection circuit 236 event selection circuit 238 suspension detection circuit 240 mutual exclusion circuit 242 detection circuit 250, 250_0, 250_1, 250_2, 250 252 Timing 254 Working ID Register 256 Working Priority Register 258 Working Status Register 260 Working Start Address Register 262 Standby Reason Register 264 Flag ID Register 265 Mutual斥ID register 266 event ID register 268 standby flag register 270 flag condition register status register 105 200937294 272 flag initialization register 274 pause counter 280 priority indicator 290a~290d 1 Comparison circuit 292a, 292b Second comparison circuit 294 Third comparison circuit 296a to 296h Decision circuits 300a to 300d First comparison circuit 302a, 302b Second comparison circuit 304 Third comparison circuit 306a to 306h Decision circuit 320 processes data holding portion 322 Register switch control circuit 324 interrupt interface circuit 400 main circuit 402 write circuit 404 Column control circuit 406 maximum value selection circuit 410_0, 410_1, 4102, 410_3 412_0, 412_1, 412 2, 412 3 4140, 4141, 414 2, 414 3 416_0, 416_1, 416 2, 416 3 420_0, 420_1 register value generation 422a, 422b first comparison circuit

❹ 工作ID暫存器 工作優先順序暫存器 作列順序暫存器 # %辨別暫存器 電略 106 200937294 424a 第2比較電路 426a〜426d 判定電路 430a, 430b 第1比較電路 432a 第2比較電路 434a〜434d 判定電路❹ Work ID register work priority register register sequence register # % discrimination register memory 106 200937294 424a second comparison circuit 426a to 426d decision circuit 430a, 430b first comparison circuit 432a second comparison circuit 434a~434d decision circuit

500 HWF 500_0 〜500_k HWF 502 中斷控制器 504 HWFID暫存器 506 佇列順序暫存器 508 佇列辨別暫存器 510 HWF待機選擇電路 512 CPU匯流排 ❹ 107500 HWF 500_0 ~500_k HWF 502 Interrupt Controller 504 HWFID Register 506 Array Sequence Scratchpad 508 辨 Column Discriminator 510 HWF Standby Select Circuit 512 CPU Bus ❹ 107

Claims (1)

200937294 七、申請專利範圍: 1.一種工作處理裝置,其特徵在於,具備: 處理暫存器,暫時儲存用以執行工作的資料; 執行控制電路,將指令及運算元從記憶體載入至該處 理暫存器’依該處理暫存器之指令及運算純行工作; 狀癌暫存器,係用以儲存表示工作之執行狀態的狀態 資料; 工作切換電路,係用以控制工作的執行狀態; ❹ 工作選擇電路’根據該狀態資料,藉由既定選擇條件 來選擇工作;以及 輔助處理電路,執行既定辅助處理作為工作之一部分; 該執行控制電路,當鈾仵吨―么 田執订既疋系統呼叫指令時,將既 定系統呼叫訊號傳至該工作切換電路; 該工作選擇電路,從夹干往 攸表不待機為可執行狀態之REady 狀態之工作之t選擇成為下―個執行對象的工作; 該工作切換電路,藉ώ 接收該系統呼叫訊號時之該工 作選擇電路的輸出選擇成為下_ 〇 谇攻為下個執行對象的工作,將該 處理暫存器之資料保留於 ^ 4於既疋§己憶區域,且將執行中之工 作之狀態資料從表示工作執杆Φ 執仃中之RUN狀態設定變更為另 一狀態,對選擇之工作,骆仅防# 文文马另 至,處㈣Μ 將保留於該記憶區域之資料載入 =處理暫存器’且將該卫作之狀_料從舰 更為函狀態,藉此切換成為執行對象的工作;U 於該執行控制電路,當勃并由&gt; 令作為用以執行該既定輔=二t工作執行輔助處理指 疋輔助處理的系統呼叫指令時該工 108 ❹ ❹ 200937294 作切換電路’指示該輔 2.如尹請專㈣輔助處理。 作切換電路,當指示執行該輔 處理裝置,其中,該工 處理指令之第i工作對 處理時,設定執行該辅助 該第1工作不同之第2工1〜理電路的佔有權,且將與 ^ ? φ 乍攻定成RUN狀態,以從哕輔ΒΛ 處理電路接收到表示該辅 u ^该辅助 件,解除該第!工作的佔有權“之辅助結束訊號為條 :如申請專利範圍第2項之工作 執灯控制電路,執行佔有要求指令 、中^ 有該辅助處理電路的线呼叫指令,/ 作要求佔 該工作切換電路,以對噹魎 作之佔右D輔助處理電路未設定其他工 =有權為條件’設定該第1工作對該輔助處理電路的 處理==制電路,該第1工作,以成功取得該輔助 處理電路的佔有權為條件,執行該輔助處理指令。 ^如巾4專利範圍第丨項之工作處理裝置其中該工 刀、電路,將既定資料記錄於執行該輔助處理指令之第1 =的狀態暫存器,以収該第丨卫作正在等待該輔助處 理電路的處理結束; 該工作選擇電路’將該狀態暫存器記錄有該既定資料 的工作通知該工作切換電路; 該工作切換電路,從該輔助處理電路接收到表示該輔 助處理結束之輔助結束訊號時,將從該工作選擇電路通知 之該第1工作再次設定成RUN狀態。 109 200937294 5.如申請專利範圍第}項之工作處理 助處理電路,伤八e,此 直其中,該輔 於該热〜 數種辅助處理設置複數個丨 ;I行控制電路,當執行中之工作以輔助處 類為參數執杆呤結稀助處理的種 數執仃該輔助處理指令時,該工作切 數個輔助處理電路之t㈣# ,從複 的輔助處理電路,對、 助處理對應 助處理。 料選擇之辅助處理電路指示執行該輔 6.如申請專利範圍第5項之工作處理裝置 作切換電路,選摆呤MbA老 其中’該工 ❹ 指令之…電路時’對執行該輔助處理 、'〜暫存器記錄一意辨識該選 電路的辅肋虛稍助處理 辅助處理ID,以設定執行該輔 在等待該選擇之輔肋虛揮帝相7之工作正 “電路的處理結束,從該選擇之辅 助處理電路接收到表示該 ^辅 0#,蔣兮囉抵^ u 处牲、,σ束之輔助結束訊號 時將忒選擇之輔助處理電路的輔助處 擇電路丨 神助慝理1D通知該工作選 s亥工作選擇電路,撰媒# + τ ... 擇记錄有該通知之輔助處理ID的 Ύτ , ❹ 該工作切換電路,接收該輔狀々士土 ^ ^ 忑補助結束訊號時,將該選擇 之工作再次設定成RXJN狀態。 7.如申請專利範圍第丨項之工 備用以保留該處理暫存器之資料4理裝置,其進一步具 ^ 、 貢枓,分別與複數個工作相對 應的複數個保留暫存器; 該工作切換電路,接收該 .^ ^ 既疋系統呼叫訊號時’將該 處理暫存器之資料保留於與執行中 订中之工作相對應之該保留 110 200937294 暫存器將與成為下一個執行對象之工作相對應之該保留 暫存器的資料載入至該處理暫存器。 8. 如申請專利範圍第7項之工作處理裝置,其中,該工 作切換電路,從該輔助處理電路接收到表示該輔助處理結 束之辅助結束訊號時,從該辅助處理電路取得表示該輔助 絲之結果的回傳值,將該回傳值寫人至執行該輔助處理 指令之工作的保留暫存器,以將該輔助處理之結果通知執 行該辅助處理指令之工作。 ❹ φ 9. 如申請專利範圍第i項之工作處理裝置,其中,該工 7切=電路,從該辅助處理電路接收到表示該辅助處理結 之助結束訊號時,將執行該辅助處理指令之工作再次 設定成RUN狀態。 如申請專利範圍第丨項之卫作處理震置, 工作切換電路,以你兮姑# + Ψ 該 理”之電路接㈣表示該輔助處 之工作並設定成RUN狀t 選擇成為下一個執行對象 ^ ^ ^ &quot; 以防止該辅助處理之執行申於 該執订控制電路執行工作。 订1 如中請專利範圍第iQ項之卫作處理裝置,其中,談 工切換電路,當執行該辅助處理指、7 μ 電路傳送停止要求訊&amp; ; 7彳肖該執仃控制 該執行控制電路,桩 甩以進行工作之執行 &quot;苧止要求訊號後,停止供應 該輔助處理指令之::序的執行用時脈’以暫時停止執行 ^ 相7之工作的執行程序; 該工作切換電路, 接收該輔助結束訊號時,對該執 111 200937294 行控制電路傳送停止解除訊號; 該執行控制電路,接收該停止解除訊號後,解除該執 行用時脈之供應停止,以再次開始執行該輔助處理指令之 工作的執行程序。 /&quot;V、圖式· (如次頁) ❹200937294 VII. Patent application scope: 1. A work processing device, comprising: processing a temporary storage device for temporarily storing data for performing work; and executing a control circuit for loading instructions and operation elements from the memory to the The processing register is operated in accordance with the instructions and operations of the processing register; the cancer register is used to store state data indicating the execution state of the work; the work switching circuit is used to control the execution state of the work. ❹ The work selection circuit 'selects the work according to the state selection data by the predetermined selection condition; and the auxiliary processing circuit performs the predetermined auxiliary process as part of the work; the execution control circuit, when the uranium 仵 ― 么 么 么 么 么 么 么When the system calls the command, the predetermined system call signal is transmitted to the work switching circuit; the work selection circuit selects the work of the next execution object from the work of the REady state in which the standby is not standby to the executable state. The work switching circuit borrows the work selection circuit when receiving the system call signal The output selection becomes the work of the next _ 〇谇 attack for the next execution object, and the data of the processing register is retained in the 己 己 己 , 、 、 、 、 、 、 、 、 、 、 、 、 、 、 、 Φ The RUN status setting in the stub is changed to another status. For the selection work, Luo Weifang #文文马到到,四(四)Μ The data retained in the memory area is loaded = processing register' and The shape of the _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ When referring to the system call instruction of the auxiliary processing, the worker 108 ❹ ❹ 200937294 is used as the switching circuit to indicate the auxiliary 2. If the application is (4) auxiliary processing. a switching circuit for instructing execution of the auxiliary processing device, wherein, in the processing of the i-th work pair of the processing command, setting a possession of the second work 1 to the circuit that assists the first work is performed, and ^ ? φ 乍 乍 成 RUN RUN , , , , 乍 , , , , 乍 乍 乍 乍 乍 乍 乍 乍 乍 乍 乍 乍 乍 乍 乍 乍 乍 乍 乍 乍 乍 乍 乍 乍 乍 乍 RUN RUN RUN RUN RUN RUN RUN RUN RUN RUN RUN The work light control circuit of the item executes the line command command for occupying the demand instruction, the middle part has the auxiliary processing circuit, and the request is occupied by the work switching circuit, so as to do not set other work for the right D auxiliary processing circuit = has the right to set the first work to the auxiliary processing circuit == system, the first operation, the acquisition of the auxiliary processing circuit is conditional on the condition that the auxiliary processing instruction is executed. The working processing device of the invention of claim 2, wherein the tool and the circuit record the predetermined data in a state register that executes the first processing instruction of the auxiliary processing instruction, to receive the third security device and the like. The processing of the auxiliary processing circuit ends; the work selection circuit 'notifies the work switching circuit of the operation of recording the predetermined data in the state register; the work switching circuit receives, from the auxiliary processing circuit, the end of the auxiliary processing When the auxiliary end signal is received, the first operation notified from the work selection circuit is set to the RUN state again. 109 200937294 5. If the work processing auxiliary processing circuit of the patent application scope item is injured, the damage is eight, which is straight, In addition to the heat ~ several kinds of auxiliary processing to set a plurality of 丨; I line control circuit, when the work in the implementation to assist the category as the parameter of the stick 呤 稀 稀 稀 稀 稀 稀 辅助 辅助 辅助 辅助 辅助 辅助 辅助 辅助a plurality of auxiliary processing circuits t(four)#, the auxiliary auxiliary processing circuit, the auxiliary processing corresponding processing, and the auxiliary processing circuit of the material selection instructing execution of the auxiliary 6. The working processing device of the fifth application of the patent scope is used as the switching circuit. , select the 呤 MbA old one of the 'the work 指令 command ... circuit when 'to perform the auxiliary processing, ' ~ register record Identifying the auxiliary ribs of the selected circuit to assist the processing of the auxiliary processing ID to set the execution of the auxiliary ribs to wait for the selection of the auxiliary ribs. The processing of the circuit ends, and the auxiliary processing circuit receives the selected processing circuit. It is indicated that the ^^0#, Jiang兮啰 arrived at ^u, and the auxiliary signal of the auxiliary processing circuit selected by the σ bundle is the auxiliary processing circuit. , the author # + τ ... selects the Ύτ that records the auxiliary processing ID of the notification, ❹ the work switching circuit receives the auxiliary 々士土 ^ ^ 忑 subsidy end signal, and sets the selected work again. Into the RXJN state. 7. If the work of the third paragraph of the patent application is reserved to retain the data processing device of the processing register, further comprising a plurality of reserved registers corresponding to the plurality of jobs respectively; Switching circuit, when receiving the .^ ^ system call signal, 'retain the data of the processing register in the reservation corresponding to the work in the execution order. 200937294 The register will be the next execution object. The data corresponding to the reserved scratchpad is loaded into the processing register. 8. The work processing apparatus according to claim 7, wherein the work switching circuit receives, from the auxiliary processing circuit, an auxiliary end signal indicating that the auxiliary processing is completed, and obtains the auxiliary wire from the auxiliary processing circuit. The returned value of the result is written to the reserved register that performs the work of the auxiliary processing instruction to notify the execution of the auxiliary processing instruction of the result of the auxiliary processing. φ φ 9. The work processing apparatus of claim i, wherein the work 7 is a circuit, and when the auxiliary processing circuit receives a help end signal indicating the auxiliary processing, the auxiliary processing instruction is executed. The work is set to the RUN state again. For example, if the processing of the third paragraph of the patent application is handled, the work switching circuit is connected to the circuit of the 兮 # + + + + 四 四 四 四 四 四 四 四 四 四 四 四 四 四 四 四 四 四 四 四 四 四 四 四 四 四 四 四 四 四^ ^ ^ &quot; to prevent the execution of the auxiliary processing from being executed by the binding control circuit. The processing device of the iQ item of the patent scope, wherein the switching circuit is executed, when the auxiliary processing is performed Refers to the 7 μ circuit transmission stop request message &amp; 7 该 该 该 该 该 该 该 该 该 该 该 该 该 该 该 该 该 该 该 该 该 该 该 该 该 该 该 该 该 该 该 该 该 该 该 该 该 该 该 该 该 : : : : : Executing a clock for temporarily stopping execution of the operation of the phase 7; the work switching circuit, when receiving the auxiliary termination signal, transmits a stop release signal to the control circuit of the control circuit 111; the execution control circuit receives the After the stop signal is stopped, the supply of the execution clock is stopped, and the execution of the operation of the auxiliary processing instruction is resumed. /&quo t;V, schema · (such as the next page) ❹ 112112
TW098101355A 2008-01-15 2009-01-15 Work processing device TWI476696B (en)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/JP2008/000026 WO2009090684A1 (en) 2008-01-15 2008-01-15 Task processor

Publications (2)

Publication Number Publication Date
TW200937294A true TW200937294A (en) 2009-09-01
TWI476696B TWI476696B (en) 2015-03-11

Family

ID=40885097

Family Applications (1)

Application Number Title Priority Date Filing Date
TW098101355A TWI476696B (en) 2008-01-15 2009-01-15 Work processing device

Country Status (3)

Country Link
JP (1) JP5155336B2 (en)
TW (1) TWI476696B (en)
WO (1) WO2009090684A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8892810B2 (en) 2011-02-18 2014-11-18 Kabushiki Kaisha Toshiba Semiconductor device and memory protection method

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2012170185A1 (en) * 2011-05-20 2012-12-13 Apple Inc. Apparatus and methods for optimizing scheduled operations in hybrid network environments
KR101573920B1 (en) 2011-05-20 2015-12-02 애플 인크. Apparatus and methods for priority based task scheduling in hybrid network operation
CN104272256B (en) * 2012-05-24 2018-07-27 瑞萨电子株式会社 Task Processing Unit
JP2017037370A (en) 2015-08-06 2017-02-16 富士通株式会社 Computing device, process control method and process control program
JP2017123190A (en) * 2017-03-08 2017-07-13 ルネサスエレクトロニクス株式会社 Task processing device
JP2018180768A (en) * 2017-04-07 2018-11-15 ルネサスエレクトロニクス株式会社 Semiconductor device

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH1139171A (en) * 1997-07-18 1999-02-12 Masaharu Imai Multitask processor, multitask processing control method and control program storing medium
US6986141B1 (en) * 1998-03-10 2006-01-10 Agere Systems Inc. Context controller having instruction-based time slice task switching capability and processor employing the same
JP2003263329A (en) * 2002-03-08 2003-09-19 Oki Electric Ind Co Ltd Task scheduler
GB2414575B (en) * 2004-05-26 2007-06-06 Advanced Risc Mach Ltd Management of polling loops in a data processing apparatus
US20060059372A1 (en) * 2004-09-10 2006-03-16 International Business Machines Corporation Integrated circuit chip for encryption and decryption having a secure mechanism for programming on-chip hardware
ATE406613T1 (en) * 2004-11-30 2008-09-15 Koninkl Philips Electronics Nv EFFICIENT SWITCHING BETWEEN PRIORIZED TASKS
US7545381B2 (en) * 2005-11-10 2009-06-09 Via Technologies, Inc. Interruptible GPU and method for context saving and restoring
JP2007317171A (en) * 2006-04-27 2007-12-06 Matsushita Electric Ind Co Ltd Multi-thread computer system and multi-thread execution control method

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8892810B2 (en) 2011-02-18 2014-11-18 Kabushiki Kaisha Toshiba Semiconductor device and memory protection method
TWI474171B (en) * 2011-02-18 2015-02-21 Toshiba Kk Semiconductor device and memory protection method
US9336065B2 (en) 2011-02-18 2016-05-10 Kabushiki Kaisha Toshiba Semiconductor device and memory protection method

Also Published As

Publication number Publication date
JPWO2009090684A1 (en) 2011-05-26
JP5155336B2 (en) 2013-03-06
TWI476696B (en) 2015-03-11
WO2009090684A1 (en) 2009-07-23

Similar Documents

Publication Publication Date Title
TWI438679B (en) Virtual queue processing circuit and work processing device
TWI426452B (en) Work processing device
TWI416413B (en) Work processing device
TWI426451B (en) Work processing device
US8898666B2 (en) Virtual machine system and virtual machine system control method for controlling program execution on a plurality of processors that have a plurality of privileged modes
TW200937294A (en) Task processor
US7676808B2 (en) System and method for CPI load balancing in SMT processors
JP6153925B2 (en) Task processing device
TWI537831B (en) Multi-core processor,method to perform process switching,method to secure a memory block, apparatus to enable transactional processing using a multi core device and method to perform memory transactional processing
JP5650952B2 (en) Multi-core / thread workgroup calculation scheduler
US20050086660A1 (en) System and method for CPI scheduling on SMT processors
TW201001291A (en) Method and apparatus for moving threads in a shared processor partitioning environment
CN101310257A (en) Multi-processor system and program for causing computer to execute multi-processor system control method
US10095542B2 (en) Cooperative thread array granularity context switch during trap handling
TW201435576A (en) Cooperative thread array granularity context switch during trap handling
JP2018180768A (en) Semiconductor device
WO2007088816A1 (en) Multi-processor system and program for causing computer to execute multi-processor system control method
TW200925999A (en) Task processing device
JP2017123190A (en) Task processing device
JP2019003710A (en) Task processing device