CN110399324A - Interrupt converter and interrupt conversion method - Google Patents
Interrupt converter and interrupt conversion method Download PDFInfo
- Publication number
- CN110399324A CN110399324A CN201910574788.XA CN201910574788A CN110399324A CN 110399324 A CN110399324 A CN 110399324A CN 201910574788 A CN201910574788 A CN 201910574788A CN 110399324 A CN110399324 A CN 110399324A
- Authority
- CN
- China
- Prior art keywords
- interrupt
- msi
- int
- module
- converter
- 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.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 21
- 238000006243 chemical reaction Methods 0.000 title claims abstract description 12
- 230000002093 peripheral effect Effects 0.000 claims abstract description 46
- 230000006870 function Effects 0.000 description 4
- 238000011161 development Methods 0.000 description 3
- 238000010586 diagram Methods 0.000 description 3
- 230000001133 acceleration Effects 0.000 description 2
- 238000004891 communication Methods 0.000 description 2
- 238000012545 processing Methods 0.000 description 2
- 230000001960 triggered effect Effects 0.000 description 2
- 238000011144 upstream manufacturing Methods 0.000 description 2
- 238000012356 Product development Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000003672 processing method Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F13/00—Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F13/38—Information transfer, e.g. on bus
- G06F13/382—Information transfer, e.g. on bus using universal interface adapter
- G06F13/387—Information transfer, e.g. on bus using universal interface adapter for adaptation of different data processing systems to different peripheral devices, e.g. protocol converters for incompatible systems, open system
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F13/00—Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F13/38—Information transfer, e.g. on bus
- G06F13/42—Bus transfer protocol, e.g. handshake; Synchronisation
- G06F13/4282—Bus transfer protocol, e.g. handshake; Synchronisation on a serial bus, e.g. I2C bus, SPI bus
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Bus Control (AREA)
Abstract
本发明实施例提供中断转换器及中断转换方法,以实现不同中断类型的模块间的中断类型转换。上述中断转换器包括寄存器模块、信息比对模块和INT中断生成模块;INT中断生成模块具有连接第二外设设备的中断接口,中断接口对应唯一的中断号。其中:寄存器模块用于存储配置信息;配置信息包括MSI编号与中断号的第一对应关系,以及,中断号对应的中断方式;信息比对模块用于:接收第一外设设备的MSI中断,将MSI中断的MSI编号与第一对应关系进行匹配;若匹配成功,通知INT中断生成模块匹配成功的目标中断号及目标中断方式;INT中断生成模块用于:根据目标中断方式产生INT中断,输出至目标中断号对应的中断接口。
Embodiments of the present invention provide an interrupt converter and an interrupt conversion method to realize interrupt type conversion between modules of different interrupt types. The above-mentioned interrupt converter includes a register module, an information comparison module and an INT interrupt generating module; the INT interrupt generating module has an interrupt interface connected to the second peripheral device, and the interrupt interface corresponds to a unique interrupt number. Wherein: the register module is used to store configuration information; the configuration information includes the first correspondence between the MSI number and the interrupt number, and the interrupt mode corresponding to the interrupt number; the information comparison module is used to: receive the MSI interrupt of the first peripheral device, Match the MSI number of the MSI interrupt with the first corresponding relationship; if the match is successful, notify the INT interrupt generating module of the successfully matched target interrupt number and the target interrupt mode; the INT interrupt generating module is used to: generate an INT interrupt according to the target interrupt mode, and output To the interrupt interface corresponding to the target interrupt number.
Description
技术领域technical field
本发明涉及计算机技术领域,特别涉及中断转换器及中断转换方法。The invention relates to the technical field of computers, in particular to an interrupt converter and an interrupt conversion method.
背景技术Background technique
随着异构加速日益广泛的应用,基于FPGA(Field-Programmable Gate Array,现场可编程门阵列)的加速卡也发展迅速,例如,DMA(Direct Memory Access,直接内存存取)控制器,MAC(MediaAccess Control Address,媒体访问控制地址)控制器都可基于FPGA加速卡实现。With the increasingly widespread application of heterogeneous acceleration, accelerator cards based on FPGA (Field-Programmable Gate Array, Field Programmable Gate Array) are also developing rapidly, for example, DMA (Direct Memory Access, direct memory access) controller, MAC ( MediaAccess Control Address, media access control address) controllers can be implemented based on FPGA accelerator cards.
FPGA加速卡通过PCI-E接口与服务器主机(host)连接,host通过PCIE接口将需要加速处理的数据发送给FPGA加速卡,FPGA加速卡处理完成后通过PCI-E接口返回相关的数据。The FPGA accelerator card is connected to the server host (host) through the PCI-E interface, and the host sends the data that needs to be accelerated to the FPGA accelerator card through the PCIE interface, and the FPGA accelerator card returns relevant data through the PCI-E interface after processing.
在上述加速处理过程中会有大量的中断产生,FPGA加速卡通过PCI-E接口向host发送的中断是MSI(Message Signaled Interrupt,消息信号中断)。除了MSI中断,请参见图1,与服务器主机连接的外部设备(例如传感器、看门狗等)常用中断类型是传统的通过信号线电平或者沿触发的中断(INT中断)。A large number of interrupts will be generated during the above acceleration processing. The interrupt sent by the FPGA accelerator card to the host through the PCI-E interface is MSI (Message Signaled Interrupt, message signal interrupt). In addition to MSI interrupts, please refer to Figure 1. The common interrupt types of external devices (such as sensors, watchdogs, etc.) connected to the server host are traditional interrupts triggered by signal line levels or edges (INT interrupts).
在实际运行中,可能会遇到不同类型的模块相关联的情况:比如,某一传感器作为DMA控制器的下游模块,DMA控制器发出的MSI中断除了要通过PCI-E上传到host,还要触发下游模块进行下一步的操作。但是下游模块能够识别的中断是INT中断,中断类型不同,将导致互相交流比较困难。In actual operation, different types of modules may be associated: for example, if a certain sensor is used as a downstream module of the DMA controller, the MSI interrupt sent by the DMA controller must be uploaded to the host through PCI-E. Trigger the downstream module to proceed to the next step. However, the interrupts that the downstream modules can recognize are INT interrupts, and the different types of interrupts will make it difficult to communicate with each other.
发明内容Contents of the invention
有鉴于此,本发明实施例提供中断转换器及中断转换方法,以实现不同中断类型的模块间的中断类型转换。In view of this, the embodiments of the present invention provide an interrupt converter and an interrupt conversion method, so as to implement interrupt type conversion between modules of different interrupt types.
为实现上述目的,本发明实施例提供如下技术方案:In order to achieve the above purpose, embodiments of the present invention provide the following technical solutions:
一种中断转换器,包括寄存器模块、信息比对模块和INT中断生成模块;所述信息比对模块与生成MSI中断的第一外设设备相连接,所述INT中断生成模块具有中断接口,所述中断接口对应唯一的中断号,所述中断接口用于连接第二外设设备,所述第二外设设备的中断类型为INT;An interrupt converter, comprising a register module, an information comparison module and an INT interrupt generation module; the information comparison module is connected to the first peripheral device generating an MSI interrupt, and the INT interruption generation module has an interrupt interface, so The interrupt interface corresponds to a unique interrupt number, the interrupt interface is used to connect the second peripheral device, and the interrupt type of the second peripheral device is INT;
其中:in:
所述寄存器模块用于存储配置信息;所述配置信息包括:所述第一外设设备的MSI编号与中断号的第一对应关系,以及,中断号对应的中断方式;所述中断方式包括电平中断或沿中断;The register module is used to store configuration information; the configuration information includes: the first correspondence between the MSI number of the first peripheral device and the interrupt number, and the interrupt mode corresponding to the interrupt number; the interrupt mode includes electrical Flat interrupt or edge interrupt;
所述信息比对模块用于:接收第一外设设备的MSI中断,将所述MSI中断的MSI编号与所述寄存器模块存储的第一对应关系进行匹配;若匹配成功,通知所述INT中断生成模块匹配成功的目标中断号及目标中断方式;The information comparison module is used to: receive the MSI interrupt of the first peripheral device, match the MSI number of the MSI interrupt with the first corresponding relationship stored in the register module; if the match is successful, notify the INT interrupt Generate the target interrupt number and target interrupt mode that the module matches successfully;
所述INT中断生成模块用于:根据所述目标中断方式产生INT中断,输出至所述目标中断号对应的中断接口。The INT interrupt generating module is configured to: generate an INT interrupt according to the target interrupt mode, and output the INT interrupt to the interrupt interface corresponding to the target interrupt number.
可选的,所述配置信息还包括屏蔽信息,所述屏蔽信息用于指示MSI编号与不需进行中断转换的中断号间的第二对应关系。Optionally, the configuration information further includes mask information, where the mask information is used to indicate a second correspondence between the MSI number and the interrupt number that does not need to be converted.
可选的,所述信息比对模块还用于:若匹配不成功,或者接收到的MSI中断的MSI编号与屏蔽信息中的中断号相匹配,则终止工作。Optionally, the information comparison module is further configured to terminate the work if the matching is unsuccessful, or the MSI number of the received MSI interrupt matches the interrupt number in the masked information.
可选的,所述中断转换器基于FPGA板卡实现。Optionally, the interrupt converter is implemented based on an FPGA board.
可选的,所述中断转换器被封装为知识产权IP包。Optionally, the interrupt converter is packaged as an intellectual property IP package.
一种中断方法,基于中断转换器,所述中断转换器包括寄存器模块、信息比对模块和INT中断生成模块;所述信息比对模块与生成MSI中断的第一外设设备相连接,所述INT中断生成模块具有中断接口,所述中断接口对应唯一的中断号,所述中断接口用于连接第二外设设备,所述第二外设设备的中断类型为INT;所述寄存器模块用于存储配置信息;所述配置信息包括:所述第一外设设备的MSI编号与中断号的第一对应关系,以及,中断号对应的中断方式;所述中断方式包括电平中断或沿中断;An interrupt method, based on an interrupt converter, the interrupt converter includes a register module, an information comparison module and an INT interrupt generation module; the information comparison module is connected to the first peripheral device that generates an MSI interrupt, and the The INT interrupt generating module has an interrupt interface, and the interrupt interface corresponds to a unique interrupt number, and the interrupt interface is used to connect the second peripheral device, and the interrupt type of the second peripheral device is INT; the register module is used for storing configuration information; the configuration information includes: a first correspondence between the MSI number of the first peripheral device and an interrupt number, and an interrupt mode corresponding to the interrupt number; the interrupt mode includes a level interrupt or an edge interrupt;
所述方法包括:The methods include:
所述信息比对模块接收第一外设设备的MSI中断,将所述MSI中断的MSI编号与所述寄存器模块存储的第一对应关系进行匹配;若匹配成功,通知所述INT中断生成模块匹配成功的目标中断号及目标中断方式;The information comparison module receives the MSI interrupt of the first peripheral device, and matches the MSI number of the MSI interrupt with the first correspondence stored in the register module; if the match is successful, notify the INT interrupt generation module to match Successful target interrupt number and target interrupt mode;
所述INT中断生成模块根据所述目标中断方式产生INT中断,输出至所述目标中断号对应的中断接口。The INT interrupt generating module generates an INT interrupt according to the target interrupt mode, and outputs the INT interrupt to the interrupt interface corresponding to the target interrupt number.
可选的,所述配置信息还包括屏蔽信息,所述屏蔽信息用于指示MSI编号与不需进行中断转换的中断号间的第二对应关系;所述方法还包括:若匹配不成功,或者接收到的MSI中断的MSI编号与屏蔽信息中的中断号相匹配,则终止工作。Optionally, the configuration information further includes mask information, and the mask information is used to indicate the second correspondence between the MSI number and the interrupt number that does not need to be interrupted; the method further includes: if the matching is unsuccessful, or If the MSI number of the received MSI interrupt matches the interrupt number in the mask information, the work is terminated.
可选的,所述中断转换器基于FPGA板卡实现。Optionally, the interrupt converter is implemented based on an FPGA board.
可选的,所述中断转换器被封装为知识产权IP包。Optionally, the interrupt converter is packaged as an intellectual property IP package.
可见,在本发明实施例中,中断转换器在接收到第一外设设备的MSI中断后,会根据配置信息将MSI中断转换为INT中断,输出至相应的中断接口。中断接口又与中断类型为INT的第二外设设备连接,从而实现了将MSI中断转换成第二外设设备的INT中断,方便了不同中断类型的模块之间的交流。It can be seen that, in the embodiment of the present invention, after receiving the MSI interrupt from the first peripheral device, the interrupt converter converts the MSI interrupt into an INT interrupt according to the configuration information, and outputs it to the corresponding interrupt interface. The interrupt interface is connected with the second peripheral device whose interrupt type is INT, so that the MSI interrupt is converted into the INT interrupt of the second peripheral device, and the communication between modules of different interrupt types is facilitated.
附图说明Description of drawings
图1为本发明实施例提供的包含不同中断类型模块的硬件架构示意图;FIG. 1 is a schematic diagram of a hardware architecture including modules of different interrupt types provided by an embodiment of the present invention;
图2为本发明实施例提供的包含中断转换器的硬件架构示意图;FIG. 2 is a schematic diagram of a hardware architecture including an interrupt converter provided by an embodiment of the present invention;
图3为本发明实施例提供的中断转换器的示例性结构图;FIG. 3 is an exemplary structural diagram of an interrupt converter provided by an embodiment of the present invention;
图4为本发明实施例提供的中断转换方法示例性流程图。FIG. 4 is an exemplary flowchart of an interrupt conversion method provided by an embodiment of the present invention.
具体实施方式Detailed ways
为了引用和清楚起见,下文中使用的技术名词、简写或缩写总结如下:For reference and clarity, technical terms, abbreviations or abbreviations used hereinafter are summarized as follows:
BMC:Baseboard Management Controller,基板管理控制器;BMC: Baseboard Management Controller, Baseboard Management Controller;
FPGA:Field-Programmable Gate Array,现场可编程门阵列;FPGA: Field-Programmable Gate Array, Field Programmable Gate Array;
PCI:Peripheral Component Interconnect,外设部件互连标准;PCI: Peripheral Component Interconnect, peripheral component interconnection standard;
PCI-E:PCI Express,一种高速串行计算机扩展总线标准;PCI-E: PCI Express, a high-speed serial computer expansion bus standard;
DMA:Direct Memory Access,直接内存存取;DMA允许不同速度的硬件装置来沟通,而不需要依赖于CPU的大量中断负载;DMA: Direct Memory Access, direct memory access; DMA allows hardware devices of different speeds to communicate without relying on a large number of interrupt loads from the CPU;
MAC:MediaAccess Control Address,媒体访问控制地址;MAC: MediaAccess Control Address, media access control address;
Avalon-MM:由intel提出的Avalon总线的memory map类型的接口;Avalon-MM: The memory map type interface of the Avalon bus proposed by intel;
Avalon-ST:由intel提出的Avalon总线的流模式接口;Avalon-ST: The stream mode interface of the Avalon bus proposed by intel;
TLP:Transaction Layer Package,在PCIE协议中的事务层数据包;TLP: Transaction Layer Package, the transaction layer data packet in the PCIE protocol;
INT:interrupt,传统中断,通过信号电平或者沿触发;INT: interrupt, traditional interrupt, triggered by signal level or edge;
MSI:Message Signaled Interrupt消息信号中断,通过写PCIE的固定地址空间来触发中断,是PCIE内部中断机制,有别于传统INT中断。MSI: Message Signaled Interrupt, which triggers an interrupt by writing to the fixed address space of PCIE, is the internal interrupt mechanism of PCIE, which is different from the traditional INT interrupt.
本发明实施例提供中断转换器及中断转换方法,以实现不同中断类型的模块间的中断类型转换。Embodiments of the present invention provide an interrupt converter and an interrupt conversion method to realize interrupt type conversion between modules of different interrupt types.
上述中断转换器为硬件结构,图2示出了包含中断转换器的FPGA硬件模块系统的一种示例性结构,第一外设设备,例如DMA控制器1、MAC控制器2通过PCI-E接口3与宿主机(host)4相连接。Above-mentioned interrupt converter is a hardware structure, and Fig. 2 shows a kind of exemplary structure that comprises the FPGA hardware module system of interrupt converter, the first peripheral equipment, such as DMA controller 1, MAC controller 2 through PCI-E interface 3 is connected with the host computer (host) 4.
而中断转换器5作为新添的器件,可基于FPGA板卡(逻辑)实现。与DMA控制器1、MAC控制器2等可生成MSI中断的第一外设设备相连接,并通过中断接口与一个或多个第二外设设备相连接。The interrupt converter 5, as a newly added device, can be realized based on FPGA board (logic). It is connected with a first peripheral device that can generate an MSI interrupt, such as a DMA controller 1 and a MAC controller 2, and is connected with one or more second peripheral devices through an interrupt interface.
每一中断接口都对应一个唯一的中断号。Each interrupt interface corresponds to a unique interrupt number.
第二外设设备的中断类型为INT,其示例性得可包括:看门狗、传感器、BMC等。The interrupt type of the second peripheral device is INT, which exemplarily includes: watchdog, sensor, BMC and so on.
中断转换器能够接收来自主机端的配置信息,然后根据配置信息与第一外设设备的MSI中断信息,生成对应的中断接口的INT中断输出至相应的第二外设设备。The interrupt converter can receive configuration information from the host, and then generate an INT interrupt corresponding to the interrupt interface and output it to the corresponding second peripheral device according to the configuration information and the MSI interrupt information of the first peripheral device.
可见,在本发明实施例中,中断转换器在接收到第一外设设备的MSI中断后,会根据配置信息将MSI中断转换为INT中断,输出至相应的中断接口。中断接口又与中断类型为INT的第二外设设备连接,从而实现了将MSI中断转换成第二外设设备的INT中断,方便了不同中断类型的模块之间的交流。It can be seen that, in the embodiment of the present invention, after receiving the MSI interrupt from the first peripheral device, the interrupt converter converts the MSI interrupt into an INT interrupt according to the configuration information, and outputs it to the corresponding interrupt interface. The interrupt interface is connected with the second peripheral device whose interrupt type is INT, so that the MSI interrupt is converted into the INT interrupt of the second peripheral device, and the communication between modules of different interrupt types is facilitated.
需要说明的是,现有的处理方式是,在生成MSI中断的上游模块中额外加入生成INT中断的逻辑,这样,上游模块在生成MSI中断的同时,生成INT中断输出给下游模块;或者不输出INT中断,直接在模块内部将中断处理。It should be noted that the existing processing method is to add additional logic for generating INT interrupts to the upstream module that generates MSI interrupts, so that the upstream module generates INT interrupts to output to downstream modules while generating MSI interrupts; or does not output INT interrupt, directly handle the interrupt inside the module.
由于没有可以通用的逻辑,所以在加速卡相关的FPGA开发应用过程中,如果遇到不同类型中断模块相关联的情况,就需要修改原有模块的逻辑,同时还要增加模块的端口信号,以输出INT中断。Since there is no common logic, in the process of FPGA development and application related to the accelerator card, if different types of interrupt modules are associated, it is necessary to modify the logic of the original module, and at the same time increase the port signal of the module to Output INT interrupt.
而在本发明实施例中,中断转换器可以封装成知识产权(IP)包独立使用(可理解为通用模块),这样就不需要修改原有模块的内部逻辑和端口信号,可移植性和复用性都大大增强,在项目开发中可以直接调用,为产品的开发提供便利,缩短开发周期。In the embodiment of the present invention, the interrupt converter can be packaged into an intellectual property (IP) package for independent use (can be understood as a general module), so that the internal logic and port signals of the original module do not need to be modified, and the portability and complexity can be improved. The usability is greatly enhanced, and it can be called directly during project development, which facilitates product development and shortens the development cycle.
图3示出了中断转换器的内部结构,其可包括:寄存器模块51、信息比对模块52和INT中断生成模块53;其中,信息比对模块51与前述的第一外设设备相连接,而INT中断生成模块53具有中断接口,中断接口与中断类型为INT的第二外设设备相连接。Figure 3 shows the internal structure of the interrupt converter, which may include: a register module 51, an information comparison module 52 and an INT interrupt generation module 53; wherein, the information comparison module 51 is connected to the aforementioned first peripheral device, The INT interrupt generating module 53 has an interrupt interface, and the interrupt interface is connected to the second peripheral device whose interrupt type is INT.
第二外设设备与中断接口连接后一般不会随便改变,因此,中断号除了代表中断接口,也可认为代表了某一具体的第二外设设备。After the second peripheral device is connected to the interrupt interface, it will not be changed casually. Therefore, the interrupt number can also be considered to represent a specific second peripheral device in addition to representing the interrupt interface.
各模块作用如下:The functions of each module are as follows:
寄存器模块51用于存储配置信息;The register module 51 is used for storing configuration information;
配置信息可包括:第一外设设备的MSI编号与中断号的第一对应关系,以及,中断号对应的中断方式(电平中断或沿中断);The configuration information may include: the first correspondence between the MSI number of the first peripheral device and the interrupt number, and the interrupt mode (level interrupt or edge interrupt) corresponding to the interrupt number;
每一可生成MSI中断的模块都会分配唯一的MSI编号,而第二外设设备前已述及可用中断号表示。因此,通过第一对应关系和中断号对应的中断方式,可知道某一MSI编号的MSI中断要转换的INT中断是沿中断还是电平中断,通过哪一个中断接口输出。Each module capable of generating MSI interrupts will be assigned a unique MSI number, and the second peripheral device can be represented by an interrupt number as mentioned above. Therefore, through the first corresponding relationship and the interrupt mode corresponding to the interrupt number, it can be known whether the INT interrupt to be converted by the MSI interrupt of a certain MSI number is an edge interrupt or a level interrupt, and which interrupt interface is output through.
举例来讲,MAC控制器2的MSI编号与中断号A对应,中断号A连接的第二外设设备是看门狗,对应的中断方式是沿中断。则MAC控制器发出的MSI中断,最终将会被转化为脉冲(对应沿中断),传输至看门狗。For example, the MSI number of the MAC controller 2 corresponds to the interrupt number A, the second peripheral device connected to the interrupt number A is a watchdog, and the corresponding interrupt mode is an edge interrupt. The MSI interrupt sent by the MAC controller will eventually be converted into pulses (corresponding to edge interrupts) and transmitted to the watchdog.
在一个示例中,MSI编号具体包括能够触发MSI中断的地址和数据。In one example, the MSI number specifically includes address and data capable of triggering an MSI interrupt.
信息比对模块52用于:接收第一外设设备的MSI中断,将MSI中断的MSI编号与寄存器模块51存储的第一对应关系进行匹配;The information comparison module 52 is configured to: receive the MSI interrupt of the first peripheral device, and match the MSI number of the MSI interrupt with the first corresponding relationship stored in the register module 51;
若匹配成功,通知INT中断生成模块53匹配成功的目标中断号及目标中断方式;If the matching is successful, notify the INT interrupt generating module 53 of the successfully matched target interrupt number and the target interrupt mode;
仍以MAC控制器2为例,假定其MSI编号对应中断号A,则信息比对模块52在接收到MAC控制器2的MSI中断后,会将其与第一对应关系进行匹配,得到的目标中断号为“A”,目标中断方式为“沿中断”。Still taking the MAC controller 2 as an example, assuming that its MSI number corresponds to the interrupt number A, the information comparison module 52 will match it with the first corresponding relationship after receiving the MSI interrupt of the MAC controller 2, and the obtained target The interrupt number is "A", and the target interrupt mode is "edge interrupt".
INT中断生成模块53用于:根据目标中断方式产生INT中断,输出至目标中断号对应的中断接口,触发与中断接口连接的第二外设设备的相关操作。The INT interrupt generating module 53 is used for: generating an INT interrupt according to the target interrupt mode, outputting the INT interrupt to the interrupt interface corresponding to the target interrupt number, and triggering related operations of the second peripheral device connected to the interrupt interface.
沿用前例,INT中断生成模块53将产生脉冲作为INT中断,输出至中断号为A的中断接口,也即输出至看门狗。Following the previous example, the INT interrupt generation module 53 will generate pulses as INT interrupts, and output them to the interrupt interface with the interrupt number A, that is, to the watchdog.
对于中断方式为“电平中断”的情况,INT中断生成模块53则会拉高相应中断接口的输出电平。When the interrupt mode is "level interrupt", the INT interrupt generation module 53 will pull up the output level of the corresponding interrupt interface.
在本发明其他实施例中,上述配置信息还可包括屏蔽信息,屏蔽信息用于指示MSI编号与不需进行中断转换的中断号间的第二对应关系。In other embodiments of the present invention, the above configuration information may further include mask information, and the mask information is used to indicate the second correspondence between the MSI number and the interrupt number that does not need to be converted.
则上述信息比对模块52还可用于:Then the above-mentioned information comparison module 52 can also be used for:
若匹配不成功,或者接收到的MSI中断的MSI编号与屏蔽信息中的中断号相匹配,则终止工作,不发送INT中断。If the match is unsuccessful, or the MSI number of the received MSI interrupt matches the interrupt number in the mask information, the work is terminated and the INT interrupt is not sent.
图4示出了由中断器所执行的中断转换方法的一种示例性流程,包括:Fig. 4 shows an exemplary process of the interrupt conversion method performed by the interrupter, including:
S0:host进行准备工作;S0: host prepares for work;
在一个示例中,host的准备工作可包括:In one example, host preparation may include:
通过lspci命令获取PCI-E中与MSI有关的配置信息,上述配置信息包括MSI编号(例如能够触发MSI中断的地址和数据),然后将MSI编号与中断号的第一对应关系写入中断转换器的寄存器模块51,同时将各种其他中断屏蔽信息也写入寄存器模块51。Obtain the configuration information related to MSI in PCI-E through the lspci command. The above configuration information includes the MSI number (such as the address and data that can trigger the MSI interrupt), and then write the first correspondence between the MSI number and the interrupt number into the interrupt converter register module 51, and various other interrupt mask information is also written into the register module 51.
需要说明的是,host可能支持不止一个应用,而不同的应用可能对应不同的配置信息,举例来讲,host在执行应用A之前,会把应用A对应的配置信息写入寄存器模块51,而在执行应用B之前,会把应用B对应的配置信息写入寄存器模块51。It should be noted that the host may support more than one application, and different applications may correspond to different configuration information. For example, before the host executes the application A, it will write the configuration information corresponding to the application A into the register module 51, and in Before the application B is executed, the configuration information corresponding to the application B will be written into the register module 51 .
屏蔽信息根据应用的实际需求进行人工配置。The shielding information is manually configured according to the actual requirements of the application.
S1:信息比对模块52接收第一外设设备的MSI中断,将MSI中断的MSI编号与寄存器模块51存储的配置信息匹配;S1: the information comparison module 52 receives the MSI interrupt of the first peripheral device, and matches the MSI number of the MSI interrupt with the configuration information stored in the register module 51;
以DAM控制器为例,DAM搬完数据后会产生MSI中断,信息比对模块52收到该MSI中断信息,会与寄存器模块51存储的配置信息进行比对,如果该MSI中断和外设INT中断都没有被屏蔽,则生成INT中断的中断号。Taking the DAM controller as an example, an MSI interrupt will be generated after the DAM moves the data, and the information comparison module 52 will compare the configuration information stored in the register module 51 after receiving the MSI interrupt information. If the MSI interrupt and the peripheral INT If none of the interrupts is masked, the interrupt number of the INT interrupt is generated.
配置信息的介绍请参见本文前述记载,在此不作赘述。For the introduction of configuration information, please refer to the previous description of this article, and will not be repeated here.
S2:若MSI编号与第一对应关系匹配成功,通知INT中断生成模块匹配成功的目标中断号及目标中断方式。S2: If the MSI number matches the first corresponding relationship successfully, notify the INT interrupt generating module of the successfully matched target interrupt number and target interrupt mode.
请参见本文前述举例,在此不作赘述。Please refer to the previous examples in this article, and details will not be repeated here.
S3:若匹配不成功,或者与屏蔽信息中的中断号相匹配,则终止工作。S3: If the matching is unsuccessful, or if it matches the interrupt number in the mask information, terminate the work.
请参见本文前述记载,在此不作赘述。Please refer to the foregoing descriptions in this article, and details will not be repeated here.
S4:INT中断生成模块53根据目标中断方式产生INT中断,输出至目标中断号对应的中断接口。S4: The INT interrupt generation module 53 generates an INT interrupt according to the target interrupt mode, and outputs the INT interrupt to the interrupt interface corresponding to the target interrupt number.
专业人员还可以进一步意识到,结合本文中所公开的实施例描述的各示例的单元及模型步骤,能够以电子硬件、计算机软件或者二者的结合来实现,为了清楚地说明硬件和软件的可互换性,在上述说明中已经按照功能一般性地描述了各示例的组成及步骤。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本发明的范围。Professionals can further realize that the units and model steps described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the possibilities of hardware and software For interchangeability, in the above description, the composition and steps of each example have been generally described according to their functions. Whether these functions are executed by hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art may use different methods to implement the described functions for each specific application, but such implementation should not be regarded as exceeding the scope of the present invention.
结合本文中所公开的实施例描述的方法或模型的步骤可以直接用硬件、处理器执行的软件模块,或者二者的结合来实施。软件模块可以置于随机存储器(RAM)、内存、只读存储器(ROM)、电可编程ROM、电可擦除可编程ROM、寄存器、硬盘、可移动磁盘、WD-ROM、或技术领域内所公知的任意其它形式的存储介质中。The steps of the methods or models described in conjunction with the embodiments disclosed herein may be directly implemented by hardware, software modules executed by a processor, or a combination of both. Software modules can be placed in random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, WD-ROM, or any Any other known storage medium.
对所公开的实施例的上述说明,使本领域专业技术人员能够实现或使用本发明。对这些实施例的多种修改对本领域的专业技术人员来说将是显而易见的,本文中所定义的一般原理可以在不脱离本发明的精神或范围的情况下,在其它实施例中实现。因此,本发明将不会被限制于本文所示的这些实施例,而是要符合与本文所公开的原理和新颖特点相一致的最宽的范围。The above description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the present invention will not be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims (9)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910574788.XA CN110399324A (en) | 2019-06-28 | 2019-06-28 | Interrupt converter and interrupt conversion method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910574788.XA CN110399324A (en) | 2019-06-28 | 2019-06-28 | Interrupt converter and interrupt conversion method |
Publications (1)
Publication Number | Publication Date |
---|---|
CN110399324A true CN110399324A (en) | 2019-11-01 |
Family
ID=68323575
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910574788.XA Pending CN110399324A (en) | 2019-06-28 | 2019-06-28 | Interrupt converter and interrupt conversion method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110399324A (en) |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111078597A (en) * | 2019-12-04 | 2020-04-28 | 江苏芯盛智能科技有限公司 | Interrupt message generation device and method and end equipment |
CN112711559A (en) * | 2021-01-15 | 2021-04-27 | 天津飞腾信息技术有限公司 | Serial interrupt method, device, serial interrupt processing method and processor |
WO2022227565A1 (en) * | 2021-04-29 | 2022-11-03 | 上海阵量智能科技有限公司 | Interrupt controller, interrupt control method, chip, computer device, and medium |
CN115292219A (en) * | 2022-10-10 | 2022-11-04 | 三未信安科技股份有限公司 | System and method for realizing PCIe MSI interruption in RISC-V platform |
CN115328830A (en) * | 2022-10-17 | 2022-11-11 | 南京芯驰半导体科技有限公司 | PCIe host-to-device interrupt sending method and system |
WO2023165518A1 (en) * | 2022-03-02 | 2023-09-07 | 山东云海国创云计算装备产业创新中心有限公司 | Interrupt message processing method and apparatus, electronic device, and readable storage medium |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1154166A (en) * | 1994-06-28 | 1997-07-09 | 英特尔公司 | PCI to ISA interrupt protocol converter and selection mechanism |
CN1340171A (en) * | 1999-12-07 | 2002-03-13 | 松下电器产业株式会社 | Interruption managing device and interruption managing method |
CN101201752A (en) * | 2006-12-11 | 2008-06-18 | 联想(北京)有限公司 | Method and apparatus for interruption handling |
CN101729280A (en) * | 2008-10-29 | 2010-06-09 | 晨星软件研发(深圳)有限公司 | Data transmission method and circuit device capable of automatically selecting transmission interface |
CN101872330A (en) * | 2009-11-04 | 2010-10-27 | 杭州海康威视数字技术股份有限公司 | Interrupt processing method of multi-PCIE (Peripheral Component Interface Express) equipment system |
CN102662889A (en) * | 2012-04-24 | 2012-09-12 | 华为技术有限公司 | Interrupt handling method, interrupt controller and processor |
CN106681816A (en) * | 2016-12-27 | 2017-05-17 | 深圳开立生物医疗科技股份有限公司 | PCIe interrupting method and system |
CN108628782A (en) * | 2018-03-27 | 2018-10-09 | 天津麒麟信息技术有限公司 | A kind of implementation method of the interruption transformation mechanism based on platform of soaring |
-
2019
- 2019-06-28 CN CN201910574788.XA patent/CN110399324A/en active Pending
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1154166A (en) * | 1994-06-28 | 1997-07-09 | 英特尔公司 | PCI to ISA interrupt protocol converter and selection mechanism |
CN1340171A (en) * | 1999-12-07 | 2002-03-13 | 松下电器产业株式会社 | Interruption managing device and interruption managing method |
CN101201752A (en) * | 2006-12-11 | 2008-06-18 | 联想(北京)有限公司 | Method and apparatus for interruption handling |
CN101729280A (en) * | 2008-10-29 | 2010-06-09 | 晨星软件研发(深圳)有限公司 | Data transmission method and circuit device capable of automatically selecting transmission interface |
CN101872330A (en) * | 2009-11-04 | 2010-10-27 | 杭州海康威视数字技术股份有限公司 | Interrupt processing method of multi-PCIE (Peripheral Component Interface Express) equipment system |
CN102662889A (en) * | 2012-04-24 | 2012-09-12 | 华为技术有限公司 | Interrupt handling method, interrupt controller and processor |
CN106681816A (en) * | 2016-12-27 | 2017-05-17 | 深圳开立生物医疗科技股份有限公司 | PCIe interrupting method and system |
CN108628782A (en) * | 2018-03-27 | 2018-10-09 | 天津麒麟信息技术有限公司 | A kind of implementation method of the interruption transformation mechanism based on platform of soaring |
Cited By (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111078597A (en) * | 2019-12-04 | 2020-04-28 | 江苏芯盛智能科技有限公司 | Interrupt message generation device and method and end equipment |
CN111078597B (en) * | 2019-12-04 | 2021-07-30 | 江苏芯盛智能科技有限公司 | An interrupt message generating device, method and terminal device |
CN112711559A (en) * | 2021-01-15 | 2021-04-27 | 天津飞腾信息技术有限公司 | Serial interrupt method, device, serial interrupt processing method and processor |
CN112711559B (en) * | 2021-01-15 | 2023-06-13 | 飞腾信息技术有限公司 | Serial interrupt method, serial interrupt device, serial interrupt processing method and processor |
US11809350B2 (en) | 2021-01-15 | 2023-11-07 | Phytium Technology Co., Ltd. | Serial interrupt method, device, serial interrupt processing method, and processor |
WO2022227565A1 (en) * | 2021-04-29 | 2022-11-03 | 上海阵量智能科技有限公司 | Interrupt controller, interrupt control method, chip, computer device, and medium |
WO2023165518A1 (en) * | 2022-03-02 | 2023-09-07 | 山东云海国创云计算装备产业创新中心有限公司 | Interrupt message processing method and apparatus, electronic device, and readable storage medium |
CN115292219A (en) * | 2022-10-10 | 2022-11-04 | 三未信安科技股份有限公司 | System and method for realizing PCIe MSI interruption in RISC-V platform |
CN115328830A (en) * | 2022-10-17 | 2022-11-11 | 南京芯驰半导体科技有限公司 | PCIe host-to-device interrupt sending method and system |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110399324A (en) | Interrupt converter and interrupt conversion method | |
US12067767B2 (en) | Buses for pattern-recognition processors | |
US10140242B2 (en) | General purpose input/output (GPIO) signal bridging with I3C bus interfaces and virtualization in a multi-node network | |
CN114443529B (en) | Memory direct access architecture, system, method, electronic device and medium | |
WO2018120780A1 (en) | Method and system for pcie interrupt | |
US10409744B1 (en) | Low-latency wake-up in a peripheral device | |
CN103559156A (en) | Communication system between FPGA (field programmable gate array) and computer | |
CN112765082B (en) | Multi-host arbitration method, device and readable storage medium | |
CN110489983B (en) | Chip access method, device, chip and terminal | |
CN110659143B (en) | A communication method, device and electronic device between containers | |
US7549009B2 (en) | High-speed PCI interface system and a reset method thereof | |
CN111371799B (en) | Method, device and equipment for controlling data receiving and transmitting of MCTP (Multi-channel media Port) controller | |
TWI727581B (en) | Data transmission system | |
CN104750634B (en) | Read method and system, InterWorking Equipment controller | |
CN109800202B (en) | PCIE (peripheral component interface express) -based data transmission system, method and device | |
CN109557846B (en) | Detection identification circuit, detection identification method thereof and electronic equipment | |
JP3859173B2 (en) | General-purpose operator station module for distributed process control systems. | |
US7783809B2 (en) | Virtualization of pin functionality in a point-to-point interface | |
CN116932047A (en) | Data transmission method, device, electronic equipment and readable storage medium | |
CN108549611A (en) | A kind of driving realization method and system based on gt9 family chips | |
US11216398B2 (en) | USB device and data transfer method thereof | |
CN116467245A (en) | Computing system, method, device and acceleration device | |
JP6965943B2 (en) | Configuration management device, configuration management system, configuration management method, and configuration management program | |
CN117436405B (en) | A simulation verification method, device and electronic equipment | |
TWI799258B (en) | Device and method for handling programming language function |
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 | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20191101 |
|
RJ01 | Rejection of invention patent application after publication |