WO2006102845A1 - A method of program postpone execution with delay and a device thereof - Google Patents

A method of program postpone execution with delay and a device thereof Download PDF

Info

Publication number
WO2006102845A1
WO2006102845A1 PCT/CN2006/000551 CN2006000551W WO2006102845A1 WO 2006102845 A1 WO2006102845 A1 WO 2006102845A1 CN 2006000551 W CN2006000551 W CN 2006000551W WO 2006102845 A1 WO2006102845 A1 WO 2006102845A1
Authority
WO
WIPO (PCT)
Prior art keywords
program
stack
driver
execution
queue
Prior art date
Application number
PCT/CN2006/000551
Other languages
French (fr)
Chinese (zh)
Inventor
Xiaobo Li
Original Assignee
Xiaobo Li
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Xiaobo Li filed Critical Xiaobo Li
Publication of WO2006102845A1 publication Critical patent/WO2006102845A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4812Task transfer initiation or dispatching by interrupt, e.g. masked

Definitions

  • the present invention relates to the field of computer technology, and in particular to a method and apparatus for slow execution of a program. Background technique
  • Interrupt processing is one of the most important functions of a computer, because with the interrupt processing function, the computer can implement multi-program functions, real-time control functions, and so on.
  • the traditional interrupt processing method because of the limitations of the von Neumann architecture, can only perform single-channel program characteristics at the same time in one CPU, not only requires multiple program switching and transfer, but also requires multiple visits.
  • Store operations such as taking interrupt handler instructions, and saving and restoring the scene, etc., require a lot of system time and system resources. In modern computer applications where frequent interruptions occur, the efficiency of the entire system is undoubtedly significantly reduced. In the computer of the von Neumann architecture, this system overhead is unavoidable because it can only perform the characteristics of a single program at the same time in the same CPU.
  • a new type of computer architecture has been invented.
  • the main features of this new type of computer architecture are: Multiple programs can be executed concurrently and concurrently at the same time in the same central processing unit (CPU).
  • CPU central processing unit
  • the architecture that can execute multiple programs at the same time in the same CPU is the L computer architecture, and the CPU using the L computer architecture is called the L-structure CPU.
  • the handling of interrupts is not covered in the relevant patent documents.
  • the present invention proposes a method for slow execution of a program, which is simply referred to as a program mitigation method, and a device using the method, which is simply referred to as a program easing device. Its purpose is mainly to provide a low-cost, high-efficiency method and device for the L-structure CPU for implementing the traditional interrupt function. In the process of interrupt processing, this method not only can eliminate multiple switching and transfer of the program, but also can avoid a large number of memory access operations, thereby greatly improving the overall efficiency of the computer.
  • a program easing method as described above and a program easing apparatus using the method characterized in that the "interrupted execution" processing of the program is used instead of the "interrupt" processing of the program.
  • a program When a program needs to be interrupted, it does not actually suspend execution or interrupt execution as in the traditional interrupt processing method, but instead puts it into a state of slow execution, that is, put it into a
  • the queue called the continuation queue, temporarily does not participate in the normal execution of the program, so that other programs can execute.
  • the deferred program moves from the entry of the easing queue to the exit of the queue in a continuation queue according to a certain rule, completing the interrupt waiting similar to the traditional interrupt processing. Programs at the exit of the continuation queue can return to the normal program execution state on their own.
  • the method and apparatus for procedural slow-moving proposed by the present invention replace the conventional interrupt processing, and the program can be removed multiple times. Switching and transferring, and avoiding a large number of memory access operations, can significantly improve the overall efficiency of the computer.
  • slow queues There are one or more queues for caching program drivers, called slow queues
  • the continuation queue has an N stack, that is, the length of the easing queue is N; the 0th stack is the tail of the easing queue, and is also the input buffer register of the program easing device; the N-1 stack is the header of the easing queue. , is also the output buffer register of the program easing device; also called N is the mitigation depth of the program slow execution device;
  • Each stack of the mitigation queue has a busy and idle flag; 'When a stack of the mitigation queue holds a program driver, the busy and idle flag corresponding to the stack will be set to a busy flag; otherwise it is idle. Sign
  • the stack marked as busy flag detects whether the busy and idle flag of its next stack is idle.
  • n is greater than or equal to 1;
  • n be the program cycle of the program execution time; the slow execution time of the program slow execution device is equal to the delay depth multiplied by the stack cycle, that is, N*n ;
  • each beat is incremented by i, where i ⁇ l.
  • the program input buffer register of the slow-running execution device that is, the tail of the queue of the program slow-running queue, is connected to the program driver transmission output portion of the program control device in the L-structure CPU;
  • the program output buffer register of the program slow execution time that is, the queue header of the program easing queue, is connected to the program driver input receiving portion of the instruction fetching device in the L-structure CPU.
  • the program control device of the L-structure CPU first checks Whether the receiving buffer of the program easing device is idle, that is, whether the busy idle flag of the 0th stack of the easing queue is idle; if it is idle, the program driver of the program is sent to the receiving buffer register of the program easing device, The busy flag of the stack is set to a busy flag;
  • the program easing device When a program driver ends the interrupt waiting to leave the output buffer register of the program easing device, that is, when the busy flag of the N-1 ⁇ of the easing queue is a busy flag, the program easing device first detects the L structure CPU. Whether the receiving buffer of the instruction fetching device is idle; if idle, the program slowing device sends the program driver saved in the output buffer register to the receiving buffer register of the instruction fetching device of the L-structure CPU, and sets the N-1th stack The busy sign is a free sign.
  • a program easing method and a program using the method as described above are arranged, wherein: a plurality of program easing devices that can be operated in parallel can be set as needed, or can be set in a program easing device Multiple mitigation queues, each of which may have different mitigation depths N and stack periods n.
  • a program easing method as described above and a program easing device using the same characterized in that: the value of the stack period n can be dynamically adjusted as needed; the stack period n of a larger value means a longer delay Lag time, longer waiting time, and vice versa means shorter lag time, faster dequeue rate; occurrence of certain events, or certain conditions, state changes may cause some in a slow state
  • the program driver needs to end the lag state as soon as possible.
  • the program easing device can be notified in some way to lower the value of the stack period n of the corresponding easing queue to speed up the program driver waiting in the easing queue.
  • the core idea of the present invention for replacing the traditional interrupt processing method is: When a program needs to be interrupted, it does not actually stop the execution as in the conventional interrupt processing method, but puts it into a In the slow state, it is placed in the slow queue for every n beats, so that it does not participate in the normal execution of the program at least in the n*N beat, so that other programs that need to execute more are executed.
  • “so" means: 1. If the program that needs to be executed is not executed, it has a chance to be executed; 2. If the program that needs to be executed is in execution, its chances of obtaining the required resources for execution will be greater than The program that was slowed down.
  • the deferred program moves from the entry of the easing queue to the exit of the queue in a continuation queue according to a certain rule, completing the interrupt waiting similar to the traditional interrupt processing.
  • FIG. 1 is a view showing the hardware configuration of a program slow time executing device of the present invention.
  • FIG. 2 is a flow chart showing the operation of the program slow execution method of the present invention.
  • Figure 3 is a flow chart showing the program driver driving of the L-structure CPU.
  • Fig. 4 is a flow chart showing the drive of the program driver of the L-structure CPU after the program slow-running apparatus of the present invention is added. detailed description
  • Fig. 1 is a view showing the hardware configuration of a program slow time executing device of the present invention.
  • the hardware composition of the program slow-running device and its corresponding main functions are described.
  • the connection between the components of the program that is slow to execute is shown in the figure.
  • the main component of the program slow execution device is the program slow execution queue for storing the program driver. It consists of a stack of N.
  • the number of bits per stack is the same as the number of bits of the program driver.
  • Each stack is denoted by reference numeral 10.
  • Each stack is equipped with a free/busy flag indicating the current free/busy state of the stack, ie whether a program driver is currently stored in the stack.
  • the stack shift counter 20 is incremented per beat, and is reset to zero when a specified value is reached, giving a shift permission signal.
  • the management control component 30 of the program slow execution device is mainly used for managing and controlling various operations of the device, such as determining whether the input buffer of the program execution device is not empty, according to the transfer permission signal, and the free/busy flag of each stack.
  • the bit control program driver executes the movement between the stacks of the queue when the program is slow.
  • Step 21 ⁇ The depth counter is incremented by one; if the current value of the stack depth counter is less than the stack depth, continue this step; otherwise, go to step 21;
  • Step 22 The stack depth counter is set to 0;
  • Step 23 The program slow-running execution queues simultaneously detect whether the stack is full; any stack that detects that the stack is empty has no operation; and the stack is detected to be full until step 24;
  • Step 24 The program slow execution execution queue meets the above conditions, and each stack detects whether the lower stack is empty; if it detects that the lower stack is full, no operation; and detects that the lower stack is empty, step 25;
  • Step 25 The program execution queue queues satisfying the above conditions, and the program driver saved in the stack is stored in the lower stack, and the stack flag is set to full, and the stack flag is empty. Go to step 21.
  • Figure 3 is a schematic diagram of the program driver driving process of the L-structure CPU.
  • the main drive flow executed by the program driver driver in the L-structure CPU, multiple program drivers can be simultaneously at the same time Drive parallel execution of multiple programs.
  • a program driver drives the drive flow of a program from the program control device, through the instruction fetching device, the instruction decoding device, to the command execution device, and finally back to the program control device, and repeats. The specific process is as follows:
  • Step 31 The program control device generates the address of the next instruction by using the PC in the APC update program driver in the program driver and completes other related settings; if the program is detected without interruption, the updated program is The driver is sent to the instruction fetching device of the L-structure CPU in some way, that is, step 32 is performed; Step 32: The fetching device fetches the corresponding instruction into the program memory according to the PC address in the program driver and saves it to the current program driver. In the corresponding unit; afterwards, the program driver carrying the current instruction is sent to the instruction decoding device, that is, step 33;
  • Step 33 The instruction decoding device decodes the instruction carried by the current program driver and saves it to the corresponding unit of the current program driver; then sends the program driver carrying the decoded current instruction to the instruction execution device, ie Go to step 34;
  • Step 34 The instruction execution device executes the instruction according to the operation specified by the instruction, forms an execution state such as APC, and saves them to the corresponding unit of the current program driver; finally, the program driver is sent to the program control device in some manner, To execute the next instruction of the program, go to step 31.
  • the interrupt processing is performed in accordance with the conventional method, and is provided by some dedicated system programs under the condition of providing some hardware support.
  • the program control device saves the relevant scene of the program driver to be interrupted, and starts a dedicated system program to save the relevant field information of the interrupted program driver to a certain memory, and According to the program scheduling rule, another program is selected, and the relevant scene of the program driver is restored, and the program control device starts execution.
  • FIG. 4 is a program driver driving flow of the L-structure CPU after adding the program slow-time execution device of the present invention. Schematic. It is a new driving flow executed by the program driver driver in the L-structure CPU after using the program slow execution method and the device using the same.
  • Step 41 The program control device generates the address of the next instruction by using the PC in the APC update program driver in the program driver and completes other related settings; if the program is detected without interruption, the updated program is The driver is sent to the instruction fetching device of the L-structure CPU in some manner, that is, to step 42; if it is detected that the program needs to perform interrupt processing, the updated program driver is sent to the L-structure CPU in some manner.
  • the program is executed slowly, that is, step 45;
  • Step 42 The instruction fetching device fetches the corresponding instruction into the program memory according to the PC address in the program driver and saves it to the corresponding unit of the current program driver; after that, the program driver carrying the current instruction is sent to the instruction decoding.
  • Device that is, step 43;
  • Step 43 The instruction decoding device decodes the instruction carried by the current program driver and saves it to the corresponding unit of the current program driver; then sends the program driver carrying the decoded current instruction to the instruction execution device, ie Go to step 44;
  • Step 44 The instruction execution device executes the instruction according to the operation specified by the instruction, forms an execution state such as APC, and saves them to the corresponding unit of the current program driver; finally, the program driver is sent to the program control device in some manner, To execute the next instruction of the program, go to step 41;
  • Step 45 After receiving the program driver that needs to perform interrupt processing, the program slow execution device stores the program driver in the 0th stack of the program easing queue; after that, the program driver of the program program is dynamically locked in the program execution time. Dynamic waiting in the device; every n beats, if the stack is idle, move the stack; until the interrupted program driver has moved to the queue of the program slow queue by stack, that is, the Nth of the program slow queue -1 stack; At this point, the interrupted program driver has been interrupted for a period of time and can be returned to the normal program driver flow; at this point, the program easing device will be stored in the program continuation queue in some way.
  • the interrupted program driver of the N-1th stack is sent to the instruction fetching device to cause the program to go to the normal execution flow, that is, to step 42.

Abstract

A method of program postpone execution and a device thereof. The said method includes: “program postpone execution” takes the place of “program interruption”; a program is placed in a queue of postpone execution and is not normally executed temporarily when the program needs being interrupted, so another programs which much need being executed can be executed; the postpone executed program in the queue of postpone execution moves from entrance of the queue to the exit of the queue gradually according to a certain rule and completes the interruption similar to the traditional interruption; the program at the exit of the queue can successively return to the normal executing state of itself. The said device includes: the queue of postpone execution storing program driver, a administrating and controlling component and a counter for stack movement.

Description

一种程序缓时执行的方法及其装置  Method and device for slow execution of program
技术领域 Technical field
本发明涉及计算机技术领域, 特别是一种程序缓时执行的方法及其装置。 背景技术  The present invention relates to the field of computer technology, and in particular to a method and apparatus for slow execution of a program. Background technique
中断处理功能是计算机非常重要的功能之一, 因为借助中断处理功能, 计算机可 实现多道程序功能、 可实现实时控制功能等等。  Interrupt processing is one of the most important functions of a computer, because with the interrupt processing function, the computer can implement multi-program functions, real-time control functions, and so on.
传统的中断处理方法, 由于受到冯. 诺依曼体系结构的在一台 CPU中在同一时刻 只能执行单道程序特性的局限, 不仅需要多次的程序切换与转移, 而且需要多次的访 存操作, 如取中断处理程序的指令, 以及保存与恢复现场等, 因而需要花费大量的系 统时间和系统资源。 在中断频繁的现代计算机应用中, 整个系统的效率无疑被显著地 降低了。 在冯. 诺依曼体系结构的计算机中, 由于其在同一台 CPU中在同一时刻只能 执行单道程序的特性, 这种系统开销是不可回避的。  The traditional interrupt processing method, because of the limitations of the von Neumann architecture, can only perform single-channel program characteristics at the same time in one CPU, not only requires multiple program switching and transfer, but also requires multiple visits. Store operations, such as taking interrupt handler instructions, and saving and restoring the scene, etc., require a lot of system time and system resources. In modern computer applications where frequent interruptions occur, the efficiency of the entire system is undoubtedly significantly reduced. In the computer of the von Neumann architecture, this system overhead is unavoidable because it can only perform the characteristics of a single program at the same time in the same CPU.
然而, 在 L结构 CPU中, 由于其可在同一时刻能够执行多道程序的特性, 故而对 中断的需求相对而言减少了许多。 因此需要一种开销较小、 效率高的中断处理机制来 替换传统的中断处理机制。 发明内容  However, in the L-structured CPU, since the characteristics of the multi-program can be executed at the same time, the demand for the interrupt is relatively reduced. Therefore, a less expensive and efficient interrupt handling mechanism is needed to replace the traditional interrupt handling mechanism. Summary of the invention
一种新型的计算机体系结构已被发明, 该种新型的计算机体系结构的主要特点是: 在同一台中央处理器 (CPU)中在同一时刻能够并行与并发地执行多道程序。以下称在同 一台 CPU中在同一时刻能够执行多道程序的体系结构为 L计算机体系结构,采用 L计 算机体系结构的 CPU称为 L结构 CPU。然而,在相关的专利文件中未涉及有关中断的 处理。  A new type of computer architecture has been invented. The main features of this new type of computer architecture are: Multiple programs can be executed concurrently and concurrently at the same time in the same central processing unit (CPU). Hereinafter, the architecture that can execute multiple programs at the same time in the same CPU is the L computer architecture, and the CPU using the L computer architecture is called the L-structure CPU. However, the handling of interrupts is not covered in the relevant patent documents.
有鉴于此, 本发明提出一种程序缓时执行的方法, 简称程序缓执方法, 及使用这 种方法的装置, 简称程序缓执装置。 其目的主要是为 L结构 CPU提供一种开销小、 效 率高的方法及装置用于实现传统的中断功能。 在中断的处理过程中, 这种方法不仅能 够消除程序的多次切换与转移, 而且可以避免大量的访存操作, 从而可大大的提高计 算机的总体效率。 如上所述的一种程序缓执方法及使用这种方法的程序缓执装置, 其特征在于用程 序的 "缓时执行"处理代替程序的 "中断"处理。 In view of the above, the present invention proposes a method for slow execution of a program, which is simply referred to as a program mitigation method, and a device using the method, which is simply referred to as a program easing device. Its purpose is mainly to provide a low-cost, high-efficiency method and device for the L-structure CPU for implementing the traditional interrupt function. In the process of interrupt processing, this method not only can eliminate multiple switching and transfer of the program, but also can avoid a large number of memory access operations, thereby greatly improving the overall efficiency of the computer. A program easing method as described above and a program easing apparatus using the method, characterized in that the "interrupted execution" processing of the program is used instead of the "interrupt" processing of the program.
当某道程序需要被中断时, 它不是象传统的中断处理方法那样实际上将其暂时.中 止执行或中断执行, 而是将其放置到一个缓时执行的状态中, 即把它放到一个队列中, 称为缓执队列, 暂时不参与程序的正常执行, 以便让其它程序执行。 被缓执的程序在 缓执队列中依据某种规则由缓执队列的入口逐级移动到队列的出口, 完成类似于传统 中断处理中的中断等待。 处于缓执队列出口处的程序可相继自行返回到正常的程序执 行状态中去。  When a program needs to be interrupted, it does not actually suspend execution or interrupt execution as in the traditional interrupt processing method, but instead puts it into a state of slow execution, that is, put it into a The queue, called the continuation queue, temporarily does not participate in the normal execution of the program, so that other programs can execute. The deferred program moves from the entry of the easing queue to the exit of the queue in a continuation queue according to a certain rule, completing the interrupt waiting similar to the traditional interrupt processing. Programs at the exit of the continuation queue can return to the normal program execution state on their own.
根据在同一时刻在单台 CPU上能够并行地执行多道程序的计算机的特性, 如用本 发明提出的这种程序缓执的方法与装置代替传统的中断处理, 不仅可以免去程序的多 次切换与转移, 而且可以避免大量的访存操作, 进而可显著的提高计算机的总体效率。  According to the characteristics of a computer capable of executing a plurality of programs in parallel on a single CPU at the same time, the method and apparatus for procedural slow-moving proposed by the present invention replace the conventional interrupt processing, and the program can be removed multiple times. Switching and transferring, and avoiding a large number of memory access operations, can significantly improve the overall efficiency of the computer.
如上所述的一种程序缓执方法及使用这种方法的程序缓执装置, 其中:  A program easing method as described above and a program easing device using the method, wherein:
1. 有一个或多个用于缓存程序驱动器的队列, 称为缓执队列;  1. There are one or more queues for caching program drivers, called slow queues;
2.缓执队列设有 N栈, 即缓执队列的长度为 N; 第 0栈是缓执队列的尾部, 也是 程序缓执装置的输入缓存寄存器; 第 N-1 栈是缓执队列的首部, 也是程序缓执装置的 输出缓存寄存器; 也称 N为程序缓时执行装置的缓执深度;  2. The continuation queue has an N stack, that is, the length of the easing queue is N; the 0th stack is the tail of the easing queue, and is also the input buffer register of the program easing device; the N-1 stack is the header of the easing queue. , is also the output buffer register of the program easing device; also called N is the mitigation depth of the program slow execution device;
3.缓执队列的每一栈都有一个忙闲标志; '当缓执队列的某一栈保存有某个程序驱 动器时, 该栈对应的忙闲标志将被置¾忙标志; 否则为闲标志;  3. Each stack of the mitigation queue has a busy and idle flag; 'When a stack of the mitigation queue holds a program driver, the busy and idle flag corresponding to the stack will be set to a busy flag; otherwise it is idle. Sign
4.每 n拍, 标志为忙标志的栈都检测它下一栈的忙闲标志是否为闲  4. Every n beats, the stack marked as busy flag detects whether the busy and idle flag of its next stack is idle.
标志; 若是, 则将保存在本栈的程序驱动器存入下一栈, 将下桟的忙闲标志置为忙标 志、 将本栈的忙闲标志置为闲标志; 其中 n大于等于1 ; 也称 n为程序缓时执行装置的 桟周期; 程序缓时执行装置的缓执周期等于缓执深度乘以栈周期, 即 N*n; Flag; if yes, save the program driver saved on the stack to the next stack, set the busy idle flag to the busy flag, and set the busy idle flag of the stack to the idle flag; where n is greater than or equal to 1; Let n be the program cycle of the program execution time; the slow execution time of the program slow execution device is equal to the delay depth multiplied by the stack cycle, that is, N*n ;
5.有一个或多个栈周期计数器, 初值为 0, 每拍递增 i, 其中 i≥l。  5. There are one or more stack cycle counters, the initial value is 0, and each beat is incremented by i, where i≥l.
如上所述的一种程序缓执方法及使用这种方法的程序缓执装置, 其中:  A program easing method as described above and a program easing device using the method, wherein:
1. 程序缓时执行装置的输入缓存寄存器, 即程序缓执队列的队列尾部, 与 L结 构 CPU中的程序控制装置的程序驱动器发送输出部分相连;  1. The program input buffer register of the slow-running execution device, that is, the tail of the queue of the program slow-running queue, is connected to the program driver transmission output portion of the program control device in the L-structure CPU;
2. 程序缓时执行装置的输出缓存寄存器, 即程序缓执队列的队列首部, 与 L结 构 CPU中的取指令装置的程序驱动器输入接收部分相连。  2. The program output buffer register of the program slow execution time, that is, the queue header of the program easing queue, is connected to the program driver input receiving portion of the instruction fetching device in the L-structure CPU.
如上所述的一种程序缓执方法及使用这种方法的程序缓执装置, 其中- A program easing method as described above and a program easing device using the method, wherein -
1. 当某道程序由于某种原因需要被中断时, L结构 CPU的程序控制装置首先检 测程序缓执装置的接收缓存是否空闲, 即缓执队列的第 0栈的忙闲标志是否 为闲; 若为闲, 则将该道程序的程序驱动器发送到程序缓执装置的接收缓存 寄存器, 并置该栈的忙闲标志为忙标志; 1. When a program needs to be interrupted for some reason, the program control device of the L-structure CPU first checks Whether the receiving buffer of the program easing device is idle, that is, whether the busy idle flag of the 0th stack of the easing queue is idle; if it is idle, the program driver of the program is sent to the receiving buffer register of the program easing device, The busy flag of the stack is set to a busy flag;
2. 当某道程序驱动器结束中断等待需要离开程序缓执装置的输出缓存寄存器 时, 即缓执队列的第 N-1桟的忙闲标志为忙标志时, 程序缓执装置首先检测 L结构 CPU的取指令装置的接收缓存是否空闲; 若为空闲, 则该程序缓执装 置将其输出缓存寄存器中保存的程序驱动器发送到 L结构 CPU的取指令装置 的接收缓存寄存器, 置第 N-1栈的忙闲标志为闲标志。  2. When a program driver ends the interrupt waiting to leave the output buffer register of the program easing device, that is, when the busy flag of the N-1桟 of the easing queue is a busy flag, the program easing device first detects the L structure CPU. Whether the receiving buffer of the instruction fetching device is idle; if idle, the program slowing device sends the program driver saved in the output buffer register to the receiving buffer register of the instruction fetching device of the L-structure CPU, and sets the N-1th stack The busy sign is a free sign.
如上所述的一种程序缓执方法及使用这种方法的程序缓执 ^置, 其中: 根据需要, 可设置多个可并行工作的程序缓执装置, 也可在一个程序缓执装置中设置多个缓执队 列, 每个缓执队列又可有不同的缓执深度 N和栈周期 n。  A program easing method and a program using the method as described above are arranged, wherein: a plurality of program easing devices that can be operated in parallel can be set as needed, or can be set in a program easing device Multiple mitigation queues, each of which may have different mitigation depths N and stack periods n.
如上所述的一种程序缓执方法及使用这种方法的程序缓执装置, 其特征在于: 栈 周期 n的值可根据需要动态地调整; 较大值的栈周期 n意味着较长的缓时滞后时间、 更长的等待时间, 反之意味着较短的缓时滞后时间、 更快的出队速率; 某些事件的发 生、 或某些条件、 状态的改变可能导致某些处于缓时状态的程序驱动器需要尽快结束 缓时状态, 此时可以以某种方式通知程序缓执装置调低相应的缓执队列的栈周期 n的 值, 以加快在该缓执队列中处于等待状态的程序驱动器的出队速率; 由于在该缓执队 列中至多有 N个程序驱动器, 故提速 N拍后, 程序缓执装置可自动将栈周期 n调回到 正常值。  A program easing method as described above and a program easing device using the same, characterized in that: the value of the stack period n can be dynamically adjusted as needed; the stack period n of a larger value means a longer delay Lag time, longer waiting time, and vice versa means shorter lag time, faster dequeue rate; occurrence of certain events, or certain conditions, state changes may cause some in a slow state The program driver needs to end the lag state as soon as possible. At this point, the program easing device can be notified in some way to lower the value of the stack period n of the corresponding easing queue to speed up the program driver waiting in the easing queue. The dequeue rate; since there are at most N program drivers in the continuation queue, after the speed N is taken, the program easing device can automatically adjust the stack period n back to the normal value.
本发明提出的用于代替传统的中断处理方法的核心思想是: 当某道程序需要被中 断时, 它不是象传统的中断处理方法那样实际上将其中止执行, 而是将其置放到一个 缓行的状态中, 即把它放到缓行队列中每 n拍挪一栈, 因而至少在 n*N拍内不参与程 序的正常执行, 以便让其它更需要执行的程序执行。  The core idea of the present invention for replacing the traditional interrupt processing method is: When a program needs to be interrupted, it does not actually stop the execution as in the conventional interrupt processing method, but puts it into a In the slow state, it is placed in the slow queue for every n beats, so that it does not participate in the normal execution of the program at least in the n*N beat, so that other programs that need to execute more are executed.
这里的 "以便"是指: 一、 如果更需要执行的程序未执行, 则它有机会被执行了; 二、 如果更需要执行的程序在执行中, 则它获取执行所需资源的机会将大于被缓行的 程序。  Here, "so" means: 1. If the program that needs to be executed is not executed, it has a chance to be executed; 2. If the program that needs to be executed is in execution, its chances of obtaining the required resources for execution will be greater than The program that was slowed down.
被缓执的程序在缓执队列中依据某种规则由缓执队列的入口逐级移动到队列的出 口, 完成类似于传统中断处理中的中断等待。  The deferred program moves from the entry of the easing queue to the exit of the queue in a continuation queue according to a certain rule, completing the interrupt waiting similar to the traditional interrupt processing.
当中断发生时, 只需要将相应程序的程序驱动器发送到程序缓执装置, 中断的处 理既告结束。 由于被缓执的程序没有被真正的中止执行, 而是在缓执, 因而没有换道到系统管理程序、 以及保存现场等操作所需要的开销。 又由于当中断等待结束时, 即被缓执的程序结束缓执时, 它将自行检测是否可以 返回到正常的执行状态。 如果可以就返回, 否则就等在缓执队列中。 因而也没有系统 管理程序挑选下一道程序、 并恢复其现场、 最后再换道等操作所需要的开销。 When an interrupt occurs, it is only necessary to send the program driver of the corresponding program to the program easing device, and the processing of the interrupt ends. Since the delayed program was not actually suspended, Rather, it is slow, so there is no need to change the way to the system management program, and save the scene and other operations. Also, when the interrupt waits for the end, that is, when the suspended program ends the easing, it will detect whether it can return to the normal execution state by itself. If it can, return, otherwise wait in the queue. Therefore, there is no overhead required by the hypervisor to select the next program and resume its operations on the site and finally the lane change.
本文所述仅为本发明技术构思下的一些基本说明。 基于本技术构思, 可有多种实 施方法, 如程序缓时执行队列可采用 FIFO等, 故而依据本发明的技术构想所做的任何 等效变换, 均应属于本发明的保护范围。 本发明的应用也不仅仅局限于本文所涉及的 领域中。 附图说明  The description herein is only some basic descriptions of the technical idea of the present invention. Based on the technical idea, various implementation methods are available. For example, the program slow execution queue can adopt FIFO or the like, and therefore any equivalent transformation according to the technical idea of the present invention should fall within the protection scope of the present invention. The application of the present invention is not limited to only the fields referred to herein. DRAWINGS
图 1是本发明的程序缓时执行装置的硬件结构图。  BRIEF DESCRIPTION OF THE DRAWINGS Fig. 1 is a view showing the hardware configuration of a program slow time executing device of the present invention.
图 2是本发明的程序缓时执行方法的工作流程图。  2 is a flow chart showing the operation of the program slow execution method of the present invention.
图 3是 L结构 CPU的程序驱动器驱动流程图。  Figure 3 is a flow chart showing the program driver driving of the L-structure CPU.
图 4是增设本发明的程序缓时执行装置后的 L结构 CPU的程序驱动器驱动流程 图。 具体实施方式  Fig. 4 is a flow chart showing the drive of the program driver of the L-structure CPU after the program slow-running apparatus of the present invention is added. detailed description
图 1是本发明的程序缓时执行装置的硬件结构图。 描述了程序缓时执行装置的硬 件组成、 及其相应的主要功能。 程序缓时执行装釁的各组成部件之间的连接关系如图 所示。 程序缓时执行装置的主要的组成部件是用于存放程序驱动器的程序缓时执行队 列, 共由 N栈组成, 每栈的位数与程序驱动器的位数相同, 每栈由标号 10表示。 每栈 都配备有一个忙 /闲标志位, 标明该栈当前的忙 /闲状态, 即当前该栈中是否存放有某个 程序驱动器。栈移计数器 20每拍递增, 当达到某个指定值时归零, 给出移栈许可信号。 程序缓时执行装置的管理控制部件 30主要用于管理控制完成本装置的各项操作, 如判 别程序缓时执行装置的输入缓存是否非空、 根据移栈许可信号以及各栈的忙 /闲标志位 控制程序驱动器在程序缓时执行队列各栈间的移动等。  BRIEF DESCRIPTION OF THE DRAWINGS Fig. 1 is a view showing the hardware configuration of a program slow time executing device of the present invention. The hardware composition of the program slow-running device and its corresponding main functions are described. The connection between the components of the program that is slow to execute is shown in the figure. The main component of the program slow execution device is the program slow execution queue for storing the program driver. It consists of a stack of N. The number of bits per stack is the same as the number of bits of the program driver. Each stack is denoted by reference numeral 10. Each stack is equipped with a free/busy flag indicating the current free/busy state of the stack, ie whether a program driver is currently stored in the stack. The stack shift counter 20 is incremented per beat, and is reset to zero when a specified value is reached, giving a shift permission signal. The management control component 30 of the program slow execution device is mainly used for managing and controlling various operations of the device, such as determining whether the input buffer of the program execution device is not empty, according to the transfer permission signal, and the free/busy flag of each stack. The bit control program driver executes the movement between the stacks of the queue when the program is slow.
图 2是本发明的程序缓时执行方法的工作流程:  2 is a workflow diagram of the program slow execution method of the present invention:
步骤 21: 桟深度计数器加一; 若栈深度计数器的当前值小于栈深度 则继续本 步骤; 否则转步骤 21 ;  Step 21: 桟 The depth counter is incremented by one; if the current value of the stack depth counter is less than the stack depth, continue this step; otherwise, go to step 21;
步骤 22: 栈深度计数器置 0; 步骤 23 : 程序缓时执行队列各栈同时检测本栈是否为满; 凡检测到本栈为空的栈 无操作; 凡检测到本栈为满的栈转步骤 24; Step 22: The stack depth counter is set to 0; Step 23: The program slow-running execution queues simultaneously detect whether the stack is full; any stack that detects that the stack is empty has no operation; and the stack is detected to be full until step 24;
步骤 24: 程序缓时执行队列满足上述条件的各栈同时检测下栈是否为空; 凡检测 到下栈为满的桟无操作; 凡检测到下栈为空的栈转步骤 25 ;  Step 24: The program slow execution execution queue meets the above conditions, and each stack detects whether the lower stack is empty; if it detects that the lower stack is full, no operation; and detects that the lower stack is empty, step 25;
步骤 25:程序缓时执行队列满足上述条件的各栈同时将保存在本栈的程序驱动器 存入到下栈, 置下栈标志为满, 置本栈标志为空, 转步骤 21。  Step 25: The program execution queue queues satisfying the above conditions, and the program driver saved in the stack is stored in the lower stack, and the stack flag is set to full, and the stack flag is empty. Go to step 21.
图 3是 L结构 CPU的程序驱动器驱动流程示意图。 当没有使用程序缓时执行方 法及其使用这种方法的装置时, 在 L结构 CPU中, 程序驱动器驱动程序执行的主要驱 动流程, 在 L结构 CPU .中, 多个程序驱动器可在同一时刻同时驱动多道程序并行的执 行。 一个程序驱动器驱动一道程序的驱动流开始于程序控制装置, 经取指令装置、 指 令译码装置、 到指令执行装置, 最后返回到程序控制装置, 周而复始。 其具体流程如 下:  Figure 3 is a schematic diagram of the program driver driving process of the L-structure CPU. When the program execution method and the apparatus using the same are not used, in the L-structure CPU, the main drive flow executed by the program driver driver, in the L-structure CPU, multiple program drivers can be simultaneously at the same time Drive parallel execution of multiple programs. A program driver drives the drive flow of a program from the program control device, through the instruction fetching device, the instruction decoding device, to the command execution device, and finally back to the program control device, and repeats. The specific process is as follows:
步骤 31 : 程序控制装置按规定用程序驱动器中的 APC 更新程序驱动器中的 PC 生成下一条指令的地址并完成其它一些相关的设置; 如果检测到该道程序无需中断, 则将该已更新的程序驱动器以某种方式发送给 L结构 CPU的取指令装置,即转步骤 32; 步骤 32: 取指令装置按程序驱动器中的 PC地址到程序存储器中取到相应的指令 并将其保存到当前程序驱动器的相应单元中; 之后, 将携带有当前指令的程序驱动器 发送给指令译码装置, 即转步骤 33 ;  Step 31: The program control device generates the address of the next instruction by using the PC in the APC update program driver in the program driver and completes other related settings; if the program is detected without interruption, the updated program is The driver is sent to the instruction fetching device of the L-structure CPU in some way, that is, step 32 is performed; Step 32: The fetching device fetches the corresponding instruction into the program memory according to the PC address in the program driver and saves it to the current program driver. In the corresponding unit; afterwards, the program driver carrying the current instruction is sent to the instruction decoding device, that is, step 33;
步骤 33 ;指令译码装置对当前程序驱动器携带的指令进行译码并将其保存到当前 程序驱动器的相应单元中; 随后将携带有已译码的当前指令的程序驱动器发送给指令 执行装置, 即转步骤 34;  Step 33: The instruction decoding device decodes the instruction carried by the current program driver and saves it to the corresponding unit of the current program driver; then sends the program driver carrying the decoded current instruction to the instruction execution device, ie Go to step 34;
步骤 34; 指令执行装置按指令所规定的操作执行该指令、 形成 APC等执行状态, 并将它们保存到当前程序驱动器的相应单元中; 最后将该程序驱动器以某种方式发送 给程序控制装置, 以执行该道程序的下一条指令, 即转步骤 31。  Step 34: The instruction execution device executes the instruction according to the operation specified by the instruction, forms an execution state such as APC, and saves them to the corresponding unit of the current program driver; finally, the program driver is sent to the program control device in some manner, To execute the next instruction of the program, go to step 31.
在 L结构 CPU中, 中断处理是按照传统的方法, 在提供一些硬件支持的条件下, 主要由一些专用的系统程序来完成。 当某道程序因某种原因需要中断时, 程序控制装 置将保存需中断的程序驱动器的相关现场, 并启动一道专用的系统程序将被中断的程 序驱动器的相关现场信息保存到某存储器中, 并根据程序调度规则选取另一道程序, 恢复其程序驱动器的相关现场, 交由程序控制装置启动执行。  In the L-structured CPU, the interrupt processing is performed in accordance with the conventional method, and is provided by some dedicated system programs under the condition of providing some hardware support. When a program needs to be interrupted for some reason, the program control device saves the relevant scene of the program driver to be interrupted, and starts a dedicated system program to save the relevant field information of the interrupted program driver to a certain memory, and According to the program scheduling rule, another program is selected, and the relevant scene of the program driver is restored, and the program control device starts execution.
图 4是增设本发明的程序缓时执行装置后的 L结构 CPU的程序驱动器驱动流程 示意图。是在使用了程序缓时执行方法及其使用这种方法的装置后,在 L结构 CPU中, 程序驱动器驱动程序执行的新的驱动流程。 4 is a program driver driving flow of the L-structure CPU after adding the program slow-time execution device of the present invention. Schematic. It is a new driving flow executed by the program driver driver in the L-structure CPU after using the program slow execution method and the device using the same.
在无中断发生时, 程序驱动器驱动一道程序的驱动流程与图 3所示的流程相同。 不同的是: 当某道程序因某种原因需要中断时, 相应的中断处理是通过程序缓时执行 装置完成的。 其具体步骤如下:  When no interruption occurs, the program driver drives a program to drive the same process as shown in Figure 3. The difference is: When a program needs to be interrupted for some reason, the corresponding interrupt processing is completed by the program slow execution device. The specific steps are as follows:
步骤 41 : 程序控制装置按规定用程序驱动器中的 APC 更新程序驱动器中的 PC 生成下一条指令的地址并完成其它一些相关的设置; 如果检测到该道程序无需中断, 则将该已更新的程序驱动器以某种方式发送给 L结构 CPU的取指令装置,即转步骤 42; 如果检测到该道程序需要进行中断处理时, 则将该已更新的程序驱动器以某种方式发 送给 L结构 CPU的程序缓时执行装置, 即转步骤 45;  Step 41: The program control device generates the address of the next instruction by using the PC in the APC update program driver in the program driver and completes other related settings; if the program is detected without interruption, the updated program is The driver is sent to the instruction fetching device of the L-structure CPU in some manner, that is, to step 42; if it is detected that the program needs to perform interrupt processing, the updated program driver is sent to the L-structure CPU in some manner. The program is executed slowly, that is, step 45;
步骤 42: 取指令装置按程序驱动器中的 PC地址到程序存储器中取到相应的指令 并将其保存到当前程序驱动器的相应单元中; 之后, 将携带有当前指令的程序驱动器 发送给指令译码装置, 即转步骤 43;  Step 42: The instruction fetching device fetches the corresponding instruction into the program memory according to the PC address in the program driver and saves it to the corresponding unit of the current program driver; after that, the program driver carrying the current instruction is sent to the instruction decoding. Device, that is, step 43;
步骤 43:指令译码装置对当前程序驱动器携带的指令进行译码并将其保存到当前 程序驱动器的相应单元中; 随后将携带有已译码的当前指令的程序驱动器发送给指令 执行装置, 即转步骤 44;  Step 43: The instruction decoding device decodes the instruction carried by the current program driver and saves it to the corresponding unit of the current program driver; then sends the program driver carrying the decoded current instruction to the instruction execution device, ie Go to step 44;
步骤 44: 指令执行装置按指令所规定的操作执行该指令、 形成 APC等执行状态, 并将它们保存到当前程序驱动器的相应单元中; 最后将该程序驱动器以某种方式发送 给程序控制装置, 以执行该道程序的下一条指令, 即转步骤 41 ;  Step 44: The instruction execution device executes the instruction according to the operation specified by the instruction, forms an execution state such as APC, and saves them to the corresponding unit of the current program driver; finally, the program driver is sent to the program control device in some manner, To execute the next instruction of the program, go to step 41;
步骤 45: 程序缓时执行装置接收到需要进行中断处理的程序驱动器后, 将其存入 程序缓执队列的第 0栈; 此后, 该道程序的程序驱动器就被动态地锁在程序缓时执行 装置中进行动态等待; 每隔 n拍, 如果下栈空闲, 就下挪一栈; 直到被中断的程序驱 动器已经经过逐栈移动到程序缓执队列的队首, 即程序缓执队列的第 N-1 栈; 此时, 被中断的程序驱动器已经经过了一段时间的中断等待、 可以返回到正常的程序驱动流 程中了; 此时, 程序缓执装置以某种方式将存放在程序缓执队列第 N-1栈的被中断的 程序驱动器发送给取指令装置使该道程序转入正常的执行流程, 即转步骤 42。  Step 45: After receiving the program driver that needs to perform interrupt processing, the program slow execution device stores the program driver in the 0th stack of the program easing queue; after that, the program driver of the program program is dynamically locked in the program execution time. Dynamic waiting in the device; every n beats, if the stack is idle, move the stack; until the interrupted program driver has moved to the queue of the program slow queue by stack, that is, the Nth of the program slow queue -1 stack; At this point, the interrupted program driver has been interrupted for a period of time and can be returned to the normal program driver flow; at this point, the program easing device will be stored in the program continuation queue in some way. The interrupted program driver of the N-1th stack is sent to the instruction fetching device to cause the program to go to the normal execution flow, that is, to step 42.

