CN117873756A - Kernel interrupt processing method, device, equipment, medium and heterogeneous acceleration device - Google Patents
Kernel interrupt processing method, device, equipment, medium and heterogeneous acceleration device Download PDFInfo
- Publication number
- CN117873756A CN117873756A CN202410269819.1A CN202410269819A CN117873756A CN 117873756 A CN117873756 A CN 117873756A CN 202410269819 A CN202410269819 A CN 202410269819A CN 117873756 A CN117873756 A CN 117873756A
- Authority
- CN
- China
- Prior art keywords
- interrupt
- vector
- kernel
- current
- request
- Prior art date
- Legal status (The legal status 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 status listed.)
- Granted
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/54—Interprogram communication
- G06F9/545—Interprogram communication where tasks reside in different layers, e.g. user- and kernel-space
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/48—Program initiating; Program switching, e.g. by interrupt
- G06F9/4806—Task transfer initiation or dispatching
- G06F9/4812—Task transfer initiation or dispatching by interrupt, e.g. masked
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Bus Control (AREA)
Abstract
Description
技术领域Technical Field
本发明涉及计算机技术领域,特别是涉及一种内核中断的处理方法、装置、设备、介质及异构加速设备。The present invention relates to the field of computer technology, and in particular to a kernel interrupt processing method, device, equipment, medium and heterogeneous acceleration equipment.
背景技术Background technique
随着计算机技术的发展,越来越多的数据需要进行处理。为了满足处理庞大的数据的需求,异构加速设备应运而生。异构加速设备中的内核在执行完某次运算后,内核需要向静态外壳发起中断请求,然后由静态外壳处理请求并通知主机。With the development of computer technology, more and more data needs to be processed. In order to meet the needs of processing huge amounts of data, heterogeneous acceleration devices have emerged. After the core in a heterogeneous acceleration device completes a certain operation, the core needs to initiate an interrupt request to the static shell, which then processes the request and notifies the host.
在高密度内核场景下,同一时刻当有多个内核同时发起中断请求,静态外壳必须完成多个内核中断请求到快速外设组件互联(Peripheral Component InterconnectExpress,PCIE)中断请求的并串转换,即静态外壳每次只能发起一个中断至上位机。在一些用户公平性要求高的场景下,中断发起的先后顺序直接影响用户功能的时延。In high-density core scenarios, when multiple cores initiate interrupt requests at the same time, the static shell must complete the parallel-serial conversion of multiple core interrupt requests to the Peripheral Component Interconnect Express (PCIE) interrupt requests, that is, the static shell can only initiate one interrupt to the host computer at a time. In some scenarios where user fairness requirements are high, the order of interrupt initiation directly affects the latency of user functions.
由此可见,如何处理同时发起的中断请求的输出,以降低中断发起的时延、提高用户体验感是本领域人员亟需解决的技术问题。It can be seen that how to process the output of interrupt requests initiated simultaneously to reduce the delay of interrupt initiation and improve user experience is a technical problem that people in this field need to solve urgently.
发明内容Summary of the invention
本发明的目的是提供一种内核中断的处理方法、装置、设备、介质及异构加速设备,以解决并行中断申请场景中,若不设置合理的中断发起次序,会导致用户功能的时延,降低用户体验感的技术问题。The purpose of the present invention is to provide a kernel interrupt processing method, device, equipment, medium and heterogeneous acceleration device to solve the technical problem that in parallel interrupt application scenarios, if a reasonable interrupt initiation order is not set, it will cause user function delays and reduce user experience.
为解决上述技术问题,本发明提供一种内核中断的处理方法,包括:In order to solve the above technical problems, the present invention provides a method for processing a kernel interrupt, comprising:
获取预设时刻多内核设备中内核发起的中断请求以及根据预设时刻多内核设备中内核发起中断请求的情况获取当前请求向量;Obtaining an interrupt request initiated by a kernel in a multi-core device at a preset time and obtaining a current request vector according to the interrupt request initiated by the kernel in the multi-core device at the preset time;
获取当前优先级矩阵;其中,当前优先级矩阵中的每一行或每一列元素组成的向量均为独热向量,每一行独热向量或每一列独热向量分别表征各内核的优先级顺序;Get the current priority matrix; wherein, the vectors composed of each row or column of elements in the current priority matrix are all one-hot vectors, and each row of one-hot vectors or each column of one-hot vectors respectively represents the priority order of each kernel;
将所述当前请求向量分别与所述当前优先级矩阵的每一行独热向量或每一列独热向量轮询相与,并根据各相与结果分别获取发起中断请求的内核编号;Performing AND operations on the current request vector and each row one-hot vector or each column one-hot vector of the current priority matrix respectively, and obtaining the kernel number that initiates the interrupt request according to each AND operation result;
根据内核编号并结合内核的优先级顺序依次输出发起中断请求的内核对应的中断请求。The interrupt request corresponding to the core that initiated the interrupt request is output in sequence according to the core number and the priority order of the cores.
一方面,将所述当前请求向量分别与所述当前优先级矩阵的每一行独热向量或每一列独热向量轮询相与之前,还包括:On the one hand, before polling and performing AND operation on the current request vector with each row one-hot vector or each column one-hot vector of the current priority matrix respectively, the method further includes:
在检测到发起中断请求的内核的数量大于1的情况下,进入所述将所述当前请求向量分别与所述当前优先级矩阵的每一行独热向量或每一列独热向量轮询相与的步骤;When it is detected that the number of cores initiating interrupt requests is greater than 1, the step of polling and performing AND operation on the current request vector and each row one-hot vector or each column one-hot vector of the current priority matrix is entered;
在检测到发起中断请求的内核的数量等于1的情况下,根据所述当前请求向量确定发起中断请求的内核编号;根据内核编号输出内核对应的中断请求;When it is detected that the number of cores initiating interrupt requests is equal to 1, determining the core number initiating the interrupt request according to the current request vector; and outputting the interrupt request corresponding to the core according to the core number;
在检测到发起中断请求的内核的数量等于0的情况下,则结束。When it is detected that the number of cores initiating interrupt requests is equal to 0, the process ends.
另一方面,确定发起中断请求的内核的数量等于1包括:On the other hand, determining that the number of cores that initiate interrupt requests is equal to 1 includes:
在检测到所述当前请求向量的最低位非零值的位置和最高位非零值的位置相同的情况下,确定发起中断请求的内核的数量等于1。When it is detected that the position of the least significant non-zero value and the position of the most significant non-zero value of the current request vector are the same, it is determined that the number of cores initiating interrupt requests is equal to 1.
另一方面,每一行独热向量分别表征各内核的优先级顺序,且行标号越小表征优先级越高;所述将所述当前请求向量分别与所述当前优先级矩阵的每一行独热向量或每一列独热向量轮询相与,并根据各相与结果分别获取发起中断请求的内核编号包括:On the other hand, each row of one-hot vectors represents the priority order of each core, and the smaller the row number, the higher the priority; the current request vector is polled and ANDed with each row of one-hot vectors or each column of one-hot vectors of the current priority matrix, and the core number that initiates the interrupt request is obtained according to each AND result, including:
将所述当前请求向量依次与所述当前优先级矩阵的每一行独热向量顺序轮询相与;Sequentially poll and AND the current request vector with each row of the one-hot vector of the current priority matrix;
在检测到当前次相与结果不为0向量的情况下,根据预先建立的相与后的向量与内核编号之间的对应关系确定发起中断请求的当前内核编号。When it is detected that the result of the current AND operation is not a zero vector, the current kernel number for initiating the interrupt request is determined according to a pre-established correspondence between the vector after the AND operation and the kernel number.
另一方面,在所述根据内核编号并结合内核的优先级顺序依次输出发起中断请求的内核对应的中断请求之后,或在所述根据内核编号输出内核对应的中断请求之后,还包括:On the other hand, after outputting the interrupt request corresponding to the core that initiated the interrupt request in sequence according to the core number and in combination with the priority order of the cores, or after outputting the interrupt request corresponding to the core according to the core number, the method further includes:
按照内核的优先级从低到高的顺序将所述当前请求向量分别与所述当前优先级矩阵的每一行独热向量或每一列独热向量轮询相与,根据各相与结果更新所述当前优先级矩阵。The current request vector is polled and ANDed with each row of one-hot vectors or each column of one-hot vectors in the current priority matrix in order of the kernel priorities from low to high, and the current priority matrix is updated according to the results of each ANDing.
另一方面,每一行独热向量分别表征各内核的优先级顺序,且行标号越小表征优先级越高;On the other hand, each row of one-hot vectors represents the priority order of each kernel, and the smaller the row number, the higher the priority;
所述按照内核的优先级从低到高的顺序将所述当前请求向量分别与所述当前优先级矩阵的每一行独热向量或每一列独热向量轮询相与,根据各相与结果更新所述当前优先级矩阵包括:The step of polling and performing AND operations on the current request vector and each row one-hot vector or each column one-hot vector of the current priority matrix in order of the kernel priorities from low to high, and updating the current priority matrix according to the AND operations results comprises:
将所述当前请求向量依次与所述当前优先级矩阵的每一行独热向量逆序轮询相与;Performing AND operations on the current request vector and each row of the one-hot vector of the current priority matrix in reverse order;
在检测到当前次相与结果不为0向量的情况下,按照预设方式更新所述当前优先级矩阵;When it is detected that the result of the current phase and is not a zero vector, the current priority matrix is updated according to a preset method;
在检测到当前次相与结果为0向量的情况下,保持当前次的上一次相与后所对应的待更新优先级矩阵不变。When it is detected that the result of the current AND operation is a 0 vector, the priority matrix to be updated corresponding to the last AND operation of the current operation is kept unchanged.
另一方面,所述当前优先级矩阵为N阶矩阵,N为多内核设备的总内核数,当前优先级矩阵的行标为k,0≤k≤N-1;将所述当前请求向量依次与所述当前优先级矩阵的每一行独热向量逆序轮询相与,若检测到相与结果不为0向量,则所述按照预设方式更新所述当前优先级矩阵包括:On the other hand, the current priority matrix is an N-order matrix, N is the total number of cores of the multi-core device, and the row of the current priority matrix is labeled k, 0≤k≤N-1; the current request vector is sequentially and polled in reverse order with each row of the one-hot vector of the current priority matrix, and if it is detected that the result of the AND is not a 0 vector, then updating the current priority matrix in a preset manner includes:
当k等于N-1时,将所述当前请求向量与所述当前优先级矩阵的行标为k的行对应的独热向量相与,若检测到相与结果不为0向量,则将所述当前优先级矩阵的行标为k的行对应的独热向量赋值给当前待更新优先级矩阵的最后一行;当前待更新优先级矩阵的行标为0的行至行标为k-1的行对应的独热向量与所述当前优先级矩阵的行标为0的行至行标为k-1的行对应的独热向量相同;When k is equal to N-1, the current request vector is ANDed with the one-hot vector corresponding to the row labeled k of the current priority matrix. If it is detected that the ANDed result is not a zero vector, the one-hot vector corresponding to the row labeled k of the current priority matrix is assigned to the last row of the priority matrix to be updated; the one-hot vector corresponding to the row labeled 0 to the row labeled k-1 of the priority matrix to be updated is the same as the one-hot vector corresponding to the row labeled 0 to the row labeled k-1 of the current priority matrix;
当k小于N-1时,将所述当前请求向量与所述当前优先级矩阵的行标为k的行对应的独热向量相与,若检测到相与结果不为0向量,则将所述当前优先级矩阵的行标为k的行对应的独热向量赋值给当前待更新优先级矩阵的最后一行;将当前次的上一次相与后所对应的待更新优先级矩阵的行标为k+1至行标为N-1的行对应的独热向量赋值给当前待更新优先级矩阵的行标为k到行标为N-2的行;当前待更新优先级矩阵的行标为0的行至行标为k-1的行对应的独热向量与当前次的上一次相与后所对应的待更新优先级矩阵的行标为0的行至行标为k-1的行对应的独热向量相同。When k is less than N-1, the current request vector is ANDed with the one-hot vector corresponding to the row labeled k of the current priority matrix. If it is detected that the AND result is not a zero vector, the one-hot vector corresponding to the row labeled k of the current priority matrix is assigned to the last row of the priority matrix to be updated; the one-hot vector corresponding to the rows labeled k+1 to N-1 of the priority matrix to be updated corresponding to the last AND operation is assigned to the rows labeled k to N-2 of the priority matrix to be updated; the one-hot vector corresponding to the rows labeled 0 to k-1 of the priority matrix to be updated is the same as the one-hot vector corresponding to the rows labeled 0 to k-1 of the priority matrix to be updated corresponding to the last AND operation.
另一方面,在所述根据各相与结果分别获取发起中断请求的内核编号之后,还包括:On the other hand, after obtaining the kernel number that initiates the interrupt request according to the results of each phase and each phase, the method further includes:
依次将各内核编号存储在先入先出缓存器中;Store each kernel number in a first-in-first-out buffer in turn;
通过所述先入先出缓存器依次输出发起中断请求的内核对应的中断请求。The interrupt requests corresponding to the core that initiates the interrupt request are output in sequence through the first-in first-out buffer.
另一方面,所述获取当前优先级矩阵包括:On the other hand, obtaining the current priority matrix includes:
在检测到上位机对多内核设备设置有内核优先级顺序的情况下,根据上位机设置的内核的优先级顺序建立所述当前优先级矩阵。When it is detected that the host computer sets a kernel priority order for the multi-core device, the current priority matrix is established according to the kernel priority order set by the host computer.
另一方面,根据内核编号并结合内核的优先级顺序依次输出发起中断请求的内核对应的中断请求包括:On the other hand, the interrupt requests corresponding to the cores initiating the interrupt requests are outputted in sequence according to the core numbers and in combination with the priority order of the cores, including:
获取预先与上位机协商的用于上报中断的中断控制协议;Obtain the interrupt control protocol for reporting interrupts that is pre-negotiated with the host computer;
根据内核编号、结合内核的优先级顺序以及按照所述中断控制协议依次将发起中断请求的内核对应的中断请求上报至上位机。According to the core number, the priority order of the cores and the interrupt control protocol, the interrupt request corresponding to the core that initiates the interrupt request is reported to the host computer in sequence.
另一方面,在所述根据各相与结果更新所述当前优先级矩阵之后,还包括:On the other hand, after updating the current priority matrix according to the results of each phase, the method further includes:
自获取到更新后的所述当前优先级矩阵开始,预设时长内返回所述获取预设时刻多内核设备中内核发起的中断请求以及根据预设时刻多内核设备中内核发起中断请求的情况获取当前请求向量的步骤。Starting from obtaining the updated current priority matrix, returning within a preset time period to the steps of obtaining an interrupt request initiated by a core in the multi-core device at a preset time and obtaining a current request vector according to the interrupt request initiated by the core in the multi-core device at the preset time.
为了解决上述技术问题,本发明还提供一种异构加速设备,包括:控制器、各内核对应的中断使能寄存器和中断状态寄存器,所述控制器分别与各所述中断使能寄存器、各所述中断状态寄存器连接,所述中断使能寄存器用于存储内核对应的中断请求信息,所述中断状态寄存器用于存储内核对应的发起中断请求的情况;所述控制器用于实现上述的内核中断的处理方法的步骤。In order to solve the above technical problems, the present invention also provides a heterogeneous acceleration device, including: a controller, an interrupt enable register and an interrupt status register corresponding to each core, the controller is respectively connected to each interrupt enable register and each interrupt status register, the interrupt enable register is used to store the interrupt request information corresponding to the core, and the interrupt status register is used to store the situation of initiating the interrupt request corresponding to the core; the controller is used to implement the steps of the above-mentioned core interrupt processing method.
另一方面,异构加速设备还包括:用于存储当前请求向量的第一先入先出缓存器、用于存储发起中断请求的内核编号的第二先入先出缓存器;On the other hand, the heterogeneous acceleration device further includes: a first first-in first-out buffer for storing a current request vector, a second first-in first-out buffer for storing a core number that initiates an interrupt request;
所述控制器与所述第一先入先出缓存器连接,用于从所述第一先入先出缓存器中获取所述当前请求向量;The controller is connected to the first FIFO buffer and is used to obtain the current request vector from the first FIFO buffer;
所述控制器与所述第二先入先出缓存器连接,用于通过所述第二先入先出缓存器依次输出发起中断请求的内核对应的中断请求。The controller is connected to the second FIFO buffer and is used for sequentially outputting interrupt requests corresponding to the core that initiates the interrupt request through the second FIFO buffer.
为了解决上述技术问题,本发明还提供一种内核中断的处理装置,包括:In order to solve the above technical problems, the present invention further provides a kernel interrupt processing device, comprising:
第一获取模块,用于获取预设时刻多内核设备中内核发起的中断请求以及根据预设时刻多内核设备中内核发起中断请求的情况获取当前请求向量;A first acquisition module is used to acquire an interrupt request initiated by a kernel in a multi-core device at a preset time and acquire a current request vector according to the interrupt request initiated by the kernel in the multi-core device at the preset time;
第二获取模块,用于获取当前优先级矩阵;其中,当前优先级矩阵中的每一行或每一列元素组成的向量均为独热向量,每一行独热向量或每一列独热向量分别表征各内核的优先级顺序;The second acquisition module is used to acquire the current priority matrix; wherein each row or column of the current priority matrix is composed of a one-hot vector, and each row of the one-hot vector or each column of the one-hot vector represents the priority order of each kernel;
轮询及获取模块,用于将所述当前请求向量分别与所述当前优先级矩阵的每一行独热向量或每一列独热向量轮询相与,并根据各相与结果分别获取发起中断请求的内核编号;A polling and acquisition module, used for polling and performing AND operations on the current request vector and each row one-hot vector or each column one-hot vector of the current priority matrix, and obtaining the kernel number that initiates the interrupt request according to each AND operation result;
输出模块,用于根据内核编号并结合内核的优先级顺序依次输出发起中断请求的内核对应的中断请求。The output module is used to output the interrupt request corresponding to the core that initiates the interrupt request in sequence according to the core number and the priority order of the cores.
为了解决上述技术问题,本发明还提供一种内核中断的处理设备,包括:In order to solve the above technical problems, the present invention further provides a kernel interrupt processing device, comprising:
存储器,用于存储计算机程序;Memory for storing computer programs;
处理器,用于执行所述计算机程序时实现上述的内核中断的处理方法的步骤。The processor is used to implement the steps of the above-mentioned kernel interrupt processing method when executing the computer program.
为了解决上述技术问题,本发明还提供一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机程序,所述计算机程序被处理器执行时实现上述的内核中断的处理方法的步骤。In order to solve the above technical problem, the present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned kernel interrupt processing method are implemented.
本发明所提供的内核中断的处理方法中,包括:获取预设时刻多内核设备中内核发起的中断请求以及根据预设时刻多内核设备中内核发起中断请求的情况获取当前请求向量;获取当前优先级矩阵;其中,当前优先级矩阵中的每一行或每一列元素组成的向量均为独热向量,每一行独热向量或每一列独热向量分别表征各内核的优先级顺序;将当前请求向量分别与当前优先级矩阵的每一行独热向量或每一列独热向量轮询相与,并根据各相与结果分别获取发起中断请求的内核编号;根据内核编号并结合内核的优先级顺序依次输出发起中断请求的内核对应的中断请求。The kernel interrupt processing method provided by the present invention includes: obtaining an interrupt request initiated by a kernel in a multi-core device at a preset time and obtaining a current request vector according to the situation that the kernel in the multi-core device initiates the interrupt request at the preset time; obtaining a current priority matrix; wherein the vectors composed of each row or column of elements in the current priority matrix are all one-hot vectors, and each row of one-hot vectors or each column of one-hot vectors respectively represent the priority order of each kernel; performing AND operation on the current request vector and each row of one-hot vectors or each column of one-hot vectors in the current priority matrix respectively, and obtaining the kernel number that initiates the interrupt request according to each AND operation result; and outputting the interrupt request corresponding to the kernel that initiates the interrupt request in sequence according to the kernel number and in combination with the kernel priority order.
本发明的有益效果在于,首先,通过获取预设时刻多内核设备中发起中断请求的内核编号,然后依据内核的优先级顺序依次输出发起中断请求的内核对应的中断请求,实现了对同时发出的中断请求的排序以及串行输出;其次,由于在输出中断请求的时候,是依据内核的优先级实现的,故而,降低了中断发起的延时,提高了用户的公平性,以及提高了用户体验感;再次,由于是直接根据内核的优先级输出中断请求,故而,不需要进行大量的比较逻辑,节省了逻辑资源开销;另外,通过将当前请求向量分别与当前优先级矩阵的每一行独热向量或每一列独热向量轮询相与,并根据各相与结果分别获取到了发起中断请求的内核编号,根据内核编号能够准确地实现对发起中断请求的各内核的中断请求的输出。The beneficial effects of the present invention are as follows: firstly, by obtaining the core number of the multi-core device that initiates the interrupt request at a preset time, and then outputting the interrupt request corresponding to the core that initiates the interrupt request in sequence according to the priority order of the cores, the sorting and serial output of the interrupt requests issued simultaneously are realized; secondly, since the interrupt request is output according to the priority of the core, the delay of interrupt initiation is reduced, the fairness of users is improved, and the user experience is improved; thirdly, since the interrupt request is output directly according to the priority of the core, a large amount of comparison logic is not required, saving logic resource overhead; in addition, by polling and ANDing the current request vector with each row of the unique hot vector or each column of the unique hot vector of the current priority matrix, and obtaining the core number of the interrupt request according to each AND result, the output of the interrupt request of each core that initiates the interrupt request can be accurately realized according to the core number.
在将当前请求向量分别与当前优先级矩阵的每一行独热向量或每一列独热向量轮询相与之前,在发起中断请求的内核的数量等于1时,不需要将当前优先级矩阵与当前请求向量轮询相与得到内核编号,而是直接根据当前请求向量确定发起中断请求的内核编号,然后根据内核编号输出内核对应的中断请求,提高了对于单个中断请求的处理效率。Before polling and ANDing the current request vector with each row one-hot vector or each column one-hot vector of the current priority matrix respectively, when the number of cores initiating interrupt requests is equal to 1, it is not necessary to poll and AND the current priority matrix with the current request vector to obtain the core number. Instead, the core number initiating the interrupt request is directly determined according to the current request vector, and then the interrupt request corresponding to the core is output according to the core number, thereby improving the processing efficiency of a single interrupt request.
在判断发起中断请求的内核的数量为1时,基于比较最低位、最高位非零值是否位置相同的方式,提高了判断是否为单中断请求的效率。When it is determined that the number of cores initiating an interrupt request is 1, the efficiency of determining whether it is a single interrupt request is improved by comparing whether the least significant bit and the most significant bit non-zero values are in the same position.
在每一行独热向量分别表征各内核的优先级顺序,且行标号越小表征优先级越高的情况下,将当前请求向量依次与当前优先级矩阵的每一行独热向量顺序轮询相与,完成排序;在输出内核对应的中断请求后,将当前请求向量依次与当前优先级矩阵的每一行独热向量逆序轮询相与,根据各相与结果更新当前优先级矩阵,保证了在并行中断申请场景中保证内核中断次序的公平性。In the case where each row of one-hot vectors represents the priority order of each core, and the smaller the row number, the higher the priority, the current request vector is sequentially polled and ANDed with each row of one-hot vectors in the current priority matrix to complete the sorting; after outputting the interrupt request corresponding to the core, the current request vector is sequentially polled and ANDed with each row of one-hot vectors in the current priority matrix in reverse order, and the current priority matrix is updated according to the results of each phase, thereby ensuring the fairness of the core interrupt order in the parallel interrupt application scenario.
在根据各相与结果分别获取发起中断请求的内核编号之后,依次将各内核编号存储在先入先出缓存器中;利用先入先出缓存器的特点实现了对发起中断请求的内核对应的中断请求的顺序输出。After obtaining the core number that initiates the interrupt request according to each phase and result, each core number is stored in a first-in first-out buffer in sequence; the first-in first-out buffer is used to realize the sequential output of the interrupt request corresponding to the core that initiates the interrupt request.
此外,本发明还提供一种异构加速设备、内核中断的处理装置、内核中断的处理设备以及计算机可读存储介质,与上述提到的内核中断的处理方法具有相同或相对应的技术特征,效果同上。In addition, the present invention also provides a heterogeneous acceleration device, a kernel interrupt processing device, a kernel interrupt processing device and a computer-readable storage medium, which have the same or corresponding technical features as the above-mentioned kernel interrupt processing method and have the same effect as above.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
为了更清楚地说明本发明实施例,下面将对实施例中所需要使用的附图做简单的介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
图1为本发明实施例提供的现场可编程门阵列芯片上报中断的示意图;FIG1 is a schematic diagram of a field programmable gate array chip reporting an interruption according to an embodiment of the present invention;
图2为本发明实施例提供的一种内核中断的处理方法的流程图;FIG2 is a flow chart of a method for processing a kernel interrupt provided by an embodiment of the present invention;
图3为本发明实施例提供的一种优先级矩阵的示意图;FIG3 is a schematic diagram of a priority matrix provided by an embodiment of the present invention;
图4为本发明实施例提供的一种输出中断请求的示意图;FIG4 is a schematic diagram of an output interrupt request provided by an embodiment of the present invention;
图5为本发明实施例提供的一种现场可编程门阵列芯片的示意图;FIG5 is a schematic diagram of a field programmable gate array chip provided by an embodiment of the present invention;
图6为本发明实施例提供的一种优先级处理的方法的流程图;FIG6 is a flow chart of a priority processing method provided by an embodiment of the present invention;
图7为本发明的一实施例提供的内核中断的处理装置的结构图;FIG7 is a structural diagram of a kernel interrupt processing device provided by an embodiment of the present invention;
图8为本发明另一实施例提供的内核中断的处理设备的结构图。FIG8 is a structural diagram of a kernel interrupt processing device provided by another embodiment of the present invention.
具体实施方式Detailed ways
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下,所获得的所有其他实施例,都属于本发明保护范围。The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the protection scope of the present invention.
本发明的核心是提供一种内核中断的处理方法、装置、设备、介质及异构加速设备,以解决并行中断申请场景中,若不设置合理的中断发起次序,会导致用户功能的时延,降低用户体验感的技术问题。The core of the present invention is to provide a kernel interrupt processing method, device, equipment, medium and heterogeneous acceleration device to solve the technical problem that in parallel interrupt application scenarios, if a reasonable interrupt initiation order is not set, it will cause user function delays and reduce user experience.
对于本发明实施例中的多内核设备不作限定,根据实际情况确定。为了方便描述,本发明实施例中以多内核设备为使用现场可编程门阵列(Field Programmable GateArray,FPGA)芯片实现的异构加速设备为例,对本发明实施例中的方案进行说明。There is no limitation on the multi-core device in the embodiment of the present invention, which is determined according to the actual situation. For the convenience of description, the embodiment of the present invention takes the multi-core device as a heterogeneous acceleration device implemented by a Field Programmable Gate Array (FPGA) chip as an example to illustrate the solution in the embodiment of the present invention.
在使用FPGA实现的异构加速设备中,一般将FPGA芯片部分的设计分为静态外壳(static shell)部分和动态内核(dynamic kernel)部分。外壳部分实现FPGA加速器的基本管理功能和接口电路;动态内核部分实现上位机需要的各种计算加速功能。图1为本发明实施例提供的现场可编程门阵列芯片上报中断的示意图。如图1所示,现场可编程门阵列芯片100上报内核中断至上位机200。其中,在现场可编程门阵列芯片100的动态区中包含多个内核,如内核1、内核2至内核N。内核受控执行完某次运算后,静态区需要收集内核的中断请求,将中断上报至上位机200。In heterogeneous acceleration devices implemented using FPGA, the design of the FPGA chip part is generally divided into a static shell part and a dynamic kernel part. The shell part implements the basic management functions and interface circuits of the FPGA accelerator; the dynamic kernel part implements various computing acceleration functions required by the host computer. FIG1 is a schematic diagram of a field programmable gate array chip reporting an interrupt provided by an embodiment of the present invention. As shown in FIG1 , a field programmable gate array chip 100 reports a kernel interrupt to a host computer 200. Among them, the dynamic area of the field programmable gate array chip 100 includes multiple kernels, such as kernel 1, kernel 2 to kernel N. After the kernel is controlled to execute a certain operation, the static area needs to collect the kernel's interrupt request and report the interrupt to the host computer 200.
在高密度内核场景下,同一时刻可能有一个或多个内核同时发起中断,若仅有单个内核发起中断请求则静态区直接处理该请求,否则静态区必须完成多个内核中断请求到快速外设组件互联中断请求的并串转换,这一过程中需要考虑发起中断的顺序。在一部分场景中,不同内核之间的处理逻辑相对独立,上位机中央处理器(Central ProcessingUnit,CPU)对收到中断的先后顺序没有固定要求。但在一些用户公平性要求较高的场景中,中断发起的先后顺序直接影响用户功能的时延。In high-density core scenarios, one or more cores may initiate interrupts at the same time. If only a single core initiates an interrupt request, the static area directly processes the request. Otherwise, the static area must complete the parallel-serial conversion of multiple core interrupt requests to fast peripheral component interconnect interrupt requests. In this process, the order of initiating interrupts needs to be considered. In some scenarios, the processing logic between different cores is relatively independent, and the host computer central processing unit (CPU) has no fixed requirements for the order in which interrupts are received. However, in some scenarios where user fairness requirements are high, the order in which interrupts are initiated directly affects the latency of user functions.
故而,本发明实施例提供一种内核中断的处理方法,排序的依据是优先级,优先级维护在静态区,可以通过FPGA逻辑设计进行实时跟踪和更新,因此不需要对针对优先级的值设计复杂的比较逻辑,只需在初始优先级的基础上完成跟踪和更新即可快速得出任意中断输入组合的内核之间的优先级关系。基于内核的优先级处理同时发起的中断请求的输出,从而降低中断发起的时延、提高用户体验感。Therefore, the embodiment of the present invention provides a method for processing kernel interrupts, in which the order is based on priority, and the priority is maintained in a static area, which can be tracked and updated in real time through FPGA logic design. Therefore, it is not necessary to design complex comparison logic for the priority value, and only tracking and updating based on the initial priority can quickly obtain the priority relationship between kernels of any interrupt input combination. The output of interrupt requests initiated simultaneously is processed based on the kernel priority, thereby reducing the delay of interrupt initiation and improving the user experience.
为了使本技术领域的人员更好地理解本发明方案,下面结合附图和具体实施方式对本发明作进一步的详细说明。图2为本发明实施例提供的一种内核中断的处理方法的流程图,如图2所示,该方法包括:In order to enable those skilled in the art to better understand the solution of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific implementation methods. FIG2 is a flow chart of a method for processing a kernel interrupt provided by an embodiment of the present invention. As shown in FIG2, the method includes:
S10:获取预设时刻多内核设备中内核发起的中断请求以及根据预设时刻多内核设备中内核发起中断请求的情况获取当前请求向量;S10: Obtaining an interrupt request initiated by a kernel in the multi-core device at a preset time and obtaining a current request vector according to the interrupt request initiated by the kernel in the multi-core device at the preset time;
S11:获取当前优先级矩阵;其中,当前优先级矩阵中的每一行或每一列元素组成的向量均为独热向量,每一行独热向量或每一列独热向量分别表征各内核的优先级顺序;S11: Obtain the current priority matrix; wherein each row or column of the current priority matrix is composed of a one-hot vector, and each row of the one-hot vector or each column of the one-hot vector represents the priority order of each kernel;
S12:将当前请求向量分别与当前优先级矩阵的每一行独热向量或每一列独热向量轮询相与,并根据各相与结果分别获取发起中断请求的内核编号;S12: performing AND operations on the current request vector and each row one-hot vector or each column one-hot vector of the current priority matrix respectively, and obtaining the core number of the initiator of the interrupt request according to each AND operation result;
S13:根据内核编号并结合内核的优先级顺序依次输出发起中断请求的内核对应的中断请求。S13: Outputting the interrupt request corresponding to the core that initiated the interrupt request in sequence according to the core number and the priority order of the cores.
本发明实施例中,内核发起中断请求或未发起中断请求,是通过高低电平来判断的,如高电平表示发起了中断请求,低电平表示未发起中断请求。由于采集到的是电平信号,若直接根据电平信号是无法区分出中断请求所对应的内核。故而,本发明实施例中在处理内核中断时,需要确定出发起中断请求的内核。为了区分各内核,会提前对多内核设备中的各内核进行编号。对于各内核的编号不作限定,根据实际情况确定。如存在4个内核,则可以将内核编号为内核0、内核1、内核2、内核3。即在处理内核中断的同时,需要确定出发起中断请求的内核的编号。In the embodiment of the present invention, whether the kernel initiates an interrupt request or does not initiate an interrupt request is determined by high and low levels, such as a high level indicates that an interrupt request is initiated, and a low level indicates that an interrupt request is not initiated. Since the collected signal is a level signal, it is impossible to distinguish the kernel corresponding to the interrupt request directly based on the level signal. Therefore, in the embodiment of the present invention, when processing a kernel interrupt, it is necessary to determine the kernel that initiates the interrupt request. In order to distinguish each kernel, each kernel in a multi-core device will be numbered in advance. There is no limitation on the numbering of each kernel, which is determined according to the actual situation. If there are 4 kernels, the kernels can be numbered as kernel 0, kernel 1, kernel 2, and kernel 3. That is, when processing a kernel interrupt, it is necessary to determine the number of the kernel that initiates the interrupt request.
为了确定发起中断请求的内核编号,本发明实施例中将请求向量与优先级矩阵进行轮询相与。具体地,根据预设时刻多内核设备中内核发起中断请求的情况获取当前请求向量。对于预设时刻不作限定。发起中断请求的情况包括发起中断请求或未发起中断请求。如上文中描述的,若发起中断请求,在静态区采集到的电平信号为1;若未发起中断请求,在静态区采集到的电平信号为0,即以0和1组成的数组作为当前请求向量。需要说明的是,存在一个中断请求时,请求向量为独热向量。In order to determine the core number that initiates the interrupt request, the request vector is polled and ANDed with the priority matrix in an embodiment of the present invention. Specifically, the current request vector is obtained according to the situation that the core in the multi-core device initiates the interrupt request at the preset time. There is no limitation on the preset time. The situation of initiating an interrupt request includes initiating an interrupt request or not initiating an interrupt request. As described above, if an interrupt request is initiated, the level signal collected in the static area is 1; if an interrupt request is not initiated, the level signal collected in the static area is 0, that is, an array composed of 0 and 1 is used as the current request vector. It should be noted that when there is an interrupt request, the request vector is a one-hot vector.
在对同时发起中断请求进行处理时,采集的是电平信号,即采集的数据为0或1,若采集的电平信号中存在多个0和/或多个1,则无法通过比较大小的方式得到排序结果。如存在4个内核,若在静态区采集到的电平信号为1、1、1、0。显然通过比较的方式,仅仅能够得到存在一个未发起中断请求的内核,而对于电平信号为1的内核则无法通过比较的形式进行排序。因此,本发明实施例中直接依据内核的优先级对同时发起中断请求的内核进行排序,进而按照顺序将发起中断请求的内核的中断请求进行输出。When processing the interrupt requests initiated simultaneously, what is collected is the level signal, that is, the collected data is 0 or 1. If there are multiple 0s and/or multiple 1s in the collected level signal, the sorting result cannot be obtained by comparing the size. For example, if there are 4 cores, if the level signals collected in the static area are 1, 1, 1, 0. Obviously, by comparison, it can only be obtained that there is a core that has not initiated an interrupt request, and the core whose level signal is 1 cannot be sorted by comparison. Therefore, in the embodiment of the present invention, the cores that simultaneously initiate interrupt requests are directly sorted according to the priority of the core, and then the interrupt requests of the cores that initiate interrupt requests are output in order.
对于设定的内核的优先级不作限定,如果没有特殊要求,可以按照内核编号设置一个初始值,比如单位矩阵就是内核编号大的,优先级最高;副对角线为1的矩阵就是内核编号小的,优先级最高。当上位机有特殊要求,则在检测到上位机对多内核设备设置有内核优先级顺序的情况下,根据上位机设置的内核的优先级顺序建立当前优先级矩阵。当前优先级矩阵中的每一行或每一列元素组成的向量均为独热向量,每一行独热向量或每一列独热向量分别表征各内核的优先级顺序。对于优先级矩阵的行数、列数等不作限定。There is no limit on the priority of the set kernel. If there is no special requirement, an initial value can be set according to the kernel number. For example, the unit matrix is the kernel with a large number and the highest priority; the matrix with a secondary diagonal of 1 is the kernel with a small number and the highest priority. When the host computer has special requirements, if it is detected that the host computer has set a kernel priority order for the multi-core device, the current priority matrix is established according to the kernel priority order set by the host computer. The vector composed of each row or column element in the current priority matrix is a one-hot vector, and each row of one-hot vectors or each column of one-hot vectors represents the priority order of each kernel. There is no limit on the number of rows and columns of the priority matrix.
本发明实施例中设定的优先级矩阵为方阵,且优先级矩阵的阶数与多内核设备中的内核的数量相同。如总内核数为N,则选取的优先级矩阵为N阶矩阵。以存在4个内核,分别为内核0、内核1、内核2和内核3。若设定的内核的优先级从高到低依次为内核1、内核2、内核3、内核0,当设定优先级矩阵的行标表示的是优先级,行标越小优先级越高;列标表示的是内核编号,此时建立的优先级矩阵如图3所示,图3为本发明实施例提供的一种优先级矩阵的示意图,第一行独热向量表征内核1的优先级顺序最高,第二行独热向量表征内核2的优先级顺序次于内核1的优先级顺序,第三行独热向量表征内核3的优先级顺序次于内核2的优先级顺序,第三行独热向量表征内核0的优先级顺序次于内核3的优先级顺序。实际中,也可以是设定优先级矩阵的列标表示优先级,列标越小优先级越高;行标表示内核编号。The priority matrix set in the embodiment of the present invention is a square matrix, and the order of the priority matrix is the same as the number of cores in the multi-core device. If the total number of cores is N, the priority matrix selected is an N-order matrix. There are 4 cores, namely core 0, core 1, core 2 and core 3. If the priorities of the cores set from high to low are core 1, core 2, core 3 and core 0, when the row label of the priority matrix is set to represent the priority, the smaller the row label, the higher the priority; the column label represents the core number, and the priority matrix established at this time is shown in Figure 3, which is a schematic diagram of a priority matrix provided by an embodiment of the present invention. The first row of one-hot vectors represents that the priority order of core 1 is the highest, the second row of one-hot vectors represents that the priority order of core 2 is lower than the priority order of core 1, the third row of one-hot vectors represents that the priority order of core 3 is lower than the priority order of core 2, and the third row of one-hot vectors represents that the priority order of core 0 is lower than the priority order of core 3. In practice, the column label of the priority matrix can also be set to represent the priority, the smaller the column label, the higher the priority; the row label represents the core number.
获取到当前请求向量和当前优先级矩阵后,将当前请求向量分别与当前优先级矩阵的每一行独热向量或每一列独热向量轮询相与。值得注意的是,在确定是将当前请求向量分别与当前优先级矩阵的每一行独热向量还是每一列独热向量进行轮询相与时,取决于所建立的优先级矩阵中的行标表示的含义或列标表示的含义,若行标表示优先级,则将当前请求向量分别与当前优先级矩阵的每一行独热向量轮询相与;若列标表示优先级,则将当前请求向量分别与当前优先级矩阵的每一列独热向量轮询相与。轮询相与时,可以按照优先级矩阵中优先级从高到低的顺序进行轮询。After obtaining the current request vector and the current priority matrix, the current request vector is polled and ANDed with each row of one-hot vectors or each column of one-hot vectors of the current priority matrix. It is worth noting that when determining whether to poll and AND the current request vector with each row of one-hot vectors or each column of one-hot vectors of the current priority matrix, it depends on the meaning of the row label or the meaning of the column label in the established priority matrix. If the row label indicates the priority, the current request vector is polled and ANDed with each row of one-hot vectors of the current priority matrix; if the column label indicates the priority, the current request vector is polled and ANDed with each column of one-hot vectors of the current priority matrix. When polling and ANDing, polling can be performed in the order of high to low priority in the priority matrix.
每次相与后,得到相与结果。根据预先建立的相与后的向量与内核编号之间的对应关系确定发起中断请求的当前内核编号。相与结果可能为0向量,也可能不为0向量。当相与结果为0向量时,不作任何处理;当相与结果为0向量时,则将相与结果(相与结果为独热向量)转换为二进制,进而根据二进制与内核编号之间的对应关系确定出当前相与结果所对应的发起中断请求的内核编号。在得到内核编号后,结合内核的优先级顺序依次输出发起中断请求的内核对应的中断请求。为了保证能够按照优先级顺序依次输出发起中断请求的内核对应的中断请求,在根据各相与结果分别获取发起中断请求的内核编号之后,还包括:依次将各内核编号存储在先入先出缓存器中;通过先入先出缓存器依次输出发起中断请求的内核对应的中断请求。After each AND operation, an AND result is obtained. The current kernel number that initiates the interrupt request is determined based on the pre-established correspondence between the vector after the AND operation and the kernel number. The AND result may be a 0 vector or may not be a 0 vector. When the AND result is a 0 vector, no processing is performed; when the AND result is a 0 vector, the AND result (the AND result is a one-hot vector) is converted into binary, and then the kernel number that initiates the interrupt request corresponding to the current AND result is determined based on the correspondence between the binary and the kernel number. After obtaining the kernel number, the interrupt request corresponding to the kernel that initiates the interrupt request is output in sequence in combination with the kernel priority order. In order to ensure that the interrupt request corresponding to the kernel that initiates the interrupt request can be output in sequence according to the priority order, after obtaining the kernel number that initiates the interrupt request according to each AND result, it also includes: storing each kernel number in a first-in-first-out buffer in sequence; and outputting the interrupt request corresponding to the kernel that initiates the interrupt request in sequence through the first-in-first-out buffer.
发起中断的形式取决于静态区采用的中断协议。如,扩展的消息信号中断(Message Signal Interrupt eXtended,MSIX)协议下,中断发起模块需查询上位机分配给该内核的特定中断向量,并将中断向量写入指定位置。因此,在根据内核编号并结合内核的优先级顺序依次输出发起中断请求的内核对应的中断请求包括:The form of initiating an interrupt depends on the interrupt protocol used in the static area. For example, under the extended message signal interrupt (MSIX) protocol, the interrupt initiation module needs to query the specific interrupt vector assigned to the kernel by the host computer and write the interrupt vector to the specified location. Therefore, the interrupt requests corresponding to the kernel that initiates the interrupt request are output in sequence according to the kernel number and the kernel priority order, including:
获取预先与上位机协商的用于上报中断的中断控制协议;Obtain the interrupt control protocol for reporting interrupts that is pre-negotiated with the host computer;
根据内核编号、结合内核的优先级顺序以及按照中断控制协议依次将发起中断请求的内核对应的中断请求上报至上位机。According to the core number, the priority order of the cores and the interrupt control protocol, the interrupt request corresponding to the core that initiates the interrupt request is reported to the host computer in sequence.
本发明实施例所提供的内核中断的处理方法,首先,通过获取预设时刻多内核设备中发起中断请求的内核编号,然后依据内核的优先级顺序依次输出发起中断请求的内核对应的中断请求,实现了对同时发出的中断请求的排序以及串行输出;其次,由于在输出中断请求的时候,是依据内核的优先级实现的,故而,降低了中断发起的延时,提高了用户的公平性,以及提高了用户体验感;再次,由于是直接根据内核的优先级输出中断请求,故而,不需要进行大量的比较逻辑,节省了逻辑资源开销;另外,通过将当前请求向量分别与当前优先级矩阵的每一行独热向量或每一列独热向量轮询相与,并根据各相与结果分别获取到了发起中断请求的内核编号,根据内核编号能够准确地实现对发起中断请求的各内核的中断请求的输出。The method for processing kernel interrupts provided in an embodiment of the present invention first obtains the kernel number of the kernel that initiates the interrupt request in a multi-core device at a preset time, and then outputs the interrupt request corresponding to the kernel that initiates the interrupt request in sequence according to the kernel priority order, thereby realizing the sorting and serial output of interrupt requests issued simultaneously; secondly, since the interrupt request is output according to the kernel priority, the delay of interrupt initiation is reduced, the fairness of users is improved, and the user experience is improved; thirdly, since the interrupt request is output directly according to the kernel priority, a large amount of comparison logic is not required, thus saving logic resource overhead; in addition, by polling and ANDing the current request vector with each row unique hot vector or each column unique hot vector of the current priority matrix respectively, and obtaining the kernel number that initiates the interrupt request according to each AND result, the output of the interrupt request of each kernel that initiates the interrupt request can be accurately realized according to the kernel number.
当预设时刻仅有一个内核发起中断请求(即单中断),若按照上文中的方式将当前请求向量与当前优先级矩阵的每一行独热向量或每一列的独热向量进行轮询相与,由于需要进行多次相与,因此,会导致确定内核编号的效率下降。所以,为了减小单中断请求处理的时延,在一些实施中,将当前请求向量分别与当前优先级矩阵的每一行独热向量或每一列独热向量轮询相与之前,还包括:When only one core initiates an interrupt request at a preset time (i.e., a single interrupt), if the current request vector is polled and ANDed with each row of the one-hot vector or each column of the current priority matrix in the manner described above, since multiple ANDs need to be performed, the efficiency of determining the core number will be reduced. Therefore, in order to reduce the latency of single interrupt request processing, in some implementations, before the current request vector is polled and ANDed with each row of the one-hot vector or each column of the one-hot vector of the current priority matrix, the following is also included:
在检测到发起中断请求的内核的数量大于1的情况下,进入将当前请求向量分别与当前优先级矩阵的每一行独热向量或每一列独热向量轮询相与的步骤;When it is detected that the number of cores initiating interrupt requests is greater than 1, the step of polling and performing AND operation on the current request vector and each row one-hot vector or each column one-hot vector of the current priority matrix is entered;
在检测到发起中断请求的内核的数量等于1的情况下,根据当前请求向量确定发起中断请求的内核编号;根据内核编号输出内核对应的中断请求;When it is detected that the number of cores initiating interrupt requests is equal to 1, the core number initiating the interrupt request is determined according to the current request vector; and the interrupt request corresponding to the core is output according to the core number;
在检测到发起中断请求的内核的数量等于0的情况下,则结束。When it is detected that the number of cores initiating interrupt requests is equal to 0, the process ends.
在实施中,通过组合逻辑判断一次请求的中断内核数量。确定发起中断请求的内核的数量等于1包括:In implementation, the number of interrupt cores requested at one time is determined by combinatorial logic. Determining that the number of cores initiating interrupt requests is equal to 1 includes:
在检测到当前请求向量的最低位非零值的位置和最高位非零值的位置相同的情况下,确定发起中断请求的内核的数量等于1。发起中断请求的内核的数量等于1,对应的当前请求向量为独热向量,将独热向量转换成二进制,进而根据二进制信息与内核编号之间的对应关系确定出发起该中断请求的内核编号,在得到内核编号后,输出该内核对应的中断请求。When it is detected that the position of the lowest non-zero value and the position of the highest non-zero value of the current request vector are the same, it is determined that the number of cores that initiate the interrupt request is equal to 1. The number of cores that initiate the interrupt request is equal to 1, and the corresponding current request vector is a one-hot vector. The one-hot vector is converted into binary, and then the core number that initiates the interrupt request is determined according to the corresponding relationship between the binary information and the core number. After the core number is obtained, the interrupt request corresponding to the core is output.
本实施例中,在判断出发起中断请求的内核数量为1的情况下,直接根据当前请求向量确定出内核编号,不需要将当前请求向量分别与当前优先级矩阵的每一行独热向量或每一列的独热向量进行轮询相与,提高了确定出内核编号的效率,提升了对单中断请求处理的效率。In this embodiment, when it is determined that the number of cores initiating an interrupt request is 1, the core number is directly determined based on the current request vector. There is no need to poll the current request vector with the one-hot vector of each row or each column of the current priority matrix respectively, which improves the efficiency of determining the core number and the efficiency of processing a single interrupt request.
为了使本领域人员更好地理解本发明实施例提供的确定内核编号的方式,以及输出中断请求的方式。此处以每一行独热向量分别表征各内核的优先级顺序,且行标号越小表征优先级越高为例,说明将当前请求向量分别与当前优先级矩阵的每一行独热向量或每一列独热向量轮询相与,并根据各相与结果分别获取发起中断请求的内核编号的过程。具体地,将当前请求向量依次与当前优先级矩阵的每一行独热向量顺序轮询相与;In order to enable those skilled in the art to better understand the method for determining the kernel number and the method for outputting the interrupt request provided by the embodiment of the present invention. Here, taking each row of one-hot vectors as an example to represent the priority order of each kernel, and the smaller the row number, the higher the priority, the process of polling and ANDing the current request vector with each row of one-hot vectors or each column of one-hot vectors of the current priority matrix, and obtaining the kernel number that initiated the interrupt request according to each AND result, is explained. Specifically, the current request vector is polled and ANDed with each row of one-hot vectors of the current priority matrix in sequence;
在检测到当前次相与结果不为0向量的情况下,根据预先建立的相与后的向量与内核编号之间的对应关系确定发起中断请求的当前内核编号。When it is detected that the result of the current AND operation is not a zero vector, the current kernel number for initiating the interrupt request is determined according to a pre-established correspondence between the vector after the AND operation and the kernel number.
图4为本发明实施例提供的一种输出中断请求的示意图。假设总内核数为4,建立的优先级矩阵为4阶矩阵。优先级矩阵的行标表示优先级,且行标越小,优先级越高。当预先设定的内核优先级从高到低的顺序为:内核1、内核2、内核3、内核0,则建立的优先级矩阵如图4中A矩阵所示。矩阵的行标从上到下依次为0、1、2、3。请求向量为1011,将请求向量1011与优先级矩阵的每一行顺序相与,根据每个相与结果确定出发出中断请求的内核。具体地,1011&0010得到0010,根据0010确定出内核1,输出内核1的中断请求;1011&0100得到0000,不作任何处理;1011&1000得到1000,根据1000确定出内核3,输出内核3的中断请求;1011&0001得到0001,根据0001确定出内核0,输出内核0的中断请求。FIG4 is a schematic diagram of an output interrupt request provided by an embodiment of the present invention. Assuming that the total number of cores is 4, the established priority matrix is a 4-order matrix. The row label of the priority matrix represents the priority, and the smaller the row label, the higher the priority. When the pre-set kernel priority is in the order from high to low: core 1, core 2, core 3, core 0, the established priority matrix is shown in matrix A in FIG4. The row labels of the matrix are 0, 1, 2, and 3 from top to bottom. The request vector is 1011, and the request vector 1011 is sequentially ANDed with each row of the priority matrix, and the core that issues the interrupt request is determined according to each AND result. Specifically, 1011&0010 obtains 0010, and core 1 is determined based on 0010, and the interrupt request of core 1 is output; 1011&0100 obtains 0000, and no processing is performed; 1011&1000 obtains 1000, and core 3 is determined based on 1000, and the interrupt request of core 3 is output; 1011&0001 obtains 0001, and core 0 is determined based on 0001, and the interrupt request of core 0 is output.
本实施例提供的方法中,每一行独热向量分别表征各内核的优先级顺序,且行标号越小表征优先级越高,将当前请求向量依次与当前优先级矩阵的每一行独热向量顺序轮询相与,根据相与结果确定出内核,并对内核对应的请求进行输出,实现了对同时发起中断请求的内核的排序,以及按照优先级顺序实现了对发起中断请求的各内核的中断请求的处理,尽可能地保证了并行中断申请场景中保证内核中断次序的公平性。In the method provided by this embodiment, each row of one-hot vectors represents the priority order of each kernel, and the smaller the row number, the higher the priority. The current request vector is sequentially polled and ANDed with each row of one-hot vectors in the current priority matrix, and the kernel is determined according to the AND result, and the request corresponding to the kernel is output, so as to sort the kernels that initiate interrupt requests at the same time and process the interrupt requests of each kernel that initiates the interrupt request in the order of priority, thereby ensuring the fairness of the kernel interrupt order in the parallel interrupt application scenario as much as possible.
在输出请求后,为了进一步保证并行中断申请场景中内核中断次序的公平性,在一些实施例中,在根据内核编号并结合内核的优先级顺序依次输出发起中断请求的内核对应的中断请求之后,或在根据内核编号输出内核对应的中断请求之后,还包括:After outputting the request, in order to further ensure the fairness of the kernel interrupt order in the parallel interrupt application scenario, in some embodiments, after outputting the interrupt request corresponding to the kernel that initiated the interrupt request in sequence according to the kernel number and in combination with the kernel priority order, or after outputting the interrupt request corresponding to the kernel according to the kernel number, it also includes:
按照内核的优先级从低到高的顺序将当前请求向量分别与当前优先级矩阵的每一行独热向量或每一列独热向量轮询相与,根据各相与结果更新当前优先级矩阵。According to the order of kernel priority from low to high, the current request vector is polled and ANDed with each row one-hot vector or each column one-hot vector of the current priority matrix respectively, and the current priority matrix is updated according to the results of each ANDing.
同样地,在确定是将当前请求向量分别与当前优先级矩阵的每一行独热向量还是每一列独热向量进行轮询相与时,取决于所建立的优先级矩阵中的行标表示的含义或列标表示的含义,若行标表示优先级,则将当前请求向量分别与当前优先级矩阵的每一行独热向量轮询相与;若列标表示优先级,则将当前请求向量分别与当前优先级矩阵的每一列独热向量轮询相与。为了提高内核中断处理的公平性,同一时刻发起中断请求的内核中最先被发出中断的内核在下一次处理中具有最低的优先级,即同一个处理周期内需要反向更新优先级。Similarly, when determining whether to perform polling AND with each row of one-hot vectors or each column of one-hot vectors in the current priority matrix, it depends on the meaning of the row label or the column label in the established priority matrix. If the row label indicates the priority, the current request vector is polled and ANDed with each row of one-hot vectors in the current priority matrix; if the column label indicates the priority, the current request vector is polled and ANDed with each column of one-hot vectors in the current priority matrix. In order to improve the fairness of kernel interrupt processing, the kernel that is interrupted first among the kernels that initiate interrupt requests at the same time has the lowest priority in the next processing, that is, the priority needs to be updated in the same processing cycle.
为了使本领域人员更好地理解本发明实施例提供的更新优先级矩阵的方式。此处以每一行独热向量分别表征各内核的优先级顺序,且行标号越小表征优先级越高为例,说明按照内核的优先级从低到高的顺序将当前请求向量分别与当前优先级矩阵的每一行独热向量或每一列独热向量轮询相与,根据各相与结果更新当前优先级矩阵的过程。包括将当前请求向量依次与当前优先级矩阵的每一行独热向量逆序轮询相与;在检测到当前次相与结果不为0向量的情况下,按照预设方式更新当前优先级矩阵;在检测到当前次相与结果为0向量的情况下,保持当前次的上一次相与后所对应的待更新优先级矩阵不变。In order to enable those skilled in the art to better understand the method of updating the priority matrix provided by the embodiment of the present invention. Here, each row of one-hot vectors represents the priority order of each kernel, and the smaller the row number, the higher the priority. As an example, the current request vector is polled and ANDed with each row of one-hot vectors or each column of one-hot vectors in the current priority matrix in order from low to high priority of the kernel, and the current priority matrix is updated according to the results of each AND. It includes polling and ANDing the current request vector with each row of one-hot vectors in the current priority matrix in reverse order; when it is detected that the result of the current AND is not a 0 vector, the current priority matrix is updated according to a preset method; when it is detected that the result of the current AND is a 0 vector, the priority matrix to be updated corresponding to the previous AND of the current AND is kept unchanged.
具体地,当前优先级矩阵为N阶矩阵,N为多内核设备的总内核数,当前优先级矩阵的行标为k,0≤k≤N-1;将当前请求向量依次与当前优先级矩阵的每一行独热向量逆序轮询相与,若检测到相与结果不为0向量,则按照预设方式更新当前优先级矩阵包括:Specifically, the current priority matrix is an N-order matrix, N is the total number of cores of the multi-core device, and the row of the current priority matrix is labeled k, 0≤k≤N-1; the current request vector is polled and ANDed with each row of the unique hot vector of the current priority matrix in reverse order, and if it is detected that the result of the ANDing is not a zero vector, the current priority matrix is updated according to a preset method, including:
当k等于N-1时,将当前请求向量与当前优先级矩阵的行标为k的行对应的独热向量相与,若检测到相与结果不为0向量,则将当前优先级矩阵的行标为k的行对应的独热向量赋值给当前待更新优先级矩阵的最后一行;当前待更新优先级矩阵的行标为0的行至行标为k-1的行对应的独热向量与当前优先级矩阵的行标为0的行至行标为k-1的行对应的独热向量相同。When k is equal to N-1, the current request vector is ANDed with the one-hot vector corresponding to the row labeled k of the current priority matrix. If it is detected that the AND result is not a zero vector, the one-hot vector corresponding to the row labeled k of the current priority matrix is assigned to the last row of the priority matrix to be updated; the one-hot vector corresponding to the row labeled 0 to the row labeled k-1 of the priority matrix to be updated is the same as the one-hot vector corresponding to the row labeled 0 to the row labeled k-1 of the current priority matrix.
当k小于N-1时,将当前请求向量与当前优先级矩阵的行标为k的行对应的独热向量相与,若检测到相与结果不为0向量,则将当前优先级矩阵的行标为k的行对应的独热向量赋值给当前待更新优先级矩阵的最后一行;将当前次的上一次相与后所对应的待更新优先级矩阵的行标为k+1至行标为N-1的行对应的独热向量赋值给当前待更新优先级矩阵的行标为k到行标为N-2的行;当前待更新优先级矩阵的行标为0的行至行标为k-1的行对应的独热向量与当前次的上一次相与后所对应的待更新优先级矩阵的行标为0的行至行标为k-1的行对应的独热向量相同。When k is less than N-1, the current request vector is ANDed with the one-hot vector corresponding to the row labeled k of the current priority matrix. If it is detected that the result of the ANDing is not a zero vector, the one-hot vector corresponding to the row labeled k of the current priority matrix is assigned to the last row of the priority matrix to be updated; the one-hot vector corresponding to the rows labeled k+1 to N-1 of the priority matrix to be updated corresponding to the last ANDing is assigned to the rows labeled k to N-2 of the priority matrix to be updated; the one-hot vector corresponding to the rows labeled 0 to k-1 of the priority matrix to be updated is the same as the one-hot vector corresponding to the rows labeled 0 to k-1 of the priority matrix to be updated corresponding to the last ANDing.
参照图4,对更新优先级矩阵的方式进行说明。图4中更新优先级矩阵中第一个矩阵为当前优先级矩阵即A矩阵,当k=3,将请求向量1011与A矩阵的0001相与,得到的相与结果为0001,不为0向量,则将A矩阵的行标为3的行对应的独热向量(0001)作为A1矩阵(当前待更新矩阵)的最后一行(即行标为3的行),A1矩阵的行标为0至2的行对应的独热向量与A矩阵的行标为0至2的行对应的独热向量相同,即A1矩阵的前3行元素与A矩阵的前3行元素相同;当k=2,将请求向量1011与A1矩阵的1000相与,得到的相与结果为1000,不为0向量,则继续更新A1矩阵,将A1矩阵的行标为2的行对应的独热向量(1000)作为A2矩阵(当前待更新矩阵)的最后一行(即行标为3的行),将A1矩阵的行标为3的行对应的独热向量(0001)赋值给A2矩阵的行标为2的行,A2矩阵的行标为0至1的行对应的独热向量与A1矩阵的行标为0至1的行对应的独热向量相同,即A2矩阵的前2行元素与A1矩阵的前2行元素相同;当k=1,将请求向量1011与A2矩阵的0100相与,得到的相与结果为0000,即0向量,则此时不需要更新A2向量;当k=0,将请求向量1011与A2矩阵的0010相与,得到的相与结果为0010,不为0向量,则继续更新A2矩阵,将A2矩阵的行标为0的行对应的独热向量(0010)作为A3矩阵(当前待更新矩阵)的最后一行(即行标为3的行),将A2矩阵的行标为1的行至行标为3的行对应的独热向量赋值给A3的行标为0至2的行。通过上述过程实现了对优先级矩阵A的更新。4 , the method of updating the priority matrix is described. In Figure 4, the first matrix in the update priority matrix is the current priority matrix, i.e., the A matrix. When k=3, the request vector 1011 is ANDed with 0001 of the A matrix, and the result is 0001, which is not a zero vector. Then, the one-hot vector (0001) corresponding to the row labeled 3 of the A matrix is used as the last row (i.e., the row labeled 3) of the A1 matrix (the matrix currently to be updated). The one-hot vectors corresponding to the rows labeled 0 to 2 of the A1 matrix are the same as the one-hot vectors corresponding to the rows labeled 0 to 2 of the A matrix, i.e., the first 3 rows of the A1 matrix are the same as the first 3 rows of the A matrix. When k=2, the request vector 1011 is ANDed with 1000 of the A1 matrix, and the result is 1000, which is not a zero vector. Then, the A1 matrix is continued to be updated, and the one-hot vector (1000) corresponding to the row labeled 2 of the A1 matrix is used as the last row (i.e., the row labeled 3) of the A2 matrix (the matrix currently to be updated). The one-hot vector (0001) corresponding to the row labeled 3 is assigned to the row labeled 2 of the A2 matrix. The one-hot vectors corresponding to the rows labeled 0 to 1 of the A2 matrix are the same as the one-hot vectors corresponding to the rows labeled 0 to 1 of the A1 matrix, that is, the first 2 rows of the A2 matrix are the same as the first 2 rows of the A1 matrix. When k=1, the request vector 1011 is ANDed with the 0100 of the A2 matrix, and the result is 0000, that is, the 0 vector, so there is no need to update at this time. A2 vector; when k=0, the request vector 1011 is ANDed with 0010 of the A2 matrix, and the result is 0010, which is not a 0 vector. Then the A2 matrix is updated, and the one-hot vector (0010) corresponding to the row labeled 0 of the A2 matrix is used as the last row (i.e., the row labeled 3) of the A3 matrix (the matrix to be updated currently), and the one-hot vectors corresponding to the rows labeled 1 to 3 of the A2 matrix are assigned to the rows labeled 0 to 2 of A3. The update of the priority matrix A is realized through the above process.
本实施例提供的方法中,每一行独热向量分别表征各内核的优先级顺序,且行标号越小表征优先级越高,将当前请求向量依次与当前优先级矩阵的每一行独热向量逆序轮询相与,根据各相与结果更新当前优先级矩阵,保证了在并行中断申请场景中保证内核中断次序的公平性。In the method provided in this embodiment, each row of one-hot vectors represents the priority order of each core, and the smaller the row number, the higher the priority. The current request vector is polled and ANDed with each row of one-hot vectors in the current priority matrix in reverse order, and the current priority matrix is updated according to the results of each AND, thereby ensuring the fairness of the core interrupt order in the parallel interrupt application scenario.
在对当前请求向量处理完成后,实际中,可能会存在多个当前请求向量,为了能够继续对请求向量进行处理,因此,在根据各相与结果更新当前优先级矩阵之后,还包括:After the current request vector is processed, in practice, there may be multiple current request vectors. In order to continue processing the request vector, after updating the current priority matrix according to the results of each phase, the following is also included:
自获取到更新后的当前优先级矩阵开始,预设时长内返回获取预设时刻多内核设备中内核发起的中断请求以及根据预设时刻多内核设备中内核发起中断请求的情况获取当前请求向量的步骤。Starting from obtaining the updated current priority matrix, returning within a preset time period to the steps of obtaining an interrupt request initiated by a core in the multi-core device at a preset time and obtaining a current request vector according to the interrupt request initiated by the core in the multi-core device at the preset time.
对于预设时长不作限定,根据实际情况确定。需要说明的是,在处理新的当前请求的时候,此处的当前优先级矩阵可以采用对上一次对请求向量进行处理后得到的更新后的优先级矩阵,也可以采用根据上位机上所设置的新的优先级顺序创建的优先级矩阵。当有新的请求向量的时候,采用上文中描述的方法,即可实现对新的请求向量的输出。There is no limit on the preset duration, which is determined according to the actual situation. It should be noted that when processing a new current request, the current priority matrix here can use the updated priority matrix obtained after the last processing of the request vector, or can use the priority matrix created according to the new priority order set on the host computer. When there is a new request vector, the method described above can be used to output the new request vector.
上文中描述了一种内核中断的处理方法,本实施例还提供一种异构加速设备。异构加速设备包括:控制器、各内核对应的中断使能寄存器和中断状态寄存器,控制器分别与各中断使能寄存器、各中断状态寄存器连接,中断使能寄存器用于存储内核对应的中断请求信息,中断状态寄存器用于存储内核对应的发起中断请求的情况;控制器用于实现上文中描述的内核中断的处理方法的步骤。A method for processing a kernel interrupt is described above, and this embodiment further provides a heterogeneous acceleration device. The heterogeneous acceleration device includes: a controller, an interrupt enable register and an interrupt status register corresponding to each kernel, the controller is connected to each interrupt enable register and each interrupt status register respectively, the interrupt enable register is used to store the interrupt request information corresponding to the kernel, and the interrupt status register is used to store the situation of initiating an interrupt request corresponding to the kernel; the controller is used to implement the steps of the method for processing a kernel interrupt described above.
异构加速设备还包括:用于存储当前请求向量的第一先入先出缓存器、用于存储发起中断请求的内核编号的第二先入先出缓存器;The heterogeneous acceleration device further includes: a first first-in first-out buffer for storing a current request vector, a second first-in first-out buffer for storing a kernel number that initiates an interrupt request;
控制器与第一先入先出缓存器连接,用于从第一先入先出缓存器中获取当前请求向量;The controller is connected to the first FIFO buffer and is used to obtain the current request vector from the first FIFO buffer;
控制器与第二先入先出缓存器连接,用于通过第二先入先出缓存器依次输出发起中断请求的内核对应的中断请求。The controller is connected to the second FIFO buffer and is used for sequentially outputting the interrupt requests corresponding to the core that initiates the interrupt request through the second FIFO buffer.
图5为本发明实施例提供的一种现场可编程门阵列芯片的示意图,如图5所示,现场可编程门阵列芯片100加速平台分为动态区与静态区两部分,动态区的大量内核实现上位机要求的计算加速功能,本发明实施例提供的内核中断的处理方法主要实现在静态区。动态区中,每个内核都设置有中断使能寄存器,输出中断信号到中断信息提取模块。静态区分为中断信息提取模块、中断发起模块、优先级管理模块三部分。FIG5 is a schematic diagram of a field programmable gate array chip provided by an embodiment of the present invention. As shown in FIG5 , the field programmable gate array chip 100 acceleration platform is divided into two parts: a dynamic area and a static area. A large number of cores in the dynamic area realize the calculation acceleration function required by the host computer. The method for processing kernel interrupts provided by an embodiment of the present invention is mainly implemented in the static area. In the dynamic area, each kernel is provided with an interrupt enable register, which outputs an interrupt signal to an interrupt information extraction module. The static area is divided into three parts: an interrupt information extraction module, an interrupt initiation module, and a priority management module.
中断信息提取模块从内核的中断使能寄存器中提取有效的中断请求信息,将有效的内核中断请求提交优先级查找模块。由于中断使能寄存器的延迟特性,从内核到中断信息提取模块的请求信号即使在中断发出后仍保持在有效电平,直到驱动读取中断状态寄存器并将中断使能寄存器的有效值清除,因此必须经过中断信息提取模块的有效边沿检测才能识别出有效的中断请求供优先级管理模块直接使用。The interrupt information extraction module extracts valid interrupt request information from the interrupt enable register of the kernel and submits the valid kernel interrupt request to the priority search module. Due to the delay characteristics of the interrupt enable register, the request signal from the kernel to the interrupt information extraction module remains at a valid level even after the interrupt is issued, until the driver reads the interrupt status register and clears the valid value of the interrupt enable register. Therefore, the valid interrupt request must be identified through the effective edge detection of the interrupt information extraction module for direct use by the priority management module.
本发明实施例中要求一次请求必须花费固定的时钟周期完成优先级矩阵的轮询,因此有必要筛选出单一内核请求的周期进行单独处理,以尽量提高发起中断的时间效率。优先级管理细分为中断发起优先级的查找与中断优先级矩阵的更新两部分,两部分在功能上独立,逻辑上可并行执行。图6为本发明实施例提供的一种优先级处理的方法的流程图,如图6所示,该方法包括:In the embodiment of the present invention, it is required that a request must spend a fixed clock cycle to complete the polling of the priority matrix. Therefore, it is necessary to screen out the cycle of a single core request for separate processing to maximize the time efficiency of initiating interrupts. Priority management is subdivided into two parts: the search for interrupt initiation priority and the update of the interrupt priority matrix. The two parts are functionally independent and can be executed in parallel logically. FIG6 is a flow chart of a priority processing method provided by an embodiment of the present invention. As shown in FIG6, the method includes:
S14:等待有效中断申请;S14: Waiting for a valid interruption request;
S15:判断中断内核数是否等于1;若是,则进入步骤S16;若否,则进入步骤S19;S15: Determine whether the number of interrupt cores is equal to 1; if so, proceed to step S16; if not, proceed to step S19;
S16:计算中断内核编号(独热码转二进制);S16: Calculate the interrupt kernel number (convert one-hot code to binary);
S17:输出单中断请求;S17: Output single interrupt request;
S18:输出第一待更新的优先级矩阵;S18: Outputting a first priority matrix to be updated;
S19:中断请求向量与中断优先级矩阵顺序相与;S19: The interrupt request vector is ANDed with the interrupt priority matrix in sequence;
S20:输出多中断请求;S20: output multiple interrupt requests;
S21:中断请求向量与中断优先级矩阵逆序轮询相与;S21: The interrupt request vector is polled in reverse order with the interrupt priority matrix;
S22:输出第二待更新的优先级矩阵;S22: Outputting a second priority matrix to be updated;
S23:更新第一待更新的优先级矩阵或第二待更新的优先级矩阵,并返回步骤S14。S23: Update the first priority matrix to be updated or the second priority matrix to be updated, and return to step S14.
优先级管理模块等待来自中断信息提取模块的有效中断申请,通过组合逻辑判断一次请求的中断内核数量。判断方式采用的实现方式为判断最低位、最高位非零值是否位置相同,相同则中断内核数量为1。The priority management module waits for the valid interrupt request from the interrupt information extraction module, and determines the number of interrupt cores requested at one time through combinational logic. The determination method is to determine whether the least significant bit and the most significant bit are in the same position. If they are the same, the number of interrupt cores is 1.
中断内核数量判断完成后进行流程支路选择。由于两条支路均有更新优先级矩阵和输出中断请求的要求,且在内核数量较大时多中断支路的处理时延要远高于单中断支路,为保证输出中断不乱序、避免复杂的仲裁逻辑,此处采用有限状态机从时间上完全分割两个支路的处理,在更新优先级矩阵时合并状态。After the number of interrupt cores is determined, the process branch is selected. Since both branches have the requirements of updating the priority matrix and outputting interrupt requests, and the processing delay of multiple interrupt branches is much higher than that of single interrupt branches when the number of cores is large, in order to ensure that the output interrupts are not out of order and avoid complex arbitration logic, a finite state machine is used here to completely divide the processing of the two branches in time, and merge the states when updating the priority matrix.
上文中对单中断请求时输出单中断请求、以及多中断请求时输出多中断请求的方式以及优先级矩阵的更新方式已经进行了详细地描述,此处不再赘述。The manner of outputting a single interrupt request when there is a single interrupt request and outputting multiple interrupt requests when there are multiple interrupt requests, as well as the manner of updating the priority matrix have been described in detail above, and will not be repeated here.
中断发起模块通过先入先出缓存器装置接收需要发起中断的内核编号并按顺序发出中断向量。The interrupt initiation module receives the core number to be interrupted through the first-in first-out buffer device and issues interrupt vectors in sequence.
本发明实施例提供的方法中,分类处理单中断、多中断请求,通过中断请求向量与优先级矩阵每一行的顺序相与确定同时发起中断的各个内核的优先级,通过中断请求向量与优先级矩阵每一行的逆序相与完成优先级矩阵的更新,保证内核间公平性;基于比较最低位、最高位非零值是否位置相同快速判断是否为单中断请求;排序依据是内核的优先级,而非完全未知的输入数据,通过中断优先级矩阵的查找更新,将排序过程通过优先级矩阵的轮询实现,能够免比较地实现内核中断优先级排序,节省了逻辑资源开销。In the method provided by the embodiment of the present invention, single interrupt and multiple interrupt requests are classified and processed, the priorities of each core that initiates interrupts at the same time are determined by ANDing the interrupt request vector with the order of each row of the priority matrix, and the priority matrix is updated by ANDing the interrupt request vector with the reverse order of each row of the priority matrix to ensure fairness among cores; whether it is a single interrupt request is quickly determined based on comparing whether the lowest and highest non-zero values are in the same position; the sorting is based on the priority of the core, rather than completely unknown input data, and the sorting process is implemented by polling the priority matrix through searching and updating the interrupt priority matrix, which can realize the priority sorting of core interrupts without comparison and save logic resource overhead.
在上述实施例中,对内核中断的处理方法进行了详细描述,本发明还提供内核中断的处理装置、内核中断的处理设备对应的实施例。需要说明的是,本发明从两个角度对装置部分的实施例进行描述,一种是基于功能模块的角度,另一种是基于硬件的角度。In the above embodiments, the method for processing kernel interrupts is described in detail, and the present invention also provides embodiments corresponding to the kernel interrupt processing device and kernel interrupt processing equipment. It should be noted that the present invention describes the embodiments of the device part from two perspectives, one is based on the functional module perspective, and the other is based on the hardware perspective.
图7为本发明的一实施例提供的内核中断的处理装置的结构图。本实施例基于功能模块的角度,包括:FIG7 is a structural diagram of a kernel interrupt processing device provided by an embodiment of the present invention. This embodiment is based on the perspective of functional modules and includes:
第一获取模块10,用于获取预设时刻多内核设备中内核发起的中断请求以及根据预设时刻多内核设备中内核发起中断请求的情况获取当前请求向量;A first acquisition module 10 is used to acquire an interrupt request initiated by a core in a multi-core device at a preset time and acquire a current request vector according to the interrupt request initiated by the core in the multi-core device at the preset time;
第二获取模块11,用于获取当前优先级矩阵;其中,当前优先级矩阵中的每一行或每一列元素组成的向量均为独热向量,每一行独热向量或每一列独热向量分别表征各内核的优先级顺序;The second acquisition module 11 is used to acquire the current priority matrix; wherein each row or column of the current priority matrix is composed of a one-hot vector, and each row of the one-hot vector or each column of the one-hot vector represents the priority order of each kernel;
轮询及获取模块12,用于将当前请求向量分别与当前优先级矩阵的每一行独热向量或每一列独热向量轮询相与,并根据各相与结果分别获取发起中断请求的内核编号;The polling and acquisition module 12 is used to perform AND operation on the current request vector and each row one-hot vector or each column one-hot vector of the current priority matrix, and obtain the kernel number that initiates the interrupt request according to each AND operation result;
输出模块13,用于根据内核编号并结合内核的优先级顺序依次输出发起中断请求的内核对应的中断请求。The output module 13 is used to sequentially output the interrupt request corresponding to the core that initiated the interrupt request according to the core number and the priority order of the cores.
在一些实施例中,还包括:In some embodiments, it also includes:
检测模块,用于在检测到发起中断请求的内核的数量大于1的情况下,则触发轮询及获取模块12;在检测到发起中断请求的内核的数量等于1的情况下,根据当前请求向量确定发起中断请求的内核编号;根据内核编号输出内核对应的中断请求;在检测到发起中断请求的内核的数量等于0的情况下,则结束。The detection module is used to trigger the polling and acquisition module 12 when it is detected that the number of cores initiating interrupt requests is greater than 1; determine the core number initiating the interrupt request according to the current request vector when it is detected that the number of cores initiating interrupt requests is equal to 1; output the interrupt request corresponding to the core according to the core number; and end when it is detected that the number of cores initiating interrupt requests is equal to 0.
每一行独热向量分别表征各内核的优先级顺序,且行标号越小表征优先级越高;轮询及获取模块12包括:Each row of unique hot vectors represents the priority order of each kernel, and the smaller the row number, the higher the priority; the polling and acquisition module 12 includes:
顺序轮询及确定模块,用于将当前请求向量依次与当前优先级矩阵的每一行独热向量顺序轮询相与;在检测到当前次相与结果不为0向量的情况下,根据预先建立的相与后的向量与内核编号之间的对应关系确定发起中断请求的当前内核编号。The sequential polling and determination module is used to sequentially poll and AND the current request vector with each row of the one-hot vector of the current priority matrix in turn; when it is detected that the result of the current AND is not a 0 vector, the current kernel number that initiates the interrupt request is determined based on the pre-established correspondence between the vector after the AND and the kernel number.
在一些实施例中,还包括:相与及更新模块,用于按照内核的优先级从低到高的顺序将当前请求向量分别与当前优先级矩阵的每一行独热向量或每一列独热向量轮询相与,根据各相与结果更新当前优先级矩阵。In some embodiments, it also includes: an AND and update module, which is used to poll the current request vector with each row of one-hot vectors or each column of one-hot vectors in the current priority matrix in order from low to high priority of the kernel, and update the current priority matrix according to each AND result.
每一行独热向量分别表征各内核的优先级顺序,且行标号越小表征优先级越高;相与及更新模块包括:Each row of unique hot vectors represents the priority order of each kernel, and the smaller the row number, the higher the priority; the AND and update modules include:
逆序轮询相与模块,用于将当前请求向量依次与当前优先级矩阵的每一行独热向量逆序轮询相与;A reverse polling AND module is used to perform reverse polling AND operations on the current request vector and each row of the one-hot vector of the current priority matrix in sequence;
更新模块,用于在检测到当前次相与结果不为0向量的情况下,按照预设方式更新当前优先级矩阵;An updating module, used for updating the current priority matrix according to a preset method when detecting that the current phase and result is not a zero vector;
保持模块,用于在检测到当前次相与结果为0向量的情况下,保持当前次的上一次相与后所对应的待更新优先级矩阵不变。The maintaining module is used to keep the priority matrix to be updated corresponding to the last phase and the current phase unchanged when it is detected that the result of the current phase and the current phase is a 0 vector.
当前优先级矩阵为N阶矩阵,N为多内核设备的总内核数,当前优先级矩阵的行标为k,0≤k≤N-1;更新模块具体用于:The current priority matrix is an N-order matrix, where N is the total number of cores of the multi-core device, and the row of the current priority matrix is labeled k, 0≤k≤N-1; the update module is specifically used for:
当k等于N-1时,将当前请求向量与当前优先级矩阵的行标为k的行对应的独热向量相与,若检测到相与结果不为0向量,则将当前优先级矩阵的行标为k的行对应的独热向量赋值给当前待更新优先级矩阵的最后一行;当前待更新优先级矩阵的行标为0的行至行标为k-1的行对应的独热向量与当前优先级矩阵的行标为0的行至行标为k-1的行对应的独热向量相同;When k is equal to N-1, the current request vector is ANDed with the one-hot vector corresponding to the row labeled k of the current priority matrix. If it is detected that the result of the ANDing is not a zero vector, the one-hot vector corresponding to the row labeled k of the current priority matrix is assigned to the last row of the priority matrix to be updated; the one-hot vector corresponding to the row labeled 0 to the row labeled k-1 of the priority matrix to be updated is the same as the one-hot vector corresponding to the row labeled 0 to the row labeled k-1 of the current priority matrix;
当k小于N-1时,将当前请求向量与当前优先级矩阵的行标为k的行对应的独热向量相与,若检测到相与结果不为0向量,则将当前优先级矩阵的行标为k的行对应的独热向量赋值给当前待更新优先级矩阵的最后一行;将当前次的上一次相与后所对应的待更新优先级矩阵的行标为k+1至行标为N-1的行对应的独热向量赋值给当前待更新优先级矩阵的行标为k到行标为N-2的行;当前待更新优先级矩阵的行标为0的行至行标为k-1的行对应的独热向量与当前次的上一次相与后所对应的待更新优先级矩阵的行标为0的行至行标为k-1的行对应的独热向量相同。When k is less than N-1, the current request vector is ANDed with the one-hot vector corresponding to the row labeled k of the current priority matrix. If it is detected that the result of the ANDing is not a zero vector, the one-hot vector corresponding to the row labeled k of the current priority matrix is assigned to the last row of the priority matrix to be updated; the one-hot vector corresponding to the rows labeled k+1 to N-1 of the priority matrix to be updated corresponding to the last ANDing is assigned to the rows labeled k to N-2 of the priority matrix to be updated; the one-hot vector corresponding to the rows labeled 0 to k-1 of the priority matrix to be updated is the same as the one-hot vector corresponding to the rows labeled 0 to k-1 of the priority matrix to be updated corresponding to the last ANDing.
在一些实施例中,还包括:In some embodiments, it also includes:
存储模块,用于依次将各内核编号存储在先入先出缓存器中;A storage module, used for sequentially storing the kernel numbers in a first-in first-out buffer;
输出子模块,用于通过先入先出缓存器依次输出发起中断请求的内核对应的中断请求。The output submodule is used to sequentially output the interrupt requests corresponding to the core that initiates the interrupt request through the first-in first-out buffer.
第二获取模块11具体用于在检测到上位机对多内核设备设置有内核优先级顺序的情况下,根据上位机设置的内核的优先级顺序建立当前优先级矩阵。The second acquisition module 11 is specifically configured to establish a current priority matrix according to the priority order of the cores set by the host computer when it is detected that the host computer sets a priority order of the cores for the multi-core device.
输出模块13包括:The output module 13 includes:
第三获取模块,用于获取预先与上位机协商的用于上报中断的中断控制协议;A third acquisition module is used to acquire an interrupt control protocol for reporting interrupts that is pre-negotiated with the host computer;
上报模块,用于根据内核编号、结合内核的优先级顺序以及按照中断控制协议依次将发起中断请求的内核对应的中断请求上报至上位机。The reporting module is used to report the interrupt request corresponding to the core that initiates the interrupt request to the host computer in sequence according to the core number, the priority order of the cores and the interrupt control protocol.
由于装置部分的实施例与方法部分的实施例相互对应,因此装置部分的实施例请参见方法部分的实施例的描述,这里暂不赘述。并且具有与上述提到的内核中断的处理方法相同的有益效果。Since the embodiments of the apparatus part correspond to the embodiments of the method part, the embodiments of the apparatus part refer to the description of the embodiments of the method part, which will not be described here. And it has the same beneficial effects as the above-mentioned kernel interrupt processing method.
图8为本发明另一实施例提供的内核中断的处理设备的结构图。本实施例基于硬件角度,如图8所示,内核中断的处理设备包括:FIG8 is a structural diagram of a kernel interrupt processing device provided by another embodiment of the present invention. This embodiment is based on the hardware perspective, as shown in FIG8, the kernel interrupt processing device includes:
存储器20,用于存储计算机程序;A memory 20, for storing computer programs;
处理器21,用于执行计算机程序时实现如上述实施例中所提到的内核中断的处理方法的步骤。The processor 21 is used to implement the steps of the method for processing kernel interrupts mentioned in the above embodiment when executing a computer program.
其中,处理器21可以包括一个或多个处理核心,比如4核心处理器、8核心处理器等。处理器21可以采用数字信号处理器(Digital Signal Processor,DSP)、现场可编程门阵列、可编程逻辑阵列(Programmable Logic Array,PLA)中的至少一种硬件形式来实现。处理器21也可以包括主处理器和协处理器,主处理器是用于对在唤醒状态下的数据进行处理的处理器,也称CPU;协处理器是用于对在待机状态下的数据进行处理的低功耗处理器。在一些实施例中,处理器21可以集成有图形处理器(Graphics Processing Unit,GPU),GPU用于负责显示屏所需要显示的内容的渲染和绘制。一些实施例中,处理器21还可以包括人工智能(Artificial Intelligence,AI)处理器,该AI处理器用于处理有关机器学习的计算操作。Among them, the processor 21 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 21 can be implemented in at least one hardware form of a digital signal processor (DSP), a field programmable gate array, and a programmable logic array (PLA). The processor 21 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU; the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 21 may be integrated with a graphics processing unit (GPU), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 21 may also include an artificial intelligence (AI) processor, which is used to process computing operations related to machine learning.
存储器20可以包括一个或多个计算机可读存储介质,该计算机可读存储介质可以是非暂态的。存储器20还可包括高速随机存取存储器,以及非易失性存储器,比如一个或多个磁盘存储设备、闪存存储设备。本实施例中,存储器20至少用于存储以下计算机程序201,其中,该计算机程序被处理器21加载并执行之后,能够实现前述任一实施例公开的内核中断的处理方法的相关步骤。另外,存储器20所存储的资源还可以包括操作系统202和数据203等,存储方式可以是短暂存储或者永久存储。其中,操作系统202可以包括Windows、Unix、Linux等。数据203可以包括但不限于上述所提到的内核中断的处理方法所涉及到的数据等。The memory 20 may include one or more computer-readable storage media, which may be non-transitory. The memory 20 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In this embodiment, the memory 20 is at least used to store the following computer program 201, wherein, after the computer program is loaded and executed by the processor 21, the relevant steps of the kernel interrupt processing method disclosed in any of the aforementioned embodiments can be implemented. In addition, the resources stored in the memory 20 may also include an operating system 202 and data 203, etc., and the storage method may be temporary storage or permanent storage. Among them, the operating system 202 may include Windows, Unix, Linux, etc. The data 203 may include, but is not limited to, the data involved in the kernel interrupt processing method mentioned above.
在一些实施例中,内核中断的处理设备还可包括有显示屏22、输入输出接口23、通信接口24、电源25以及通信总线26。In some embodiments, the kernel interrupt processing device may further include a display screen 22 , an input/output interface 23 , a communication interface 24 , a power supply 25 , and a communication bus 26 .
本领域技术人员可以理解,图8中示出的结构并不构成对内核中断的处理设备的限定,可以包括比图示更多或更少的组件。Those skilled in the art will appreciate that the structure shown in FIG. 8 does not constitute a limitation on the device for processing kernel interrupts, and may include more or fewer components than those shown in the figure.
本发明实施例提供的内核中断的处理设备,包括存储器和处理器,处理器在执行存储器存储的程序时,能够实现如下方法:内核中断的处理方法,效果同上。The kernel interrupt processing device provided by the embodiment of the present invention includes a memory and a processor. When the processor executes the program stored in the memory, it can implement the following method: the kernel interrupt processing method has the same effect as above.
最后,本发明还提供一种计算机可读存储介质对应的实施例。计算机可读存储介质上存储有计算机程序,计算机程序被处理器执行时实现如上述方法实施例中记载的步骤。Finally, the present invention also provides an embodiment corresponding to a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps recorded in the above method embodiment are implemented.
可以理解的是,如果上述实施例中的方法以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,执行本发明各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。It is understandable that if the method in the above embodiment is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium to execute all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc. Various media that can store program codes.
本发明提供的计算机可读存储介质包括上述提到的内核中断的处理方法,效果同上。The computer-readable storage medium provided by the present invention includes the above-mentioned method for processing kernel interrupts, and the effect is the same as above.
以上对本发明所提供的内核中断的处理方法、装置、设备、介质及异构加速设备进行了详细介绍。说明书中各个实施例采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似部分互相参见即可。对于实施例公开的装置而言,由于其与实施例公开的方法相对应,所以描述的比较简单,相关之处参见方法部分说明即可。应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明原理的前提下,还可以对本发明进行若干改进和修饰,这些改进和修饰也落入本发明的保护范围内。The above is a detailed introduction to the kernel interrupt processing method, device, equipment, medium and heterogeneous acceleration device provided by the present invention. The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same and similar parts between the various embodiments can be referenced to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description. It should be pointed out that for ordinary technicians in this technical field, without departing from the principle of the present invention, the present invention can also be improved and modified in several ways, and these improvements and modifications also fall within the scope of protection of the present invention.
还需要说明的是,在本说明书中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。It should also be noted that, in this specification, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the statement "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.
Claims (16)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410269819.1A CN117873756B (en) | 2024-03-11 | 2024-03-11 | Method, device, equipment, medium and heterogeneous acceleration equipment for processing kernel interrupt |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410269819.1A CN117873756B (en) | 2024-03-11 | 2024-03-11 | Method, device, equipment, medium and heterogeneous acceleration equipment for processing kernel interrupt |
Publications (2)
Publication Number | Publication Date |
---|---|
CN117873756A true CN117873756A (en) | 2024-04-12 |
CN117873756B CN117873756B (en) | 2024-05-31 |
Family
ID=90595156
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202410269819.1A Active CN117873756B (en) | 2024-03-11 | 2024-03-11 | Method, device, equipment, medium and heterogeneous acceleration equipment for processing kernel interrupt |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117873756B (en) |
Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP0262608A1 (en) * | 1986-09-30 | 1988-04-06 | Siemens Aktiengesellschaft | Arrangement for priority selection in an interrupt controller |
JPH04369064A (en) * | 1991-06-18 | 1992-12-21 | Kawasaki Steel Corp | Method and device for controlling interruption processing |
CN1294707A (en) * | 1998-01-21 | 2001-05-09 | 英特尔公司 | Method and appts. for handling multiple level-triggered and edge-triggered interrupts |
US20030074508A1 (en) * | 2001-10-12 | 2003-04-17 | Uhler G. Michael | Configurable prioritization of core generated interrupts |
JP2004118412A (en) * | 2002-09-25 | 2004-04-15 | Matsushita Electric Ind Co Ltd | Interruption management device, interruption management method, program development support device, and program development support method |
CN1547082A (en) * | 2003-12-12 | 2004-11-17 | 中兴通讯股份有限公司 | Programmable Interrupt Controller |
US7590982B1 (en) * | 2003-12-17 | 2009-09-15 | Vmware, Inc. | System and method for virtualizing processor and interrupt priorities |
CN106844025A (en) * | 2016-12-30 | 2017-06-13 | 青岛朗思信息科技有限公司 | A kind of asynchronous interrupt processing method and interrupt control unit |
CN117056054A (en) * | 2023-08-30 | 2023-11-14 | 山东云海国创云计算装备产业创新中心有限公司 | Interrupt control method, interrupt controller, computer device, and storage medium |
-
2024
- 2024-03-11 CN CN202410269819.1A patent/CN117873756B/en active Active
Patent Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP0262608A1 (en) * | 1986-09-30 | 1988-04-06 | Siemens Aktiengesellschaft | Arrangement for priority selection in an interrupt controller |
JPH04369064A (en) * | 1991-06-18 | 1992-12-21 | Kawasaki Steel Corp | Method and device for controlling interruption processing |
CN1294707A (en) * | 1998-01-21 | 2001-05-09 | 英特尔公司 | Method and appts. for handling multiple level-triggered and edge-triggered interrupts |
US20030074508A1 (en) * | 2001-10-12 | 2003-04-17 | Uhler G. Michael | Configurable prioritization of core generated interrupts |
JP2004118412A (en) * | 2002-09-25 | 2004-04-15 | Matsushita Electric Ind Co Ltd | Interruption management device, interruption management method, program development support device, and program development support method |
CN1547082A (en) * | 2003-12-12 | 2004-11-17 | 中兴通讯股份有限公司 | Programmable Interrupt Controller |
US7590982B1 (en) * | 2003-12-17 | 2009-09-15 | Vmware, Inc. | System and method for virtualizing processor and interrupt priorities |
CN106844025A (en) * | 2016-12-30 | 2017-06-13 | 青岛朗思信息科技有限公司 | A kind of asynchronous interrupt processing method and interrupt control unit |
CN117056054A (en) * | 2023-08-30 | 2023-11-14 | 山东云海国创云计算装备产业创新中心有限公司 | Interrupt control method, interrupt controller, computer device, and storage medium |
Non-Patent Citations (1)
Title |
---|
陈燕俐;洪龙;: "自由调整中断优先级的研究和实现", 南京邮电大学学报(自然科学版), no. 06, 30 December 2005 (2005-12-30) * |
Also Published As
Publication number | Publication date |
---|---|
CN117873756B (en) | 2024-05-31 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP3698293B1 (en) | Neural network processing system having multiple processors and a neural network accelerator | |
CA2074769C (en) | Formula processor | |
JP7313381B2 (en) | Embedded scheduling of hardware resources for hardware acceleration | |
US7296175B2 (en) | System on a chip bus with automatic pipeline stage insertion for timing closure | |
CN112100090A (en) | Data access request processing method, device, medium and memory mapping controller | |
EP4035016B1 (en) | Processor and interrupt controller therein | |
CN117873756B (en) | Method, device, equipment, medium and heterogeneous acceleration equipment for processing kernel interrupt | |
WO2005010747A2 (en) | Microcontroller with an interrupt structure having programmable priority levels with each priority level associated with a different register set | |
CN118311916B (en) | Programmable logic system and microprocessor | |
US11373024B1 (en) | Circuit simulation based on a high-level language circuit specification | |
Drótos et al. | Interrupt driven parallel processing | |
US9921891B1 (en) | Low latency interconnect integrated event handling | |
US7409608B1 (en) | Pseudo-random wait-state and pseudo-random latency components | |
JP2002278753A (en) | Data processing system | |
JP2001320386A (en) | Electronic system | |
EP1408418A2 (en) | Digital signal processor | |
CN117112136A (en) | Interrupt virtualization method, device, operating system, equipment and storage medium | |
Heinz et al. | Supporting On-Chip Dynamic Parallelism | |
Zhang et al. | On the performance of bus interconnection for socs | |
US9690727B2 (en) | System internal latency measurements in realtime applications | |
CN118569170A (en) | Memory efficient fault simulation and diagnosis method and device and storage medium | |
Paggi et al. | Development of a multiprocessor architecture for efficient processing allocation in electronic musical instruments | |
Zhu | FPGA-based implementation of task management in μC/OS-II operating system | |
JPS61114342A (en) | Controller of data processor | |
JPH0368418B2 (en) |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |