CN102436393B - Task treatment device - Google Patents

Task treatment device Download PDF

Info

Publication number
CN102436393B
CN102436393B CN 201110345010 CN201110345010A CN102436393B CN 102436393 B CN102436393 B CN 102436393B CN 201110345010 CN201110345010 CN 201110345010 CN 201110345010 A CN201110345010 A CN 201110345010A CN 102436393 B CN102436393 B CN 102436393B
Authority
CN
Grant status
Grant
Patent type
Prior art keywords
task
state
circuit
register
wait
Prior art date
Application number
CN 201110345010
Other languages
Chinese (zh)
Other versions
CN102436393A (en )
Inventor
丸山修孝
Original Assignee
科尼龙硅公司
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
Grant date

Links

Abstract

一种任务处理装置(100),包括CPU(150)、保存电路(120)以及任务控制电路(200)。 One kind of task processing apparatus (100) comprising a CPU (150), the save circuit (120) and a task control circuit (200). CPU(150)配置有处理寄存器、和将数据从存储器加载到处理寄存器中并按照处理寄存器中的数据来执行任务的执行控制电路(152)。 CPU (150) disposed on the processing register, and loads data from memory into the processing register and to execute data processing task execution control register circuit (152). 保存电路(120)配置有分别对应多个任务的多个保存寄存器(110)。 Hold circuit (120) arranged respectively corresponding to a plurality of tasks to a plurality of storage registers (110). 当执行规定的系统调用命令时,执行控制电路(152)将通知任务控制电路(200)。 When executing a predetermined system call instruction, the execution control circuit (152) notifies the task control circuit (200). 当收到系统调用命令执行通知时,任务控制电路(200)将处理寄存器中的数据保存到与执行中的任务相对应的保存寄存器(110)中,接着选择下一个应被执行的任务,并将与所选择任务相对应的保存寄存器(110)中的数据加载到处理寄存器(154)中,从而切换执行对象的任务。 When a system call instruction execution notification is received, the task control circuit (200) to save the data into the processing register and execute a task corresponding to the save register (110), then select the next task to be executed, and loaded to the selected task corresponding to the data stored in the register (110) into the processing register (154), thereby switching the task execution object.

Description

任务处理装置 The task processing device

[0001] 本申请是申请日为2006年8月24日、申请号为200680055671.1、发明名称为“任务处理装置”的中国专利申请的分案申请。 [0001] This application is filed August 24, 2006, Application No. 200680055671.1, entitled "task processing device" divisional application Chinese patent application.

技术领域 FIELD

[0002] 本发明涉及一种OS (Operating System,操作系统)的功能,特别是涉及一种任务调度技术。 [0002] The present invention relates to an OS (Operating System, OS) features, in particular, to a task scheduling technology.

背景技术 Background technique

[0003] 不仅是如个人计算机一样的通用设备用OS,就连如移动电话一样的专用设备用OS中也逐渐要求高级功能。 [0003] is not only a personal computer as a general-purpose device with OS, and even mobile phones with the OS as special equipment requirements are also gradually advanced features. 特别是能够用一个CPU (Central Processing Unit,中央处理器)执行多个任务的0S(以下将这种类型的OS称作“多任务OS”)现已经被配置在很多的电子装置中。 In particular, capable of performing a plurality of tasks with a CPU (Central Processing Unit, central processing unit) 0S (hereinafter referred to as the OS of this type "multitask OS") has now been arranged in many electronic devices.

[0004] 多任务OS将CPU的处理时间分割为单位时间(时间片),并为多个任务顺序分配时间片。 [0004] The multitask OS CPU processing time is divided into units of time (time slices) and assigns time slices to a plurality of tasks sequentially. 只有当从OS获得时间片时,各任务才能够使用CPU。 Only when the time slice is obtained from the OS, each task to be able to use the CPU. 在一个时间片中执行一个任务。 Perform one task at a time slice. 由于时间片是非常短的时间,对于用户而言,多个任务看似是同时执行的。 Because of the time slice is a very short time, for the user, it appears to be multiple tasks simultaneously executed. 根据这种处理方法,通过在任务A到达等待输入的状态因而不需要用到CPU的处理能力时,将执行权交给其它任务B,能够有效利用CPU的处理能力。 According to this approach, when there is no need to use the processing power of the CPU by the task A reaches a state of waiting for input, the execution right to other tasks B, effective use of the processing power of the CPU. 这里所说的执行权等同于使用CPU的权利。 Referred to here is equivalent to the execution right of the right to use the CPU.

[0005] 多任务OS进行的执行权转移被称作“任务切换”。 Execution right [0005] multitask OS for transfer is referred to as "task switching." 任务切换是在时间片已经届满、或任务执行规定命令时发生。 Task switch occurs at time slice has expired, a predetermined command or task execution. 当到达任务切换的执行时刻时,多任务OS将执行中的任务的上下文信息保存到TCB (Task Control Block:任务控制块)中。 When reaching the execution time of a task switch, the multitask OS context save information to perform tasks in a TCB (Task Control Block: task control block). 上下文信息是指任务执行时存储在CPU的寄存器中的数据、或与任务执行状态有关的数据。 Context information is data stored in the register of the CPU when the task execution or data states associated with task execution. TCB是指为了存储只有任务才有的信息而在存储器中预留的区域。 TCB is an area for storing information only task reserved only in memory. 多任务OS将执行中的任务的上下文信息保存到TCB中后,选择将分配给执行权的任务,从TCB中读出上下文信息,并将该信息加载到CPU寄存器中。 After multitask OS execution context information is saved to the TCB tasks, assign tasks to select the execution right reads out the context information from the TCB, and the information is loaded into the CPU registers. 由此,各任务以时间片为单位一点点地执行自身的处理。 Accordingly, each task as the unit of time a little bit to perform its own process.

[0006] 多任务OS具有能够高效地执行多个任务的优点,但是也具有产生与上下文信息保存/加载相对应的开销的缺点。 [0006] multitask OS has the advantage of being able to perform a plurality of tasks efficiently, it also has a disadvantage that context information save / load corresponding to the overhead. 通常多任务OS的优点远远大于与任务切换有关的开销。 The advantages of multi-tasking OS is usually far greater than the overhead associated with task switching.

[0007][专利文献I]日本特开平11-272480号公报 [0007] [Patent Document I] Japanese Patent Laid-Open Publication No. 11-272480

[0008][专利文献2]日本特开2001-75820号公报 [0008] [Patent Document 2] Japanese Laid-Open Patent Publication No. 2001-75820

[0009][非专利文献I]森久直,坂卷佳寿美,重松宏志,“用于嵌入式控制系统的实时OS的硬件实现”(“組込办制御'> 7亍A向汁'J 了斤夕4 A OS乃O—卜''々工7化(Hardwareimplementat1n of a read-time operating system for embedded control system),,),东京都立产业技术研究所研究报告,日本,2005年8月4日(收稿),8,p.55-58。 [0009] [Patent Document I] Mori long straight, Sakamaki good Sumi, Shigematsu Hongzhi, "real-time OS for embedded control system hardware implementation" ( "group includes the postage do imperial system '> 7 right foot A To juice' J a 4 A OS Xi jin is the O- Bu '' 々 work of 7 (Hardwareimplementat1n of a read-time operating system for embedded control system) ,,), Tokyo Metropolitan industrial technology Research Institute research report, Japan, August 4, 2005 (Received), 8, p.55-58.

发明内容 SUMMARY

[0010] 本发明要解决的问题 [0010] Problems to be solved by the present invention

[0011] 近年来,严格要求在规定时间内完成处理的实时OS (以下称作“RT0S (Real-TimeOperating System)”)被特别广泛地应用于嵌入式系统(Embedded System)中。 [0011] In recent years, the stringent requirements of real-time OS processing is completed within a predetermined time (hereinafter referred to as "RT0S (Real-TimeOperating System)") is particularly widely used in embedded systems (Embedded System) in. 在这种时间要求严格的RT0S中,存在任务切换时的开销大大影响系统整体性能的情况。 In this strict time requirement RT0S, there are cases when the task switching overhead significantly affect the overall system performance. 本发明人意识到:为了进一步提高多任务处理的效率,需要降低与任务切换有关的开销。 The present inventors have realized that: In order to further improve the efficiency of multi-tasking, it is necessary to reduce the overhead associated with task switching.

[0012] 本发明是鉴于上述问题而作出的,其主要目的在于提供一种用于在多任务处理中更高效地控制任务执行的技术。 [0012] The present invention is made in view of the above, the main purpose is to provide a more efficient task execution control in multitasking process.

[0013] 用于解决问题的手段 [0013] Solution to Problem

[0014] 本发明的一个方面涉及一种任务处理装置。 [0014] One aspect of the invention pertains to a task processing apparatus.

[0015] 所述任务处理装置包括处理寄存器、将数据从存储器加载到所述处理寄存器中并按照该处理寄存器中的所述数据执行任务的执行控制电路、分别与多个任务对应的多个保存寄存器、以及任务控制电路; [0015] The task processing apparatus comprises a processing register, load data from memory to the processing and control circuit according to the execution of the tasks of the data processing register respectively with the plurality of storage registers corresponding to the plurality of tasks register, and a task control circuit;

[0016] 当执行规定的系统调用命令时,执行控制电路将通知所述任务控制电路; [0016] When executing a predetermined system call instruction, the execution control circuit notifies the task control circuit;

[0017] 当收到系统调用命令执行通知时,任务控制电路将所述处理寄存器中的所述数据保存到与执行中的任务相对应的保存寄存器中,接着选择下一个应被执行的任务,并将与所选择任务相对应的保存寄存器中的数据加载到所述处理寄存器中,从而切换执行对象的任务。 [0017] When a system call instruction execution notification is received, the task control circuit to store the processed data to a register in the execution of the task corresponding to the holding register, then select the next task to be executed, and loading the selected data storage register corresponding to the task is to register the processing, thereby switching the task execution object.

[0018] 加载到所述处理寄存器中的数据可以包括:命令(instruct1n)和操作数、不具有操作数的命令、或者诸如程序计数器或堆栈指针的简单数据。 [0018] The data loaded into the processing register may include: a command (instruct1n) and operands, the operand does not have a command, such as a program counter or a stack pointer or a simple data. 根据这种处理方法,通过在对应每个任务的保存寄存器和执行用处理寄存器之间适当调换上下文信息,能够实现上下文信息的保存及加载。 According to this processing method, by appropriately swap context information between the save registers corresponding to each task and the execution processing register, enables saving and loading context information. 由于这样实质上不需要为了处理寄存器中数据的保存/加载而访问TCB,因此实现了高速的任务切换。 Since such processing is substantially not necessary to save the data in the register / loading access and TCB, thus achieving high-speed task switching.

[0019] 此外,以上结构要素的任意组合、以及通过方法、系统、记录介质、计算机程序来表现本发明的实现方式,也可以作为本发明的有效方式。 [0019] Further, any combination of the aforementioned constituting elements, and by a method, system, recording medium, computer program implementation of the present invention exhibit, may be used as an effective embodiment of the present invention.

[0020] 本发明的有益效果 [0020] Advantageous effects of the present invention.

[0021] 根据本发明,能够在多任务处理中更高效地控制任务执行。 [0021] According to the present invention, it is possible to more efficiently perform tasks in multitasking.

附图说明 BRIEF DESCRIPTION

[0022] 图1为任务的状态转换图; [0022] FIG. 1 is a state transition diagram of the task;

[0023] 图2为普通RT0S的概念图; [0023] FIG. 2 is a conceptual diagram of an ordinary RT0S;

[0024] 图3为执行软件RT0S的普通CPU的电路图; [0024] FIG. 3 is a circuit diagram of a common CPU is executing software RT0S;

[0025] 图4为一个实施例中的RT0S的概念图; [0025] FIG. 4 is a conceptual diagram of RT0S embodiment;

[0026] 图5为本实施例中的任务处理装置的电路图; [0026] FIG. 5 is a circuit diagram of the task processing apparatus in the embodiment;

[0027] 图6为图5所示CPU的电路图; [0027] FIG. 6 is a circuit diagram of the CPU shown in FIG 5;

[0028] 图7为表示执行控制电路152使CPU时钟停止的构造的电路图; [0028] FIG. 7 is a circuit diagram showing the implementation of control circuit 152 halts the CPU clock of the configuration;

[0029] 图8(a)为表示中断请求信号发生时各种信号之间关系的时序图; [0029] FIG. 8 (a) is a chart showing the relation between signals when an interrupt request signal occurs;

[0030] 图8 (b)为表不执行系统调用时各种/[目号之间关系的时序图; [0030] FIG. 8 (b) showing the relationship between the timing of various mesh number / [a system call table is not performed;

[0031] 图9为用于说明流水线(pipeline)处理中CPU时钟停止时刻的示意图; [0031] FIG. 9 is a view for explaining pipeline (Pipeline) schematic CPU clock stop time of treatment;

[0032] 图10为表不状态存储单兀和任务切换电路之间关系的电路图; [0032] FIG. 10 is a circuit diagram showing the relationship between the circuit status table storing unit Wu and not task switching;

[0033] 图11为表示普通RT0S进行RUN-任务选择时所采用的任务就绪表的图; [0033] FIG. 11 is a diagram showing an ordinary RT0S RUN- task selection task ready list used;

[0034] 图12为执行选择电路的电路图; [0034] FIG. 12 is a circuit diagram of the execution selection circuit;

[0035] 图13为表示普通RT0S进行信号量(Semaphore)处理时所采用的等待信号量表(wait semaphore list)的图; [0035] FIG 13 is a signal representing an average amount RT0S (Semaphore) processing wait semaphore list used (wait semaphore list) FIG;

[0036] 图14为信号量选择电路的电路图; [0036] FIG 14 is a signal selection circuit diagram amount;

[0037] 图15为任务切换电路的状态转换图; [0037] FIG. 15 is a state transition diagram of the task switching circuit;

[0038] 图16为图5所示的任务处理装置中未配置任务控制电路时的任务处理装置的电路图; [0038] FIG. 16 is a task processing device shown in FIG. 5, a circuit diagram of the task processing device when the task control circuit is not configured;

[0039] 图17为图5所示的任务处理装置中未配置保存电路时的任务处理装置的电路图。 [0039] FIG. 17 is a task processing device shown in FIG. 5, a circuit diagram of the task processing device when the storage circuit is not configured.

具体实施方式 detailed description

[0040] 本发明实施例所示的任务处理装置100由电子电路来实现多任务0S的任务调度功能。 Task processing apparatus of the embodiment shown in [0040] the present invention, an electronic circuit 100 by a multitask 0S task scheduling function. 在详细说明任务处理装置100之前,首先参照图1说明任务的状态转换。 Before explaining the task processing apparatus 100, with reference to the state of FIG. 1 is first converted description of the task. 这里虽然是对普通多任务0S中的任务状态转换进行说明,但是这些说明对于任务处理装置100中的任务状态转换同样适用。 Although the state is a task in a commonly used multitask 0S conversion will be described, such description for the task state conversion task processing apparatus 100 are equally applicable. 另外,还对在任务处理装置100中执行的系统调用进行概述。 In addition, the system also performed in the task processing apparatus 100 calls overview. 在参照图2和图3描述普通多任务0S的设计思想的基础上,参照图4至图10详细描述本实施例中的任务处理装置100的处理方法。 Upon reference to Figures 2 and 3 design described in a commonly used multitask 0S on the processing method of the task processing apparatus 100 of the embodiment of the present embodiment is described in detail with reference to FIGS. 4 to 10. 并且,对于与信号量或互斥(Mutex)、事件等有关的处理,也适当通过与一般技术进行比较来说明任务处理装置100的特征。 And, for a semaphore or mutex (the Mutex), processing related events, but also by comparison with appropriate general technique will be described wherein the task processing device 100.

[0041] 任务的状态转换 State [0041]-task

[0042] 图1是任务的状态转换图。 [0042] FIG. 1 is a state transition diagram of the task. 在多任务处理中,各任务都具有“状态(State)”。 In multitasking, each task has "state (State)". 各任务在多个状态之间转换,通常是处于某一个状态。 Each task between a plurality of state transitions, typically in a certain state. 状态转换由“系统调用的执行”和“检测出中断请求信号”来触发。 State transition from the "system call execution" and the "detected interrupt request signal" to trigger. 系统调用是各任务执行的命令中的特殊命令。 System call is a command to perform each task in a special order. 中断请求信号是在按下键盘或点击鼠标、接收通信数据等从外围设备接收规定数据时发生的信号。 Signal occurs at the press of a keyboard or a mouse click, receiving communication data from the received data a predetermined peripheral interrupt request. 当然,当分配给各任务的时间片耗尽时也发生状态转换。 Of course, when the state transition time slots assigned to each task depletion also occurs.

[0043] 任务大致分为“常规任务”和“特殊任务”。 [0043] Task roughly divided into "routine tasks" and "special mission." 常规任务是响应系统调用而执行的非特殊任务。 Non-routine tasks and special tasks in response to execution of the system call. 特殊任务是响应检测出中断请求信号而执行的任务,即所谓的中断处理程序。 Special tasks are tasks in response to detecting the interrupt request signal is performed, i.e., a so-called interrupt handler. 首先描述各个任务状态,然后说明各种系统调用命令。 First description of each task state and then illustrating various system calls.

[0044] (1) STOP状态(休眠状态) [0044] (1) STOP state (sleep state)

[0045] 表示任务处于休眠状态。 [0045] indicates that the task is dormant. 常规任务和特殊任务都能够处于STOP状态。 Routine tasks and special tasks can assume the STOP state. 以下将处于STOP状态的任务称作“STOP-任务”。 The following tasks will be in the STOP state called "STOP- task."

[0046] 1-1.常规任务 [0046] 1-1. Common Tasks

[0047] 当其它任务执行指示启动另一项任务的系统调用(以下称作“启动系统调用”)时,处于STOP状态的常规任务转换到后述的READY状态。 [0047] When other activation system call task execution instruction of another task (hereinafter, referred to as "activation system call"), the routine task in the STOP state transition to the READY state described later.

[0048] 1-2.特殊任务 [0048] 1-2. Special Tasks

[0049] 特殊任务通常处于STOP状态。 [0049] special task usually is in STOP. 当通过后述的任务切换电路210检测出中断请求信号时,特殊任务从STOP状态转换到后述的RUN状态。 As described later task switching circuit 210 detects an interrupt request signal, a special task makes a transition from the STOP state to the RUN state will be described later. 此时原来处于RUN状态的任务转换到READY状态。 At this point the original task in the RUN state makes a transition to the READY state.

[0050] (2) RUN状态(执行状态) [0050] (2) RUN state (execution state)

[0051] 表示任务正在执行中,即任务被分配了时间片,获得了CPU的使用权的状态。 [0051] indicates the task being performed, that task is assigned a time slice, the state obtained the right to use the CPU. 常规任务和特殊任务都能够处于RUN状态。 Routine tasks and special tasks can assume the RUN state. 以下将处于RUN状态的任务称作“RUN-任务”。 The following tasks will be in the RUN state is called "RUN- task." 多个任务中处于RUN状态的任务始终只能有一个,而不能有两个任务同时处于RUN状态。 A plurality of tasks in the RUN state is always only one, not two tasks at the same time in the RUN state.

[0052] 2-1.常规任务 [0052] 2-1. Common Tasks

[0053] 当执行规定的系统调用时,处于RUN状态的常规任务从RUN状态转换到READY状态或者后述的WAIT状态。 WAIT state described later [0053] When executing a predetermined system call, the routine task in the RUN state transition from RUN to READY or. 处于RUN状态的常规任务在耗尽时间片时,也转换到READY状态。 Common tasks in the RUN state in the depletion time slice, also a transition to READY. 在任意一种情况下,原来处于READY状态的常规任务转换到RUN状态,来替代原来处于RUN状态的常规任务。 In either case, the original routine task in the READY state makes a transition to the RUN state, to replace the conventional task formerly in the RUN state. 当检测出中断请求信号时,RUN-任务转换到READY状态。 When the interrupt request signal is detected, a RUN-task makes a transition to the READY state. 此时,原先处于STOP状态的特殊任务转换到RUN状态。 In this case, the special task formerly in the STOP state makes a transition to the RUN state.

[0054] 当RUN-任务执行使自身结束的系统调用(以下称作“结束系统调用”)时,该RUN-任务转换到STOP状态。 [0054] When the task execution RUN- system call to make their ends (hereinafter "end of the system call"), the transition to the STOP state RUN- task.

[0055] 2-2.特殊任务 [0055] 2-2. Special Tasks

[0056] 当根据中断请求信号从STOP状态转换到RUN状态的特殊任务完成自身处理时,返回到STOP状态。 [0056] Upon completion of the interrupt processing in accordance with its own specific task request signal from the STOP state to the RUN state, returns to the STOP state. 特殊任务只能够处于STOP状态和RUN状态。 Special tasks can only state in the STOP and RUN state.

[0057] (3) READY状态(可执行状态) [0057] (3) READY state (executable state)

[0058] 表示任务处于可被执行的状态。 [0058] indicates that the task can be executed in the state. 如果处于READY状态的任务从0S得到执行权,则随时都能够转换到RUN状态。 If the task in the READY state to be implemented right from 0S, you can always switch to the RUN state. 只有常规任务可以处于READY状态。 Only routine task in the READY state. 以下将处于READY状态的任务称作“READY-任务”。 The following tasks will be in the READY state called "READY- task."

[0059] 当原先处于RUN状态的常规任务由于系统调用的执行而转换到RUN状态以外的状态时,或者当处于RUN状态的特殊任务完成自身处理而转换到STOP状态时,READY-任务进而转换到RUN状态。 When [0059] When the state of the original routine task in the RUN state due to the execution of a system call is converted to a state other than RUN, or when a special task in the RUN state complete its transition to the STOP state process, among the READY-tasks and then converted to RUN state. 常规任务只能从READY状态来转换到RUN状态。 Common tasks can only be converted from READY to RUN. 当有多个处于READY状态的任务时,根据作为上下文信息的一部分的任务优先级,使某一个READY-任务转换到RUN状态。 When a plurality of tasks in the READY state, according to the task priority as part of the context information, so that a certain task makes a transition to the RUN state READY-. 当有多个任务优先级相同的READY-任务时,最先转换到READY状态的任务转换到RUN状态。 When there are multiple tasks with the same priority READY- task, the first task of the transition to the READY state transition to the RUN state.

[0060] ⑷WAIT状态(待机状态) [0060] ⑷WAIT state (standby state)

[0061] 表示等待规定的WAIT解除条件满足的状态。 [0061] represents a predetermined waiting state WAIT cancellation condition is satisfied. 当WAIT解除条件满足时,处于WAIT状态的任务转换到READY状态。 When the WAIT cancellation condition is fulfilled, the task in the WAIT state makes a transition to the READY state. 只有常规任务能够处于WAIT状态。 Only routine tasks can be in WAIT state. 以下将处于WAIT状态的任务称作“WAIT-任务”。 The following tasks will be in WAIT state called "WAIT- task." 关于WAIT解除条件将在后面详述。 About WAIT cancellation condition will be detailed later.

[0062] 综上所述,只有当任务处于RUN状态时,才能够使用CPU来执行其处理。 [0062] In summary, only when the task in the RUN state, to be able to perform its processing using the CPU. RT0S 一边管理多个任务的状态一边适当切换RUN-任务。 RT0S while managing multiple tasks appropriate state while switching RUN- task. 由此,实现CPU总是执行某个任务的处理方式。 Thus, the CPU is always performed to achieve a task handled.

[0063] 系统调用 [0063] System Calls

[0064] 下面附带说明一下系统调用。 [0064] The following additional description of system calls. 系统调用大致分为“启动系列”、“WAIT系列”和“SET系列”三种。 System calls broadly divided into "Start series", "WAIT Series" and "SET" series of three.

[0065] (1)启动系列系统调用 [0065] (1) family of system calls start

[0066]启动系列系统调用是与在STOP状态和READY状态之间进行的转换相关联的系统调用。 [0066] system call is a call to start the series with the system associated with the conversion carried out between the state and the STOP READY state.

[0067] 1_1.启动系统调用 [0067] 1_1 Start system call

[0068]启动系统调用是作为RUN-任务的任务A使另一项常规任务B启动的系统调用。 [0068] The activation system call task is a task RUN- A common task of the system B to start another call. 此时,处于STOP状态的常规任务B转换到READY状态。 In this case, the conventional task B in the STOP state makes a transition to the READY state.

[0069] 1-2.结束系统调用 [0069] 1-2. End System Call

[0070] 执行该系统调用的任务结束自身处理,并从RUN状态转换到STOP状态。 [0070] The task execution system call itself the end of treatment, and a transition from RUN to STOP. 结束系统调用也可以是某项任务使另一项任务结束的命令。 End system call can also be a task for the command end of another task.

[0071] (2) WAIT系列系统调用 [0071] (2) WAIT system call Series

[0072] WAIT系列系统调用是与在RUN状态和WAIT状态之间进行的转换相关联的系统调用。 [0072] WAIT series of system calls are calls associated with the system conversion carried out between the state and the WAIT state RUN.

[0073] 2-1.等待信号量系统调用 [0073] 2-1. Wait semaphore system call

[0074] 等待信号量系统调用是请求获得信号量(后述)的系统调用。 [0074] wait semaphore system call is a request to obtain a semaphore (described later) system call.

[0075] 2-2.等待互斥系统调用 [0075] 2-2. Wait mutex system call

[0076] 等待互斥系统调用是请求获得互斥(后述)的系统调用。 [0076] a wait mutex system call is a request mutex (described later) system call.

[0077] 2-3.等待事件系统调用 [0077] 2-3. Wait event system call

[0078] 等待事件系统调用是等待建立事件(后述)的系统调用。 [0078] wait event system call to wait for the establishment of an event (to be described later) system call. 为了执行,等待事件系统调用接收事件ID、等待标记模式(后述)和标记条件(后述)作为参数。 In order to perform, a wait event system call received event ID, wait flag pattern (described later) and a flag condition (described later) as parameters.

[0079] 在任何一种情况下,WAIT系列系统调用都设定各种WAIT解除条件。 [0079] In either case, WAIT series of system calls to set various WAIT cancellation condition. 如果在执行WAIT系列系统调用时已经满足WAIT解除条件,已执行所述系统调用的RUN-任务转换到READY状态。 If in the implementation of the system call to WAIT WAIT cancellation condition has been met, the task has been performed RUN- system calls a transition to READY. 同时,当不满足WAIT解除条件时,RUN-任务转换到等待满足WAIT解除条件的WAIT状态。 Meanwhile, when the WAIT cancellation condition is not satisfied, RUN- conversion tasks to meet the waiting state WAIT WAIT cancellation condition.

[0080] (3) SET系列系统调用 [0080] (3) SET family of system calls

[0081] SET系列系统调用是与在WAIT状态和READY状态之间进行的转换相关联的系统调用。 [0081] SET are calls a system call system associated with the conversion is performed between the WAIT state and the READY state. SET系列系统调用的执行触发WAIT解除条件的建立。 SET series system call trigger WAIT cancellation condition is established.

[0082] 3-1.释放(release)信号量系统调用 [0082] 3-1. Release (release) semaphore system call

[0083] 其是释放信号量的系统调用。 [0083] which is a release semaphore system call.

[0084] 3-2.释放互斥系统调用 [0084] 3-2. Release mutex system call

[0085] 其是释放互斥的系统调用。 [0085] which is a release mutex system call.

[0086] 3-3.设定事件(Set Event)系统调用 [0086] 3-3. Setting event (Set Event) system call

[0087] 其是建立事件的当前标记模式(后述)的系统调用。 [0087] The event which is to establish a current flag pattern (described later) system call.

[0088] 3-4.清除标记系统调用 [0088] 3-4. Clear labeling system calls

[0089] 其是用于将当前标记模式清零的系统调用。 [0089] which is used to clear the current flag pattern of the system call.

[0090] 在对本实施例进行说明时,假设采用了以上9种系统调用。 [0090] When the present embodiment will be described, assuming the above nine kinds of system calls. 除此之外,当然还能够实现其他的各种系统调用。 In addition, of course, also enables various other system calls.

[0091] 普通RT0S的设计思想 Design [0091] The general RT0S

[0092] 图2是普通RT0S的概念图。 [0092] FIG. 2 is a conceptual diagram of the ordinary RT0S.

[0093] 图示的RT0S是多任务0S。 [0093] The illustrated RT0S multitasking 0S. 普通RT0S是以软件实现的。 Ordinary RT0S is implemented in software. 下面以从任务A向任务B切换RUN-任务的情况为例进行说明。 Below handover RUN- tasks from task A to task B will be described as an example. 由于任务A占用着CPU,因此RT0S向CPU申请中断,以从任务A取得CPU的使用权。 As the task A occupied by the CPU, so RT0S apply to the CPU interrupt, in order to obtain the right to use the CPU from the task A. 在此基础上,RT0S将任务A的上下文信息保存到TCB中。 On this basis, RT0S A mission to save the context information to the TCB. RT0S选择任务B作为下一个RUN-任务,并将上下文信息从任务B的TCB加载到CPU的寄存器中。 RT0S selected task B as the next RUN- task and loads the context information from the TCB for task B into the register of the CPU. 当加载完成时,RT0S将CPU的使用权移交给任务B。 When the load is complete, RT0S to transfer the right to use the CPU to task B. 由此,通过暂时获取CPU的使用权,RT0S执行从任务A向任务B的任务切换。 Accordingly, by temporarily acquiring the right to use the CPU, RT0S switching from task A to task B task. 对于特殊任务的执行也是相同的,这种情况下,也是通过将RUN-任务的上下文信息保存到TCB中后,将CPU的使用权移交给特殊任务来实现任务切换。 For the special mission is the same, in this case, but also by saving the RUN- task context information to the TCB, the transfer of the right to use the CPU to achieve specific tasks to task switching.

[0094] 因为RT0S是以软件实现的,因此为了执行自身处理,RT0S需要CPU的使用权。 [0094] Since RT0S is implemented in software, so in order to perform its own processing, RT0S need to use the right CPU. 换句话说,RTOS和任务在CPU的使用权上是竞争关系。 In other words, RTOS and task is to compete in the use of the CPU. 以下将这样通过软件实现的RTOS称作“软件RTOS”。 The thus referred to as "Software RTOS" by RTOS software implementation.

[0095] 图3是执行软件RT0S的普通CPU的电路图。 [0095] FIG. 3 is a circuit diagram of a common CPU is executing software RT0S.

[0096] CPU 84包括:执行控制电路90,用于总体地控制存储器访问、命令执行等;处理寄存器组92,用于存储如任务的上下文信息等的各种数据;以及运算电路94,用于执行运算。 [0096] CPU 84 includes: execution control circuit 90 for controlling the overall memory access command execution; processing register set 92, various data and the like for storing context information such as task; and an arithmetic circuit 94, for the operation is performed. 处理寄存器组92是多种寄存器的组合,大致分为特殊寄存器88和通用寄存器86。 Processing register set 92 is a combination of a plurality of registers, special registers roughly classified into general purpose registers 88 and 86. 特殊寄存器88是存储程序计数器、堆栈指针以及标记等的寄存器。 Special registers 88 are registers storing a program counter, stack pointer, and mark the like. 通用寄存器86是存储作业用数据的寄存器,包括R0〜R15共16个寄存器。 General-purpose registers 86 are registers storing the job data, including R0~R15 total of 16 registers. 特殊寄存器88存在用户用和系统用两面,但是通用寄存器86只有一面。 88 registers with the presence of particular users and systems on both sides, but only one side 86 of general register. 以下将存储在处理寄存器组92中的数据称作“处理数据”。 Hereinafter, data stored in the processing register set 92 is referred to as "data processing."

[0097] 执行控制电路90利用指示输出选择器98的控制信号(CTRL),将处理寄存器组92中所期望的寄存器的处理数据输出到运算电路94中。 Output [0097] The execution control circuit 90 using a control signal (CTRL) indicates the output of the selector 98, the process register set 92 registers a desired processed data to the arithmetic circuit 94. 运算电路94按照该处理数据,即命令和变量,来执行运算。 Arithmetic processing circuit 94 in accordance with the data, i.e. commands and variables to perform calculations. 运算结果向输入选择器96输出。 It outputs the calculated result to the input selector 96. 执行控制电路90利用指示输入选择器96的控制信号(CTRL),向处理寄存器组92中所期望的寄存器输入运算结果。 The execution control circuit 90 using the instruction input selector control signal (CTRL) 96, and input to the calculation result of the processing register set 92 in a desired register.

[0098] 另外,执行控制电路90通过CPU数据总线从存储器中读出数据,并通过输入选择器96将该数据适时加载到处理寄存器组92中。 [0098] Further, the execution control circuit 90 CPU data bus is read from the memory, and timely loaded into the processing register set 92 via the input selector 96 via the data. 执行控制电路90同样通过该CPU数据总线将处理数据适时记录到存储器中。 The execution control circuit 90 similarly through the CPU data bus to process data recorded in the memory in a timely manner. 执行控制电路90—边更新特殊寄存器88中的程序计数器,一边执行任务。 90- execution control circuit updates the program counter edge in the special registers 88, while tasks.

[0099] 当发生任务切换时,执行控制电路90将处理数据保存到存储器中预留的区域即TCB中。 Save [0099] When a task switch occurs, the control circuit 90 performs processing data to the memory area that is reserved in the TCB. 如果任务A执行系统调用,则认为发生了从任务A到任务B的任务切换。 A system call if the task is considered to occur from task to task B A task switch. 系统调用的执行触发RT0S获取CPU的使用权,因此CPU 84将暂时按照RT0S的程序来运行,其处理过程如下: System call trigger RT0S obtain the right to use the CPU, so the CPU 84 will temporarily be run in accordance with RT0S program, its process is as follows:

[0100] <任务A的上下文信息的保存> [0100] <saved context information of task A>

[0101] 1.执行控制电路90将特殊寄存器88从用户用切换到系统用。 [0101] 1. The execution control circuit 90 from the special register 88 to the switching systems by a user. 向系统用特殊寄存器88中加载RT0S处理用的处理数据。 Loading processing data RT0S treated with special registers 88 put to the system.

[0102] 2.执行控制电路90将通用寄存器86中的数据保存到未示出的堆栈中。 [0102] 2. The execution control circuit 90 saves the data in the general register 86 to the stack is not shown.

[0103] 3.执行控制电路90将用于RT0S的处理数据从未示出的记录介质中,例如其它寄存器中,加载到通用寄存器86中。 [0103] 3. The execution control circuit 90 for processing the data recording medium RT0S never been shown, for example, the other register is loaded into a general register 86. 在该阶段,处理寄存器组92中的处理数据被完全替换为RT0S用的处理数据。 At this stage, the data processing in the processing register set 92 is completely replaced with the processed data RT0S.

[0104] 4.RT0S从存储器中识别出任务A的TCB,并将保存在堆栈中的处理数据写入该TCB中。 [0104] 4.RT0S identification from memory TCB for task A, and writes the process data saved in the TCB in the stack. 另外,用户用特殊寄存器88中的处理数据也作为上下文信息的一部分写入该TCB中。 Further, the user data processed by the special register 88 is also written in the TCB as part of the context information. 由此,任务A的处理数据被保存到该TCB中。 Thus, the process data for task A to be saved in the TCB. RT0S将任务A已从“RUN”状态转换到“READY (或者WAIT) ”状态的情况记录在任务A的TCB中。 A case RT0S conversion task from "RUN" state to the "READY (or WAIT)" state is recorded in the TCB for task A's.

[0105] <任务B的上下文信息的加载> [0105] <Loading of context information of task B>

[0106] 1.RT0S从存储器中识别出任务B的TCB,并将该TCB中的上下文信息写入堆栈和用户用特殊寄存器88中。 [0106] 1.RT0S identification from memory TCB for task B, and writes the user stack and the special register 88 with the context information in the TCB. RT0S将任务B已从“READY”状态转换到“RUN”状态的情况记录在任务B的TCB中。 B case RT0S conversion task from "READY" state to the "RUN" state of the record in TCB task B's.

[0107] 2.RT0S将RT0S处理用数据从通用寄存器86保存到未示出的记录介质中。 [0107] 2.RT0S RT0S the processing from general purpose registers 86 to save data to a recording medium not shown.

[0108] 3.执行控制电路90将堆栈中的上下文信息加载到通用寄存器86中。 [0108] 3. The execution control circuit 90 loads the context information in the stack into the general-purpose register 86. 执行控制电路90将特殊寄存器88从系统用切换到用户用。 The execution control circuit 90 with the special register 88 to switch from a system with a user. 由此,任务B的处理数据被加载到处理寄存器组92中。 Thus, the process data for task B is loaded into the processing register set 92.

[0109] 经过如上所述的处理过程,实现了任务切换。 [0109] After the processing described above, to achieve the task switching. 通常通用寄存器86是一面结构,因此为了切换任务用的处理数据和RT0S用的处理数据而使用堆栈。 General-purpose registers 86 is generally the side structure, to process data for task switching and processing of data with RT0S used with the stack. 如果通用寄存器86也是两面,则将无需通过堆栈来保存/加载数据,因此能够实现更高速的任务切换。 If both sides of the general register 86 is, through the stack will not need to save / load data, it is possible to realize higher-speed task switching.

[0110] 在本实施例中,还通过为每个任务设置保存寄存器110,来实现更高速的任务切换。 [0110] In the present embodiment, it is also provided by the save register 110 for each task, the task to achieve faster switching. 使用保存寄存器110的任务切换,将参照图5进行详述。 Using the save registers 110, the task switching will be described in detail with reference to FIG. 在参照图3说明的CPU 84和普通软件RT0S中,在进行任务切换时频繁地访问TCB。 In the CPU 84 and the commonly used software RT0S 3 described with reference to the drawing, when performing task switching TCB access frequently. 在上述例子中,是以从任务A向任务B进行任务切换为例进行的说明,但是实际上,RT0S为了选择下面应执行的任务B也需要执行很多命令。 In the above example, is performed from task A to task B illustrate an example of task switching, but in practice, RT0S B to select the next task to be executed have to perform many commands. 此时,RT0S将频繁地访问存储器。 At this time, RT0S frequent memory access. 通过采用后述的专门用于任务选择的任务控制电路200,本实施例中的任务处理装置100实现了更高速的任务切换。 Dedicated to the task by the task selection adopting the control circuit 200 described later, the present embodiment of the task processing apparatus 100 achieved faster task switching.

[0111] 根据任务处理装置100的RT0S硬件实现 [0111] The RT0S hardware implemented task processing apparatus 100

[0112] 图4是本实施例中的RT0S的概念图。 [0112] FIG. 4 is a conceptual diagram of the embodiment of the present RT0S.

[0113] 与普通软件RT0S不同,本实施例中的RT0S主要是以与CPU分离的硬件来实现的。 [0113] RT0S different from ordinary software, mainly from the CPU hardware implemented in the embodiment of the present embodiment RT0S. 以下将由硬件实现的RT0S称作“硬件RT0S”。 The following will be implemented in hardware RT0S called "hardware RT0S." 由于本实施例的RT0S主要是与CPU分离的硬件,因此为了执行自身处理,则实质上基本不需要CPU的使用权。 Since RT0S embodiment of the present embodiment is separate from the main CPU hardware, in order to perform its own process and therefore, it is not necessary to use a substantially substantially of the CPU. 换句话说,RT0S和任务在CPU的使用权上基本不是竞争关系。 In other words, RT0S and fundamental task is not competing in the use of the CPU. 在图2所示的普通软件RT0S中,CPU既是任务执行用电路,还是RT0S执行用电路。 In general software RT0S shown in FIG. 2, the CPU circuit for performing both tasks, or RT0S execution circuit. 相反地,在本实施例的硬件RT0S中,CPU明确为任务执行电路。 In contrast, in the embodiment RT0S hardware of this, the CPU circuit specifically for the task execution. 任务调度功能主要由后述的保存电路120和任务控制电路200来实现。 Hold circuit mainly task scheduling function 120 described later and the task control circuit 200 is achieved.

[0114] 图5是本实施例中的任务处理装置100的电路图。 [0114] FIG. 5 is a circuit diagram of the task processing device 100 in the present embodiment.

[0115] 除了CPU 150之外,任务处理装置100还包括保存电路120和任务控制电路200。 [0115] In addition to the CPU 150, the task processing apparatus 100 further includes a storage circuit 120 and the task control circuit 200. CPU 150是任务的执行主体。 CPU 150 is to perform the main task. 保存电路120和任务控制电路200是起到图4所示的RT0S的作用的电路。 Save circuit 120 and the task control circuit 200 is a circuit acting RT0S functions shown in FIG. 4. 任务调度处理是由任务控制电路200来主导的。 Task scheduling by the task control circuit 200 to lead the.

[0116] CPU 150包括执行控制电路152、处理寄存器组154以及运算电路160。 [0116] CPU 150 includes execution control circuit 152, a processing register set 154, and the arithmetic circuit 160. CPU 150可以是参照图3说明的普通CPU。 CPU 150 may be described with reference to a common CPU 3 of FIG. 但是,本实施例中的CPU 150的信号线连接方式与图3所示的CPU 84的信号线连接方式不同。 However, in the embodiment of the signal line connection to the CPU 150 of the present embodiment different from FIG signal line connection CPU 84 shown in Figure 3. 对于具体的电路结构,将参照下面的图6进行详述。 For the specific circuit configuration, with reference to FIG. 6 described in detail below.

[0117] 任务控制电路200包括任务切换电路210、信号量表212、事件表214、任务选择电路230以及状态存储单元220。 [0117] task control circuit 200 includes a task switching circuit 210, a semaphore table 212, an event table 214, the task selecting circuit 230, and state storage units 220. 对于信号量表212和事件表214,将参照图13及其后图进行详述。 The signal table 212 and event table 214, with reference to FIG. 13 and described in detail later in FIG. 状态存储单元220是与每个任务相对应的单元。 State storage unit 220 is a unit corresponding to each task. 以下将与任务A对应的状态存储单元220表示为“状态存储单元220_A”。 The following tasks corresponding to the A-state storage unit 220 is represented as "state storage unit 220_A." 各状态存储单元220存储对应任务的状态数据。 Each state of the state data storage unit 220 stores the corresponding task. 状态数据是指上下文信息中的特别是任务优先级或任务状态等表示任务属性的信息。 Status data means that context information, particularly information on the task priority or the like showing the task status of the task properties. 对于具体的数据内容,将在后面参照图10进行说明。 For the specific content data, which will be described later with reference to FIG 10. 全部任务的全部状态数据从各状态存储单元220中不断地输出到任务选择电路230中。 All of the state data continuously output all the tasks from each state storage unit 220 to the task selecting circuit 230. 任务选择电路230是根据各任务的状态数据进行如RUN-任务选择等的各种任务选择的电路。 The task selecting circuit 230 is a circuit such as the task selection RUN- various tasks each task selected according to the state data. 对于任务选择电路230,将参照图10及其后图进行详述。 For the task selecting circuit 230 will be described in detail later with reference to FIG. 10 and FIG. 当检测出从执行控制电路152接收的系统调用信号(SC)或来自外部设备的中断请求信号(INTR)时,任务切换电路210执行任务切换。 When the detected calling signal (SC) from the system control circuit 152 performs interruption or received from an external device request signal (INTR), the task switching circuit 210 performs task switching.

[0118] 执行控制电路152在执行系统调用时,将系统调用信号(SC)发送到任务切换电路210。 [0118] When the execution control circuit 152 executes a system call, the system call signal (SC) is sent to the task switching circuit 210. 另外,当任务切换电路210检测出中断请求信号(INTR)时,任务切换电路210向执行控制电路152申请停止请求信号(HR)。 Further, when the task switching circuit 210 detects an interrupt request signal (the INTR), the task switching circuit 210 control circuit 152 halt request signal (HR) to perform. 当CPU 150的操作停止时,执行控制电路152向任务切换电路210申请停止完成信号(HC)。 When the operation of the CPU 150 is stopped, the control circuit 152 performs the task switching circuit 210 to a halt completion signal (HC). 通过这三种信号,CPU 150和任务控制电路200将能够进行配合操作。 By these three signals, CPU 150 and the task control circuit 200 will be able to operate with.

[0119] 保存电路120包括加载选择电路112以及多个保存寄存器110。 [0119] preservation circuit 120 includes a load selection circuit 112 and a plurality of save registers 110. 保存寄存器110也是与每个任务相对应的单元,是用于保存处理寄存器组154中的处理数据的寄存器组。 Save registers 110 is the unit corresponding to each task, the register set for processing data saving processing register set 154. 因而,保存寄存器110具有与处理寄存器组154相等以上的数据容量。 Thus, save register 110 has a data capacity equal to the processing register set 154 or more. 以下将与任务A对应的保存寄存器110表示为“保存寄存器110_A”。 A represents a task will save register 110 corresponding to the "save register 110_A." 加载选择电路112接受任务切换电路210的指示,将某个保存寄存器110中的数据(以下将保存寄存器110所存储的数据称作“保存数据”)加载到处理寄存器组154中。 Load selection circuit 112 to accept the task switching circuit 210 indicates the data a stored in the register 110 (hereinafter, to save the data stored in the register 110 is referred to "saved data") loaded into the processing register set 154.

[0120] 各保存寄存器110不断地将各自的保存数据输出到加载选择电路112中。 [0120] Each save register 110 continuously outputs the respective saved data to the load selection circuit 112. 当任务切换电路210向加载选择电路112输入用于指定任务ID的任务选择信号(TS)时,加载选择电路112将与所指定任务对应的保存寄存器110中的保存数据输出到处理寄存器组154中。 When the task switching circuit 210 is inputted to the selection circuit 112 for loading the task ID of the specified task selection signal (TS), the load selection circuit 112 outputs to the processing register set 154 and the stored data corresponding to the specified task in the save register 110 . 并且,当任务切换电路210向处理寄存器组154输入写入信号(WT)时,该保存数据实际上被加载到处理寄存器组154中。 And, when the task switching circuit 210 to the processing register set 154 when the write signal input (the WT), the saved data is actually loaded into the processing register set 154.

[0121] 另一方面,处理寄存器组154中的全部处理数据也不断地被输出到全部的保存寄存器110中。 [0121] On the other hand, all of the process data in the processing register set 154 is also continuously output to the save registers 110 in all. 当任务切换电路210确认向期望的保存寄存器110发送了写入信号(WT)时,处理数据被保存到该保存寄存器110中。 When the task switching circuit when transmitting a write signal (WT) to the desired save register 210 confirms that the 110, the processing data is saved into the save register 110. 这里,连接处理寄存器组154和各保存寄存器110的总线能够一次传输的位数设定为能够并行传输处理数据。 Here the number of bits, the bus connecting the processing register set 154 can be transmitted once and stored in each register 110 is set so as to process data transmitted in parallel. 因此,任务切换电路210通过向保存寄存器110仅发送一次写入信号,就能够将处理数据一次写入保存寄存器110中。 Therefore, the task switching circuit 210 to the save registers 110 by transmitting a write signal only once, it is possible to save register 110 to a write-once processing data. 另外,连接保存寄存器110和加载选择电路112的总线以及连接加载选择电路112和CPU 150的总线的位数也同样地设定。 Further, the save registers 110 connected to the bus and the load selection circuit 112 and the bus circuit 112 and the number of bits of the CPU 150 is also connected to the load selection set.

[0122] 下面分别对系统调用和中断请求信号引起的任务切换的执行方法进行描述。 [0122] The following are system calls and interrupts the execution of the task request signals caused by the method of switching will be described.

[0123] [1]系统调用的执行 Execution [0123] [1] system calls

[0124] 当CPU 150的执行控制电路152执行系统调用时,执行控制电路152使CPU 150的时钟(以下称作“CPU时钟(CLK) ”)停止。 [0124] When the execution control circuit 152 of the CPU 150 executes a system call, the execution control circuit 152 halts the clock of the CPU 150 (hereinafter referred to as "CPU clock (CLK)") is stopped. 对于具体的停止方法,将参照图7等在后面详述。 The specific method of stopping, with reference to FIG. 7 and the like described later. 执行控制电路152将表示系统调用的执行的系统调用信号(SC)发送给任务控制电路200的任务切换电路210。 Executing a system control circuit 152 performs the system call task is sent to the task control circuit 200 of the switching circuit 210 call signal (SC). 另外,当CLK的停止完成时,执行控制电路152向任务切换电路210申请停止完成信号(HC)。 Further, when stopping the CLK is completed, the control circuit 152 performs the task switching circuit 210 to a halt completion signal (HC).

[0125] 在CPU 150和任务切换电路210之间,为了系统调用信号的传输而连接有9根信号线。 [0125] In the switching circuit 210 between the CPU 150 and the task, to transmit call signal system signal line 9 is connected. 这9根信号线与前述9种系统调用相对应。 This nine nine kinds of signal lines and the corresponding system call. 执行控制电路152根据所执行的系统调用种类,用对应的某根系统信号线传输数字脉冲。 Execution control circuit 152 in accordance with the type of system call executed by the root system of a digital signal corresponding to the pulse transmission line. 任务切换电路210通过判断是从9根系统信号线中的哪根信号线中检测出数字脉冲,来立即检测出所执行的系统调用种类。 The task switching circuit 210 is determined by the system is from 9 to which the signal lines signal lines detected digital pulse to immediately detect the type of system call executed. 任务切换电路210根据系统调用种类,从任务选择电路230输出的数据中选择所需数据,执行由系统调用所指定的处理。 The task switching circuit 210 according to the type of system call, the data output from the selecting circuit 230 to select the desired mission data, the processing designated by the system call executed. 该处理是以申请HC为条件来执行的。 The application process is conditional HC performed. 对于任务切换电路210和任务选择电路230之间的关系,将参照图10进行详述。 For the task switching circuit 210, and the relationship between the task selecting circuit 230 will be described in detail with reference to FIG. 10. 此外,该系统调用的参数和返回值写入处理寄存器组154中规定的通用寄存器158中。 In addition, this system call parameters and return values ​​are written in predetermined general-purpose register 154 in the processing register set 158. 任务切换电路210能够对通用寄存器158执行参数的读出和返回值的写入。 The task switching circuit 210 is capable of reading parameters of a general register 158 to perform a write and return values. 这里,假设作为RUN-任务的任务A执行等待信号量系统调用。 Here, it is assumed task as RUN- task A executes a wait semaphore system call. 因而,首先需要将任务A的处理数据保存。 Thus, we first need to save the data processing task A.

[0126] <任务A的上下文信息的保存> [0126] <saved context information of task A>

[0127] 执行控制电路152将表示等待信号量系统调用的SC信号输入到任务切换电路210中。 [0127] The control circuit 152 performs signal SC indicating a wait semaphore system call to the task switching input circuit 210. 执行控制电路152使CLK停止,当停止完成时申请HC。 Execution control circuit 152 halts CLK is stopped, the application is stopped when HC is completed. 任务切换电路210在向内置于任务选择电路230的各种选择电路中后述的信号量选择电路234输出成为待机对象的信号量的信号量ID后,选择下一个应执行的任务B。 When the task switching circuit 210 selects the output circuit 234 disposed inwardly in the amount of signal selection circuits selecting various tasks in circuit 230 becomes a signal amount of said standby target semaphore ID, select the next task to be executed B. 任务切换电路210向状态存储单元220_A写入规定数据。 The task switching circuit 210 writes data to a predetermined state storage unit 220_A. 例如,作为任务A的状态,从“RUN”更新为“READY”或“WAIT”。 For example, as the state of task A, from the "RUN" is updated to "READY" or "WAIT". 更具体地说,任务切换电路210在将表示任务状态“WAIT”的状态数据输出到全部状态存储单元220的基础上,只向状态存储单元220_A输入写入信号(WT_A)。 More specifically, the task switching circuit 210 indicates the status of the output task "WAIT" status data to all of the state storage unit 220 based on only the write signal (WT_A) input to the state storage unit 220_A. 由此,任务A的状态被更新。 Thus, the state of task A is updated.

[0128] 接着,任务切换电路210向保存寄存器110_A输出写入信号(WT)。 [0128] Subsequently, the task switching circuit 210 a write signal (WT) to the save register 110_A output. 由于处理寄存器组154中的处理数据不断地被输出到各保存寄存器110中,因此该写入信号(WT)使得任务A的处理数据被保存到任务A的保存寄存器110_A中。 Since the data processing register set 154 is continuously output to the save registers 110 in each, so that the write signal (WT) so that task A process data is saved to the save register 110_A for task A's.

[0129] <任务B的上下文信息的加载> [0129] <Loading of context information of task B>

[0130] 当任务A的状态数据更新、处理数据保存完成时,任务切换电路210将指定任务B的任务选择信号(TS_B)输出到加载选择电路112中。 [0130] When the state of task A data update, data saving processing is completed, the task switching circuit 210 to signal task selecting specified task B (TS_B) is output to the load selection circuit 112. 由此,保存寄存器110_B中的保存数据输出到处理寄存器组154中。 Thus, the output of the data holding register 110_B to the processing register set 154. 当任务切换电路210向处理寄存器组154输出写入信号(WT)时,任务B的保存数据被加载到处理寄存器组154中。 When the task switching circuit 210 to the processing register set 154 outputs a write signal (WT), saved data for task B is loaded into the processing register set 154. 另外,任务切换电路210还向任务B的状态存储单元220中写入规定数据。 Further state storage unit, the task switching circuit 210 to the task B 220 also writes predetermined data. 例如,任务B的状态从“READY”更新为“RUN”。 For example, the status of the task B from "READY" is updated to "RUN". 当以上处理完成时,执行控制电路152使CPU时钟恢复。 When the above process is completed, the execution control circuit 152 halts the CPU clock recovery. CPU 150根据所恢复的CPU时钟来开始执行任务B。 CPU 150 to start the task B. Depending on the CPU clock recovery 关于该处理方法的更具体细节,将在后面参照图8(b)进行描述。 More details on the processing method, will be described with reference to FIG. 8 (b) below.

[0131] [2]中断请求信号的产生 [0131] [2] interrupt request signal

[0132] 任务切换电路210检测来自外围设备的中断请求信号(INTR)。 [0132] The task switching circuit 210 detects an interrupt request signal (the INTR) from a peripheral device. 更具体地说,中断请求信号(INTR)从未示出的中断控制器发送到任务切换电路210。 More specifically, the interrupt controller interrupt request signal (the INTR) from an unillustrated switching circuit 210 is sent to the task. 表示中断请求信号(INTR)等级的参数被记录在内置于该中断控制器的寄存器中。 An interrupt request signal parameters (the INTR) built into the recording level of the interrupt controller register. 任务切换电路210向执行控制电路152申请停止请求信号(HR)后,执行控制电路152使CPU时钟停止。 Task switching circuit 210 apply to the execution control circuit 152 stops the request signal (HR), the execution control circuit 152 halts the CPU clock. 与系统调用执行时相同,任务切换电路210将RUN-任务的处理数据保存到保存寄存器110中。 The same as when performing a system call, the task switching circuit 210 to save the process data to the save RUN- task register 110. 接着,任务切换电路210启动特殊任务。 Subsequently, the task switching circuit 210 to start a special task. 与中断请求信号的参数无关而启动的特殊任务只有1种。 Special tasks independent of the parameters of the interrupt request signal and started only one kind. 该特殊任务从中断控制器的内置寄存器中读出INTR的参数,并执行与该参数相应的处理。 The special task readout parameter of INTR from the register built in the interrupt controller and performs the processing corresponding to the parameters. 该特殊任务所执行的处理,可以是设定事件系统调用或设定信号量系统调用的执行,可以是常规任务的启动。 The special processing tasks to be performed, which can be set event system call or set to perform semaphore system calls, common tasks can be started. 根据该参数,该特殊任务可以不执行任何特别处理就结束。 According to this argument, the special task may not perform any special treatment ends. 根据INTR的参数执行何种处理,是由特殊任务的实现方式来决定的。 INTR executed according to the parameters of what kind of treatment by the implementation of specific tasks to decide. 当该特殊任务的执行结束时,从READY-任务中选择出下一个RUN-任务。 When the execution of the particular task, the next selected task from READY- RUN- tasks.

[0133] 任务切换电路210将与该特殊任务对应的保存寄存器110中的处理数据加载到CPU 150中。 [0133] The task switching circuit 210 will be loaded into the CPU 150 to process data corresponding to the specific task in the save register 110. 这种从常规任务切换到特殊任务所需的时间,能够根据任务控制电路200的工作时钟来预先估计。 This switching from the normal time required for the task to a special task, the operation clock control circuit 200 can be estimated in advance according to the task. 当向执行控制电路152申请HR后,任务切换电路210的工作时钟经过规定的时间时,任务切换电路210为了解除CPU时钟的停止而取消(negate) HR。 When the HR application to the execution control circuit 152, clock circuit 210 after a predetermined operating time of a task switch, the task switching circuit 210 in order to release the CPU clock is stopped and canceled (negate) HR. 当HR被取消时,执行控制电路152使CPU时钟恢复。 When HR is canceled, the execution control circuit 152 halts the CPU clock recovery. 此时,任务切换电路210完成了从常规任务到特殊任务的任务切换。 At this time, the task switching circuit 210 to complete the routine tasks from task switching to a special task. 关于该处理方法的具体细节,将在后面参照图8(a)进行描述。 Specific details about the processing method will be described with reference to FIG. 8 (a) below.

[0134] 在任何情况下,任务切换的核心处理,即(A)处理数据的保存/加载,以及(B)任务状态转换和RUN-任务的选择,都是通过硬件来实现的。 [0134] In any case, the core processing task switching, i.e., (A) processing data saving / loading, and the task state transition and selection RUN- task (B), are realized by hardware. 在(A)和(B)中,无需访问存储器上的TCB,这对任务切换的高速化也有贡献。 In (A) and (B) is, without accessing the TCB on the memory, which is of high-speed task switching also contribute. 任务处理装置100的CPU 150中所要求的只是追加使CPU时钟停止和恢复的功能。 Task processing device 100 CPU 150 that is required is that the CPU clock is stopped and the additional recovery functions. 此外,这些功能全部由硬件来实现,这并非是要限定本发明的范围。 In addition, all of these functions be implemented in hardware, it is not intended to limit the scope of the present invention. 例如,本领域技术人员可以理解,(A)或者(B)的主要功能可以由硬件来实现,而为了辅助硬件功能,RTOS的一部分功能可以由软件来实现。 For example, those skilled in the art will appreciate, (A) or (B) mainly functions may be implemented by hardware, and in order to assist the hardware function, the function may be a part of the RTOS implemented by software.

[0135] 图6是图5所示的CPU 150的电路图。 [0135] FIG. 6 is a circuit diagram of the CPU 150 shown in FIG. 5.

[0136] 与图3所示的CPU 84不同,处理寄存器组154的特殊寄存器156和通用寄存器158都是一面的结构。 [0136] and the CPU 84 shown in FIG. 3 different processing register set of special registers 156,154 and 158 are general purpose registers of the side structure. 处理寄存器组154中分别引入了来自加载选择电路112的输入总线、到保存寄存器110的输出总线、以及来自任务切换电路210的写入信号(WT)用信号线。 Processing register set 154 are introduced from the load selection circuit 112 input bus, to output bus save registers 110, and a write signal from the task switching circuit 210 (WT) signal line. 执行控制电路152根据对输出选择器164的控制信号(CTRL),将处理寄存器组154中所期望的寄存器中的数据输入到运算电路160中。 Execution control circuit 152 in accordance with a control signal (CTRL) output from the selector 164, the data processing register set 154 in a desired register input to the arithmetic circuit 160. 运算结果成为输入选择器162的输入。 Calculation result becomes the input selector 162. 执行控制电路152根据对输入选择器162的控制信号(CTRL),向处理寄存器组154中所期望的寄存器输入运算结果。 The execution control circuit 152 to the input selector control signal (CTRL) 162, and the operation result to the register input processing register set 154 as desired. 执行控制电路152 —边更新特殊寄存器156中的程序计数器,一边执行任务。 Execution control circuit 152 Edge - updating the program counter in the special registers 156, while performing the task.

[0137] 处理数据保存到保存寄存器110中而不是存储器上的TCB中。 Save [0137] TCB processed data to the save registers 110 instead of the memory. 处理寄存器组154不断地向各保存寄存器110输出处理数据。 Processing register set 154 continuously outputs the respective saved register 110 process the data. 实际上,如前所述,何时将处理数据保存到保存寄存器110中,是由任务切换电路210来控制的。 Indeed, as described above, when the data storage processing to the save register 110, the task switching circuit 210 is controlled.

[0138] 保存数据是从保存寄存器110而不是从存储器上的TCB加载到处理寄存器组154中的。 [0138] Data storage 110 is loaded from the save register and not from the TCB on the memory into the processing register set 154. 实际上,如前所述,加载哪个保存寄存器110中的处理数据以及何时加载,是由任务切换电路210来控制的。 Indeed, as described above, which process data stored in the register 110 is loaded and when loaded, the task switching circuit 210 is controlled.

[0139] 连接处理寄存器组154和加载选择电路112、以及处理寄存器组154和保存寄存器110的总线能够传输的位数,设定为能够在一次处理中并行传输处理数据。 [0139] connecting the processing register set 154 and the load selection circuit 112, and a processing register set 154 and the save registers bus 110 bits can be transmitted, can be set to a parallel transmission processing in the processing data. 因此,根据任务切换电路210发送的写入信号(WT),能够实现一次读出或写入数据。 Thus, the task switching according to a write signal (WT) sent from the circuit 210 can be realized a read or write data. 普通软件RT0S在任务切换时,需要暂时占用处理寄存器组154。 Common software RT0S a task switch, temporarily occupy the processing register set 154. 与此相反,本实施例中的硬件RT0S没有必要将用于任务切换处理的特殊处理数据加载到处理寄存器组154中。 In contrast to this, in the present embodiment RT0S hardware is not necessary to load special process data for task switching processing to the processing register set 154. 当从任务A切换到任务B时,只需要将任务A的处理数据保存,然后加载任务B的处理数据,因此,处理寄存器组154无需配置系统用和用户用两面及通过堆栈执行数据替换处理。 When a task switch from task A to task B, task A To process data just stored, and then load the process data for task B is, therefore, no need to configure the processing register set 154 and user systems on both sides and replacement process performed by using the data stack.

[0140] 图7是执行控制电路152使CPU时钟停止的构造的电路图。 [0140] FIG. 7 is a circuit diagram of the implementation of control circuit 152 halts the CPU clock of the configuration.

[0141] 第二AND门174的输入是原始时钟(CLK0)和第一AND门172的输出,第一AND门172的输出被反相。 [0141] input of the second AND gate 174 is the original clock (CLKO) and the output of the first AND gate 172, the output of the first AND gate 172 is inverted. 第一AND门172的输出是停止完成信号(HC)。 The output of the first AND gate 172 is a stop completion signal (HC). 由于停止完成信号(HC)通常是0,因此第二AND门174直接输出所输入的原始时钟(CLK0)作为CPU时钟(CLK)。 Since stop completion signal (HC) is normally zero, the second AND gate 174 therefore directly outputs the input original clock (CLKO) as the CPU clock (CLK). CPU 150接收到第二AND门174所输出的CPU时钟时进行操作。 When the CPU 150 receives the operation clock to the CPU of the second AND gate 174 output. 当第一AND门172的输出是“1”时,换句话说,当停止完成信号(HC) = 1时,第二AND门174的输出固定为零,以使CPU时钟(CLK)停止。 When the output of the first AND gate 172 is "1", in other words, when the stop completion signal (HC) = 1, the output of the second AND gate 174 is fixed at zero, so that the CPU clock (CLK) is stopped.

[0142] 第一AND门172的输入是0R门176的输出和CPU忙信号(CBUSY),该CPU忙信号是负逻辑。 [0142] The first input of AND gate 172 is the output of 0R gate and a CPU busy signal (CBUSY) 176, which CPU busy signal is negative logic. CBUSY是从产生CPU 150内部循环的已知状态机中输出的信号。 CBUSY is a signal output from the internal cycle of the CPU 150 generates a known state machine. 当CPU 150处于可停止状态时,CBUSY变成“1”。 When the CPU 150 is in a stopped state, CBUSY becomes "1." 例如,当运算电路160完成执行单一命令或者被锁定的多个命令的最后命令从而CPU处于可停止状态时,或者当已经停止提供CPU时钟时,CBUSY变成“0”。 For example, when the last command to the arithmetic circuit 160 or completion of execution of a single command of the plurality of commands are locked so that the CPU is in a stopped state, or when the supply of the CPU clock has stopped, CBUSY goes to "0."

[0143] 0R门176的输入是命令解码器170的输出(SC_DETECT)和来自任务切换电路210的停止请求信号(HR)。 [0143] 0R gate 176 is input command output (SC_DETECT) and a decoder 170 from the task switching circuit 210 stops the request signal (HR). 命令解码器170内置有保持SC_DETECT的锁存电路。 Command decoder 170 built SC_DETECT holding latch circuit. 命令解码器170接收从CPU 150提取(fetch)的数据(FD)。 Command decoder 170 receives data (FD) from the CPU 150 extracts (FETCH) the. 当FD是系统调用命令时,命令解码器170输出SC_DETECT = 1。 When FD is a system call instruction, the instruction decoder 170 outputs SC_DETECT = 1. 通过内置锁存电路,即使在这之后FD变化,命令解码器170也继续输出SC_DETECT = 1。 Built-in latch circuit, FD change even after this, the instruction decoder 170 continues to output SC_DETECT = 1. 命令解码器170中,还输入任务切换电路210发送给处理寄存器组154的写入信号(WT)。 A command decoder 170, the task switching circuit 210 is also input to a processing write signal (WT) of the register set 154. 如前所述,当WT从0变为1时,保存数据被加载到处理寄存器组154中。 As described above, when the WT changes from 0 to 1, save data to be loaded into the processing register set 154. 该WT是在规定时间后从1返回到0的脉冲信号。 The WT is returned from 1 to 0 in the pulse signal after a predetermined time. 当WT从1变为0时,命令解码器170的锁存电路被复位,命令解码器170取消SC_DETECT。 When WT changes from 1 to 0, the command decoder latch circuit 170 is reset, the instruction decoder 170 to cancel SC_DETECT. SC_DETECT和写入信号(WT)之间的关系,将参照图8(b)进行详述。 The relationship between SC_DETECT and the write signal (WT), will be described in detail with reference to FIG. 8 (b). 本实施例中的命令解码器170,是为了判定执行对象命令是否是系统调用而专门设置在执行控制电路152中的装置。 Example command decoder 170 of the present embodiment, for determining whether executing a system call instruction is an execution specially provided control circuit 152 in the apparatus. 作为变型例,命令解码器170可以与负责CPU 150的解码阶段的CPU解码器共用。 As a variant, the command decoder 170 may be shared with the charge of the decode stage of the CPU 150 of the CPU decoder. 这种情况下,可通过向CPU解码器追加当被解码的数据是系统调用命令时输出SC_DETECT = 1的功能来实现命令解码器170。 In this case, may be achieved when the command decoder 170 outputs SC_DETECT function is invoked when the command data is decoded by adding 1 = system CPU to the decoder.

[0144] 当中断请求信号(INTR)发生时,任务切换电路210向执行控制电路152申请停止请求信号(HR),即当执行系统调用、或当申请停止请求信号(HR)时,0R门176的输出变成“1”。 [0144] When an interrupt request signal (the INTR) occurs, the task switching circuit 210 to the execution control circuit 152 halt request signal (HR), i.e., when the system call is executed or when a halt request signal (HR), 0R gate 176 the output becomes "1."

[0145] 综上所述,当执行系统调用或发生中断请求信号、且当CPU忙信号变成“0”时,第一AND门172的输出变成“1”,且第二AND门174不输出CPU时钟。 [0145] In summary, when the system call is executed or an interrupt request signal, and when the CPU busy signal becomes "0", the output of the first AND gate 172 becomes "1", and the second AND gate 174 is not CPU clock output.

[0146] 图8(a)是表示中断请求信号发生时各种信号之间关系的时序图。 [0146] FIG. 8 (a) is a timing chart showing the relation between signals when an interrupt request signal occurs.

[0147] 在图8(a)中,首先,在时刻t0,任务切换电路210检测出来自外部的中断请求信号(INTR)。 [0147] in FIG. 8 (a), first, at time t0, the task switching circuit 210 detects an interrupt request signal from the outside (INTR). 任务切换电路210为了执行特殊任务,向执行控制电路152申请停止请求信号(HR)。 The task switching circuit 210 to perform a specific task, the execution control circuit 152 to apply a halt request signal (HR). 输入时刻tl与检测时刻t0几乎是同时的。 Input time tl and the time t0 is detected almost simultaneously. 在时刻tl,CPU 150的状态机处于“任务执行中”,CBUSY = 1。 At time tl, the state machine of the CPU 150 is in the "task is being executed", CBUSY = 1. 由于HR = 1,所以0R门176输出“1”。 Since HR = 1, so 0R gate 176 outputs "1." 但是由于CBUSY = 1,因此CPU 150不停止。 However, since CBUSY = 1, and therefore CPU 150 does not stop. 因此,即使输入HR = 1,CPU时钟(CLK)也暂且与原始时钟(CLK0)同步输出。 Thus, even if the input HR = 1, CPU clock (CLK) also temporarily synchronized with the original output clock (CLK0).

[0148] 经过一定时间,在时刻t2处,CBUSY = 0。 [0148] After a certain time, at time t2, CBUSY = 0. 由于已经是HR = 1,所以第一AND门172输出HC= 1,从第二AND门174输出的CPU时钟维持为0。 Since already HR = 1, so that the first AND gate 172 outputs HC = 1, output from the second AND gate 174 CPU clock is maintained at 0. 另一方面,任务切换电路210以申请HC为契机,开始从常规任务到特殊任务的任务切换。 On the other hand, the task switching circuit 210 as an opportunity to apply HC, starting from the ordinary task to a special task task switching. 细节将在后面描述。 Details will be described later. 任务切换所需时间是任务控制电路200的工作时钟的数倍。 Task switching time is required for multiple task control circuit 200 of the clock. 在申请HC后,任务控制电路200的工作时钟变化了规定次数(时刻t3)的条件下,任务控制电路200取消停止请求信号(HR)。 After application under the HC, the task control circuit 200 changes the operation clock of a predetermined number of times (time t3), the task control circuit 200 to cancel a halt request signal (HR). 由于HR = 0,因此执行控制电路152恢复CPU时钟(CLK)。 Since HR = 0, the execution control circuit 152 thus restore the CPU clock (CLK). 当CPU 150恢复处理时,CPU 150使CBUSY从0变为1 (时刻t4)。 When the restoration processing CPU 150, CPU 150 so that CBUSY from 0 to 1 (time t4). 由此,在CPU时钟停止的时刻t2至时刻t3期间,执行从常规任务到特殊任务的任务切换。 Accordingly, the CPU clock is stopped at time t2 to time t3, perform routine tasks from task switching to a special task.

[0149] 作为另一种处理方法,代替以任务控制电路200的工作时钟变化了规定次数为条件,而以任务控制电路200已完成任务切换为条件来取消HR。 [0149] As another approach, instead of the task control circuit 200 changes the operation clock frequency of a predetermined condition, and the task control circuit 200 has completed the task switching condition is canceled HR. 而且,执行控制电路152可以以取消HR为条件来取消HC。 Further, the execution control circuit 152 may cancel condition to cancel HR HC. 当HC = 0时,执行控制电路152恢复CPU时钟(CLK)。 When HC = 0, the execution control circuit 152 to restore the CPU clock (CLK). 由此,可以恢复任务的执行。 This makes it possible to recover mission.

[0150] 图8 (b)是表不执行系统调用时各种/[目号之间关系的时序图。 [0150] FIG. 8 (b) is a timing chart showing a relationship between the various / [log number of tables is not performed when the system call.

[0151] 在图8(b)中,首先,在时刻t0,命令解码器170检测出系统调用,并使SC_DETECT从0变为1。 [0151] in FIG. 8 (b), first, at time t0, the command decoder 170 detects a system call and changes SC_DETECT from 0 to 1. 在时刻to,CPU 150的状态机处于“任务执行中”,CBUSY = 1。 At time to, CPU 150 of the state machine is in the "task execution", CBUSY = 1. 由于SC_DETECT=1,所以OR门176输出“1”。 Since SC_DETECT = 1, so the OR gate 176 outputs "1." 但是由于CBUSY = 1,因此CPU 150不停止。 However, since CBUSY = 1, and therefore CPU 150 does not stop. 因此,即使输出SC_DETECT = 1,CPU时钟(CLK)也暂且与原始时钟(CLK0)同步输出。 Thus, even if the output SC_DETECT = 1, CPU clock (CLK) also temporarily synchronized with the original output clock (CLK0).

[0152] 经过一定时间,在时刻tl,CBUSY = 0。 [0152] After a certain time, at time tl, CBUSY = 0. 由于SC_DETECT = 1、且CBUSY = 1,因此取消HC,并停止CPU时钟。 Since SC_DETECT = 1, and CBUSY = 1, the cancellation of HC, and stopping the CPU clock. 当输入HC = 0时,任务切换电路210开始任务切换处理,并将写入信号(WT)输出到CPU 150。 When the input HC = 0, the task switching circuit 210 starts a task switching process, and a write signal (WT) is output to the CPU 150. 在WT从0变为1的时刻t2,保存数据被加载到处理寄存器组154中。 In WT changes from 0 to the time point t2 1, save the data to be loaded into the processing register set 154. 由于写入信号(WT)是脉冲信号,因此在经过规定时间后的时刻t3,变成WT =0。 Since the write signal (WT) is a pulse signal, the elapsed time t3 after a predetermined time, into WT = 0. 根据检测出的WT:1 — 0的下降沿,锁存在命令解码器170中的SC_DETECT被复位(时刻t4)。 The detected WT: 1 - 0 falling edge of the lock there is a command decoder 170 SC_DETECT is reset (time t4). 此时,CBUSY从0变为1。 At this time, CBUSY changes from 0 to 1. 由于CBUSY= 1,因此HC = 0,从而恢复CPU时钟。 Since CBUSY = 1, and therefore HC = 0, thereby restoring the CPU clock. 在CPU时钟停止的时刻tl至时刻t4期间,执行任务切换。 At the time of the CPU clock is stopped during the time tl to t4, perform a task switch.

[0153] 此外,作为其它处理方法,代替以检测出WT:1 — 0的下降沿为条件,而以任务控制电路200完成任务切换并取消HR为条件,执行控制电路152取消HC。 [0153] Further, as another processing method in place to detect the WT: 1 - 0 to falling conditions, to complete the task control 200 and the task switching circuit cancellations HR condition, the execution control circuit 152 to cancel HC. 而且,以HC = 0为条件,复位SC_DETECT。 Further, HC = 0 condition to reset SC_DETECT. 执行控制电路152恢复CPU时钟(CLK),CBUSY从0变为1。 Execution control circuit 152 to restore the CPU clock (CLK), CBUSY from 0 to 1.

[0154] 在任何情况下,CPU 150都无需知道在CPU时钟停止期间进行RUN-任务切换的情况。 [0154] In any case, CPU 150 are without knowing the situation RUN- task switching during the CPU clock is stopped. 任务切换电路210在CPU时钟停止而使CPU 150处于冻结期间进行任务切换处理,因此CPU 150的处理和任务控制电路200的处理在事件序列中是分离的。 The task switching circuit 210 stops the CPU 150 is frozen during task switching processing in the CPU clock, the CPU 150 and the task control circuit 200 is treated in a separate sequence of events.

[0155] 图9是用于说明流水线处理中CPU时钟停止时刻的示意图。 [0155] FIG. 9 is a diagram for explaining pipeline processing time of the CPU clock is stopped.

[0156] CPU 150通过从存储器中顺序读出多个命令到处理寄存器组154中并执行这些命令,来执行任务。 [0156] CPU 150 by sequentially reading out a plurality of commands from the memory into the processing register set 154 and executes these commands to perform tasks. 作为任务执行单位的命令,分解为如下四个阶段(phase)。 As a command task execution units, broken down into the following four phases (phase).

[0157] 1.F(提取(fetch)):从存储器中提取命令。 [0157] 1.F (extract (fetch)): extract command from memory.

[0158] 2.D(解码(decode)):解释命令。 [0158] 2.D (decoding (decode)): interprets the command.

[0159] 3.E(执行(execut1n)):执行命令。 [0159] 3.E (execution (execut1n)): execute the command.

[0160] 4.WB(回写(write back)):将执行结果写入存储器中。 [0160] 4.WB (write-back (write back)): The execution result into memory.

[0161 ] 当一个任务顺次执行命令1至命令5时,可以是命令1被执行完从F到WB阶段后,才执行命令2的F阶段。 [0161] When a task sequentially to 5:01 Run command may be a command from F 1 to be executed after completion of the WB stage, before the implementation of Stage F 2 command. 但是,为了更高效地执行,大多是在命令1的执行过程中就开始执行命令2。 However, in order to efficiently perform, mostly during the execution of the command 1 Run 2 starts. 这种处理方法被称作流水线处理。 This treatment is called pipeline processing. 例如,当命令1到达D阶段时,就开始命令2的F阶段。 For example, when instruction 1 reaches phase D, phase F of instruction begins 2. 当命令1到达E阶段时,就执行命令2的D阶段和命令3的F阶段。 When instruction 1 reaches phase E, phase D to Run 2 and 3 of the Command Phase F. 由此,通过增加单位时间内执行的命令数,能够减少每个任务的执行时间。 Thus, by increasing the command executed within unit time, you can reduce the execution time of each task.

[0162] 并且,各阶段可以进一步细分为两个阶段。 [0162] Further, each stage may be further subdivided into two stages. 例如,F阶段可以分为F1和F2两个阶段。 For example, F can be divided into stage two stages F1 and F2. 当命令1到达F2阶段时,开始命令2的F1阶段。 When instruction 1 reaches phase F2, F1 Phase 2 of the start command. 当命令1到达D1阶段时,执行命令2的F2阶段和命令3的F1阶段。 When instruction 1 reaches phase D1, phase F2 Run 2 and phase F1 of instruction 3. 通过细分阶段,能够进一步有效利用CPU 150的计算资源。 By segmenting stage, to further the effective use of computing resources of the CPU 150. 在图9中,说明了在将各阶段细分为两个阶段来执行的流水线处理中发生系统调用时的CPU时钟停止时刻。 In FIG. 9, the CPU clock system call occurs in the various stages of the pipeline processing is subdivided into two stages to be executed when the stop time.

[0163] 在图9中,命令1在CPU时钟为“0”的时刻开始处理。 [0163] In FIG. 9, a start command at time processing CPU clock is "0". 在CPU时钟为“4”的时刻,命令1的解码完成。 CPU clock at time "4", the decode command 1 is completed. 假设命令1为系统调用。 1 to assume command system calls. 命令解码器170使SC_DETECT从0变为1。 Command decoder 170 so SC_DETECT from 0 to 1. 接着,SC_DETECT从1返回到0的条件是:从任务切换电路210到处理寄存器组154的写入信号(WT)从1变为0。 Next, SC_DETECT returns from 1 to 0 with the proviso that: from the task switching circuit 210 to process the write signal (WT) register set 154 changes from 1 to 0. 即使输出的是SC_DETECT = 1,由于命令2〜5已经在执行中或者执行启动完,因此还是CBUSY = 1。 Even if the output is SC_DETECT = 1, 2 ~ 5 since the command execution has been started or completed in execution, so it CBUSY = 1. 因此,第二AND门174继续输出CPU时钟。 Thus, the second AND gate 174 continues to output the CPU clock. 但是,当SC_DETECT= 1时,执行控制电路152暂时停止程序计数器的更新,使得新的命令不被提取。 However, when SC_DETECT = 1, the execution control circuit 152 to temporarily stop updating the program counter, so that the new command will not be extracted. 因而,命令6及其后续命令不会从存储器中被提取。 Accordingly, a subsequent command and command 6 is not extracted from the memory.

[0164] 在CPU时钟为“8”的时刻,命令1执行完成,但是命令2〜5正在执行中,因此CPU忙信号还是“1”。 [0164] CPU clock at time "8", a command execution is completed, but the command is being executed in 2 ~ 5, the CPU busy signal or a "one." 当到达CPU时钟为“12”的时刻时,命令5执行完成。 When the time to reach the CPU clock is "12", execution of instruction 5 is completed. 此时,CPU忙信号变成“0”。 At this time, CPU busy signal becomes "0." 之后,按照参照图8(b)所述的流程,停止提供CPU时钟。 Thereafter, in accordance with reference to FIG. 8 (b) of the process, provides the CPU clock is stopped. 任务切换电路210将直到命令5的执行结束为止产生的处理数据保存到保存寄存器110中。 The task switching circuit 210 until the end of the data until the command generating processing is performed 5 to the saved register 110. 根据这种停止方法,任务切换能够以不浪费执行系统调用后的命令执行结果的方式实现。 According to this method stops, able to perform the task switching mode results in order not to waste execute the command after the system call. 当任务切换完成时,CPU忙信号再次设为“1”,命令解码器170的处理也得到恢复。 When the task switch is completed, the CPU busy signal is again set to "1", the command decoder process 170 is also restored. 由此,将再次提供CPU时钟。 Thus, the CPU clock will be provided again.

[0165] 作为另一种处理方法,也可以在系统调用命令执行完成的时刻,将CPU忙信号设为“0”,以停止提供CPU时钟。 [0165] As another processing method, the system may also be called command completion time, the CPU busy signal is set to "0", to stop the supply of the CPU clock. 这种情况下,与系统调用命令同时执行的其它命令在执行过程中停止。 In this case, other command and call the execute command system while stopping in the implementation process. 中途停止的命令的中间处理结果记录在处理寄存器组154中后,保存到保存寄存器110中。 Intermediate processing results stopped halfway after the recording command processing register set 154, to the saved register 110. 当下次该任务变成RUN-任务时,接着执行中途停止的命令。 The next time the task becomes RUN- task, then execute the command to stop halfway. 例如,当某个命令在读取结束阶段被中途停止时,将从存储器中读出的命令和操作数保存到保存寄存器110中。 For example, when a command is stopped midway at the end of the reading phase, the command from the storage memory operand read out and stored into the register 110. 当该任务恢复时,保存寄存器110中的数据被加载到处理寄存器组154中,以执行解码阶段及后续阶段。 When the task is restored, the data stored in the register 110 is loaded into the processing register set 154 to perform decoding stage and a subsequent stage.

[0166] 图10是表示状态存储单元220和任务切换电路210之间关系的电路图。 [0166] FIG. 10 shows a state storage unit 220 and the task switching circuit 210 a circuit diagram of the relationship between.

[0167] 状态存储单元220包括状态寄存器250和定时器252。 [0167] state storage unit 220 includes a state register 250 and a timer 252. 状态存储单元220存储任务的状态数据。 State data state storage unit 220 stores the task. 另外,定时器252是在任务转换到READY状态或者WAIT状态时开始的定时器。 In addition, the timer 252 is started when the task is a transition to READY or WAIT state timer. 任务转换到READY状态后所经过的时间称作“READY经过时间”,任务转换到WAIT状态后所经过的时间称作“WAIT经过时间”。 After the state transition to the READY task elapsed time is referred to "elapsed READY time", after the transition to the WAIT state of the task elapsed time is referred to "elapsed WAIT time." 定时器252以ΊΊΜ信号方式不断地输出经过时间的值。 ΊΊΜ signaled the timer 252 continuously outputs the value of the time elapsed. 在任务切换时,当任务转换到READY状态或者WAIT状态时,任务切换电路210驱动该任务的定时器252来开始测量时间。 A task switch, when a task makes a transition to the READY state or the WAIT state, the task switching circuit 210 drives the timer 252 for the task starts measuring time.

[0168] 状态存储单元220是如下所述的寄存器组。 [0168] The storage unit 220 is a state of the register bank as follows.

[0169] (A)任务ID寄存器254:用于存储任务ID。 [0169] (A) Task ID register 254: for storing a task ID. 任务ID寄存器254不断地向任务选择电路230输出表示任务ID的ID信号。 The task ID register 254 continuously selecting circuit 230 outputs the task ID indicates the ID signal to the task. 以下将任务A的任务ID寄存器254向任务选择电路230输出的ID信号表示为“10_八信号”。 The following task ID register 254 for task A selection circuit 230 outputs the task ID of the signal is represented as "10_ eight signals." 从状态存储单元220输出的所有其它信号也米用同样的表不方法。 All other output signals from the state storage unit 220 m is not the same table method.

[0170] (B)任务优先级寄存器256:用于存储任务优先级。 [0170] (B) task priority register 256: for storing a task priority order. 任务优先级寄存器256不断地输出表示任务优先级的PR信号。 Task priority register 256 continuously outputs a PR signal of task priority. “0”表示最高优先级,值越大表示任务优先级越低。 "0" represents the highest priority, larger value indicates a lower priority task.

[0171] (C)任务状态寄存器258:用于存储任务状态。 [0171] (C) Task state register 258: for storing a task state. 任务状态寄存器258不断地输出表示STOP、READY、RUN、WAIT、IDLE中的某一个的ST信号。 Task state register 258 continuously outputs a STOP, READY, RUN, WAIT, ST signal in one of IDLE. 此外,IDLE是指任务初始化之前的状态。 In addition, IDLE is a state before the task initialization.

[0172] (D)任务启动地址寄存器260:用于存储存储器中的任务的TCB地址。 [0172] (D) the task start address register 260: TCB address of a task stored in the memory. 任务启动地址寄存器输出AD信号。 Task start address register output signal AD.

[0173] (E)待机理由寄存器262:用于在任务处于WAIT状态时,存储构成WAIT解除条件的待机理由。 [0173] (E) the wait reason register 262: when a task is in the WAIT state, the wait reason WAIT cancellation condition storage configuration. 待机理由是“信号量等待”、“事件等待”和“互斥等待”中的某一个。 Standby grounds that "semaphore wait", "waiting for events" and "mutex wait for" the one. 待机理由寄存器262输出WR信号。 Wait reason register 262 outputs the WR signal.

[0174] (F)信号量ID寄存器264:用于在任务以信号量等待为理由处于WAIT状态时,存储等待对象的信号量(以下简称为“待机信号量”)的信号量ID。 [0174] (F) Semaphore ID register 264: when a semaphore waiting tasks in the WAIT state for the reason, signal waiting storage object (hereinafter referred to as "standby signal amount") of the semaphore ID. 信号量ID寄存器264输出SID信号。 Semaphore ID register 264 output signal SID.

[0175] (G)互斥ID寄存器265:用于在任务以互斥等待为理由处于WAIT状态时,存储等待对象的互斥(以下简称为“待机互斥”)的互斥ID。 [0175] (G) Mutex ID register 265: a mutex to wait for when a task is in the WAIT state for the reason, the memory wait mutex object (hereinafter referred to as the "standby mutex") mutex ID. 互斥ID输出MID信号。 Mutex ID MID output signal.

[0176] (H)事件ID寄存器266:用于在任务以事件等待为理由处于WAIT状态时,存储等待对象的事件(以下简称为“待机事件”)的事件ID。 [0176] (H) the event ID register 266: an event when a task waits for an event grounds in the WAIT state waiting for the object is stored (hereinafter referred to as the "standby event") is an event ID. 事件ID寄存器266输出EID信号。 EID event ID register 266 output signal.

[0177] (I)待机标记寄存器268:用于在任务以事件等待为理由处于WAIT状态时,存储待机标记模式。 [0177] (I) in standby register 268: when a task waits for an event grounds in the WAIT state, the wait flag pattern is stored. 待机标记寄存器268输出FL信号。 Standby register 268 output signal FL.

[0178] (J)标记条件寄存器270:用于在任务以事件等待为理由处于WAIT状态时,存储标记条件。 [0178] (J) flag condition register 270: when a task waits for an event grounds in the WAIT state flag storage conditions. 标记条件寄存器270输出FLC信号。 Flag condition register 270 outputs signal FLC. 待机标记模式和标记条件将在后面详述。 Wait flag pattern and a flag condition will be described later.

[0179] (K)标记初始化寄存器272:用于存储表示是否有待机标记模式的数据。 [0179] (K) initialization flag registers 272: for storing data indicating whether the wait flag pattern. 标记初始化寄存器272输出FLI信号。 FLI initialization flag register 272 output signal.

[0180] (L)超时计数器274:超时值是在WAIT系列系统调用中指定的变量。 [0180] (L) Timeout counter 274: a variable timeout value is specified in the system call related to WAIT. 超时计数器274存储超时值。 Timeout counter 274 stores the timeout value. 任务切换电路210定期对各超时计数器274的超时值进行递减。 The task switching circuit 210 periodically timeout values ​​of the timeout counter 274 is decremented. 超时计数器274输出T0信号。 T0 timeout counter 274 output signal. 代替任务切换电路210对超时值进行递减,也可以是超时计数器274本身定期对其超时值自动地进行递减。 Instead of the task switching circuit 210 decrements the timeout value, the timeout counter 274 may be decremented periodically itself automatically to its timeout value.

[0181] 任务选择电路230根据各状态存储单元220输出的各种信号来选择任务。 [0181] The task selecting circuit 230 to select a task according to each of the state storage unit 220 outputs the various signals. 任务选择电路230包括以下电路。 The task selecting circuit 230 include the following circuits.

[0182] (A)执行选择电路232:用于在任务切换时,选择下一个RUN-任务。 [0182] (A) execution selection circuit 232: a task switch, selecting a next RUN- task. 执行选择电路232通常根据状态存储单元220不断输出的状态数据,来选择某一个任务作为RUN-任务。 The execution selection circuit 232 is generally constant state of state of the output data storage unit 220 to select one of the tasks as task RUN-. 执行选择电路232的输入信号有ID、ST、PR和TIM四种。 232 performs the selection circuit has an input signal ID, ST, PR, and TIM of four. 执行选择电路232输出下一个RUN-任务的任务ID。 Execution selection circuit 232 outputs the task ID of the next RUN- task. 关于详细的电路结构,将参照图12进行详述。 For a detailed circuit configuration, will be described in detail with reference to FIG. 12.

[0183] (B)信号量选择电路234:用于通过释放信号量系统调用的执行,选择应该从WAIT状态转换到READY状态的任务。 [0183] (B) the amount of the signal selection circuit 234: for performing a release semaphore system call by selecting should transition from the WAIT state to the READY state tasks. 信号量选择电路234的输入为来自任务切换电路210的释放信号量系统调用释放的信号量(以下简称为“释放信号量”)的信号量ID。 Semaphore-based selection circuit 234 as an input signal an amount of release semaphore system call is released from the task switching circuit 210 (hereinafter referred to as "Release Semaphore") semaphore ID. 来自状态存储单元220的输入信号有ID、ST、WR、PR、SID和ΊΊΜ六种。 Input signals from the state storage units 220 are ID, ST, WR, PR, SID, and six kinds ΊΊΜ. 信号量选择电路234的输出信号是从WAIT状态转换到READY状态的任务的任务ID。 Task ID semaphore-based selection circuit 234 is the output signal transition from the WAIT state to the READY state task. 如果不存在该任务,则输出如_1等的规定值。 If the task does not exist, a predetermined value is output as _1 like. 关于更具体的电路结构,将参照图13进行详述。 A more specific circuit configuration will be described in detail with reference to FIG 13.

[0184] (C)事件选择电路236:用于通过设定事件系统调用的执行,选择从WAIT状态转换到READY状态的任务。 [0184] (C) an event selection circuit 236: a set event system call is performed by selecting a transition from WAIT state to the READY task. 事件选择电路236的输入为来自任务切换电路210的由设定事件系统调用设定的事件(以下简称为“设定事件”)的事件ID。 Event selection circuit 236 is input to the event ID from the event set by a set event system call to the task switching circuit 210 (hereinafter referred to as "set event") of the. 来自状态存储单元220的输入信号有10、51\11?310、? Input from the state storage unit 220 are 10, 51 \ 11? 310 ,? 1^和? 1 ^ and? 1^(:六种。事件选择电路236的输出信号为从WAIT状态转换到READY状态的任务的任务ID、以及该任务的FL、FLC。 ^ 1 (: The six circuit 236 selects the output signal event is a transition from the WAIT state to the READY state, a task the task ID, and the task FL, FLC.

[0185] (D)超时检测电路238:用于检测出处于WAIT状态的任务中超时计数器274的超时值变成零的任务。 [0185] (D) Timeout detecting circuit 238: a timeout is detected when the value of the counter 274 Super task in the WAIT state of the task becomes zero. 每当更新超时值时,驱动超时检测电路238。 Updated whenever the timeout value, the timeout detecting circuit 238 driving. 超时检测电路238的输入信号有ID、ST和T0三种,输出信号是该任务的任务ID。 An input signal detecting circuit 238 has timed out ID, ST, and three kinds of T0, the output signal is the task ID of the task. 如果不存在该任务,则输出如-1等的规定值。 If the task does not exist, a predetermined value such as -1 is output.

[0186] (E)互斥电路240:用于通过释放互斥系统调用的执行,选择从WAIT状态转换到READY状态的任务。 [0186] (E) Mutex circuit 240: a release mutex system call is performed by selecting a transition from WAIT state to the READY task. 互斥电路240的输入信号为来自任务切换电路210的由释放互斥系统调用释放的互斥(以下简称为“释放互斥”)的互斥ID。 By a release mutex system call release mutex exclusive circuit 240 is an input signal from the task switching circuit 210 (hereinafter referred to as "releasing the mutex") mutex ID. 来自状态存储单元220的输入信号有ID、ST、WR、PR、SID和ΊΊΜ六种。 Input signals from the state storage units 220 are ID, ST, WR, PR, SID, and six kinds ΊΊΜ. 互斥电路240输出从WAIT状态转换到READY状态的任务的任务ID。 Mutex circuit 240 outputs the task ID of transition from the WAIT state to the READY state task. 如果不存在该任务,则输出如-1等的规定值。 If the task does not exist, a predetermined value such as -1 is output.

[0187] (F)检索电路242:当任务切换电路210输入任务ID时,检索电路242输出该任务的全部状态数据。 [0187] (F) retrieving circuit 242: When the task switching circuit 210 inputs the Job ID, retrieving circuit 242 outputs the entire state data of the task.

[0188] 下面通过关于任务切换的描述,对RUN-任务的选择、信号量、事件、互斥和超时,特别是任务选择电路230的处理,与通用技术进行比较说明。 [0188] The following description of the task switching by the choice of RUN- task, semaphore, event, mutex, and timeout, in particular processing task selecting circuit 230, described in comparison with the general technique.

[0189] RUN-任务的选择 Select [0189] RUN- task

[0190] [1]通过普通软件RT0S进行RUN-任务的选择 [0190] [1] through common tasks performed RUN- software RT0S selection

[0191] 图11是表示普通RT0S进行RUN-任务选择时所采用的任务就绪表的图。 [0191] FIG. 11 is a diagram showing an ordinary RT0S RUN- task selection task ready list used.

[0192] 任务就绪表形成在存储器上,将各READY-任务的TCB用指针连接。 [0192] task ready list is formed on a memory, a TCB pointer for each connection READY- task. 优先级指针280设置在每个任务优先级上,指出对应任务优先级的任务的TCB的开始地址。 The priority order pointer 280 is provided on each task priority indicating the priority task TCB corresponding to the task start address. 在图11的任务就绪表中,任务优先级“0”的优先级指针280指向任务A的TCB的地址,任务优先级“1”的优先级指针280指向任务B的TCB的地址。 In FIG task ready list 11, TCB task priority "0" in the priority order pointer 280 points to the address of the task A, TCB address of a task priority of "1" in the priority order pointer 280 of the task B point. 任务A的TCB指向任务D的TCB的地址。 TCB point to Task D address the TCB for task A.

[0193] 普通软件RT0S—边扫描该任务就绪表一边选择出下一个RUN-任务。 [0193] common side scanning software RT0S- the task ready list while selecting the next RUN- task. 在这个处理过程中,RT0S进行如下两个阶段的处理: In this process, RT0S processed in the following two stages:

[0194] A.使RUN-任务从RUN状态转换到READY状态。 [0194] A. RUN- make a transition from RUN task to READY.

[0195] B.选择下一个RUN-任务,并使该选择出的任务的任务状态从READY状态转换到RUN状态。 [0195] B. RUN- select the next task, and the task status of the task selected transition from READY to RUN.

[0196] 将软件RT0S进行的处理分解成如下各处理。 [0196] The software RT0S be decomposed into the following each process.

[0197] 〈RUN-任务的状态转换> [0197] <task state transition RUN->

[0198] 这里,以任务J为RUN-任务来进行说明。 [0198] Here, J is the task RUN- task will be described.

[0199] A1.RT0S将RUN-任务的任务ID存储在存储器中。 [0199] A1.RT0S RUN- task to the task ID stored in the memory. RT0S根据该任务ID,获取任务J的TCB的地址。 RT0S according to the task ID, to obtain the address of the TCB for task J.

[0200] A2.访问该TCB,获取任务J的任务优先级。 [0200] A2. Visit the TCB, get task priority task of J. 假设该任务优先级为“0”。 Assuming that the task priority is "0."

[0201] A3.参考图11所示的任务就绪表,获取与任务J的任务优先级对应的优先级指针280。 [0201] A3. With reference to FIG. 11 shown in the task ready list to acquire the task priority task J corresponding to the priority order pointer 280.

[0202] A4.检测所获取的优先级指针280所指的TCB。 [0202] A4. TCB detecting the acquired priority order pointer 280 is pointing. 这里检测出任务A的TCB。 Here TCB for task A is detected.

[0203] A5.跟踪任务A的TCB所具有的指针,以检测出任务就绪表最末尾的TCB。 [0203] A5. Tracked TCB for task A has a pointer to the task ready list detected the rearmost TCB. 图11中,任务就绪表的最末尾是任务F。 11, the task is most ready at the end of the task table F.

[0204] A6.配置任务F的TCB的指针指向任务J的TCB的地址。 [0204] A6. F of the configuration task TCB pointer to address the TCB for task J. 由此,任务J的TCB被追加到任务就绪表中。 Thus, the TCB for task J is added to the task ready list.

[0205] A7.在任务J的TCB中设定“READY”。 [0205] A7. Setting "READY" in the TCB for task J. 另外,处理数据被复制到该TCB的寄存器存储区域。 Further, the process data is copied to the register storage area of ​​the TCB.

[0206] 〈READY-任务的状态转换> [0206] <READY- task state transitions>

[0207] B1.RT0S检测任务优先级“0”的优先级指针280指向哪个TCB。 [0207] B1.RT0S detection task priority "0" in the priority order pointer 280 which points to TCB. 如果没有指向任何TCB,则检测任务优先级“1”的优先级指针280指向哪个TCB。 If you do not point to any TCB, the detection task priority "1" priority pointer 280 points to which TCB. RT0S —边以降低的任务优先级顺序检测该任务就绪表,一边试图确定任务直到发现指向的TCB为止。 RT0S - task priority order of edge detection to reduce the task ready list, while trying to determine the task until it finds a point of TCB. 该图中,将指定任务A。 This figure, the specified task A.

[0208] B2.将任务A从任务就绪表中移除。 [0208] B2. A task is removed from the task ready list. 具体地说,重写任务优先级“0”的优先级指针280,以取代任务A来指向任务D的TCB的地址。 More specifically, rewriting the task priority "0" in the priority order pointer 280, instead of the task A to point D task TCB address. 另外,通过设定NULL使得任务A的指针不指向任务D的地址。 Further, by setting the task A NULL pointer that does not point to the address of the task D. 由此,任务A的TCB从任务就绪表中移除。 Thus, TCB for task A is removed from the task ready list.

[0209] B3.在任务A的TCB中设定“RUN”。 [0209] B3. Setting "RUN" in the TCB for task A's. 另外,保存在任务A的TCB的寄存器存储区域中的处理数据被加载到处理寄存器组中。 Further, the data processing register storage area in the TCB for task A stored in is loaded into the processing register set.

[0210] 如上所述,普通软件RT0S采用该任务就绪表进行任务切换,即RT0S根据下述策略,从多个READY-任务中选择RUN-任务。 [0210] As described above, using this common software RT0S task ready list for task switching, i.e. according to the following strategy RT0S, selected from a plurality of tasks RUN- READY- tasks. [0211 ] 1.所选择的任务为READY-任务(第一条件)。 [0211] 1. The task selected as READY- task (first condition).

[0212] 2.所选择的任务为READY-任务中任务优先级最高的任务(第二条件)。 [0212] 2. The task selected is the task READY- highest task priority tasks (second condition).

[0213] 3.当存在多个任务优先级最高的任务时,所选择的任务是转换为READY状态的时间最久的任务(第二条件)。 [0213] 3. When a plurality of tasks the highest priority task, the task is to convert the selected time to the READY state oldest tasks (second condition).

[0214] 这三个条件统称为“RUN任务选择条件”。 [0214] These three conditions are collectively referred to as "RUN task selection condition." 任务处理装置100的执行选择电路232通过硬件来实现这种RT0S的任务调度功能。 Execution selection circuit 100 of the task processing apparatus 232 to achieve this RT0S task scheduling function by hardware.

[0215] [2]通过本实施例的硬件RT0S所进行的RUN-任务的选择 [0215] [2] RUN- tasks performed by hardware in the present embodiment selection RT0S

[0216] 图12是执行选择电路232的电路图。 [0216] FIG. 12 is a circuit diagram of the execution selection circuit 232.

[0217] 这里,假设从任务0〜任务7共八个任务中选择出RUN-任务。 [0217] Here, it is assumed RUN- selected task from task 7. Task 0~ eight tasks. 执行选择电路232包括四个第一比较电路290 (290a〜290d)、两个第二比较电路292 (292a、292b)、以及一个第三比较电路294。 Execution selection circuit 232 includes four 1st comparison circuits 290 (290a~290d), two 2nd comparison circuits 292 (292a, 292b), and a third comparator circuit 294. 另外,还包括八个判定电路296 (296a〜296h)。 Further, also includes eight determination circuits 296 (296a~296h).

[0218] 判定电路296的输入信号为表示任务状态的ST信号。 [0218] The input signal determination circuit 296 indicates that the task state signal ST. 当该ST信号表示READY时,判定电路296输出的CID信号为“1” ;当该ST信号表示READY之外的任务状态时,则输出的CID信号为“0”。 When the ST signal indicates READY, the CID signals output from the decision circuit 296 is "1"; CID signal ST when the signal indicates READY in the task state than when the output is "0." 判定电路296根据上述RUN-任务选择条件中的第一条件进行判定。 The determination circuit 296 determines the above-described conditions RUN- first task selection condition. 第一比较电路290的输入为两个任务的ID、PR和ΊΊΜ、以及来自判定电路296的CID信号。 A first comparator circuit 290 is input ID, PR, and ΊΊΜ two tasks, and the CID signal from the circuit 296 is determined.

[0219] 以第一比较电路290a为例进行说明。 [0219] In a first comparison circuit 290a will be described as an example. 第一比较电路290a比较任务0和任务1,以根据上述的RUN任务选择条件选择出更适合的任务。 The first comparison circuit 290a comparison task 0 and task 1, according to the above-described selection condition more suitable RUN task selection task.

[0220] 第一判定:首先,比较分别从判定电路296a和判定电路296b输出的CID信号。 [0220] First determination: First, the comparison determination circuit 296a, respectively, from the CID, and the determination signal output circuit 296b. 如果某一个CID信号是“1”,换句话说,如果只有一个任务处于READY状态,则第一比较电路290a输出该任务的ID、PR和ΊΊΜ。 If one of the CID signal is "1", in other words, if only one task is in the READY state, the first comparison circuit 290a outputs ID, PR, and ΊΊΜ the task. 如果两个CID信号都是“0”,即哪个任务都不处于READY状态,则第一比较电路290a输出ID = PR = TIM = NULL。 CID if two signals are "0", i.e. which tasks are in the READY state, the first comparison circuit 290a outputs ID = PR = TIM = NULL. 这表示哪个任务都没有被选择。 This means that tasks which have not been selected. 如果两个CID信号都是“1”,即两个任务都处于READY状态,则执行下面的第二判定。 CID if two signals are "1", i.e., two tasks are in the READY state, following the second determination is performed.

[0221] 第二判定:比较任务0的PR信号和任务1的PR信号,以选择出任务优先级较高的任务。 [0221] Second determination: PR signal of task 0 and task more PR signal is 1, the task to select a higher priority task. 例如,如果任务0的任务优先级是“1”、任务1的任务优先级是“2”,则第一比较电路290a输出任务0的ID、PR和ΊΊΜ。 For example, if the task priority order of task 0 is "1", the task priority of the task 1 is "2", then the output 290a of the first comparator circuit 0 task ID, PR, and ΊΊΜ. 通过第二判定,能够选择出任务优先级最高的任务作为RUN-任务的候选。 The second determination, it is possible to select the task with the highest task priority order as a candidate RUN- task. 如果任务0和任务1的任务优先级相同,则执行下面的第三判定。 If the task 0 and task 1 of the same task priority order, perform the following third determination.

[0222] 第三判定:比较任务0的ΊΊΜ信号和任务1的ΊΊΜ信号,以选择出READY经过时间较长的任务。 [0222] Third determination: ΊΊΜ comparison signal of task 0 and task 1 ΊΊΜ signal to select the longer elapsed READY task. 如果对应的READY经过时间相同,则选择任务0。 If the corresponding same elapsed READY time, task 0 is selected. 由于仅通过比较经过时间的大小就能够进行判定,因此将无需进行如任务就绪表一样的TCB顺序管理。 Because only by comparing the size elapsed time it can be judged, and therefore will not need to be the same as the task ready list of TCB order management.

[0223] 由此,任务0和任务1、任务2和任务3、任务4和任务5、以及任务6和任务7,分别根据RUN-任务选择条件进行比较。 [0223] Accordingly, task 0 and task 1, task 2 and task 3, task 4 and task 5, and task 6 and task 7, were compared according RUN- task selection condition. 第二比较电路292通过测试来自两个第一比较电路290的输出,来进一步筛选RUN-任务的候选。 The second comparator 290 from the test circuit 292 output two first comparison circuit, further screening of candidate tasks by RUN-. 第二比较电路292a根据第一比较电路290a和第一比较电路290b的输出来执行任务选择。 The second comparison circuit 292a performs task selection according to a first comparison circuit 290a and the output of the first comparison circuit 290b. 因此,第二比较电路292a输出任务0〜任务3中最符合RUN-任务选择条件的任务的ID、PR和ΊΊΜ。 Thus, the second comparison circuit 292a outputs Task Task 3 0~ best meet ID, PR, and task selection condition ΊΊΜ task RUN-. 第三比较电路294也以相同的方式进行操作,第三比较电路294输出任务0〜任务7中某一个任务的任务ID。 The third comparator circuit 294 also operates in the same manner, the third comparison circuit 294 outputs the task ID 0~ task 7 in one of the tasks of the task.

[0224] 根据这种处理方法,能够通过硬件来实现RUN-任务选择条件。 [0224] According to this processing method can be implemented by hardware RUN- task selection condition. 普通软件RT0S —边访问任务就绪表一边选择RUN-任务。 Ordinary software RT0S - side access to the task ready list while selecting RUN- task. 但是本实施例中的执行选择电路232根据从状态存储单元220不断输出的状态数据,选择RUN-任务。 However, embodiments of the execution selection circuit 232 according to the present embodiment from the state data continuously output from the state storage unit 220, the task selection RUN-. 由执行选择电路232执行的处理总结如下。 It summarizes the processing performed by the execution selection circuit 232 is as follows.

[0225] 〈RUN-任务的状态转换> [0225] <task state transition RUN->

[0226] 这里,假设任务J为该RUN-任务。 [0226] assumes that task J that task RUN-.

[0227] A1.任务切换电路210在任务J的任务状态寄存器258中设定“READY”。 [0227] A1. 258 task switching circuit 210 is set "READY" in the task state register J task.

[0228] A2.任务切换电路210设置任务J的定时器252,以开始测量READY经过时间。 [0228] A2. The task switching circuit 210 sets the timer 252 for task J, to start measuring the elapsed READY time.

[0229] 由此,任务J从RUN状态转换到READY状态。 [0229] Thus, the task J transition from RUN to READY. 如前所述,处理数据保存在任务J的保存寄存器110中。 As described above, the process data is saved in the save register 110 for task J in. 连接处理寄存器组154和保存寄存器110的总线,能够并行传输处理数据,从而A1和A2的处理能够在一个时钟时间内执行。 Connecting the processing register set 154 and the save registers 110 of the bus, data can be transmitted in parallel processing, whereby the processing A1 and A2 can be performed in one clock time.

[0230] 〈READY-任务的状态转换> [0230] <READY- task state transitions>

[0231] B1.当任务J的状态转换完成时,任务切换电路210根据执行选择电路232所输出的任务ID确定RUN-任务,并在该确定的任务的任务状态寄存器258中设定“RUN”。 [0231] B1. When the conversion is complete task state J, the task switching circuit 210 determines task ID RUN- task execution selection circuit 232 according to output, and the task state register 258 determines task set "RUN" .

[0232] 由此,所确定的任务从READY状态转换到RUN状态。 [0232] Thus, the task of determining a transition from READY to RUN. 所确定的任务的处理数据从保存寄存器110加载到处理寄存器组154中。 The determined data processing tasks loaded from the save registers 110 into the processing register set 154. 连接保存寄存器110和处理寄存器组154的总线,也能够并行传输处理数据,从而B1的处理能够在一个时钟时间内执行。 Saving bus connecting the processing register set 110 and register 154, data can be transmitted in parallel processing, so that the processing of B1 can be performed within one clock period.

[0233] 软件RT0S在任务切换时,由于例如访问任务就绪表等原因会消耗CPU的很多CPU时钟时间。 [0233] software RT0S when task switching, due for example to access the task ready list other reasons will consume a lot of CPU time of the CPU clock. 与此相反,本实施例中的任务控制电路200能够在很短的时间内完成任务切换。 In contrast, the task control circuit 200 in the present embodiment to complete the task switching in a short period of time. 由于状态存储单元220不断地将状态数据输出给执行选择电路232,因此执行选择电路232不断地输出某一个任务的任务ID。 Since the state storage units 220 continuously output status data to the execution selection circuit 232, selection circuit 232 thus performs continuously outputs one of the task of the task ID. 不是在任务切换发生后才开始RUN-任务的选择处理,而是根据任务切换发生时的执行选择电路232的输出来执行RUN-任务的选择,这对任务切换高速化也有贡献。 It does not start until after a task switch occurs RUN- task selection processing, but the output selection circuit 232 according to the execution time of a task switch occurs to perform the selected task RUN-, which also contributes to the speed of a task switch. 以上说明假设有八个任务,但是通过增加比较电路的阶段数,能够对更多的任务进行寻址。 The above description assumes eight tasks, however, is possible to more tasks addressed by increasing the number of stages of comparison circuits.

[0234][信号量处理] [0234] [Semaphore process]

[0235] 图13是表示由普通RT0S进行的信号量处理中所采用的等待信号量表的图。 [0235] FIG. 13 shows a wait semaphore process performed by ordinary RT0S employed in FIG signal Scale.

[0236] 在说明等待信号量表之前,先简单说明信号量。 [0236] In the description before the wait semaphore, the semaphore briefly described. 信号量表212中对应记录信号量ID和信号量计数器。 Signal table 212 records semaphore ID and a semaphore counter. 在信号量计数器中将初始值设定为有限数。 The initial value of the semaphore counter is set in the limited number. 例如,假设设定为信号量ID = 4,信号量计数器=3。 For example, assume that the semaphore is set to ID = 4, the semaphore counter = 3. 当某一个任务执行将信号量ID = 4的信号量作为待机信号量的等待信号量系统调用时,任务切换电路210使待机信号量的信号量计数器递减。 When one of the tasks executes signal the semaphore ID = 4 as the amount of standby semaphore wait semaphore system call, the task switching circuit 210 causes the standby signal amount of the semaphore counter is decremented. 每当通过等待信号量事件调用来请求获取时,递减信号量计数器,当信号量计数器变成0时,无法再获取信号量。 Whenever a call by waiting for the event to request a semaphore, the semaphore counter is decremented when the semaphore counter becomes zero, can no longer obtain the semaphore. 执行将信号量计数器为0的信号量作为待机信号量的等待信号量系统调用的任务,状态转换到WAIT状态。 Mission semaphore counter is 0 as a semaphore waiting semaphore wait semaphore system call, the state transitions to the WAIT state.

[0237] 另一方面,当某一个任务执行将信号量ID = 4的信号量作为释放信号量的释放信号量系统调用时,任务切换电路210使信号量表212的信号量计数器递增。 [0237] On the other hand, when a task executes a signal amount of the semaphore ID = 4 as a release semaphore system call releases the semaphore, the task switching circuit 210 in semaphore table 212 the semaphore counter is incremented. 综上所述: In summary:

[0238] 当信号量计数器> 0时:执行等待信号量系统调用的任务,从RUN转换到READY。 [0238] When the semaphore counter> 0: perform tasks wait semaphore system call, the conversion from RUN to READY. 此时递减信号量计数器。 At this time, the semaphore counter is decremented.

[0239] 当信号量计数器=0时:执行等待信号量系统调用的任务,从RUN转换到WAIT。 [0239] When the semaphore counter = 0: perform tasks wait semaphore system call makes a transition from RUN to WAIT. 不递减信号量计数器。 Semaphore counter is not decremented.

[0240] 为了使执行等待信号量系统调用的任务从WAIT状态转换到READY状态,其它任务需要执行释放信号量系统调用。 [0240] In order to perform the task waits for a semaphore system call transition from the WAIT state to the READY state, the other tasks need to perform a release semaphore system call.

[0241] [1]由普通软件RT0S进行的信号量处理 [0241] [1] the amount of signal processing by the ordinary software RT0S

[0242] 普通软件RT0S通过采用等待信号量表来管理以信号量等待为理由处于WAIT状态的任务(以下特别称作“信号量等待任务”)的TCB。 [0242] By using common software RT0S wait semaphore list to wait semaphore management tasks in the WAIT state for the reason (hereinafter, referred to as special "task wait semaphore") of TCB. 等待信号量表是具有与图11所示的任务就绪表类似构造的列表,形成在存储器上。 Wait semaphore list is a list of the tasks shown in FIG. 11 having a structure similar to the ready list is formed on the memory. 各信号量等待任务的TCB由指针连接。 TCB of each task waiting for a semaphore are connected by pointers. 优先级指针280指向对应任务优先级的信号量等待任务的TCB的开始地址。 The priority order pointer 280 points to the start address of the TCB for task priority corresponding to an amount of signal waiting tasks.

[0243] 当执行释放信号量系统调用时,普通软件RT0S —边扫描该等待信号量表一边选择应从WAIT状态转换到READY状态的信号量等待任务。 [0243] When the release semaphore system call, an ordinary software RT0S - scans the wait semaphore list edge side should be selected from WAIT state to the READY state semaphore waiting task. 执行等待信号量系统调用以及执行释放信号量系统调用时,RT0S执行的处理如下。 When executing a wait semaphore system call and performing a release semaphore system call, the processing performed RT0S follows.

[0244] <等待信号量系统调用的执行> [0244] <executes a wait semaphore system call>

[0245] 这里,假设任务J为RUN-任务。 [0245] assumes that task J is RUN- task.

[0246] A1.RT0S将RUN-任务的任务ID存储在存储器中。 [0246] A1.RT0S RUN- task to the task ID stored in the memory. 根据该任务ID,获取任务J的TCB的地址。 According to the task ID, to obtain the address of the TCB for task J.

[0247] A2.检测在等待信号量系统调用中所指定的待机信号量的信号量计数器。 [0247] A2. Awaiting detection of the semaphore wait semaphore system call as specified semaphore counter. 以下根据信号量计数器的值,处理被分别说明。 The value of the semaphore counter, the process branches.

[0248](当信号量计数器> 0时) [0248] (When the semaphore counter> 0)

[0249] A3.RT0S使待机信号量的信号量计数器递减。 [0249] A3.RT0S standby signal so that the amount of the semaphore counter is decremented.

[0250] A4.在任务J的TCB中设定“READY”。 [0250] A4. Setting "READY" in the TCB for task J. 这种情况下,任务J的TCB被追加到任务就绪表中。 In this case, the TCB for task J is added to the task ready list.

[0251](当信号量计数器=0时) [0251] (When the semaphore counter = 0)

[0252] A3.RT0S访问该TCB,以获取任务J的任务优先级。 [0252] A3.RT0S access the TCB, to get the task priority of the task J. 假设任务优先级为“0”。 Assume the task priority is "0."

[0253] A4.根据等待信号量表,获取与任务J的任务优先级对应的优先级指针。 [0253] A4. The wait semaphore list to acquire the task priority order of task J corresponding to the priority order pointer.

[0254] A5.检测所获取的优先级指针所指的TCB。 [0254] A5. TCB detecting the acquired priority cursor. 这里,检测到任务A的TCB。 Here, the TCB for task A is detected.

[0255] A6.跟踪任务A的TCB所具有的指针,以检测出该等待信号量表中最末尾的TCB。 [0255] A6. Tracked TCB for task A has the pointer to detect the wait semaphore list rearmost TCB. 如图13所示,任务F在该等待信号量表的最末尾。 13, the task waits for the rearmost F signal Scale.

[0256] A7.配置任务F的TCB的指针指向任务J的TCB的地址。 [0256] A7. F of the configuration task TCB pointer to address the TCB for task J. 由此,任务J的TCB被追加到等待信号量表中。 Thus, the TCB for task J is added to the wait semaphore list.

[0257] A8.在任务J的TCB中设定“WAIT”。 [0257] A8. Setting "WAIT" in the TCB for task J. 另外,还设定待机信号量的信号量ID。 Further, setting of the semaphore wait semaphore's ID.

[0258] <释放信号量系统调用的执行> [0258] <perform a release semaphore system call>

[0259] B1.RT0S 一边按顺序跟踪任务优先级为“0”的任务,一边搜索以释放信号量为待机信号量的信号量等待任务。 [0259] B1.RT0S while tracking task priority order is "0" task, while the amount of the search signal to release the semaphore to the semaphore standby waiting task. 如果不存在这样的任务,则将任务优先级为“1”的任务设为搜索对象。 If this task does not exist, task priority task "1" is set to search for objects. 根据是否搜索到以释放信号量为待机信号量的信号量等待任务,分别执行不同的处理。 Depending on whether the search is to release the semaphore of the semaphore wait semaphore waiting task, each performing a different process.

[0260](搜索到时) [0260] (search time)

[0261] B2.以搜索到的任务是任务E来进行说明。 [0261] B2. In search job is the E will be described. RT0S在任务E的TCB中设定“READY”。 RT0S set "READY" in TCB task E's. 另外,清除待机信号量的信号量ID。 Further, removal of the semaphore wait semaphore's ID.

[0262] B3.将任务E的TCB从等待信号量表中移除。 [0262] B3. The mission of E TCB is removed from the wait semaphore list.

[0263] B4.使释放信号量的任务的状态从RUN状态转换到READY状态。 [0263] B4. Release Semaphore a state task transition from RUN to READY. 该任务的TCB被追加到任务就绪表中。 TCB of the task is added to the task ready list.

[0264](未搜索到时) [0264] (when not searched)

[0265] B2.RT0S使信号量计数器递增。 [0265] B2.RT0S that the semaphore counter is incremented.

[0266] B3.使释放信号量的任务的状态从RUN状态转换到READY状态。 [0266] B3. Release Semaphore a state task transition from RUN to READY. 该任务的TCB被追加到任务就绪表中。 TCB of the task is added to the task ready list.

[0267] 普通软件RT0S通过管理上述等待信号量表,进行与信号量相关的处理。 [0267] Common RT0S software manages the wait signal by the scale, a process associated with the semaphore. 在释放信号量时,RT0S根据以下策略从多个WAIT-任务中选择READY-任务。 Upon release of the semaphore, RT0S select READY- tasks from multiple WAIT- tasks in accordance with the following strategy.

[0268] 1.所选择的任务应该为WAIT-任务(第一条件)。 [0268] 1. The task selected should WAIT- task (first condition).

[0269] 2.所选择的任务应该为WAIT-任务中将释放信号量作为待机信号量的任务(第二条件)。 [0269] 2. The task selected should be a release semaphore WAIT- task will signal the standby intensive tasks (second condition).

[0270] 3.当存在多个这种任务时,所选择的任务应该具有最高的任务优先级(第三条件)。 [0270] 3. When there are a plurality of such tasks, the task selected should have the highest priority task (third condition).

[0271] 4.如果存在多个任务优先级最高的任务,所选择的任务应该是转换为WAIT状态的时间最久的任务(第四条件)。 [0271] 4. If a plurality of tasks the highest priority task exists, the task selected should be a WAIT state is converted to the time the oldest task (fourth condition).

[0272] 这四个条件统称为“信号量待机解除条件”。 [0272] These four conditions are collectively referred to as "semaphore wait cancellation condition." 任务处理装置100的信号量选择电路234通过硬件来实现这种RT0S的任务调度功能。 Semaphore task processing apparatus 100 of the selection circuit 234 to achieve this RT0S task scheduling function by hardware.

[0273] [2]由本实施例的硬件RT0S进行的信号量处理 [0273] [2] Hardware RT0S amount signal of the present embodiment performs a process

[0274] 图14是信号量选择电路234的电路图。 [0274] FIG. 14 is a circuit diagram of the semaphore-based selection circuit 234.

[0275] 这里,也是以任务0〜任务7共八个任务为例进行说明。 [0275] Here, the task is the task 0~ 7 of eight tasks as an example. 信号量选择电路234包括四个第一比较电路300 (300a〜300d)、两个第二比较电路302 (302a、302b)、以及一个第三比较电路304。 Semaphore-based selection circuit 234 includes four 1st comparison circuits 300 (300a~300d), two 2nd comparison circuits 302 (302a, 302b), and a third comparison circuit 304. 另外,还包括八个判定电路306 (306a〜306h)。 Further, also includes eight determination circuits 306 (306a~306h).

[0276] 判定电路306的输入信号为来自状态存储单元220的ST、WR、SID信号和来自任务切换电路210的表示信号量ID的信号。 [0276] determination circuit 306 as an input signal ST from the state storage unit 220, WR, SID signals from the task switching circuit 210 indicates the amount of the ID signal. 这里所输入的信号量ID是释放信号量的信号量ID。 Semaphore ID entered here is the semaphore ID of the semaphore released. 如果对应的任务是以释放信号量为待机信号量的信号量等待任务,则判定电路306输出的CID信号为“ 1 ”,如果不是,则输出的CID信号为“0”。 If the task is to release the corresponding semaphore wait semaphore to the semaphore waiting task, it is determined that the CID signal is output from the circuit 306 '. 1 ", if not the CID signal, the output is" 0. " 判定电路306输出基于上述信号量待机解除条件中的第一条件和第二条件的判定结果。 Determination circuit 306 outputs the determination result based on a first condition of the semaphore wait cancellation condition and a second condition. 第一比较电路300的输入信号为两个任务的ID、PR和ΊΊΜ、以及来自判定电路306的CID信号。 A first comparator circuit input signal 300 is ID, PR, and ΊΊΜ two tasks, and the CID signal from the determination circuit 306.

[0277] 第一比较电路300是根据信号量待机解除条件中的第三条件和第四条件进行判定的电路。 [0277] The first comparator circuit 300 is a circuit according to the third determination conditions of the semaphore wait cancellation condition and the fourth condition. 第二比较电路302和第三比较电路304也同样。 The second comparator circuit 302 and the third comparator circuit 304 also. 以上已经说明,RUN-任务选择条件的第二条件和第三条件,与信号量待机解除条件的第三条件和第四条件相同。 It has been described above, a RUN-task selection condition and the third condition the second condition, and third condition of the semaphore wait cancellation condition and a fourth condition of the same. 执行选择电路232的各比较电路是比较任务的状态数据(PR、HM)的电路。 Each execution selection circuit 232 is a comparator circuit comparing the task state data (PR, HM) circuit. 另一方面,信号量选择电路234的各比较电路也是比较任务的状态数据(PR、HM)的电路。 On the other hand, each comparator circuit semaphore-based selection circuit 234 also compare state data of the task (PR, HM) circuit. 因而,执行选择电路232的第一比较电路290和信号量选择电路234的第一比较电路300是内置有相同逻辑的电路,能够共用。 Thus, a first execution selection circuit 290 and comparator circuit 232 signals the amount of first selection circuit 234 is the comparison circuit 300 has the same built-in logic circuit, can be shared. 各任务在通过判定电路306基于第一条件和第二条件进行判定的基础上,通过第一比较电路300进行判定处理。 On the basis of the respective tasks is determined by circuit 306 based on the first and second conditions on the determination, the determination process by the first comparison circuit 300. 之后通过与执行选择电路232相同的判定处理,第三比较电路304输出某一个任务ID。 After the determination process performed by the selection circuit 232 the same, a third comparison circuit 304 outputs a task ID. 当执行等待信号量系统调用以及当执行释放信号量系统调用时进行如下处理。 When executing a wait semaphore system call and performing a process executed when a release semaphore system call.

[0278] <等待信号量系统调用的执行> [0278] <executes a wait semaphore system call>

[0279] 这里,假设任务J为RUN-任务。 [0279] assumes that task J is RUN- task.

[0280] A1.任务切换电路210从信号量表212中检测在等待信号量系统调用中所指定的信号量的信号量计数器。 [0280] A1. Semaphore counter task switching circuit 210 detects an amount of signal wait semaphore system call specified from the signal table 212. 以下根据信号量计数器的值,处理被分别说明。 The value of the semaphore counter, the process branches.

[0281](当信号量计数器>0时) [0281] (When the semaphore counter> 0)

[0282] A2.任务切换电路210使信号量表212的信号量计数器递减。 [0282] A2. The task switching circuit 210 causes the semaphore table 212 the semaphore counter is decremented.

[0283] A3.在任务J的任务状态寄存器258中设定“READY”。 [0283] A3. Setting "READY" in the task state register 258 for task J in. 此时,任务切换电路210设置RUN-任务的定时器252,以开始测量READY经过时间。 At this time, the timer task switching circuit 210 is provided RUN- task 252 to start measuring the elapsed READY time.

[0284](当信号量计数器=0时) [0284] (When the semaphore counter = 0)

[0285] A2.任务切换电路210在任务J的任务状态寄存器258中设定“WAIT”,在待机理由寄存器262中设定“信号量等待”,在信号量ID寄存器264中设定待机信号量的信号量ID,并设定定时器252以开始测量WAIT经过时间。 [0285] A2. The task switching circuit 210 is set 258 "WAIT" in the task state register task J is set in the wait reason register 262 "semaphore wait", setting the amount of standby signal the semaphore ID register 264 semaphore ID, and sets the timer 252 to start measuring the elapsed WAIT time.

[0286] 由此,执行等待信号量系统调用的任务,从RUN状态转换到READY状态或者WAIT状态。 [0286] Thus, tasks wait semaphore system call makes a transition from the RUN state to the READY state or the WAIT state.

[0287] <释放信号量系统调用的执行> [0287] <perform a release semaphore system call>

[0288] B1.任务切换电路210将释放信号量的信号量ID输入到各判定电路306中。 [0288] B1. The task switching circuit 210 releases the semaphore ID of the semaphore to the respective inputs of the determination circuit 306. 各判定电路306根据该信号量ID,判定是否满足信号量待机解除条件中的第一条件以及第二条件。 Each determination circuit 306 in accordance with the semaphore ID, determines whether or not a first condition of the semaphore wait cancellation condition and the second condition is satisfied. 因而,各个第一比较电路300根据第三条件以及第四条件选择任务。 Accordingly, each of the first comparison circuit 300 selects a task according to a third condition and a fourth condition.

[0289](当某一个判定电路306输出“1”,第三比较电路304输出某一个任务ID时) [0289] (When one of the determination circuit 306 outputs "1", the third comparator circuit 304 when the output of one of the task ID)

[0290] B2.任务切换电路210在所检测出的任务的任务状态寄存器258中设定“READY”,清除待机理由寄存器262和信号量ID寄存器264,并使定时器252开始测量READY经过时间。 [0290] B2. The task switching circuit 210 sets the task state register 258 detected in task "READY", clears the wait reason register 262 and the semaphore ID register 264, and causes the timer 252 to start measuring the elapsed READY time.

[0291] B3.在执行系统调用的任务的任务状态寄存器258中设定“READY”,并开始测量READY经过时间。 [0291] B3. In the system call task execution status register 258 for the task of "READY", and starts measuring the elapsed READY time.

[0292](当没有判定电路306输出“1”,第三比较电路304不输出任何一个任务ID时) (When no determination circuit 306 outputs "1", the third comparison circuit 304 does not output any task ID) [0292]

[0293] B2.任务切换电路210使信号量表212的信号量计数器递增。 [0293] B2. The task switching circuit 210 in semaphore table 212 the semaphore counter is incremented.

[0294] B3.使执行系统调用的任务的状态从RUN状态转换到READY状态。 [0294] B3. The state of the system call to perform tasks of a transition from RUN to READY.

[0295] 由于状态存储单元220不断地将状态数据输出给信号量选择电路234,因此当任务切换电路210将信号量ID输入给判定电路306时,信号量选择电路234能够立即执行选择处理。 [0295] Since the state storage units 220 continuously output status data to the semaphore-based selection circuit 234, so when the task switching circuit 210 a semaphore ID to the determination circuit 306, selection circuit semaphore 234 can immediately perform selection process.

[0296][互斥处理] [0296] [mutex Processing]

[0297] 互斥也与信号量相同,用于任务之间的同步处理。 [0297] mutex semaphore is also the same for synchronization between tasks. 互斥和信号量存在以下几点不同。 Mutex and a semaphore exist for the following points.

[0298] 1.信号量计数器可设定为1以上的整数。 [0298] 1. The semaphore counter may be set to an integer of 1 or more. 与此相对,互斥是信号量计数器为1或者0的特殊信号量。 In contrast, a mutex semaphore counter of the semaphore particular 0 or 1. 当信号量计数器为2以上时,能够有2个以上的任务获得相同的信号量。 When the semaphore counter is 2 or more, there can be two or more tasks to obtain the same semaphore. 但是,在互斥的情况下,能够获得某互斥的任务通常只有一个。 However, in the case of mutually exclusive, exclusive access to certain tasks usually only one.

[0299] 2.能够通过释放信号量系统调用释放信号量的任务,不限于通过等待信号量系统调用来获得信号量的任务。 [0299] 2. The call can be released by a release semaphore system task semaphore is not limited to tasks to obtain the semaphore by a wait semaphore system call. 与此相对,能够通过释放互斥系统调用释放互斥的任务,只能是通过等待互斥系统调用来获得互斥的任务。 On the other hand, it can be called mutually exclusive release through the release mutex system task can only be invoked to acquire the mutex by a wait mutex system tasks.

[0300] 在释放互斥时,任务切换电路210从多个WAIT-任务中选择READY-任务的策略如下。 [0300] When a mutex is released, the task selected from a plurality of tasks READY- WAIT- tasks strategy circuit 210 is switched as follows.

[0301] 1.所选择的任务应该是WAIT-任务(第一条件)。 [0301] 1. The task selected should be WAIT- task (first condition).

[0302] 2.所选择的任务应该是WAIT-任务中以释放互斥为待机互斥的任务(第二条件)。 [0302] 2. The task selected should be a task WAIT- tasks (second condition) to release the mutex standby mutually exclusive.

[0303] 3.当存在多个这种任务时,所选择的任务应该是任务优先级最高的任务(第三条件)。 [0303] 3. When there are a plurality of such tasks, the task selected should be a task with the highest task priority order (third condition).

[0304] 4.当存在多个任务优先级最高的任务时,所选择的任务应该是转换为WAIT状态时间最久的任务(第四条件)。 [0304] 4. When a plurality of tasks the highest priority task, the task selected should be a WAIT state is converted to the oldest task (fourth condition).

[0305] 这四个条件统称为“互斥待机解除条件”。 [0305] These four conditions are collectively referred to as "the mutex wait cancellation condition."

[0306] 因而,当执行等待互斥系统调用以及当执行释放互斥系统调用时,本实施例的硬件RT0S执行如下处理。 [0306] Thus, when executing a wait mutex system call and when executing a release mutex system call, the hardware RT0S embodiment of the present embodiment performs the following process. 信号量表212中对应存储互斥ID和表不该互斥是否被哪一个任务占用的占用状态数据。 Signal table 212 stores a mutex ID and occupation state data table should mutex is occupied in which a task. 当该互斥没有被占用时,占用状态数据为“0”,当该互斥被占用时,占用状态数据为占用该互斥的任务的任务ID。 When the mutex is not occupied, the occupation state data is "0", when the mutex is occupied, the occupation state data is the task occupying the mutex task ID.

[0307] <等待互斥系统调用的执行> [0307] <a wait mutex system call>

[0308] 这里,假设任务J为RUN-任务。 [0308] assumes that task J is RUN- task.

[0309] A1.任务切换电路210检测在等待互斥系统调用中指定的互斥是否被占用。 [0309] A1. The task switching circuit 210 detects the mutex designated in a wait mutex system call is occupied. 以下根据该互斥的占用状态,处理被分别说明。 According to the state of the mutex is occupied, the process branches.

[0310](当互斥没有被占用时) [0310] (time when the mutex is not occupied)

[0311] A2.任务切换电路210将执行系统调用的任务的任务ID作为互斥占用状态数据记录。 [0311] A2. Task ID Task switching circuit 210 performs the tasks of a system call exclusive occupation state data record.

[0312] A3.在任务J的任务状态寄存器258中设定“READY”。 [0312] A3. Setting "READY" in the task state register 258 for task J in. 此时,任务切换电路210设置RUN-任务的定时器252,以开始测量READY经过时间。 At this time, the timer task switching circuit 210 is provided RUN- task 252 to start measuring the elapsed READY time.

[0313](当互斥被占用时) [0313] (When the mutex is occupied)

[0314] A2.任务切换电路210在任务J的任务状态寄存器258中设置“WAIT”,在待机理由寄存器262中设置“互斥等待”,在互斥ID寄存器265中设定待机互斥的互斥ID,并设定定时器252以开始测量WAIT经过时间。 [0314] A2. The task switching circuit 210 sets "WAIT" in the task state register 258 for task J, the wait reason register 262 sets "mutex wait", in a mutual mutex ID register 265 is set in the standby mutually exclusive repellent ID, and sets the timer 252 to start measuring the elapsed WAIT time.

[0315] <释放互斥系统调用的执行> [0315] <release mutex system call>

[0316] B1.任务切换电路210在执行系统调用的任务占用释放互斥的条件下,将释放信号量ID输入给互斥电路240。 [0316] B1. The task switching circuit 210 at task executed the system call occupies the mutex is released, the release semaphore ID to the mutex circuit 240. 互斥电路240也包括如图14所示的多阶段连接的比较电路、以及判定是否满足互斥待机解除条件中第一条件以及第二条件的判定电路。 FIG mutex circuit 240 also includes a multi-stage comparator circuit 14 is connected as shown, and determines whether or not the mutex wait cancellation condition satisfied in the first and second conditions of the decision circuit. 该判定电路以该互斥为对象,只有当互斥待机条件中的第一条件以及第二条件同时满足时才输出“1”。 The decision circuit in the mutex object, only when the first exclusive standby condition and a second condition are fulfilled simultaneously outputs "1." 此夕卜,当没有占用释放互斥的任务执行释放互斥系统调用时,使该任务的状态从RUN状态转换到READY状态。 Bu this evening, when there is no release occupation mutually exclusive mandate to release mutex system call, the task of the state transition from RUN to READY.

[0317](当某一个判定电路输出“1”,互斥电路240输出某一个任务ID时) [0317] (When one of the determination circuit outputs "1", the mutex circuit 240 outputs one of the task ID)

[0318] B2.任务切换电路210在所检测出的任务的任务状态寄存器258中设定“READY”,清除待机理由寄存器262和互斥ID寄存器265,并使定时器252开始测量READY经过时间。 [0318] B2. The task switching circuit 210 sets the task state register 258 detected in task "READY", clears the wait reason register 262 and the mutex ID register 265, and causes the timer 252 to start measuring the elapsed READY time.

[0319] B3.在执行系统调用的任务的任务状态寄存器258中设定“READY”,并开始测量READY经过时间。 [0319] B3. In the system call task execution status register 258 for the task of "READY", and starts measuring the elapsed READY time.

[0320](当没有判定电路输出“1”,互斥电路240不输出任何一个任务ID时) (When no decision circuit outputs "1", the mutex circuit 240 does not output any task ID) [0320]

[0321] B2.任务切换电路210在信号量表212中将互斥设定为非占用状态。 [0321] B2. The task switching circuit 210 in a mutually exclusive semaphore table 212 is set in the non-occupied state.

[0322] B3.使执行系统调用的任务的状态从RUN状态转换到READY状态。 [0322] B3. The state of the system call to perform tasks of a transition from RUN to READY.

[0323][事件处理] [0323] [event handler]

[0324] 下面简单说明本实施例中的事件管理。 [0324] The following description of the event management is simple in this embodiment. 事件表214对应记录事件ID和标记模式(以下称作“当前标记模式”)。 Event table records an event ID 214 and the corresponding flag pattern (hereinafter, referred to as "current flag pattern"). 标记模式是8位的位模式。 The flag pattern is 8-bit mode.

[0325] 设定事件系统调用是以事件ID和标记模式(以下称作“设定标记模式”)为参数来更新当前标记模式的系统调用。 [0325] is a set event system call and Event ID flag pattern (hereinafter referred to as "the set flag pattern") as a parameter to update the system calls the current flag pattern. 当执行设定事件系统调用时,对应该事件的当前标记模式更新为与设定标记模式的逻辑或。 When executing a set event system call, should the current flag pattern of events is updated to logic and the set flag pattern. 例如,假如当前标记模式为“00001100”、设定标记模式为“00000101”,则当前标记模式变为“00001101”。 For example, if the current flag pattern is "00001100", mode flag is set to "00000101", the current flag pattern is changed to "00001101." 以下关于各标记模式,从左至右依次称作第0位,第1位,…,和第7位。 Below with respect to each mark pattern, from left to right is referred to bit 0, bit 1, ..., and bit 7.

[0326] 等待事件系统调用是用于等待待机事件的当前标记模式满足规定条件的系统调用,以事件ID、标记模式(以下称作“待机标记模式”)、和标记条件作为参数。 [0326] wait event system call is used to wait for an event waiting system calls the current flag pattern satisfy predetermined conditions, an event ID, flag pattern (hereinafter, referred to as "wait flag pattern"), and a flag condition as parameters. 当执行等待事件系统调用时,判定当前标记模式和待机标记模式之间是否满足标记条件。 When executing a wait event system call satisfies the flag condition determination between the current flag pattern and the wait flag pattern. 标记条件是逻辑或(0R)或者逻辑与(AND)。 Flag condition is logical (0R) or a logic (AND). 在标记条件是逻辑与(AND)的情况下,WAIT解除条件是指对在待机标记模式中为“ 1 ”的全部位,当前标记模式中的对应位也全部是“ 1 ”。 In the flag condition is logical AND (AND) of the case, the WAIT cancellation condition is that as the wait flag pattern of "1" in all bits, corresponding bits in the current flag pattern are all "1." 在标记条件是逻辑或(0R)的情况下,WAIT解除条件是指对在待机标记模式中为“1”的至少一位,当前标记模式的对应位也是“1”。 Under the reference condition is logical (0R) case, the WAIT cancellation condition is that at least one corresponding bit of the current flag pattern in the wait flag pattern is "1" is also "1." 例如,在当前标记模式为“00001101”、待机标记模式为“00000011”、标记条件是“逻辑或(0R) ”的情况下,待机标记模式的第6位以及第7位是1,当前标记模式的第7位是1,因此这种情况下,在等待事件系统调用中指定的WAIT解除条件满足。 For example, in the case where the current flag pattern of "00001101", the wait flag pattern of "00000011", the flag condition is "OR (0R)", the bit 6 and bit 7 of the wait flag pattern is 1, the current flag pattern bit 7 is 1, so in this case, designated in a wait event system call wAIT cancellation condition is fulfilled. 另一方面,在标记条件是“逻辑与(AND)”的情况下,由于当前标记模式的第6位是“0”,因此WAIT解除条件不满足。 On the other hand, the flag condition is "AND (the AND)," a case, since the current flag pattern 6 is "0", the WAIT cancellation condition is not satisfied.

[0327] [1]由普通软件RT0S所进行的事件处理 [0327] [1] event carried out by ordinary processing software RT0S

[0328] 当执行等待事件系统调用以及当执行设定事件系统调用时,普通RT0S执行如下处理。 [0328] When executing a wait event system call and when executing a set event system call, ordinary RT0S performs the following process. 在普通RT0S中,为了管理事件,在存储器上保持着事件表。 In general RT0S in order to manage events, event table maintained in memory. 在该事件表中,不仅存储有事件ID、当前标记模式,通常还对应存储有以该事件为待机事件而处于WAIT状态的任务(以下称作“事件等待任务”)的任务ID、待机标记模式、和标记条件。 In this event table stores not only an event ID, a current flag pattern, usually stored corresponding to the event is waiting tasks in the WAIT state of the event (hereinafter referred to as "event waiting task") of the Job ID, the wait flag pattern and labeling conditions.

[0329] <等待事件系统调用的执行> [0329] <wait event system call>

[0330] A1.RT0S从事件表中读出由系统调用指定的事件的当前标记模式。 [0330] A1.RT0S reads the current flag pattern specified by the system call from the event table events.

[0331] A2.按照标记条件比较当前标记模式和待机标记模式,以判定WAIT解除条件是否满足。 [0331] A2. Comparing the current flag pattern and the wait flag pattern according to the flag condition to determine whether the WAIT cancellation condition is satisfied.

[0332](当WAIT解除条件满足时) [0332] (When the WAIT cancellation condition is fulfilled)

[0333] A3.使执行系统调用的任务的任务状态从RUN状态转换到READY状态。 [0333] A3. The task execution system call task state transition from RUN to READY.

[0334](当WAIT解除条件不满足时) [0334] (When the WAIT cancellation condition is not satisfied)

[0335] A3.在事件表中记录执行系统调用的任务的任务ID。 [0335] A3. Task ID Task execution system call in the event table.

[0336] A4.在事件表中记录待机标记模式。 [0336] A4. Marks recorded in the event table waiting mode.

[0337] A5.在事件表中记录标记条件。 [0337] A5. Records the flag condition in the event table.

[0338] A6.使执行系统调用的任务的任务状态从RUN状态转换到WAIT状态。 [0338] A6. The task execution system call task state transition from RUN to WAIT state.

[0339] <设定事件系统调用的执行> [0339] <set event system call execution>

[0340] B1.RT0S从事件表中读出与系统调用中指定的事件对应的当前标记模式、任务ID、待机标记模式、以及标记条件。 [0340] B1.RT0S reads the current flag pattern, the Job ID, the wait flag pattern and the flag condition in the system calls corresponding to the specified event from the event table.

[0341] B2.将当前标记模式和设定标记模式的逻辑或作为新的当前标记模式进行记录。 [0341] B2. Logic or current flag pattern as a new current flag pattern and the set flag pattern recorded.

[0342](当不存在关于指定事件的事件等待任务时,或者当即使存在关于指定事件的事件等待任务,而根据待机标记模式和标记条件,WAIT解除条件不满足时) [0342] (time when no specified event on the event waiting task, even if the event or when the event on the specified waiting task exists, in accordance with the wait flag pattern and the flag condition, the presence of the WAIT cancellation condition is not satisfied)

[0343] B3.使执行系统调用的任务的任务状态从RUN状态转换到READY状态。 [0343] B3. The task execution system call task state transition from RUN to READY.

[0344](当存在关于指定事件的事件等待任务,且WAIT解除条件满足时) [0344] (when there is an event on a specified event to wait for the task, and the WAIT cancellation condition is fulfilled)

[0345] B3.使事件等待任务的任务状态从WAIT状态转换到READY状态。 [0345] B3. The event of waiting tasks Task state transition from the WAIT state to the READY state.

[0346] B4.清除串件表中的待机任务ID、待机标记模式和标记条件。 [0346] B4. Clear standby strings table Job ID, the wait flag pattern and a flag condition.

[0347] B5.使执行系统调用的任务的任务状态从RUN状态转换到READY状态。 [0347] B5. The task execution system call task state transition from RUN to READY. 另外,进行RUN-任务的选择。 In addition, choose RUN- task.

[0348] 当执行设定事件系统调用时,RT0S从多个WAIT-任务中选择READY-任务的策略如下。 [0348] When executing a set event system call, RT0S select READY- tasks from multiple WAIT- tasks strategy is as follows.

[0349] 1.所选择的任务应该是WAIT-任务(第一条件)。 [0349] 1. The task selected should be WAIT- task (first condition).

[0350] 2.所选择的任务应该是WAIT-任务中以指定事件为待机事件的任务(第二条件)。 [0350] 2. The task selected should be a task WAIT- tasks (second condition) to specify the event of a standby event.

[0351] 3.所选择的任务应该是对待机标记模式、当前标记模式和标记条件进行比较,WAIT解除条件满足的任务(第三条件)。 [0351] 3. The task selected should be to the wait flag pattern, the current flag pattern and a flag condition are compared, releasing the WAIT task (third condition) condition is satisfied.

[0352] 这三个条件统称为“事件待机解除条件”。 [0352] These three conditions are collectively referred to as "event wait cancellation condition."

[0353] [2]由本实施例的硬件RT0S所进行的事件处理 [0353] [2] Event RT0S hardware embodiment of the present embodiment is performed by a process

[0354] 当任务处理装置100执行等待事件系统调用以及执行设定事件系统调用时,RT0S执行如下处理。 [0354] When the task processor 100 executes a wait event system call and performing a set event system call, RT0S performs the following process. 内置于任务处理装置100的信号量表212对应存储事件ID和当前标记模式。 The semaphore table built in the task processor 100 stores an event ID 212, and corresponds to the current flag pattern. 待机任务ID和待机标记模式等信息,存储在状态存储单元220中。 Task ID and a wait flag standby mode information stored in the state storage unit 220.

[0355] <等待事件系统调用的执行> [0355] <wait event system call>

[0356] A1.任务切换电路210从事件表214中读出当前标记模式。 [0356] A1. The task switching circuit 210 reads the current flag pattern from the event table 214.

[0357] A2.任务切换电路210根据标记条件比较当前标记模式和待机标记模式,以判定WAIT解除条件是否满足。 [0357] A2. The task switching circuit 210 compares the current flag condition flag pattern and the wait flag pattern, to determine whether the WAIT cancellation condition is satisfied.

[0358](当WAIT解除条件满足时) [0358] (When the WAIT cancellation condition is fulfilled)

[0359] A3.在执行系统调用的任务的任务状态寄存器258中设定“READY”。 [0359] A3. Setting "READY" in the task state register executed the system call task 258.

[0360](当WAIT解除条件不满足时) [0360] (When the WAIT cancellation condition is not satisfied)

[0361] A3.任务切换电路210在执行系统调用的任务的任务状态寄存器258中设定“WAIT”,在待机理由寄存器262中设定“事件等待”,在事件ID寄存器266中设定待机事件的事件ID,在待机标记寄存器268中设定待机标记模式,以及在标记条件寄存器270中设定标记条件。 [0361] A3. The task switching circuit 210 is set "WAIT" in the task state register executed the system call task 258, setting "wait for event" in the wait reason register 262, preset standby events in the event ID register 266 event ID, the wait flag register 268 is set in the wait flag pattern and the set flag condition in the flag condition register 270.

[0362] <设定事件系统调用的执行> [0362] <set event system call execution>

[0363] B1.任务切换电路210从事件表214中读出当前标记模式,并且将系统调用中指定的事件的事件ID输入给事件选择电路236。 [0363] B1. The task switching circuit 210 reads the current flag pattern from the event table 214, and the system call ID input event specified event to event selection circuit 236.

[0364] B2.任务切换电路210对设定标记模式和来自事件表214的当前标记模式进行逻辑或运算。 [0364] B2. The task switching circuit 210 and the setting flag pattern from the event table the current flag pattern 214 performs a logical OR operation.

[0365] B3.事件选择电路236根据所输入的事件ID选择满足事件待机条件的任务。 [0365] B3. Selection circuit 236 to select the event satisfies the event wait condition event tasks according to the inputted ID. 此时,也可以不考虑任务优先级和WAIT经过时间来选择多个任务。 At this point, it can not be considered a priority task and WAIT elapsed time select multiple tasks.

[0366](当存在满足事件待机解除条件的任务时) [0366] (when there is a task of meeting the event wait cancellation condition)

[0367] B4.任务切换电路210在事件等待任务的任务状态寄存器258中设定“READY”,清除事件ID寄存器266、待机标记寄存器268、和标记条件寄存器270。 [0367] B4. The task switching circuit 210 in event task waiting task state register 258 "READY", clears the event ID register 266, the wait flag register 268, and the flag condition register 270.

[0368] B5.使执行系统调用的任务的任务状态从RUN状态转换到READY状态。 [0368] B5. The task execution system call task state transition from RUN to READY.

[0369](当不存在满足事件待机解除条件的任务时) (When there is no task to meet the event wait cancellation condition) [0369]

[0370] B4.任务切换电路210使执行系统调用的任务的任务状态从RUN状态转换到READY状态。 [0370] B4. The task switching circuit 210 causes the task status of the task executed the system call to a transition from RUN to READY.

[0371][超时处理] [0371] [Timeout process]

[0372] 当WAIT解除条件满足时,转换到WAIT状态的任务转换到READY状态。 [0372] When the WAIT cancellation condition is satisfied, transition to the WAIT state to the READY state conversion task. 但是,如果因为某种外因或应用程序故障而阻碍WAIT解除条件满足时,该任务将不能从WAIT状态离开。 However, if for some external or application failures hinder the WAIT cancellation condition is fulfilled, the task will not leave from the WAIT state. 因此,通常在任务转换到WAIT状态时设定超时值。 Accordingly, the timeout value is normally set a task switch to the WAIT state. 超时值定期递减,当变成零时,即使WAIT解除条件不满足,任务也从WAIT状态转换到READY状态,即防止任务在WAIT状态停留的时间超过超时值。 The timeout value is decremented periodically, if it becomes zero, even if the WAIT cancellation condition is not fulfilled, the task also a transition from WAIT to READY state, that is, preventing the task WAIT state to stay longer than the time-out value.

[0373] [1]由普通软件RT0S所进行的超时处理 [0373] [1] Timeout process performed by a commonly used software RT0S

[0374] 对于普通软件RT0S,在处于WAIT状态的任务的TCB中设定超时值,该超时值周期性地递减。 [0374] For ordinary software RT0S, set timeout value TCB of the task in the WAIT state, the timeout value is decremented periodically. RT0S周期性地向CPU处理申请中断,以检查全部TCB,以及检测出超时值到达0的WAIT-任务。 RT0S apply to periodically interrupt the CPU to check all of the TCB, and detecting a time when the trade surplus to reach WAIT- task 0. 当检测出这种任务时,RT0S使该任务的任务状态从WAIT状态转换到READY状态。 Upon detection of such tasks, RT0S task status of the task to make a transition from the WAIT state to the READY state.

[0375] [2]由本实施例的硬件RT0S所进行的超时处理 [0375] [2] Timeout RT0S processing hardware of this embodiment is performed

[0376] 另一方面,在本实施例中,任务切换电路210周期性地递减各超时计数器274的超时值。 [0376] On the other hand, in the present embodiment, the task switching circuit 210 periodically decrements the timeout value of the timeout counter 274 for each of the. 当执行WAIT系列系统调用时,超时值设定为参数。 When the WAIT series system call, the timeout value is set as a parameter. 任务切换电路210在执行该系统调用的任务的超时计数器274中设定超时值。 The task switching circuit 210 is set 274 to perform tasks of the timeout value of the timeout counter system call.

[0377] 由于超时值的递减处理不需要CPU 150参与,因此任务切换电路210能够不依赖于任务执行处理进行超时值的更新。 [0377] Since the process does not require CPU 150 decrements the timeout value of participation, the task switching circuit 210 without depending on the task execution time-out value is updated. 因此,即使在CPU 150执行任务的过程中,任务控制电路200也能够自动地更新超时值。 Therefore, even when the CPU 150 during the execution of the task, the task control circuit 200 can automatically update time-out value. 由于状态数据不断地被输入到超时检测电路238中,因此超时检测电路238能够在更新超时值的同时,检测出超时值到达0的任务。 Since the state data is continuously inputted to the timeout detecting circuit 238, the timeout detecting circuit 238 therefore can be updated at the same time-out value, the detection task arrival time when surplus 0. 超时检测电路238输出检测出的这种任务的任务ID。 This timeout detecting circuit 238 outputs the detected task of task ID. 当从超时检测电路238获得该任务ID时,任务切换电路210便确定发生了超时,随后申请HC以停止提供CPU时钟。 238 is obtained when the task ID from the timeout detecting circuit, the task switching circuit 210 then determines a timeout has occurred, then the application to stop the supply of the CPU clock HC. 任务控制电路200使发生超时的WAIT-任务转换到READY状态,并且使RUN-任务转换到READY状态。 WAIT- task control circuit 200 so that the task out occurs transition to the READY state, and the transition to the READY state RUN- task. 任务切换电路210从READY-任务中选择下一个应执行的任务。 The task switching circuit 210 selects the next task to be executed from the task READY-. 另外,任务切换电路210重启已发生超时的任务的定时器252,以测量READY经过时间。 Further, the task switching circuit 210 have occurred restart task timeout timer 252 to measure the elapsed READY time.

[0378] 根据这种处理方法,在任务执行过程中,即CPU时钟运行过程中发生超时时,能够通过立即向CPU 150申请中断,来执行任务切换。 [0378] According to this processing method, that a timeout occurs during operation of the CPU clock during task execution, it is possible by applying an interrupt to the CPU 150 immediately to perform a task switch. 另外,在任务执行过程中,任务切换电路210能够不依赖CPU 150的处理能力独立地执行超时值的更新处理。 In addition, during the execution of the task, the task switching circuit 210 without depending on the processing capacity of CPU 150 is performed independently updating the timeout value.

[0379][作为有限状态机的任务切换电路210] [0379] [finite state machine as the task switching circuit 210]

[0380] 图15是任务切换电路210的状态转换图。 [0380] FIG. 15 is a state transition diagram of the task switching circuit 210.

[0381] 在初始化处理(A1)之前,全部任务都处于IDLE状态。 [0381] Before an initialization process (A1), all tasks are in an IDLE state. 当初始化处理完成时(S10),某一个任务成为RUN-任务,任务切换电路210处于任务执行状态(A2)。 When the initialization process is completed (SlO), one of the tasks becomes RUN-, the task switching circuit 210 is the task execution state (A2). 当检测出中断请求信号时(S12),特殊任务成为RUN-任务,执行中断处理(A3)。 When the interrupt request signal is detected (S12), a special task becomes RUN- task, interrupt processing (A3). 当中断处理完成时(S14),任务切换电路210从常规任务中选择RUN-任务,并转换到A2。 When the interrupt processing is completed (S14), the task switching circuit 210 selects a task from RUN- routine tasks, and converted to A2.

[0382] 另外,在任务执行过程中(A2),执行系统调用时(S16),执行系统调用处理(A4)。 [0382] Further, in the task execution process (A2), when the system call is executed (S16), a system call process (A4). 在未发生任务切换即RUN-任务切换的情况下(S18),任务切换电路210返回到A2。 I.e. in the case where the task switching RUN- task switch does not occur (S18), the task switching circuit 210 returns to A2. 另一方面,在由于系统调用处理(A4)而发生任务切换的情况下(S20),任务切换电路210根据执行选择电路232的输出来进行RUN-任务的选择(A5)。 On the other hand, in selecting (A5) As the system call process (A4) and the task switching occurs (S20), the task switching circuit 210 performs the task according to the execution RUN- selection circuit 232 output. 当任务切换完成时(S22),处理状态转换到A2。 When the task switch is completed (S22), the processing transitions to state A2.

[0383] 最后,附带说明一下只安装作为任务处理装置100的主要部件的保存电路120和任务控制电路200中的一个的情况。 [0383] Finally, additional description will be installed as a task processing apparatus only the main components of the storage circuit 100 and the task control 120 in the case of a circuit 200.

[0384][未配置任务控制电路200的类型的任务处理装置100] [0384] [task control circuit is not configured types of task processing apparatus 100, 200]

[0385] 图16是图5所示的任务处理装置100中未配置任务控制电路200的任务处理装置100的电路图。 [0385] FIG. 16 is not arranged in the task processing device 100 shown in FIG. 5 circuit diagram of the task control circuit 200 of the task processing device 100.

[0386] 代替配置任务控制电路200,追加有寄存器切换控制电路322和处理数据存储单元320。 [0386] Instead of providing the task control circuit 200, there is an additional register switching control circuit 322 and data storage processing unit 320. 由于未配置任务控制电路200,因此任务调度功能由软件RT0S来实现。 Since the task control circuit 200 is not configured, the task scheduling function is implemented by software RT0S. 因而,RT0S在任务切换时,需要暂时取得CPU 150的使用权。 Thus, RT0S when task switching, temporarily the right to use of the CPU 150. 处理数据存储单元320通常存储用于RT0S的处理数据。 Processing data storage unit 320 typically stores data for processing of RT0S. 当RT0S取得CPU 150的使用权时,处理数据存储单元320调换存储在处理数据存储单元320中的RT0S用处理数据和存储在特殊寄存器156中的任务用处理数据。 When RT0S acquired right of the CPU 150 to use, RT0S exchange process data storage unit 320 is stored in the data storage unit 320 processing tasks with data processing and data processing are stored in the special registers 156. 以下以从任务A向任务B切换来说明该处理过程。 In the following will be described the task A from the task switching process to B.

[0387] A1.当任务A执行系统调用时,将系统调用中的变量以及系统调用ID记录在某些通用寄存器158内。 [0387] A1. When task A executes a system call, the system call and the system call ID variables recorded in some general-purpose register 158.

[0388] A2.寄存器切换控制电路322将任务A的处理数据移动到处理数据存储单元320中,并将处理数据存储单元320中的RT0S用处理数据加载到处理寄存器组154中。 [0388] A2. Register switching control circuit 322 to move the process data for task A to the process data storage unit 320, and data storage processing unit 320 RT0S loaded into the processing register set 154 with processing data. 在该阶段,RT0S取得CPU 150的使用权。 At this stage, RT0S the right to use of the CPU 150.

[0389] A3.寄存器切换控制电路322向保存寄存器110a输入写入信号,以将处理数据存储单元320中存储的任务A用处理数据保存到保存寄存器110中。 [0389] A3. Register switching control circuit 322 a write signal to the save register 110a inputs, to process data stored in the storage unit 320 for task A to the saved register 110 with data handling.

[0390] A4.RT0S根据记录在通用寄存器158中的系统调用变量和ID,执行与系统调用相对应的处理。 [0390] A4.RT0S variables and call ID, and performs the processing corresponding to the system call recorded in the general-purpose register according to the system 158. 另外,将任务A的TCB中的任务状态数据设定为“READY”,并向任务就绪表中追加任务A的TCB。 In addition, the task status data TCB for task A is set to "READY", added to the ready list for task A task TCB.

[0391] B1.接着,RT0S按照前述的RUN-任务选择条件,选择RUN-任务,这里是选择任务B0 [0391] B1. Next, RT0S of the preceding RUN- task selection condition, RUN- selected task, where the task is to choose B0

[0392] B2.RTOS指示寄存器切换控制电路322将指定任务B的任务选择信号输入到加载选择电路112中。 [0392] B2.RTOS register switching control circuit 322 indicates the specified task selection signal input task B to the load selection circuit 112. 由此,处理数据从保存寄存器110b移动到处理数据存储单元320中。 Thus, the process data is moved from the save register 110b to the process data storage unit 320.

[0393] B3.寄存器切换控制电路322调换处理数据存储单元320中的任务B用处理数据和处理寄存器组154中的RT0S用处理数据。 [0393] B3. Register switching control circuit 322 exchange data storing processing unit 320 and the data processing task B with the processing register set 154. The data RT0S treatment. 由此,任务B取得CPU 150的使用权。 Thus, the task B to obtain the right to use of the CPU 150.

[0394] 根据这种处理方法,与配置任务控制电路200的图5所示的任务处理装置100相t匕,能够使任务处理装置100整体电路小型化。 [0394] According to this processing method, and the task control circuit 200 of FIG. 5 the task processing apparatus 100 illustrated with t dagger, circuit 100 as a whole can be made compact task processing device. RT0S是以软件实现的,但是处理数据的加载/保存是能够由来自寄存器切换控制电路322的信号来硬件控制的。 RT0S is implemented in software, but the process data load / save can be switched by a control circuit 322 from the register of the hardware control signals. 如果将分别连接处理寄存器组154、处理数据存储单元320、加载选择电路112、和保存寄存器110的总线设定为能够并行传输处理数据的位数,则与将处理数据保存到TCB中和从TCB加载处理数据相比,能够实现更高速的任务切换。 If the processing register set 154 are connected to the processing data storage unit 320, the load selection circuit 112, and a save register bus bits can be transmitted in parallel is set to 110 to process data, the process data is saved with a TCB and the TCB data loading process compared to the higher speed task switching.

[0395][未配置保存电路120的类型的任务处理装置100] [0395] [unconfigured types of task processing circuit 120 is stored apparatus 100]

[0396] 图17是图5所示的任务处理装置100中未配置保存电路120的任务处理装置100的电路图。 [0396] FIG. 17 is a circuit diagram of the circuit 100 is not configured to save the task processing apparatus 120 of the task processing apparatus 100 shown in FIG.

[0397] 代替配置保存电路120,追加有中断接口电路324。 [0397] Instead of providing the save circuit 120, an interrupt interface circuit 324 is added. 由于未配置保存电路120,因此处理数据保存到存储器的TCB中。 Since the save circuit 120 is not, the process data saved to TCB memory. 处理数据的保存/加载由基于软件的RTOS来实现。 Save data processing / loading is achieved by the RTOS-based software. 因而,在任务切换时,RTOS需要暂时取得CPU 150的使用权。 Thus, when task switching, RTOS need temporary right to use of the CPU 150. 以下以从任务A向任务B切换来说明该处理过程。 In the following will be described the task A from the task switching process to B.

[0398] 当通过执行系统调用来启动任务切换时,首先软件RT0S将任务A的处理数据保存到任务A的TCB中。 [0398] When the start switch by the task executes a system call, the software first RT0S save process data for task A to the task A in the TCB. 而且,将RT0S用处理数据加载到处理寄存器组154中。 Furthermore, the treatment RT0S data loaded into the processing register set 154. 此时的处理方法与参照图3说明的内容相似。 3 illustrates the contents of processing in this case is similar to the method described with reference to FIG.

[0399] 软件RT0S向中断接口电路324中写入系统调用的参数。 [0399] parameters of the system call to write software RT0S interrupt interface circuit 324. 执行控制电路152使CPU150的CPU时钟停止。 Execution control circuit 152 halts the CPU clock is stopped CPU150. 中断接口电路324使任务控制电路200执行任务切换。 The interrupt interface circuit 324 makes the task control circuit 200 performs task switching. 任务切换电路210,首先将任务A的任务状态寄存器258设定为READY,并根据来自任务选择电路230的输出选择作为下一个RUN-任务的任务B。 The task switching circuit 210, first, the task state register 258 for task A is set to READY, and based on the task from the task selecting circuit 230 outputs selected as the next job B. RUN- 任务切换电路210指示中断接口电路324加载任务B的处理数据。 The task switching circuit 210 directs the interrupt interface circuit 324 to load the data processing task B. 这时,中断接口电路324使执行控制电路152恢复CPU时钟。 At this time, the interrupt interface circuit 324 performs control circuit 152 so that the CPU clock recovery. 另外,中断接口电路324通知软件RT0S已经选择了任务B。 In addition, the interrupt interface circuit 324 notifies the software RT0S has been selected task B. 软件RT0S访问任务B的TCB,以将任务B的处理数据加载到处理寄存器组154中。 RT0S access software TCB for task B so as to load the process data for task B into the processing register set 154.

[0400] 根据这种处理方法,与配置保存电路120的图5所示任务处理装置100相比,能够使任务处理装置100整体电路小型化。 [0400] According to this processing method, and the configuration task processing apparatus shown in FIG. 5 stored 100 in comparison circuit 120, circuit 100 as a whole can be made compact task processing device. RT0S功能的一部分是以软件实现的,但是任务选择处理由任务控制电路200来实现。 RT0S portion functions are implemented in software, but the task selection process is implemented by the task control circuit 200.

[0401] 与参照图2以及图3说明的软件RT0S不同,图16以及图17所示的任务处理装置100,能够任意地将RT0S功能的一部分硬件化。 [0401] software RT0S described with reference to FIG. 2 and FIG. 3 is different 100, the hardware portion can be arbitrarily RT0S function of FIG. 16 and the task processing apparatus 17 shown in FIG. 如参照图16所述,由于配置了保存电路120,而无需访问用于处理数据保存/加载的TCB。 As described with reference to FIG 16, due to the configuration of the TCB save circuit 120, for processing the data without having to access the save / load. 因此,能够通过寄存器切换控制电路322来执行处理数据的保存/加载处理。 Thus, data saving processing can be performed by the register switching control circuit 322 / loading process. 另外,如参照图17所述,由于配置了任务控制电路200,因此软件RT0S能够将任务选择功能转移给任务控制电路200。 Further, as described with reference to FIG 17, due to the configuration of the task control circuit 200, so the software can be RT0S task selecting function to the task control circuit 200 transfers.

[0402] 如参照图5所述,在配置了保存电路120和任务控制电路200的任务处理装置100的情况下,能够将RT0S的任务调度功能完全硬件化。 [0402] As described with reference to FIG. 5, in the case where the configuration save circuit 120 and the task control circuit 200 of the task processing device 100, it can be RT0S task scheduling function of an entirely hardware. 由于在任务转换时没有必要访问存储器中的TCB,因此使任务切换处理的速度进一步提高。 Since there is no need to access the memory when task switching TCB, thus the task switching processing speed is further improved. 本发明人等的实验表明:与参照图3说明的普通软件RT0S相比,本实施例中的任务处理装置100以约100倍的速度进行操作。 The present inventors experiments showed that: compared with the conventional software RT0S described with reference to FIG. 3, the task processing apparatus 100 in the present embodiment operates to about 100 times faster.

[0403] 以上,参照实施例说明了本发明。 [0403] above with reference to examples illustrate the present invention. 这些实施例只是示例,本领域技术人员能够理解,能够对这些结构要素、处理流程的组合进行各种变型,而这些变型也属于本发明的范围。 These examples are illustrative only, those skilled in the art will appreciate that various modifications can be performed on a combination of these structural elements, the processing flow, and these variations are within the scope of the present invention.

[0404] 权利要求中所述的选择电路的功能,由本实施例中的加载选择电路112来实现。 In the [0404] claims function selecting circuit according to the present embodiment by the load selection circuit 112 in the embodiment is achieved.

[0405] 除此之外,本领域技术人员还能够理解,由权利要求中所述的各结构要素实现的其他功能,也能够由本实施例中所述的各功能模块单独或者它们的结合来实现。 [0405] In addition, those skilled in the art will also appreciate that the other functions by each component as claimed in claim implemented, the functional modules described in the embodiment can be present alone or in a combination thereof to achieve .

[0406] 能够通过以上实施例以及其变型例包括的本发明的各种方式,已经以包括权利要求范围中所述内容的形式,在下面列出。 [0406] By the above embodiments and various embodiments can be of the present invention comprises a modification thereof have been described in the scope of the claims to the content of the form include, listed below. 参照任务控制电路200的特征,理解以下发明。 Referring wherein the task control circuit 200, understanding the following disclosure.

[0407] C1.一种任务处理装置,该任务处理装置包括: . [0407] C1 one kind of task processing apparatus, the job processing apparatus comprising:

[0408] 处理寄存器,用于暂时存储用于执行任务的数据;执行控制电路,用于将命令(instruct1n)和操作数从存储器加载到所述处理寄存器中,并按照所述处理寄存器中的命令和操作数执行任务; [0408] processing register for temporarily storing data for performing a task; execution control circuit, for a command (instruct1n) and operands loaded from the memory into the processing register, and according to the processing command register and the number of operations performed tasks;

[0409] 多个状态寄存器,用于存储用于任务调度的每个任务的状态数据,分别与多个任务相对应; [0409] a plurality of status registers for storing the status for each task in the task scheduling data, respectively corresponding to the plurality of tasks;

[0410] 任务切换电路,用于执行任务的切换;以及 [0410] The task switching circuit for switching tasks; and

[0411] 任务选择电路,用于以从多个所述状态寄存器中并行输出的状态数据为输入,并根据规定的选择条件来选择任务;其中 [0411] The task selecting circuit configured to output in parallel from said plurality of state status register input data, and to select a task according to a predetermined selection condition; wherein

[0412] 当所述执行控制电路执行规定的系统调用命令时,将规定的系统调用信号发送给所述任务切换电路; [0412] When the system of the execution control circuit executes a predetermined call instruction, the predetermined system call signal to the task switching circuit;

[0413] 所述任务选择电路不依赖于是否有所述规定的系统调用命令,从表示能够执行和等待执行的处于READY (就绪)状态的任务中,选择成为执行对象的任务; [0413] The task of the task selecting circuit does not depend on whether there is the predetermined system call instruction, and capable of executing the waiting to be executed in the READY (READY) state, the selected object becomes the task execution;

[0414] 所述任务切换电路通过根据接收到所述系统调用信号时来自所述任务选择电路的输出,选择成为下一个执行对象的任务,将所述处理寄存器中的数据保存到规定的存储区域,并将与执行中的任务对应的所述状态寄存器中的状态数据从表示任务执行中的RUN(运行)状态更新为READY状态,将与所选择的任务对应的并保存在所述存储区域中的数据加载到所述处理寄存器中,并将与该选择的任务对应的所述状态寄存器中的状态数据从READY状态更新为RUN状态,来切换成为执行对象的任务。 [0414] The task switching circuit output by selecting tasks from the system according to the call when receiving the signal circuit, select the next task to become the object of execution, said data processing register in a predetermined storage region of , and the corresponding task execution status register in the state represented by the data update from the task execution rUN (running) state to the READY state, a task corresponding to the selected and stored in the storage area processing the data loaded into the register, the status register and the status data corresponding to the task selected is updated from READY state to the RUN state, the task execution is switched to become an object.

[0415] C2.根据C1所述的任务处理装置,其中,所述任务选择电路内置有多阶段连接的比较电路; . [0415] C2 task processor according to C1, wherein the task selecting circuit built multiple stage comparator circuit is connected;

[0416] 第1阶段的比较电路根据所述规定的选择条件来比较两个以上任务的状态数据,以将某一个任务的状态数据输出给第2阶段的比较电路; The comparison circuit [0416] of the first stage to compare two or more tasks according to the selection state data of the predetermined condition to the status of a task to the data output of the second phase comparator circuit;

[0417] 第η (η是2以上的自然数)阶段的比较电路根据所述规定的选择条件来比较第(η-l)阶段的多个比较电路所输出的状态数据,以输出某一个任务的状态数据,从而选择最后阶段的比较电路所指定的任务作为执行对象。 [0417] Status data of η (η is a natural number of 2 or more) to compare the phase comparator circuit according to a selection condition of the predetermined plurality of comparator circuits (η-l) of the output stage to the output of one of the tasks of status data, to select the final stage of the comparator circuit designated as the execution target task.

[0418] C3.根据C2所述的任务处理装置,其中,第k(k是自然数)阶段的比较电路在所输入的状态数据都不满足所述规定的选择条件时,不输出任何任务的状态数据。 When the [0418] C3. The task processor according to C2, wherein the first k (k is a natural number) data in the phase comparator circuit does not select the input state of the predetermined condition is satisfied, the state does not output any task data.

[0419] C4.根据C1所述的任务处理装置,其中,所述状态寄存器将任务优先级作为状态数据的一部分存储; . [0419] C4 task processor according to C1, wherein the task priority register state stored as part of the state of transactions;

[0420] 当任务切换时有多个处于READY状态的任务时,所述任务选择电路选择这些任务中任务优先级最高的任务作为执行对象。 When [0420] When the task switching a plurality of tasks in the READY state, the task selecting circuit selects the task with the highest priority task in the task targeted for execution.

[0421] C5.根据C4所述的任务处理装置,其中,当任务切换时存在多个处于READY状态的任务、且这些任务中任务优先级最高的任务也存在多个时,任务选择电路选择转换为READY状态后经过时间最长的任务作为执行对象。 [0421] C5. The task processor according to C4, wherein, the presence of a plurality of tasks in the READY state when the task switching, and the task with the highest task priority tasks when there are a plurality of task selecting circuit selects the conversion after the longest mission is targeted for execution after the READY state.

[0422] C6.根据C5所述的任务处理装置,该任务处理装置还包括分别与多个任务相对应的多个定时器;其中 . [0422] C6 C5-task processing apparatus according to the task processing apparatus further comprises a plurality of timers respectively corresponding to the plurality of tasks; wherein

[0423] 当所述任务切换电路设定任务为READY状态时,所述任务切换电路通过设置与该任务对应的定时器,开始测量经过时间。 [0423] When the task switching circuit sets the task to the READY state, the task switching circuit is provided by corresponding to the task timer, to start measuring the elapsed time.

[0424] C7.根据C1所述的任务处理装置,该任务处理装置还包括用于对应存储信号量ID和信号量计数器的信号量信息存储单元;其中 . [0424] C7 task processor according to C1, the task processing apparatus further includes a signal corresponding to the amount information storing unit stores semaphore ID and a semaphore counter; wherein

[0425] 在所述执行控制电路执行指定信号量ID的作为用于请求信号量的系统调用的等待信号量命令的情况下, [0425] In the case of a wait semaphore system call for requesting a semaphore of the execution control circuit executes the specified semaphore ID of the command,

[0426] 所述任务切换电路在所指定的信号量的信号量计数器是1以上时,使该信号量计数器递减,并将执行所述等待信号量命令的任务的状态数据更新为READY状态,以及,当该信号量计数器是0以下时,所述任务切换电路将执行所述等待信号量命令的任务的状态数据设定为表示在满足规定条件之前不能执行该任务的WAIT (等待)状态,并将所述所指定的信号量ID设定在对应的所述状态寄存器中,表示以该ID作为该任务的WAIT状态解除条件;以及 [0426] The task switching circuit in the specified amount of the signal semaphore counter is 1 or more, so that the semaphore counter is decremented, and the execution state of the task in wait semaphore command data is updated to the READY state, and when the semaphore counter is 0 or less, the task switching circuit to perform the task in wait state semaphore command data set to indicate the wAIT task can not be executed until a predetermined condition is satisfied (wait) state, and the designated semaphore ID in the associated state of the register, as indicated by the ID of the task state WAIT cancellation condition; and

[0427] 在所述执行控制电路执行指定信号量ID的作为用于释放信号量的系统调用的释放信号量命令的情况下, [0427] In the case of a release semaphore system call for releasing a semaphore of the execution control circuit executes the specified semaphore ID of the command,

[0428] 所述任务选择电路按照规定的选择条件,从处于等待具有指定信号量ID的信号量的WAIT状态的任务中选择某一个任务,并且 Task [0428] The task selecting circuit in accordance with a predetermined selection conditions with the semaphore ID of the semaphore specified in the WAIT state waiting is selected from one of the tasks, and

[0429] 当所述任务选择电路选择出某一个任务时,所述任务切换电路更新该所选任务的状态数据为READY状态,而当没有选择出任何任务时,使所述所指定的信号量的信号量计数器递增。 Status data [0429] When the task selecting circuit selects one of the tasks, the task switching circuit updates the selected task to READY, and when not selected any job, the amount of signals of the designated the semaphore counter is incremented.

[0430] C8.根据C1所述的任务处理装置,该任务处理装置还包括用于对应存储事件ID和第一标记模式的事件信息存储单元;其中 . [0430] C8 task processor according to C1, the task processing apparatus further includes means for storing a corresponding event ID and a first flag pattern in the event information storage unit; wherein

[0431] 在所述执行控制电路执行指定事件ID和第二标记模式的作为用于等待事件设定的系统调用的等待事件命令的情况下, [0431] In a case where the execution control circuit executes a wait event system as specified event ID and a second flag pattern waiting for call event setting command,

[0432]当通过对与所指定的事件对应的第一标记模式和第二标记模式进行运算操作,满足规定的运算条件时,所述任务切换电路将执行所述等待事件命令的任务的状态数据更新为READY状态,以及,当不满足所述规定的运算条件时,所述任务切换电路将执行所述等待事件命令的任务设定为表示在满足规定的条件之前不能执行该任务的状态的WAIT状态,并且将所指定的事件ID和第二标记模式设定在对应的所述状态寄存器中,表示以该事件ID和该第二标记模式作为该任务的WAIT状态解除条件;以及 [0432] When the operation conditions by the first mark and the second mark pattern specified by the pattern and performs an arithmetic operation corresponding to the event, are satisfied, the task switching circuit to perform the tasks waiting for an event command status data It is updated to the READY state, and when said predetermined operation condition is not satisfied, the task switching circuit to perform the tasks waiting for an event command is not the setting state of execution of the task before the predetermined condition is satisfied is expressed wAIT state, and the designated event ID and the second flag pattern in the associated state of the register indicates to the event ID and the second flag pattern as the WAIT state of the task is released condition; and

[0433] 在所述执行控制电路执行指定事件ID和第三标记模式的作为用于设定第一标记模式的系统调用的设定事件命令的情况下, [0433] In a case where the execution control circuit executes the specified event ID and a third flag pattern as a set event system for setting a first flag pattern of the command is called,

[0434] 所述任务切换电路对与所指定的事件对应的第三标记模式和第一标记模式进行逻辑或运算; [0434] The task switching circuit of the third mode and the first flag pattern and the flag corresponding to the specified event OR'd;

[0435] 所述任务选择电路选择处于等待该指定的事件ID的事件的WAIT状态的任务; [0435] The selecting circuit selects the task is in the WAIT state waiting for the designated event ID of the event tasks;

[0436] 当所述任务选择电路选择出某一个任务时,所述任务切换电路在存储于所选择出的任务的所述状态寄存器中的第二标记模式和第一标记模式之间满足规定的运算条件的情况下,将所选择的任务从WAIT状态更新为READY状态。 [0436] When the task selecting circuit selects one of the tasks, the task switching circuit between the status register is stored in the selected task in a first mode and a second marker pattern satisfies a predetermined flag in the case of calculation conditions, the selected task updates from the WAIT state to the READY state.

[0437] C9.根据C1所述的任务处理装置,其中,所述状态寄存器将超时计数器作为状态数据的一部分存储; . [0437] C9 task processor according to C1, wherein said status register stores a timeout counter as part of the state data;

[0438] 在所述执行控制电路执行附带超时条件的系统调用命令的情况下, [0438] In the case where the system call instruction execution control circuit executes a timeout condition is included,

[0439] 所述任务切换电路将执行所述附带超时条件的系统调用命令的任务的状态数据更新为WAIT状态,并且开始更新超时计数器; [0439] The task switching circuit that executes the system call comes timeout condition command task status data is updated to the WAIT state, and starts updating the timeout counter;

[0440] 所述任务选择电路检测处于WAIT状态中已超时的任务; [0440] The task selecting circuit detects a task in the WAIT state has timed out;

[0441] 所述任务切换电路将所述已超时的任务的状态数据从WAIT状态更新为READY状态。 The [0441] The task switching circuit has timed out the state of the data update task from WAIT state to the READY state.

[0442] C10.根据C1所述的任务处理装置,该任务处理装置还包括用于对应存储互斥ID和互斥获取状态的互斥信息存储单元;其中 . [0442] C10 task processor according to C1, the task processing apparatus further includes means for storing the mutex ID and a corresponding mutex information storage unit acquires exclusive state; wherein

[0443] 在所述执行控制电路执行指定互斥ID的作为用于请求互斥的系统调用命令的等待互斥命令的情况下, In the case [0443] designated mutex ID in the execution control circuit executes a system call instruction for requesting the exclusive command of waiting for the mutex,

[0444] 所述任务切换电路在所指定的互斥原来是非占用状态时,设定该所指定的互斥为占用状态,并将执行所述等待互斥命令的任务的状态数据更新为READY状态,以及,在该所指定的互斥是占用状态时,将执行所述等待互斥命令的任务设定为表示在满足规定条件之前不能执行该任务的状态的WAIT状态,并且将所述所指定的互斥ID设定在对应的所述状态寄存器中,表示以所述互斥ID作为该任务的WAIT状态解除条件;以及 [0444] The task switching circuit when the designated mutex original non-occupied state, sets the designated mutex is occupied state, and perform the tasks waiting for the mutex state data update command to READY and, when the designated mutex is occupied state, to perform the tasks waiting for the mutex is set to indicate the status of the command can not be executed before the task in the wAIT state satisfies a predetermined condition, and the designated mutex ID in the associated state of said register as indicated by the mutex ID of the task state WAIT cancellation condition; and

[0445] 当所述执行控制电路执行指示互斥ID的作为用于释放互斥的系统调用命令的释放互斥命令的情况下, [0445] In the case where the execution instruction execution control circuit as a mutex ID of the mutex system call instruction for releasing the mutex release command,

[0446] 所述任务选择电路按照规定的选择条件,选择处于等待所指定的互斥ID的互斥的WAIT状态的任务中的某一个任务; [0446] The task selecting circuit according to a predetermined selection condition to select one of the tasks waiting in the designated mutex ID of the mutex of the WAIT state of the task;

[0447] 所述任务切换电路将所指定的互斥设定为非占用状态,当所述任务选择电路选择出某一个任务时,将所选择的任务的状态数据更新为READY状态。 The [0447] The task switching circuit designated mutex set to the non occupied state, when the task selecting circuit selects one of the tasks, the state data of the selected job is updated to the READY state.

[0448] C11.根据C1所述的任务处理装置,该任务处理装置还包括多个保存寄存器,用于在所述处理寄存器中保存数据,分别与多个任务相对应;其中, . [0448] C11 task processor according to C1, the task processing apparatus further comprises a plurality of storage registers for storing data in the processing register respectively corresponding to the plurality of tasks; wherein,

[0449] 当所述任务切换电路接收到所述规定的系统调用信号时,将所述处理寄存器中的数据保存到与执行中的任务对应的所述保存寄存器中,并将与通过所述任务选择电路所选择的任务对应的所述保存寄存器中的数据加载到所述处理寄存器中。 [0449] When the task switching circuit receives the signal of the predetermined system call, the processing data storage register corresponding to the task to the execution of said save register and through said task the data storage register corresponding to the task selected by the selection circuit is loaded into the processing register.

[0450] 工业实用性 [0450] Industrial Applicability

[0451] 根据本发明,能够在多任务处理中实现更高效的任务执行控制。 [0451] According to the present invention, it is possible to achieve more efficient task execution control in multitasking.

Claims (11)

  1. 1.一种任务处理装置,该任务处理装置包括: 处理器; 任务控制电路,经由信号线而与所述处理器连接,并用于控制任务的切换, 所述处理器包括: 处理寄存器,用于暂时存储用于执行任务的数据; 执行控制电路,用于将命令和操作数从存储器加载到所述处理寄存器中,并按照所述处理寄存器中的命令和操作数执行任务, 所述执行控制电路包括命令解码器,所述命令解码器判断成为执行对象的命令是否是规定的系统调用命令,当执行规定的系统调用命令时,将不包括表示下一个应被执行的任务的信息的、规定的系统调用信号经由所述信号线发送给所述任务控制电路, 所述任务控制电路包括: 多个状态寄存器,用于存储用于任务调度的每个任务的状态数据,分别与多个任务相对应; 任务切换电路,用于执行任务的切换; 任务选择电路,用于以从多 A task processing apparatus, the job processing apparatus comprising: a processor; task control circuit is connected to the processor via the signal line, and for switching the control tasks, the processor comprising: a processing register for temporarily stores data for performing a task; execution control circuit for commands and operands loaded from memory into the processing register, and the process according to the command register operands and perform tasks, the execution control circuit includes a command decoder, the command decoder determines whether instructions to be executed is a predetermined system call instruction, when executing a predetermined system call instruction, the information representing the next task to be executed will not be included in a predetermined system call signal transmitted via said signal line to said task control circuit, the task control circuit comprising: a plurality of status registers for storing state data for each task of the task scheduling, respectively corresponding to the plurality of tasks ; task switching circuit for switching of tasks; task selecting circuit for a multi from 所述状态寄存器中并行输出的状态数据为输入,并根据规定的选择条件来选择任务, 其中, 所述执行控制电路执行系统调用命令时,将规定的系统调用信号发送给所述任务切换电路, 所述任务选择电路不依赖于是否有所述规定的系统调用命令,从表示能够执行和等待执行的处于就绪状态的任务中,选择成为执行对象的任务, 所述任务切换电路通过根据接收到所述系统调用信号时来自所述任务选择电路的输出,选择成为下一个执行对象的任务,并将与执行中的任务对应的所述状态寄存器中的状态数据从表示任务执行中的运行状态更新为其他状态,并将与该选择的任务对应的所述状态寄存器中的状态数据从就绪状态更新为运行状态,来切换成为执行对象的任务。 The state data output in parallel to the input status register, and to select a task according to a predetermined selection condition, wherein the system call is executed when the call instruction signal, the control circuit performs a predetermined transmission system to the task switching circuit, the task selecting circuit does not depend on whether there is said predetermined system call instruction, the task in the ready state from presentation can be performed and waiting to be executed, the task execution become the selected target, the task switching circuit according to a received by the said system when said call signal output from the task selecting circuit selects a task execution become the next object, and the status data corresponding to the task execution and the status register is updated from the operating state indicates that the task is executed other state and updating the status data corresponding to the selection status of the task register from the ready state to the running state, the object to perform task switching becomes.
  2. 2.根据权利要求1所述的任务处理装置,其中,所述任务选择电路内置有多阶段连接的比较电路; 第I阶段的比较电路根据所述规定的选择条件来比较两个以上任务的状态数据,以将某一个任务的状态数据输出给第2阶段的比较电路; 第η阶段的比较电路根据所述规定的选择条件来比较第η-1阶段的多个比较电路所输出的状态数据,其中η是2以上的自然数,以输出某一个任务的状态数据,从而选择最后阶段的比较电路所指定的任务作为执行对象。 The task processing apparatus according to claim 1, wherein the task selecting circuit built multiple stage comparator circuit connected; Phase I comparison circuit to compare two or more tasks according to the predetermined selection condition state data to output status data to the one of the tasks of the second phase comparator circuit; [eta] phase comparison circuit according to the selection of the predetermined condition to compare the first plurality of comparator circuits η-1 stage output status data, wherein η is a natural number of 2 or more, one of the tasks in the state of output data, thereby selecting the final stage comparator circuit designated as the execution target task.
  3. 3.根据权利要求2所述的任务处理装置,其中,第k阶段的比较电路在所输入的状态数据都不满足所述规定的选择条件时,不输出任何任务的状态数据,其中k是自然数。 3. The task processing apparatus according to claim 2, wherein the comparison circuit in the k th stage of the data input state is not the predetermined selection condition is satisfied, does not output any task status data, wherein k is a natural number .
  4. 4.根据权利要求1所述的任务处理装置,其中,所述状态寄存器将任务优先级作为状态数据的一部分存储; 当任务切换时有多个处于就绪状态的任务时,所述任务选择电路选择这些任务中任务优先级最高的任务作为执行对象。 The task processing apparatus according to claim 1, wherein said status register storing the task priority as part of the state of transactions; when a plurality of tasks in the ready state when a task switch, the task selecting circuit selects the task of highest priority task in the task targeted for execution.
  5. 5.根据权利要求4所述的任务处理装置,其中,当任务切换时存在多个处于就绪状态的任务、且这些任务中任务优先级最高的任务也存在多个时,任务选择电路选择转换为就绪状态后经过时间最长的任务作为执行对象。 The task processing apparatus according to claim 4, wherein there are a plurality of tasks in the ready state when the task switching, and most of these tasks in a task priority when there are a plurality of task selecting circuit selects convert after the longest mission targeted for execution after the ready state.
  6. 6.根据权利要求5所述的任务处理装置,该任务处理装置还包括分别与多个任务相对应的多个定时器;其中当所述任务切换电路设定任务为就绪状态时,所述任务切换电路通过设置与该任务对应的定时器,开始测量经过时间。 6. The task processing apparatus according to claim 5, the task processing apparatus further comprises a plurality of timers respectively corresponding to the plurality of tasks; wherein when the task switching circuit sets the task to the ready state, the task the switching circuit is provided corresponding to the task by a timer, to start measuring the elapsed time.
  7. 7.根据权利要求1所述的任务处理装置,该任务处理装置还包括用于对应存储信号量ID和信号量计数器的信号量信息存储单元;其中在所述执行控制电路执行指定信号量ID的作为用于请求信号量的系统调用的等待信号量命令的情况下, 所述任务切换电路在所指定的信号量的信号量计数器是I以上时,使该信号量计数器递减,并将执行所述等待信号量命令的任务的状态数据更新为就绪状态,以及,当该信号量计数器是O以下时,所述任务切换电路将执行所述等待信号量命令的任务的状态数据设定为表示在满足规定条件之前不能执行该任务的等待状态,并将所述所指定的信号量ID设定在对应的所述状态寄存器中,表示以该ID作为该任务的等待状态解除条件;以及在所述执行控制电路执行指定信号量ID的作为用于释放信号量的系统调用的释放信号量命令的情况下 The task processing apparatus according to claim 1, the apparatus further includes a signal processing task amount information storing unit for storing a signal corresponding to the amount of the semaphore ID and a counter; wherein in performing the designated semaphore ID of the execution control circuit as the case of a wait semaphore system call request semaphore command, the task switching circuit semaphore counter of the semaphore designated I above is that the semaphore counter is decremented, and the execution wait semaphore command task status update data ready state, and, when the semaphore counter is O or less, the task switching circuit performs the task in wait state data semaphore command is satisfied are set up in the You can not perform the task waiting state until a predetermined condition, and the designated semaphore ID in the associated state of the register indicates to the wait state of the task ID as a release condition; and the execution When the control circuit performs the specified semaphore ID of the semaphore released as a release semaphore system call command , 所述任务选择电路按照规定的选择条件,从处于等待具有指定信号量ID的信号量的等待状态的任务中选择某一个任务,并且当所述任务选择电路选择出某一个任务时,所述任务切换电路更新该所选任务的状态数据为就绪状态,而当没有选择出任何任务时,使所述所指定的信号量的信号量计数器递+¾>曰ο Task, the task selecting circuit in accordance with a predetermined selection condition, from having to wait in the designated semaphore ID of the semaphore wait state selected one of the tasks, and when the task selecting circuit selects one of the tasks, the the task switching circuit updates the state data of the selected task to the ready state, when not selected any job, the amount of signals of the designated semaphore counter handover + ¾> said ο
  8. 8.根据权利要求1所述的任务处理装置,该任务处理装置还包括用于对应存储事件ID和第一标记模式的事件信息存储单元;其中在所述执行控制电路执行指定事件ID和第二标记模式的作为用于等待事件设定的系统调用的等待事件命令的情况下, 当通过对与所指定的事件对应的第一标记模式和第二标记模式进行运算操作,满足规定的运算条件时,所述任务切换电路将执行所述等待事件命令的任务的状态数据更新为就绪状态,以及,当不满足所述规定的运算条件时,所述任务切换电路将执行所述等待事件命令的任务设定为表示在满足规定的条件之前不能执行该任务的状态的等待状态,并且将所指定的事件ID和第二标记模式设定在对应的所述状态寄存器中,表示以该事件ID和该第二标记模式作为该任务的等待状态解除条件;以及在所述执行控制电路执行指定 The task processing apparatus according to claim 1, which further comprises a job processing apparatus for storing a corresponding event ID and a first flag pattern information storing unit; wherein the execution control circuit executes a second specified event ID and wait event as a case where the mode flag is set for a wait event system call command, by the operation conditions when a first mode and a second marker flag pattern corresponding to the specified event and performs arithmetic operations, satisfy a predetermined state, the task switching circuit to perform the tasks waiting for an event data update command to the ready state, and, when said predetermined operation condition is not satisfied, the task switching circuit to perform the tasks waiting for an event command set to indicate the state of the task can not be executed until a predetermined condition is satisfied in the waiting state, and the designated event ID and the second flag corresponding to the mode set in the status register, the event ID and indicates to the a second flag pattern of the task waiting state cancellation condition; and performing the execution control circuit designated 件ID和第三标记模式的作为用于设定第一标记模式的系统调用的设定事件命令的情况下, 所述任务切换电路对与所指定的事件对应的第三标记模式和第一标记模式进行逻辑或运算;所述任务选择电路选择处于等待该指定的事件ID的事件的等待状态的任务; 当所述任务选择电路选择出某一个任务时,所述任务切换电路在存储于所选择出的任务的所述状态寄存器中的第二标记模式和第一标记模式之间满足规定的运算条件的情况下,将所选择的任务从等待状态更新为就绪状态。 When the setting member event ID and a third flag pattern for setting a first flag pattern command system call, the task switching to the specified event corresponding to the third mode and the first flag of flag circuit logical oR operation mode; the task selecting circuit selects the task in the waiting state to wait the designated event ID of the event; when the task selecting circuit selects one of the tasks, the task switching circuit to the selected memory a case where a predetermined condition is satisfied between the operation state of the task register in the second mode and the first flag pattern marks, the selected update task from the wait state to the ready state.
  9. 9.根据权利要求1所述的任务处理装置,其中,所述状态寄存器将超时计数器作为状态数据的一部分存储; 在所述执行控制电路执行附带超时条件的系统调用命令的情况下, 所述任务切换电路将执行所述附带超时条件的系统调用命令的任务的状态数据更新为等待状态,并且开始更新超时计数器;所述任务选择电路检测处于等待状态中已超时的任务;以及所述任务切换电路将所述已超时的任务的状态数据从等待状态更新为就绪状态。 9. The task processing apparatus according to claim 1, wherein said status register stores a timeout counter as part state data; in the case of the system call instruction execution control circuit executes a timeout condition is included, the task It included the switching circuit performs a timeout condition system call instruction data updating task state to the wait state, and starts updating the timeout counter; in the task selecting circuit detects a timed task waiting state; and the task switching circuit the status of the data has been updated from the task timeout wait state to the ready state.
  10. 10.根据权利要求1所述的任务处理装置,该任务处理装置还包括用于对应存储互斥ID和互斥获取状态的互斥信息存储单元;其中在所述执行控制电路执行指定互斥ID的作为用于请求互斥的系统调用命令的等待互斥命令的情况下, 所述任务切换电路在所指定的互斥原来是非占用状态时,设定该所指定的互斥为占用状态,并将执行所述等待互斥命令的任务的状态数据更新为就绪状态,以及,在该所指定的互斥是占用状态时,将执行所述等待互斥命令的任务设定为表示在满足规定条件之前不能执行该任务的状态的等待状态,并且将所述所指定的互斥ID设定在对应的所述状态寄存器中,表示以所述互斥ID作为该任务的等待状态解除条件;以及当所述执行控制电路执行指示互斥ID的作为用于释放互斥的系统调用命令的释放互斥命令的情况下,所述任务选择电路按 10. The task processing apparatus according to claim 1, which further comprises a job processing apparatus for storing the mutex ID and a corresponding mutex information storage unit acquires exclusive state; wherein the designated mutex ID in the execution control circuit executes as for the case where the wait mutex system call command requests exclusive command, the task switching circuit when the designated mutex original non-occupied state, sets the designated mutex is occupied state, and the tasks of the mutex wait state data update command to the ready state, and, at the designated mutex is occupied state, to perform the tasks waiting for the mutex command set to indicate a predetermined condition is satisfied wait until it can not perform the task status, and the designated mutex ID in the associated state of the register, as indicated by the mutex ID of the task waiting state cancellation condition; and when a case where the execution instruction of the control circuit as a mutex ID of the mutex system call instruction for releasing the mutex release command, according to the task selecting circuit 规定的选择条件,选择处于等待所指定的互斥ID的互斥的等待状态的任务中的某一个任务; 所述任务切换电路将所指定的互斥设定为非占用状态,当所述任务选择电路选择出某一个任务时,将所选择的任务的状态数据更新为就绪状态。 Selecting a predetermined condition, select the mutex designated in a wait mutex ID of the task in a wait state a task; the task switching circuit sets the designated mutex set to the non occupied state when the task when the selection circuit selects one of the tasks, the state data of the selected job is updated to the ready state.
  11. 11.根据权利要求1所述的任务处理装置,该任务处理装置还包括多个保存寄存器,用于在所述处理寄存器中保存数据,分别与多个任务相对应;其中, 当所述任务切换电路接收到所述规定的系统调用信号时,将所述处理寄存器中的数据保存到与执行中的任务对应的所述保存寄存器中,并将与通过所述任务选择电路所选择的任务对应的所述保存寄存器中的数据加载到所述处理寄存器中。 11. The task processing apparatus according to claim 1, the apparatus further comprises a plurality of task processing saving register, for storing data in the processing register respectively corresponding to the plurality of tasks; wherein, when the task switching circuit receives the predetermined system call signal, saves the data into the processing register and execute a task corresponding to the holding register, and corresponding to the selected task selected by the task circuit the data storage register are loaded into the processing register.
CN 201110345010 2006-08-24 2006-08-24 Task treatment device CN102436393B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN200680055671.12006.08.24 2006-08-24
CN 201110345010 CN102436393B (en) 2006-08-24 2006-08-24 Task treatment device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 201110345010 CN102436393B (en) 2006-08-24 2006-08-24 Task treatment device

Publications (2)

Publication Number Publication Date
CN102436393A true CN102436393A (en) 2012-05-02
CN102436393B true CN102436393B (en) 2015-03-25

Family

ID=45984472

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 201110345010 CN102436393B (en) 2006-08-24 2006-08-24 Task treatment device

Country Status (1)

Country Link
CN (1) CN102436393B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103605622B (en) * 2013-11-19 2016-06-22 北京邮电大学 A data transmission method and apparatus
CN103559045B (en) * 2013-11-21 2017-05-10 青岛大学 A hardware real-time operating system

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003271399A (en) * 2002-01-09 2003-09-26 Matsushita Electric Ind Co Ltd Processor and program executing method
CN1484144A (en) * 2002-09-19 2004-03-24 国际商业机器公司 Method and equipment for realizing support to multithread under high speed clock two-stage thread state

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003271399A (en) * 2002-01-09 2003-09-26 Matsushita Electric Ind Co Ltd Processor and program executing method
CN1484144A (en) * 2002-09-19 2004-03-24 国际商业机器公司 Method and equipment for realizing support to multithread under high speed clock two-stage thread state

Also Published As

Publication number Publication date Type
CN102436393A (en) 2012-05-02 application

Similar Documents

Publication Publication Date Title
US5349656A (en) Task scheduling method in a multiprocessor system where task selection is determined by processor identification and evaluation information
US6006247A (en) Method and system for scheduling threads and handling exceptions within a multiprocessor data processing system
US6938253B2 (en) Multiprocessor communication system and method
US6243831B1 (en) Computer system with power loss protection mechanism
US6061710A (en) Multithreaded processor incorporating a thread latch register for interrupt service new pending threads
US7610473B2 (en) Apparatus, method, and instruction for initiation of concurrent instruction streams in a multithreading microprocessor
US20090328053A1 (en) Adaptive spin-then-block mutual exclusion in multi-threaded processing
US20040172631A1 (en) Concurrent-multitasking processor
US7117285B2 (en) Method and system for efficiently directing interrupts
US6049867A (en) Method and system for multi-thread switching only when a cache miss occurs at a second or higher level
US5613114A (en) System and method for custom context switching
US20050149937A1 (en) Accelerator for multi-processing system and method
US20070073693A1 (en) Transaction and task scheduler
US6694425B1 (en) Selective flush of shared and other pipeline stages in a multithread processor
US20110066831A1 (en) System and method for software initiated checkpoint operations
US20050149936A1 (en) Thread execution scheduler for multi-processing system and method
US20060168583A1 (en) Systems and methods for TDM multithreading
US20060069738A1 (en) Multi-processor computer system
US20110296148A1 (en) Transactional Memory System Supporting Unbroken Suspended Execution
US6076157A (en) Method and apparatus to force a thread switch in a multithreaded processor
US6212544B1 (en) Altering thread priorities in a multithreaded processor
US6567839B1 (en) Thread switch control in a multithreaded processor system
US7032099B1 (en) Parallel processor, parallel processing method, and storing medium
US20120084477A1 (en) Transactional Memory Preemption Mechanism
US20040216101A1 (en) Method and logical apparatus for managing resource redistribution in a simultaneous multi-threaded (SMT) processor

Legal Events

Date Code Title Description
C06 Publication
C10 Entry into substantive examination
C14 Grant of patent or utility model
C41 Transfer of patent application or patent right or utility model
CP02