Claims

权利 要 求 书 Claim
1、 一种程序缓时执行的装置, 其特征在于: 1. A device for slow execution of a program, characterized in that:
· 有一个或多个用于存放程序执行的相关信息的程序驱动器, 被存放在缓执队 列;  · A program driver with one or more related information for storing program execution is stored in the continuation queue;
• 缓执队列设有 N桟, 其长度为 N; 第 0栈是缓执队列的尾部, 也是程序缓时执 行装置的输入缓存寄存器; 第 N-1栈是缓执队列的首部, 也是程序缓时执行装 置的输出缓存寄存器; 程序缓时执行装置的缓执深度为 N;  • The easing queue has N桟, the length of which is N; the 0th stack is the tail of the easing queue, and is also the input buffer register of the program slow execution device; the N-1 stack is the first part of the easing queue, and is also slow. Execution device output buffer register; program slow execution execution device mitigation depth is N;
缓执队列的每一栈都有一个忙闲标志; 当缓执队列的某一栈保存有程序驱动器时, 该 桟对应的忙闲标志将被置为忙标志; 否则为闲标志; Each stack of the mitigation queue has a busy idle flag; when a stack of the mitigation queue holds a program driver, the busy and idle flag corresponding to the 将 queue will be set to a busy flag; otherwise, it is an idle flag;
• 每 n拍, 标志为忙标志的栈都检测它下一栈的忙闲标志是否为闲标志; 若是, 则将保存在本栈的程序驱动器存入下一栈, 将下栈的忙闲标志置为忙标志、 将 本栈的忙闲标志置为闲标志; 其中 n大于等于 1 ; 也称 n为程序缓时执行装置 的桟周期; 程序缓时执行装置的缓执周期等于缓执深度乘以栈周期, 即 N*n; • Every n beats, the stack marked as busy flag detects whether the busy and idle flag of the next stack is idle; if yes, saves the program driver saved on the stack to the next stack, and the busy flag of the stack Set to the busy flag, set the busy and idle flag of the stack to the idle flag; where n is greater than or equal to 1; also called n is the program cycle of the program execution device; the slow execution period of the program slow execution device is equal to the delay depth multiplication In the stack cycle, that is, N*n ;
• 有一个或多个栈周期计数器, 初值为 0, 每拍递增1, 其中 i≥l。 • There are one or more stack period counters with an initial value of 0 and an increment of 1 per beat, where i≥l.
2. 根据权利要求 1所述的程序缓时执行装置, 其特征在于:  2. The program slow time execution device according to claim 1, wherein:
程序缓时执行装置的输入缓存寄存器与 L结构 CPU中的程序控制装置的程序驱动 器发送输出部分相连;  The input buffer register of the program slow execution device is connected to the program driver send output portion of the program control device in the L structure CPU;
程序缓时执行装置的输出缓存寄存器与 L结构 CPU中的取指令装置的程序驱动器 输入接收部分相连。  The output buffer register of the program slow execution device is connected to the program driver input receiving portion of the instruction fetching device in the L structure CPU.
3.—种程序缓时执行的方法, 其特征在于, 用程序的 "缓时执行"处理代替程序的 "中 断"处理; 所述方法包括步骤: 当一程序需要被中断时, 将其放置到一个缓时执行的 队列中, 暂时不参与程序的正常执行, 以便让其它更需要执行的程序执行; 被缓时执 行的程序在缓时执行队列中按照预定规则由缓执队列的入口逐级移动到队列的出口; 当程序处于缓执队列出口处时, 所述程序相继自行返回到正常的执行状态中去。  3. A method for slow execution of a program, characterized in that the "interruption" processing of the program is used instead of the "interrupt" processing of the program; the method comprises the steps of: when a program needs to be interrupted, placing it In a queue that is executed in a slow mode, it does not participate in the normal execution of the program for the time being, so that other programs that need to execute more are executed. The program that is executed slowly is moved step by step from the entry of the continuation queue in the slow execution queue according to a predetermined rule. To the exit of the queue; when the program is at the exit of the continuation queue, the program returns to the normal execution state.
4、 根据权利要求 3所述的程序缓时执行的方法, 其特征在于, 还包括: L结构 CPU的 程序驱动器驱动的方法步骤和增设程序缓时执行装置后的 L结构 CPU的程序驱动器驱 动的方法步骤。  4. The method according to claim 3, further comprising: a method driver driving method step of the L-structure CPU and a program driver driving of the L-structure CPU after adding the program-delay executing device Method steps.
5.据权利要求 3或 4所述的程序缓时执行方法, 其特征在于: 当某道程序由于某种原因需要被中断时, L结构 CPU的程序控制装置首先基于缓 执队列的第 0栈的忙 ¾标志检测程序缓执装置的接收缓存是否空闲,; 若为闲, 则 将该程序的程序驱动器发送到程序缓时执行装置的接收缓存寄存器, 并置该栈的 忙闲标志为忙标志; The program slow execution method according to claim 3 or 4, characterized in that: When a program needs to be interrupted for some reason, the program control device of the L-structure CPU first stops the receiving buffer of the device from being idle based on the busy flag detection of the 0th stack of the easing queue; if it is idle, Sending the program driver of the program to the receive buffer register of the program slow execution device, and setting the busy idle flag of the stack to a busy flag;
当某道程序驱动器结束中断等待需要离开程序缓时执行装置的输出缓存寄存器 时, 即缓执队列的第 N-1栈的忙闲标志为忙标志时, 程序缓时执行装置首先检测 L结构 CPU的取指令装置的接收缓存是否空闲; 若为空闲, 则该程序缓时执行装 置将其输出缓存寄存器中保存的程序驱动器发送到 L结构 CPU的取指令装置的接 收缓存寄存器, 置第 N-1栈的忙闲标志为闲标志。  When a certain program driver ends the interrupt waiting to leave the output buffer register of the program execution device, that is, when the busy idle flag of the N-1th stack of the easing queue is a busy flag, the program slow execution device first detects the L structure CPU. Whether the receiving buffer of the instruction fetching device is idle; if idle, the program slow execution device sends the program driver saved in the output buffer register to the receiving buffer register of the instruction fetching device of the L-structure CPU, and sets the N-1 The busy sign of the stack is a free sign.
6. 根据权利要求 3至 5之一所述的程序缓时执行方法, 其特征在于: 所述程序缓时执 行装置的数目为多个, 且并行工作。  The program slow execution method according to any one of claims 3 to 5, characterized in that: the number of the program slow execution devices is plural and works in parallel.
7. 根据权利要求 3至 6之一所述的程序缓时执行方法, 其特征在于: 在一个程序缓时 执行装置中设置多个缓执队列, 每个缓执队列有不同的缓执深度 N和栈周期 n。  The program slow execution method according to any one of claims 3 to 6, characterized in that: a plurality of easing queues are set in a program easing execution device, and each mitigation queue has a different mitigation depth N And the stack period n.
8. 根据权利要求 3至 7之一所述的程序缓时执行方法, 其特征在于: 栈周期 n的值可 根据需要动态地调整; 在某些事件的发生、 或某些条件、 状态的改变可能导致某些处 于缓时状态的程序驱动器需要尽快结束缓时等待状态时, 可以按照预定方式通知程序 缓时执行装置调低相应的缓执队列的栈周期 n的值, 以加快在该缓执队列中处于等待 状态的程序驱动器的出队速率; 在该缓执队列中至多有 N个程序驱动器, 在提速 N拍 后, 程序缓时执行装置可自动将栈周期 n调回到正常值。  The program slow execution method according to any one of claims 3 to 7, characterized in that: the value of the stack period n can be dynamically adjusted as needed; in the occurrence of certain events, or changes in certain conditions and states It may cause some program drivers in a slow state to end the buffer waiting state as soon as possible. The program may be notified in a predetermined manner to delay the execution of the stack period n of the corresponding easing queue to speed up the easing. The dequeue rate of the program driver in the queue waiting state; there are at most N program drivers in the continuation queue. After the speed up N shot, the program slow execution device can automatically adjust the stack period n back to the normal value.
9. 根据权利要求 3所述的程序缓时执行方法, 其特征在于: 其步骤如下:  9. The program slow execution method according to claim 3, wherein: the steps are as follows:
• 步骤 1 : 栈深度计数器加一; 若栈深度计数器的当前值小于栈深度 n, 则继续 本步骤; 否则转步骤 2;  • Step 1: The stack depth counter is incremented by one; if the current value of the stack depth counter is less than the stack depth n, continue with this step; otherwise, go to step 2;
• 步骤 2: 栈深度计数器置 0;  • Step 2: The stack depth counter is set to 0;
• 步骤 3: 程序缓时执行队列各栈同时检测本栈是否为满; 凡检测到本栈为空的 栈无操作; 凡检测到本桟为满的栈转步骤 4;  • Step 3: The program slows the execution of each stack of the queue and detects whether the stack is full. Any stack that detects that the stack is empty has no operation;
步骤 4: 程序缓时执行队列满足上述条件的各栈同时检测下栈是否为空; 凡检测到下栈 为满的栈无操作; 凡检测到下栈为空的栈转步骤 5; Step 4: The program slow execution execution queue meets the above conditions, and each stack detects whether the lower stack is empty; any stack that detects that the lower stack is full has no operation; and the stack that is detected to be empty is step 5;
• 步骤 5: 程序缓时执行队列满足上述两项条件的各栈同时将保存在本栈的程序 驱动器存入到下栈, 置下栈标志为满, 置本栈标志为空, 转步骤 1。  • Step 5: The program execution queue queues satisfying the above two conditions and save the program driver saved on the stack to the lower stack. Set the stack flag to full, and set the stack flag to empty. Go to step 1.
10. 根据权利要求 3至 8之一所述的程序缓时执行方法, 其特征在于, L结构 CPU的 程序驱动器驱动方法, 其步骤如下: The program slow execution method according to any one of claims 3 to 8, characterized in that the L-structure CPU The program driver driving method, the steps are as follows:
步骤 1 : 程序控制装置按规定用程序驱动器中的 APC更新程序驱动器中的 PC生 成下一条指令的地址并完成其它一些相关的设置;如果检测到该道程序无需中断, 则将该已更新的程序驱动器以某种方式发送给 L结构 CPU的取指令装置, 即转 步骤 2;  Step 1: The program control device generates the address of the next instruction and completes other related settings by using the PC in the APC update program driver in the program driver. If the program is detected without interruption, the updated program is executed. The drive is sent to the instruction fetching device of the L-structure CPU in some way, that is, step 2;
步骤 2:取指令装置按程序驱动器中的 PC地址到程序存储器中取到相应的指令并 将其保存到当前程序驱动器的相应单元中; 之后, 将携带有当前指令的程序驱动 器发送给指令译码装置, 即转步骤 3 ;  Step 2: The instruction fetching device fetches the corresponding instruction into the program memory according to the PC address in the program driver and saves it to the corresponding unit of the current program driver; after that, the program driver carrying the current instruction is sent to the instruction decoding. Device, that is, step 3;
步骤 3 ; 指令译码装置对当前程序驱动器携带的指令进行译码并将其保存到当前 程序驱动器的相应单元中; 随后将携带有已译码的当前指令的程序驱动器发送给 指令执行装置, 即转步骤 4;  Step 3: The instruction decoding device decodes the instruction carried by the current program driver and saves it to the corresponding unit of the current program driver; then sends the program driver carrying the decoded current instruction to the instruction execution device, ie Go to step 4;
步骤 4; 指令执行装置按指令所规定的操作执行该指令、 '形成 APC等执行状态, 并将它们保存到当前程序驱动器的相应单元中; 最后将该程序驱动器以某种方式 发送给程序控制装置, 以执行该道程序的下一条指令, 即转步骤 1。  Step 4: The instruction execution device executes the instruction according to the operation specified by the instruction, 'forms an execution state such as APC, and saves them to the corresponding unit of the current program driver; finally sends the program driver to the program control device in some manner To execute the next instruction of the program, go to step 1.
11.根据权利要求 3至 8之一所述的程序缓时执行方法, 其特征在于, 增设程序缓时执 行装置后的 L结构 CPU的程序驱动器驱动方法, 其步骤如下: The program slow-running method according to any one of claims 3 to 8, characterized in that the program driver driving method of the L-structure CPU after the program-delayed execution device is added, the steps of which are as follows:
步骤 1 :程序控制装置按规定用程序驱动器中的 APC更新程序驱动器中的 PC生成 下一条指令的地址并完成其它一些相关的设置; 如果检测到该道程序无需中断, 则 将该已更新的程序驱动器以某种方式发送给 L结构 CPU的取指令装置, 即转步骤 2; 如检测到该道程序需要进行中断处理时, 则将该已更新的程序驱动器以某种方 式发送给 L结构 CPU的程序缓时执行装置, 即转步骤 5;  Step 1: The program control device generates the address of the next instruction and completes other related settings by using the PC in the APC update program driver in the program driver. If the program is detected without interruption, the updated program is executed. The driver is sent to the instruction fetching device of the L-structure CPU in some manner, that is, to step 2; if it is detected that the program needs to perform interrupt processing, the updated program driver is sent to the L-structure CPU in some manner. The program is executed slowly, that is, step 5;
步骤 2: 取指令装置按程序驱动器中的 PC地址到程序存储器中取到相应的指令并将 其保存到当前程序驱动器的相应单元中; 之后, 将携带有当前指令的程序驱动器发送 给指令译码装置, 即转步骤 3 ;  Step 2: The instruction fetching device fetches the corresponding instruction into the program memory according to the PC address in the program driver and saves it to the corresponding unit of the current program driver; after that, the program driver carrying the current instruction is sent to the instruction decoding. Device, that is, step 3;
步骤 3 : 指令译码装置对当前程序驱动器携带的指令进行译码并将其保存到当前程 序驱动器的相应单元中;随后将携带有已译码的当前指令的程序驱动器发送给指令 执行装置, 即转步骤 4;  Step 3: The instruction decoding device decodes the instruction carried by the current program driver and saves it to the corresponding unit of the current program driver; then sends the program driver carrying the decoded current instruction to the instruction execution device, ie Go to step 4;
步骤 4: 指令执行装置按指令所规定的操作执行该指令、 形成 APC执行状态, 并 将它们保存到当前程序驱动器的相应单元中;最后将该程序驱动器以某种方式发送 给程序控制装置, 以执行该道程序的下一条指令, 即转步骤 1 ; 步骤 5: 程序缓时执行装置接收到需要进行中断处理的程序驱动器后, 将其存入程 序缓执队列的第 0栈; 此后, 该道程序的程序驱动器就被动态地锁在程序缓时执行 装置中进行动态等待; 每隔 n拍, 如果下栈空闲, Step 4: The instruction execution device executes the instruction according to the operation specified by the instruction, forms an APC execution state, and saves them to the corresponding unit of the current program driver; finally, the program driver is sent to the program control device in some manner to Execute the next instruction of the program, that is, go to step 1; Step 5: After the program execution device receives the program driver that needs to perform interrupt processing, it stores it in the 0th stack of the program easing queue; thereafter, the program driver of the program is dynamically locked in the program execution time. Dynamic waiting in the device; every n shots, if the stack is idle,
就下挪一栈; 直到被中断的程序驱动器已经经过逐栈移动到程序缓执队列的队首, 即 程序缓执队列的第 N-1栈; 此时, 被中断的程序驱动器已经经过了一段时间的中断等 待、 可以返回到正常的程序驱动流程中了; 此时, 程序缓时执行装置以某种方式将存 放在程序缓执队列第 N-1 栈的被中断的程序驱动器发送给取指令装置使该道程序转入 正常的执行流程, 即转步骤 2。 Move the stack down; until the interrupted program driver has moved to the beginning of the program easing queue by stack, that is, the N-1 stack of the program easing queue; at this point, the interrupted program driver has passed a section The interrupt waiting for time can be returned to the normal program-driven flow; at this time, the program-slowing execution device sends the interrupted program driver stored in the N-1th stack of the program continuation queue to the instruction fetching in some manner. The device moves the program to the normal execution flow, that is, to step 2.
PCT/CN2006/000551 2005-03-30 2006-03-30 A method of program postpone execution with delay and a device thereof WO2006102845A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CNB2005100588283A CN100514301C (en) 2005-03-30 2005-03-30 Method of program delay executing and its device
CN200510058828.3 2005-03-30

Publications (1)

Publication Number Publication Date
WO2006102845A1 true WO2006102845A1 (en) 2006-10-05

Family

ID=34876802

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2006/000551 WO2006102845A1 (en) 2005-03-30 2006-03-30 A method of program postpone execution with delay and a device thereof

Country Status (2)

Country Link
CN (1) CN100514301C (en)
WO (1) WO2006102845A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101836189A (en) * 2007-04-13 2010-09-15 施克莱无线公司 Method and device for managing the use of a processor by several applications, corresponding computer program product and storage means

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103944785B (en) * 2014-04-25 2017-05-24 成都理工大学 Information stream evaluation algorithm based on random discrete model
CN105752077B (en) * 2016-02-25 2018-03-06 上海科梁信息工程股份有限公司 The moment of torsion distribution method and system of motor vehicle driven by mixed power
CN105808338A (en) * 2016-03-17 2016-07-27 李晓波 Method and device for realizing configurability of interrupt response kernel during processing
CN110610344A (en) * 2019-07-29 2019-12-24 黑龙江金域医学检验所有限公司 Method, device and equipment for improving auditing speed of automatic auditing system

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4636944A (en) * 1984-01-17 1987-01-13 Concurrent Computer Corporation Multi-level priority micro-interrupt controller
US5913048A (en) * 1997-03-31 1999-06-15 International Business Machines Corporation Dispatching instructions in a processor supporting out-of-order execution
CN1595359A (en) * 2004-06-28 2005-03-16 李晓波 Method for executing multiprogram on unicomputer at the same time and computer thereof

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4636944A (en) * 1984-01-17 1987-01-13 Concurrent Computer Corporation Multi-level priority micro-interrupt controller
US5913048A (en) * 1997-03-31 1999-06-15 International Business Machines Corporation Dispatching instructions in a processor supporting out-of-order execution
CN1595359A (en) * 2004-06-28 2005-03-16 李晓波 Method for executing multiprogram on unicomputer at the same time and computer thereof

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101836189A (en) * 2007-04-13 2010-09-15 施克莱无线公司 Method and device for managing the use of a processor by several applications, corresponding computer program product and storage means

Also Published As

Publication number Publication date
CN1652083A (en) 2005-08-10
CN100514301C (en) 2009-07-15

Similar Documents

Publication Publication Date Title
US10452403B2 (en) Mechanism for instruction set based thread execution on a plurality of instruction sequencers
US8799929B2 (en) Method and apparatus for bandwidth allocation mode switching based on relative priorities of the bandwidth allocation modes
US20190361708A1 (en) Embedded scheduling of hardware resources for hardware acceleration
US10255107B2 (en) Operation of a multi-slice processor implementing a load/store unit maintaining rejected instructions
JP5244160B2 (en) A mechanism for instruction set based on thread execution in multiple instruction sequencers
US8006069B2 (en) Inter-processor communication method
TWI502512B (en) System and method for placing a processor into a gradual slow mode of operation
WO2006102845A1 (en) A method of program postpone execution with delay and a device thereof
US20170212852A1 (en) Method and accelerator unit for interrupt handling
WO2006000145A1 (en) A 'l' driving method for driving program/instruction and architecture and processor thereof
EP1766510B1 (en) Microprocessor output ports and control of instructions provided therefrom
US11429426B2 (en) Interrupt controller
US7152152B2 (en) Method of avoiding flush due to store queue full in a high frequency system with a stall mechanism and no reject mechanism
JP2007034731A (en) Pipeline processor
JP5093237B2 (en) Instruction processing device
US11327791B2 (en) Apparatus and method for operating an issue queue
US20040128488A1 (en) Strand switching algorithm to avoid strand starvation
CN115878190A (en) Method for instruction scheduling filling between transmission queues

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application
DPE2 Request for preliminary examination filed before expiration of 19th month from priority date (pct application filed from 20040101)
NENP Non-entry into the national phase

Ref country code: DE

WWW Wipo information: withdrawn in national office

Country of ref document: DE

NENP Non-entry into the national phase

Ref country code: RU

WWW Wipo information: withdrawn in national office

Country of ref document: RU

122 Ep: pct application non-entry in european phase

Ref document number: 06722203

Country of ref document: EP

Kind code of ref document: A1

WWW Wipo information: withdrawn in national office

Ref document number: 6722203

Country of ref document: EP