TW202103013A - An interrupt process system and method for pcie with the heterogeneous equipment - Google Patents

An interrupt process system and method for pcie with the heterogeneous equipment Download PDF

Info

Publication number
TW202103013A
TW202103013A TW108124411A TW108124411A TW202103013A TW 202103013 A TW202103013 A TW 202103013A TW 108124411 A TW108124411 A TW 108124411A TW 108124411 A TW108124411 A TW 108124411A TW 202103013 A TW202103013 A TW 202103013A
Authority
TW
Taiwan
Prior art keywords
pcie
driver
interrupt
service program
interrupt request
Prior art date
Application number
TW108124411A
Other languages
Chinese (zh)
Other versions
TWI764014B (en
Inventor
林忠杰
Original Assignee
三泰科技股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 三泰科技股份有限公司 filed Critical 三泰科技股份有限公司
Priority to TW108124411A priority Critical patent/TWI764014B/en
Publication of TW202103013A publication Critical patent/TW202103013A/en
Application granted granted Critical
Publication of TWI764014B publication Critical patent/TWI764014B/en

Links

Images

Landscapes

  • Bus Control (AREA)

Abstract

An Interrupt process system and method for PCIE with the heterogeneous equipment comprises of a PCIE adapter card, a storage unit and a process unit. The PCIE adapter card includes a control unit, an identify information and a communication connector. The storage unit includes a service program, a driver and a buffer structure. The process unit perform the driver and service program. The driver builds a channel according to the identify information. The channel map to the communication connector by the driver. The channel transmission the ISR. If the driver detects the ISR in the buffer structure, the service program performs the ISR.

Description

應用於PCIE對異質設備的中斷處理系統與方法 Interrupt processing system and method applied to PCIE to heterogeneous equipment

一種對終端設備的控制處理系統與方法,特別有關應用於PCIE對異質設備的中斷處理系統與方法。 A control processing system and method for terminal equipment, particularly related to the interrupt processing system and method applied to PCIE to heterogeneous equipment.

對於傳統所使用的各種低速的通訊接口(例如:Digital I/O、Analog I/O或RS-232等)雖然可以轉接至其他高速通訊接口中(例如:通用序列匯流排(Universal Serial Bus,USB)或快捷外設互聯標準(Peripheral Component Interconnect Express,簡稱PCIE))。但是受限於傳統通訊接口的中斷處理機制(Interrupt Service Routine,簡稱ISR)會連帶影響在高速傳輸接口中的傳輸效率。 For traditionally used various low-speed communication interfaces (for example: Digital I/O, Analog I/O or RS-232, etc.), although it can be transferred to other high-speed communication interfaces (for example: Universal Serial Bus (Universal Serial Bus, USB) or Peripheral Component Interconnect Express (PCIE)). However, the interrupt processing mechanism (Interrupt Service Routine, ISR) limited by the traditional communication interface will also affect the transmission efficiency in the high-speed transmission interface.

因為傳統通訊是採用輪詢機制,因此控制器會向所連接的各項終端設備逐一詢問有無中斷要求發出。當有終端設備發出中斷要求時,控制器將會處理完該中斷要求後才會詢問此一終端設備有無發出中斷要求。由於控制器僅能處理現行的中斷要求,使得其他設備的中斷要求會被保留住而無法被接收,造成終端設備的傳輸產生壅塞。 Because traditional communication uses a polling mechanism, the controller will inquire each terminal device connected one by one whether there is an interrupt request. When a terminal device issues an interrupt request, the controller will process the interrupt request before inquiring whether the terminal device has issued an interrupt request. Since the controller can only handle the current interrupt request, the interrupt request of other devices will be retained and cannot be received, which will cause congestion in the transmission of the terminal device.

除了硬體架構的不同外,對於軟體方面也需要有相應的協調處理。作業系統(operation system)對於計算機而言是不可或缺的角色。作業系統除了提供使用者操作的介面外,也兼具控制計算機相關硬體資源的處理。為能讓作業系統可以更完備的支援各種硬體資源,因此每種硬體會有對應的驅動程式(driver)用以作為硬體與軟體的中介溝通。 In addition to the difference in hardware architecture, the software also needs to be coordinated accordingly. The operation system is an indispensable role for the computer. The operating system not only provides an interface for user operations, but also controls the processing of computer-related hardware resources. In order to allow the operating system to more fully support various hardware resources, each type of hardware has a corresponding driver to serve as an intermediary communication between hardware and software.

也由於驅動程式會直接影響作業系統與硬體,因此每一驅動程式都要通過作業系統的認證。以微軟公司(Microsoft)的視窗作業系統(Windows OS)為例。當硬體供應商製造新的介面卡或是改版驅動程式時, 供應商都需要重新提供驅動程式給微軟公司。當微軟公司確認新版驅動程式無誤後才可以提供給終端客戶。但每一次驗證驅動程式都需要付驗證金給微軟公司,而且驗證的過程需要經過冗長的時間。因此對於供應商而言,每一次改版就需要驗證驅動程式,而所述的驗證程序都是大量的耗費開發成本。 Because the driver directly affects the operating system and hardware, each driver must pass the operating system certification. Take Microsoft's Windows operating system (Windows OS) as an example. When the hardware supplier manufactures a new interface card or revises the driver, Suppliers need to provide drivers again to Microsoft. After Microsoft confirms that the new version of the driver is correct, it can be provided to end customers. But every time you verify the driver, you need to pay a verification fee to Microsoft, and the verification process takes a long time. Therefore, for the supplier, the driver needs to be verified for each revision, and the verification procedure is a lot of development costs.

本發明提供一種應用於PCIE對異質設備的中斷處理系統,其係用於降低處理設備中斷的等待時間,並且降低送驗驅動程式的驗證成本。 The present invention provides an interrupt processing system applied to PCIE to heterogeneous equipment, which is used to reduce the waiting time of processing equipment interrupts and to reduce the verification cost of the driver program for inspection.

本發明的應用於PCIE對異質設備的中斷處理系統包括PCIE轉接卡、儲存單元與處理單元。PCIE轉接卡具有控制單元、識別資訊與至少一通訊接口,該控制單元電性連接於該些通訊接口;儲存單元具有服務程式、驅動程式與多個緩存結構,每一緩存結構用於存儲中斷要求;處理單元電性連接於PCIE轉接卡與儲存單元,處理單元執行驅動程式與服務程式,驅動程式根據識別資訊建立多個傳輸通道,並由驅動程式將不同的傳輸通道指派相應的通訊接口,傳輸通道用於傳輸中斷要求或存取要求;若驅動程式偵測任一傳輸通道傳輸中斷要求,驅動程式將中斷要求存入緩存結構,若在緩存結構存在中斷要求,由服務程式處理中斷要求。 The interrupt processing system applied to PCIE to heterogeneous equipment of the present invention includes a PCIE adapter card, a storage unit and a processing unit. The PCIE adapter card has a control unit, identification information, and at least one communication interface. The control unit is electrically connected to the communication interfaces; the storage unit has a service program, a driver program, and a plurality of cache structures, and each cache structure is used to store interrupts. Requirements: The processing unit is electrically connected to the PCIE adapter card and the storage unit. The processing unit executes the driver and service program. The driver establishes multiple transmission channels based on the identification information, and the driver assigns the corresponding communication interfaces to the different transmission channels. , The transmission channel is used to transmit interrupt request or access request; if the driver detects any transmission channel transmission interrupt request, the driver will store the interrupt request in the cache structure. If there is an interrupt request in the cache structure, the service program will handle the interrupt request .

本發明另提供一種應用於PCIE對異質設備的中斷處理方法包括:在作業系統中運行驅動程式與服務程式;初始化PCIE轉接卡,使服務程式驅使PCIE轉接卡的多組通訊接口於作業系統中映射為多個傳輸通道;由驅動程式輪詢監聽傳輸通道,並接收傳輸通道所發出的中斷要求或存取要求;當驅動程式偵測中斷要求被發出時,驅動程式將中斷要求存入至緩存結構;若緩存結構中存在中斷要求,由服務程式處理中斷要求。 The present invention also provides an interrupt processing method applied to PCIE to heterogeneous devices, including: running a driver and a service program in an operating system; initializing a PCIE adapter card so that the service program drives multiple sets of communication interfaces of the PCIE adapter card to the operating system It is mapped to multiple transmission channels; the driver polls and monitors the transmission channel, and receives the interrupt request or access request issued by the transmission channel; when the driver detects that the interrupt request is sent, the driver saves the interrupt request to Cache structure; if there is an interrupt request in the cache structure, the interrupt request will be handled by the service program.

本發明的應用於PCIE對異質設備的中斷處理系統與方法,其係應用於高速傳輸介面對於各種異質設備的相關控制。由於本發明的驅動程式與服務程式分別處理各自的程序,因此服務程式不需等待完成中斷要求才能執行下一個中斷要求。這樣一來,驅動程式可以一直進行中斷要求的偵測,而服務程式可以專職處理中斷要求。當開發人員對服務程式的 內容進行變更時,開發人員不需要重新驗證驅動程式。所以本發明除了提高終端設備的中斷處理效率,也降低每次改版時送驗驅動程式的驗證成本。 The interrupt processing system and method for heterogeneous equipment applied to PCIE of the present invention is applied to the relevant control of various heterogeneous equipment by a high-speed transmission interface. Since the driver program and the service program of the present invention process their respective procedures, the service program does not need to wait for the completion of the interrupt request before executing the next interrupt request. In this way, the driver can always detect interrupt requests, and the service program can handle interrupt requests full-time. When the developer’s When the content is changed, the developer does not need to re-verify the driver. Therefore, the present invention not only improves the interrupt processing efficiency of the terminal device, but also reduces the verification cost of sending the driver for verification every time the version is revised.

有關本發明的特徵與實作,茲配合圖式作最佳實施例詳細說明如下。 With regard to the features and implementation of the present invention, the best embodiments are described in detail as follows in conjunction with the drawings.

100‧‧‧中斷處理系統 100‧‧‧Interrupt handling system

110‧‧‧處理單元 110‧‧‧Processing unit

120‧‧‧儲存單元 120‧‧‧Storage Unit

121‧‧‧作業系統 121‧‧‧Operating System

122‧‧‧服務程式 122‧‧‧Service Program

123‧‧‧驅動程式 123‧‧‧Driver

124‧‧‧緩存結構 124‧‧‧Cache structure

130‧‧‧PCIE轉接卡 130‧‧‧PCIE riser card

131‧‧‧控制單元 131‧‧‧Control Unit

132‧‧‧記憶單元 132‧‧‧Memory Unit

133‧‧‧PCIE接腳 133‧‧‧PCIE pin

135‧‧‧通訊接口 135‧‧‧Communication interface

136‧‧‧識別資訊 136‧‧‧Identification information

140‧‧‧終端設備 140‧‧‧Terminal equipment

310‧‧‧傳輸通道 310‧‧‧Transmission Channel

320‧‧‧中斷要求 320‧‧‧Interrupt request

330‧‧‧完成通知 330‧‧‧Completion notice

411‧‧‧第一設備 411‧‧‧First Device

412‧‧‧第二設備 412‧‧‧Second device

413‧‧‧第三設備 413‧‧‧Third equipment

414‧‧‧第四設備 414‧‧‧Fourth equipment

421‧‧‧第一通道 421‧‧‧The first channel

422‧‧‧第二通道 422‧‧‧Second channel

423‧‧‧第三通道 423‧‧‧Third channel

424‧‧‧第四通道 424‧‧‧Fourth channel

431‧‧‧第一緩存 431‧‧‧First cache

432‧‧‧第二緩存 432‧‧‧Second Cache

433‧‧‧第三緩存 433‧‧‧Third cache

434‧‧‧第四緩存 434‧‧‧Fourth cache

第1圖係為本發明的系統架構示意圖。 Figure 1 is a schematic diagram of the system architecture of the present invention.

第2圖係為本發明的運作流程示意圖。 Figure 2 is a schematic diagram of the operation flow of the present invention.

第3A圖係為本發明的運作架構示意圖。 FIG. 3A is a schematic diagram of the operation structure of the present invention.

第3B圖係為本發明的運作架構示意圖。 FIG. 3B is a schematic diagram of the operation structure of the present invention.

第3C圖係為本發明的運作架構示意圖。 FIG. 3C is a schematic diagram of the operation structure of the present invention.

第3D圖係為本發明的另一運作架構示意圖。 FIG. 3D is a schematic diagram of another operational architecture of the present invention.

第3E圖係為本發明的多中斷要求在緩存結構的佇列示意圖。 Figure 3E is a schematic diagram of the queue of multiple interrupt requests in the cache structure of the present invention.

請參考第1圖所示,其係為本發明的系統架構示意圖。本發明的中斷處理系統100可應用於個人電腦、筆記型電腦或具有PCIE接腳133的嵌入式計算機中。本發明的PCIE對異質設備的中斷處理系統100包括處理單元110、儲存單元120與PCIE轉接卡130。處理單元110電性連接於儲存單元120與PCIE轉接卡130。本發明所稱的異質設備是指以PCIE腳位為主,相對於其他種類的通訊接口設備。。舉例來說,以PCIE轉接卡130轉接至RS-232的列表機為例,RS-232的列表機則為異質設備。儲存單元120存儲作業系統121(operation system)、服務程式122(service program)、驅動程式123(driver)與緩存結構124。處理單元110用於運行作業系統、服務程式122、驅動程式123與應用程式(application),並於儲存單元120中劃分若干個緩存結構124。 Please refer to Figure 1, which is a schematic diagram of the system architecture of the present invention. The interrupt processing system 100 of the present invention can be applied to a personal computer, a notebook computer, or an embedded computer with PCIE pins 133. The PCIE interrupt processing system 100 for heterogeneous devices of the present invention includes a processing unit 110, a storage unit 120, and a PCIE adapter card 130. The processing unit 110 is electrically connected to the storage unit 120 and the PCIE riser card 130. The heterogeneous equipment referred to in the present invention refers to PCIE pin-based communication interface equipment compared to other types of communication interface equipment. . For example, taking the PCIE adapter card 130 to the RS-232 printer as an example, the RS-232 printer is a heterogeneous device. The storage unit 120 stores an operation system 121 (operation system), a service program 122 (service program), a driver program 123 (driver), and a cache structure 124. The processing unit 110 is used to run an operating system, a service program 122, a driver program 123, and an application program (application), and divides a plurality of cache structures 124 in the storage unit 120.

PCIE轉接卡130除了可以安裝於主板(main board)的PCIE插槽外,也可以被裝設於相容PCIE轉接卡130的M.2插槽中。在本發明中係以PCIE插槽作為示例,並非僅侷限於此。PCIE轉接卡130包括控制單元131、記憶單元132、PCIE接腳133與至少一通訊接口135。控制單 元131電性連結於記憶單元132、PCIE接腳133與該些通訊接口135。記憶單元132儲存識別資訊136。PCIE接腳133用於連接主機板的對應插槽,使控制單元131可耦接於處理單元110。識別資訊136用於記載PCIE轉接卡130所搭載的各通訊接口135與種類,另外識別資訊136也記錄各通訊接口135的記憶體空間的配置。通訊接口135的種類係為類比輸入輸出接口(Analog Input/output)、數位輸入輸出接口(Digital Input/output)、串列接口(Serial port)、並列接口(Parallel port)或通用序列匯流排(Universal Serial Bus,USB)。每一通訊接口135可連接相應種類接口的終端設備140,例如:串列的通訊接口135可以連接條碼掃描器(barcode scanner)或印表機等終端設備140。 The PCIE riser card 130 can not only be installed in the PCIE slot of the main board, but also can be installed in the M.2 slot of the compatible PCIE riser card 130. In the present invention, the PCIE slot is taken as an example, and it is not limited to this. The PCIE riser card 130 includes a control unit 131, a memory unit 132, PCIE pins 133 and at least one communication interface 135. Control sheet The element 131 is electrically connected to the memory unit 132, the PCIE pin 133, and the communication interfaces 135. The storage unit 132 stores identification information 136. The PCIE pin 133 is used to connect to the corresponding slot of the motherboard, so that the control unit 131 can be coupled to the processing unit 110. The identification information 136 is used to record each communication interface 135 and the type of the PCIE riser card 130, and the identification information 136 also records the memory space configuration of each communication interface 135. The type of communication interface 135 is analog input/output, digital input/output, serial port, parallel port, or universal serial bus (Universal Serial Bus, USB). Each communication interface 135 can be connected to a terminal device 140 of a corresponding type of interface. For example, the serial communication interface 135 can be connected to a terminal device 140 such as a barcode scanner or a printer.

控制單元131通過通訊接口135電性連接至終端設備140,且控制單元131另電性連接於處理單元110。PCIE轉接卡130被插設於插槽時,控制單元131將會把識別資訊136發送至處理單元110。處理單元110根據識別資訊136判斷PCIE轉接卡130所搭載的通訊接口135的種類與數量。接著,處理單元110依據識別資訊136建立各通訊接口135的傳輸通道310(channel)。每一組傳輸通道310均對應通訊接口135。傳輸通道310用於定義所連接的終端設備140的種類。 The control unit 131 is electrically connected to the terminal device 140 through the communication interface 135, and the control unit 131 is also electrically connected to the processing unit 110. When the PCIE riser card 130 is inserted into the slot, the control unit 131 will send the identification information 136 to the processing unit 110. The processing unit 110 determines the type and quantity of the communication interface 135 mounted on the PCIE riser card 130 according to the identification information 136. Then, the processing unit 110 establishes a transmission channel 310 (channel) of each communication interface 135 according to the identification information 136. Each group of transmission channels 310 corresponds to the communication interface 135. The transmission channel 310 is used to define the type of the connected terminal device 140.

舉例而言,如果PCIE轉接卡130具有兩通訊接口135,則第一組的傳輸通道310可以是RS-232的通訊接口135,而第二組的傳輸通道310可對應串列通訊接口135。服務程式122可以根據識別資訊136在作業系統中配置相應的傳輸通道310,同時指派各傳輸通道310的記憶體位址(memory address)與區段空間,並使傳輸通道310的資料可以映射(mapping)與儲存於緩存結構124中。緩存結構124可以以佇列(queue)或堆疊(stack)的方式實現。 For example, if the PCIE riser card 130 has two communication interfaces 135, the transmission channel 310 of the first group may be the RS-232 communication interface 135, and the transmission channel 310 of the second group may correspond to the serial communication interface 135. The service program 122 can configure the corresponding transmission channel 310 in the operating system according to the identification information 136, and at the same time assign the memory address and section space of each transmission channel 310, and enable the data of the transmission channel 310 to be mapped. And are stored in the cache structure 124. The cache structure 124 can be implemented in a queue or a stack.

一般而言,終端設備140可以向處理單元110發出中斷要求320(Interrupt Service Routine,ISR)或存取要求。中斷要求320用於向控制單元131發出終端設備140所需求的訊號,以使處理單元110可以調配相關的硬體資源給終端設備140。存取要求係為終端設備140向處理單元110進行資料的傳輸要求。由於習知技術的中斷要求320會影響處理單元 110的處理排程,使得其他終端設備140的中斷要求320無法被立即處理。因而導致計算機的處理效能低落。存取要求的種類分別為事件(event)、指令(command)或資料(data),三種型態的存取要求分別表示執行的優先順序。最高優先的存取要求為事件,而最低優先的存取要求係為資料。 Generally speaking, the terminal device 140 may send an interrupt request 320 (Interrupt Service Routine, ISR) or access request to the processing unit 110. The interrupt request 320 is used to send a signal required by the terminal device 140 to the control unit 131 so that the processing unit 110 can allocate related hardware resources to the terminal device 140. The access request is a data transmission request from the terminal device 140 to the processing unit 110. Because the interrupt requirement 320 of the conventional technology will affect the processing unit The processing schedule of 110 prevents the interrupt request 320 of other terminal devices 140 from being processed immediately. As a result, the processing efficiency of the computer is low. The types of access requests are event, command, or data. The three types of access requests respectively indicate the priority order of execution. The highest priority access request is the event, and the lowest priority access request is the data.

為進一步說明本發明的運作方式,請配合參考第2圖,其係為本發明的運作流程示意圖。本發明的PCIE對異質設備的中斷處理方法包括:步驟S210:啟動計算機並在作業系統中運行驅動程式與服務程式;步驟S220:初始化PCIE轉接卡,使服務程式驅使PCIE轉接卡的多組通訊接口於作業系統中映射為多個傳輸通道;步驟S230:由驅動程式輪詢監聽該些傳輸通道,並接收傳輸通道所發出的中斷要求或存取要求;步驟S240:偵測當前的緩存結構中是否存在中斷要求;步驟S241:若緩存結構中存在中斷要求,由服務程式處理中斷要求;步驟S242:若緩存結構中不存在中斷要求,服務程式移向次一個緩存結構並偵測有無中斷要求;步驟S250:當驅動程式偵測傳輸通道所發出的存取要求,調用服務程式執行存取要求。 In order to further explain the operation of the present invention, please refer to Fig. 2, which is a schematic diagram of the operation process of the present invention. The PCIE interrupt processing method for heterogeneous devices of the present invention includes: Step S210: Start the computer and run the driver and service program in the operating system; Step S220: Initialize the PCIE adapter card, and enable the service program to drive multiple sets of PCIE adapter cards The communication interface is mapped into multiple transmission channels in the operating system; Step S230: The driver polls and monitors the transmission channels, and receives the interrupt request or access request issued by the transmission channel; Step S240: Detect the current buffer structure Step S241: If there is an interrupt request in the cache structure, the service program handles the interrupt request; Step S242: If there is no interrupt request in the cache structure, the service program moves to the next cache structure and detects whether there is an interrupt request ; Step S250: When the driver detects the access request issued by the transmission channel, call the service program to execute the access request.

首先,啟動計算機並於作業系統121中運行PCIE轉接卡130的驅動程式123與服務程式122。於此同時,作業系統121也會對所安裝的PCIE轉接卡130進行初始化的處理,由作業系統121根據PCIE轉接卡130的識別資訊136設定傳輸通道310的種類與相應數量。 First, start the computer and run the driver 123 and the service program 122 of the PCIE riser card 130 in the operating system 121. At the same time, the operating system 121 also initializes the installed PCIE riser card 130, and the operating system 121 sets the type and corresponding number of the transmission channel 310 according to the identification information 136 of the PCIE riser card 130.

於此同時,通訊接口135可選擇性連接實體的終端設備140,或不連接終端設備140。服務程式122都會根據傳輸通道310的種類與數量,並於作業系統121中映射為多個傳輸通道310。服務程式122對於各傳輸通道310配置相應的記憶體位址與區段。並且服務程式122於儲存單元120中劃分相應傳輸通道310數量的緩存結構124,以使緩存結構124可以存儲傳輸通道310所傳輸的要求或資料。 At the same time, the communication interface 135 can be selectively connected to the physical terminal device 140 or not connected to the terminal device 140. The service program 122 is mapped into multiple transmission channels 310 in the operating system 121 according to the type and quantity of the transmission channels 310. The service program 122 allocates a corresponding memory address and section to each transmission channel 310. And the service program 122 divides the buffer structure 124 corresponding to the number of transmission channels 310 in the storage unit 120, so that the buffer structure 124 can store the request or data transmitted by the transmission channel 310.

在終端設備140連接通訊接口135後,終端設備140可以 向處理單元110發送中斷要求320或存取要求。本發明的驅動程式123會偵測終端設備140有無發送中斷要求320。若終端設備140發出中斷要求320時,驅動程式123會將中斷要求320存入對應的緩存結構124中。隨後,驅動程式123會移向次一終端設備140並偵測有無發出中斷要求320。在驅動程式123完成所有通訊接口135的偵測後,驅動程式123會向服務程式122發送一完成通知330,用於通知服務程式122開始偵測。 After the terminal device 140 is connected to the communication interface 135, the terminal device 140 can An interrupt request 320 or an access request is sent to the processing unit 110. The driver 123 of the present invention detects whether the terminal device 140 sends an interrupt request 320. If the terminal device 140 issues an interrupt request 320, the driver 123 will store the interrupt request 320 in the corresponding cache structure 124. Subsequently, the driver 123 moves to the next terminal device 140 and detects whether an interrupt request 320 is issued. After the driver 123 completes the detection of all the communication interfaces 135, the driver 123 will send a completion notification 330 to the service program 122 to notify the service program 122 to start detection.

服務程式122接獲完成通知330時,服務程式122將會依序的偵測緩存結構124中是否存在中斷要求320。服務程式122會根據傳輸通道310的排列順序對緩存結構124依序偵測。而服務程式122在偵測緩存結構124的同時,驅動程式123會進行次一回合各終端設備140的中斷要求320的偵測。對於存取要求而言,當驅動程式偵測123傳輸通道所發出的存取要求,調用服務程式122執行存取要求。 When the service program 122 receives the completion notification 330, the service program 122 will sequentially detect whether there is an interrupt request 320 in the cache structure 124. The service program 122 sequentially detects the cache structure 124 according to the sequence of the transmission channel 310. While the service program 122 detects the cache structure 124, the driver program 123 will detect the interrupt request 320 of each terminal device 140 in the next round. For the access request, when the driver detects the access request sent by the transmission channel 123, the service program 122 is called to execute the access request.

為為清楚說明本發明的服務程式122與驅動程式123的偵測與處理中斷要求320的過程,係以四項終端設備140的輪詢偵測與處理作為說明,但並非僅侷限於此數量。請配合第3A圖~第3E圖所示,其係為本發明的中斷要求320的偵測順序與時處理的示意圖。在本實施態樣的說明例中PCIE轉接卡130分別連接第一設備411、第二設備412、第三設備413與第四設備414。第一設備411對應第一通道421、第二設備412對應第二通道422、第三設備413對應第三通道423、第四設備414對應第四通道424。第一通道421、第二通道422、第三通道423與第四通道424分別映射第一緩存431、第二緩存432、第三緩存433與第四緩存434,如第3A圖所示。 In order to clearly illustrate the process of detecting and processing the interrupt request 320 of the service program 122 and the driver 123 of the present invention, four polling detection and processing of the terminal device 140 are used as an illustration, but it is not limited to this number. Please cooperate with FIG. 3A to FIG. 3E, which are schematic diagrams of the detection sequence and time processing of the interrupt request 320 of the present invention. In the illustrative example of this embodiment, the PCIE riser card 130 is connected to the first device 411, the second device 412, the third device 413, and the fourth device 414, respectively. The first device 411 corresponds to the first channel 421, the second device 412 corresponds to the second channel 422, the third device 413 corresponds to the third channel 423, and the fourth device 414 corresponds to the fourth channel 424. The first channel 421, the second channel 422, the third channel 423, and the fourth channel 424 respectively map the first buffer 431, the second buffer 432, the third buffer 433, and the fourth buffer 434, as shown in FIG. 3A.

首先,驅動程式123會由第一設備411、第二設備412、第三設備413至第四設備414的輪詢並監聽有無中斷要求320被發出。在此驅動程式123分別在第一時間、第二時間、第三時間與第四時間對各終端設備140進行監聽,且假設第一設備411、第三設備413與第四設備414依序發出中斷要求320。因此驅動程式123會將各中斷要求320分別存入相應的緩存結構124,如第3B圖所示。當驅動程式123完成第一設備411、第二設備412、第三設備413至第四設備414的輪詢後,驅動程式123將 會結束這一回合的中斷要求320的偵測,並同時發送完成通知330至服務程式122。驅動程式123則將會開始次一回合的各中斷要求320的偵測。 First, the driver 123 will poll by the first device 411, the second device 412, the third device 413 to the fourth device 414 and monitor whether an interrupt request 320 is issued. Here, the driver 123 monitors each terminal device 140 at the first time, the second time, the third time, and the fourth time respectively, and it is assumed that the first device 411, the third device 413, and the fourth device 414 issue interrupts in sequence Requirements 320. Therefore, the driver 123 stores each interrupt request 320 into the corresponding cache structure 124, as shown in FIG. 3B. When the driver 123 completes the polling of the first device 411, the second device 412, the third device 413 to the fourth device 414, the driver 123 will The detection of the interrupt request 320 of this round will be ended, and a completion notification 330 will be sent to the service program 122 at the same time. The driver 123 will start the detection of each interrupt request 320 in the next round.

接著,由於服務程式122開始對第一緩存431、第二緩存432、第三緩存433與第四緩存434逐一偵測是否存在中斷要求320,如第3C圖所示。在第3C圖中服務程式122將中斷要求320轉存至各緩存結構124中。再由驅動程式123依序對緩存結構124與中斷要求320進行相應的處理。在處理中斷要求320的過程中,服務程式122除了可以暫停中斷要求320的偵測,等待驅動程式123完成所有的中斷要求320。服務程式122也可以進行次一回合的中斷要求320的偵測。如果服務程式122進行次一回合的中斷偵測時,則驅動程式123可以將未完成的中斷要求320以佇列的方式存在各緩存結構124之中,如第3D圖所示。 Then, the service program 122 starts to detect whether there is an interrupt request 320 for the first cache 431, the second cache 432, the third cache 433, and the fourth cache 434 one by one, as shown in FIG. 3C. In Figure 3C, the service program 122 dumps the interrupt request 320 into each cache structure 124. The driver 123 then processes the cache structure 124 and the interrupt request 320 in sequence. In the process of processing the interrupt request 320, the service program 122 can suspend the detection of the interrupt request 320 and wait for the driver 123 to complete all the interrupt requests 320. The service program 122 can also detect the interrupt request 320 in the next round. If the service program 122 performs the next round of interrupt detection, the driver 123 can store the outstanding interrupt request 320 in each cache structure 124 in a queue, as shown in FIG. 3D.

在第3D圖中,第三設備413在次一回合又發出新的中斷要求320。假設驅動程式123仍處理第四緩存434的中斷要求320時,則服務程式122仍會將新的中斷要求320轉發至第三緩存433。假設在經過多回合且緩存結構124未能完成中斷要求320時,則中斷要求320會以佇列的方式儲存在緩存結構124中,如第3E圖所示。由於服務程式122與驅動程式123的平行處理,使得PCIE轉卡對異質設備的輪詢時不會被單一終端設備140而卡住。 In Figure 3D, the third device 413 issues a new interrupt request 320 in the next round. Assuming that the driver 123 is still processing the interrupt request 320 of the fourth cache 434, the service program 122 will still forward the new interrupt request 320 to the third cache 433. Assuming that after multiple rounds and the cache structure 124 fails to complete the interrupt request 320, the interrupt request 320 will be stored in the cache structure 124 in a queue, as shown in FIG. 3E. Due to the parallel processing of the service program 122 and the driver program 123, the polling of heterogeneous devices by the PCIE transfer card will not be blocked by the single terminal device 140.

本發明的應用於PCIE對異質設備的中斷處理系統與方法,其係應用於高速傳輸介面對於各種異質設備的相關控制。由於本發明的驅動程式123與服務程式122分別處理各自的程序,因此服務程式122不需等待完成中斷要求320才能執行下一個中斷要求320。這樣一來,驅動程式123可以一直進行中斷要求320的偵測,而服務程式122可以專職處理中斷要求320。當開發人員對服務程式122的內容進行變更時,開發人員不需要重新驗證驅動程式123。所以本發明除了提高終端設備140的中斷處理效率,也降低每次改版時送驗驅動程式123的驗證成本。 The interrupt processing system and method for heterogeneous equipment applied to PCIE of the present invention is applied to the relevant control of various heterogeneous equipment by a high-speed transmission interface. Since the driver 123 and the service program 122 of the present invention process their respective processes, the service program 122 does not need to wait for the completion of the interrupt request 320 before executing the next interrupt request 320. In this way, the driver 123 can always detect the interrupt request 320, and the service program 122 can handle the interrupt request 320 full-time. When the developer changes the content of the service program 122, the developer does not need to re-verify the driver program 123. Therefore, the present invention not only improves the interrupt processing efficiency of the terminal device 140, but also reduces the verification cost of sending the driver 123 for verification every time the version is revised.

雖然本發明以前述之較佳實施例揭露如上,然其並非用以限定本發明,任何熟習相像技藝者,在不脫離本發明之精神和範圍內,當可作些許之更動與潤飾,因此本發明之專利保護範圍須視本說明書所附之 申請專利範圍所界定者為準。 Although the present invention is disclosed in the foregoing preferred embodiments as above, it is not intended to limit the present invention. Anyone familiar with similar art can make some changes and modifications without departing from the spirit and scope of the present invention. Therefore, the present invention The scope of patent protection for inventions is subject to the Those defined in the scope of the patent application shall prevail.

100‧‧‧中斷處理系統 100‧‧‧Interrupt handling system

110‧‧‧處理單元 110‧‧‧Processing unit

120‧‧‧儲存單元 120‧‧‧Storage Unit

121‧‧‧作業系統 121‧‧‧Operating System

122‧‧‧服務程式 122‧‧‧Service Program

123‧‧‧驅動程式 123‧‧‧Driver

124‧‧‧緩存結構 124‧‧‧Cache structure

130‧‧‧PCIE轉接卡 130‧‧‧PCIE riser card

131‧‧‧控制單元 131‧‧‧Control Unit

132‧‧‧記憶單元 132‧‧‧Memory Unit

133‧‧‧PCIE接腳 133‧‧‧PCIE pin

135‧‧‧通訊接口 135‧‧‧Communication interface

136‧‧‧識別資訊 136‧‧‧Identification information

140‧‧‧終端設備 140‧‧‧Terminal equipment

Claims (10)

一種應用於PCIE對異質設備的中斷處理系統,其係提供多種不同種類的接口組合,並降低各接口中斷的等待時間,該應用於PCIE對異質設備的中斷處理系統包括:一PCIE轉接卡,其係具有一控制單元、一識別資訊與至少一通訊接口,該控制單元電性連接於該些通訊接口;一儲存單元,其係具有一服務程式、一驅動程式與多個緩存結構,每一該緩存結構用於存儲一中斷要求;一處理單元,其係電性連接於該PCIE轉接卡與該儲存單元,該處理單元執行該驅動程式與該服務程式,該驅動程式根據該識別資訊建立多個傳輸通道,並由該驅動程式將不同的該傳輸通道指派相應的該通訊接口,該傳輸通道用於傳輸該中斷要求或一存取要求;其中,若該驅動程式偵測任一該傳輸通道傳輸該中斷要求,該驅動程式將該中斷要求存入該緩存結構,若在該緩存結構存在該中斷要求,由該服務程式處理該中斷要求。 An interrupt processing system applied to PCIE to heterogeneous equipment, which provides a variety of interface combinations and reduces the waiting time of each interface interrupt. The interrupt processing system applied to PCIE to heterogeneous equipment includes: a PCIE adapter card, It has a control unit, an identification information and at least one communication interface, and the control unit is electrically connected to the communication interfaces; a storage unit has a service program, a driver program and a plurality of cache structures, each The cache structure is used to store an interrupt request; a processing unit, which is electrically connected to the PCIE adapter card and the storage unit, the processing unit executes the driver and the service program, and the driver establishes according to the identification information Multiple transmission channels, and the driver assigns different transmission channels to the corresponding communication interface, and the transmission channel is used to transmit the interrupt request or an access request; wherein, if the driver detects any of the transmission The channel transmits the interrupt request, and the driver stores the interrupt request in the cache structure. If the interrupt request exists in the cache structure, the service program handles the interrupt request. 如請求項1所述之應用於PCIE對異質設備的中斷處理系統,其中該通訊接口的種類係為序列埠(Communication port)、類比輸入輸出埠(Analog I/O port)或數位輸入輸出埠(Digital I/O port)。 The interrupt processing system applied to PCIE to heterogeneous devices as described in claim 1, wherein the type of the communication interface is a serial port (Communication port), an analog input/output port (Analog I/O port), or a digital input/output port ( Digital I/O port). 如請求項1所述之應用於PCIE對異質設備的中斷處理系統,其中該緩存結構係由佇列(queue)、堆疊(stack)或陣列(array)實現。 As described in claim 1, the PCIE interrupt processing system for heterogeneous devices is applied, wherein the cache structure is implemented by a queue, a stack, or an array. 如請求項1所述之應用於PCIE對異質設備的中斷處理系統,其中該存取要求的種類分別為事件(event)、指令(command)或資料(data)。 The PCIE interrupt processing system for heterogeneous devices as described in claim 1, wherein the types of the access request are event, command, or data. 如請求項1所述之應用於PCIE對異質設備的中斷處理系統,其中該驅動程式與該服務程式係以同時運作,該驅動程式將該中斷要求存入該緩存結構後,由該服務程式處理該中斷要求。 The interrupt processing system applied to PCIE to heterogeneous devices as described in claim 1, wherein the driver and the service program operate at the same time, and the driver stores the interrupt request in the cache structure and then the service program handles it The interrupt request. 如請求項1所述之應用於PCIE對異質設備的中斷處理系統,其中該驅動程式輪詢所有該些傳輸通道後再由該服務程式處理該些中斷要求。 The interrupt processing system applied to PCIE for heterogeneous devices as described in claim 1, wherein the driver program polls all the transmission channels and then the service program processes the interrupt requests. 一種應用於PCIE對異質設備的中斷處理方法,其係提供多種不同種類的接口組合,並降低各種接口的中斷等待時間,該應用於PCIE對異質設備的中斷處理方法包括: 在一作業系統中運行一驅動程式與一服務程式;初始化一PCIE轉接卡,使該服務程式驅使該PCIE轉接卡的多組通訊接口於該作業系統中映射為多個傳輸通道;由該驅動程式輪詢監聽該些傳輸通道,並接收該傳輸通道所發出的一中斷要求或一存取要求;當該驅動程式偵測該中斷要求被發出時,該驅動程式將該中斷要求存入至一緩存結構;以及若該緩存結構中存在該中斷要求,由該服務程式處理該中斷要求。 An interrupt processing method applied to PCIE to heterogeneous equipment, which provides a variety of different types of interface combinations and reduces the interrupt waiting time of various interfaces. The interrupt processing method applied to PCIE to heterogeneous equipment includes: Run a driver program and a service program in an operating system; initialize a PCIE adapter card so that the service program drives the PCIE adapter card's multiple communication interfaces to be mapped to multiple transmission channels in the operating system; The driver polls and monitors the transmission channels, and receives an interrupt request or an access request sent by the transmission channel; when the driver detects that the interrupt request is sent, the driver saves the interrupt request to A cache structure; and if the interrupt request exists in the cache structure, the service program handles the interrupt request. 如請求項7所述之應用於PCIE對異質設備的中斷處理方法,其中於初始化該PCIE轉接卡時之步驟更包括:該作業系統根據該PCIE轉接卡的一識別資訊設定該些傳輸通道的相應數量。 The interrupt processing method applied to PCIE to heterogeneous devices as described in claim 7, wherein the step of initializing the PCIE riser card further includes: the operating system sets the transmission channels according to an identification information of the PCIE riser card The corresponding quantity. 如請求項7所述之應用於PCIE對異質設備的中斷處理方法,其中該驅動程式監聽該些傳輸通道更包括:當驅動程式偵測該些傳輸通道所發出的該存取要求,調用該服務程式執行該存取要求。 The PCIE interrupt handling method for heterogeneous devices as described in claim 7, wherein the driver monitoring the transmission channels further includes: when the driver detects the access request issued by the transmission channels, calling the service The program executes the access request. 如請求項7所述之應用於PCIE對異質設備的中斷處理方法,其中該存取要求的種類分別為事件(event)、指令(command)或資料(data)。 As described in claim 7, the PCIE interrupt handling method for heterogeneous devices is applied, wherein the types of the access request are event, command, or data.
TW108124411A 2019-07-09 2019-07-09 An interrupt process system and method for pcie with the heterogeneous equipment TWI764014B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW108124411A TWI764014B (en) 2019-07-09 2019-07-09 An interrupt process system and method for pcie with the heterogeneous equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW108124411A TWI764014B (en) 2019-07-09 2019-07-09 An interrupt process system and method for pcie with the heterogeneous equipment

Publications (2)

Publication Number Publication Date
TW202103013A true TW202103013A (en) 2021-01-16
TWI764014B TWI764014B (en) 2022-05-11

Family

ID=75234751

Family Applications (1)

Application Number Title Priority Date Filing Date
TW108124411A TWI764014B (en) 2019-07-09 2019-07-09 An interrupt process system and method for pcie with the heterogeneous equipment

Country Status (1)

Country Link
TW (1) TWI764014B (en)

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW501017B (en) * 2000-04-05 2002-09-01 Via Tech Inc Processing method, chip set and controller for supporting message signaled interrupt
US7171509B2 (en) * 2002-01-09 2007-01-30 International Business Machines Corporation Method and apparatus for host messaging unit for Peripheral Component Interconnect busmaster devices
TW201217979A (en) * 2010-10-18 2012-05-01 Sunix Co Ltd employing single PCI slot on computer motherboard to be expanded with multiple PCI devices
US9128920B2 (en) * 2011-11-30 2015-09-08 Marvell World Trade Ltd. Interrupt handling systems and methods for PCIE bridges with multiple buses
CN104506379B (en) * 2014-12-12 2018-03-23 北京锐安科技有限公司 Network Data Capturing method and system

Also Published As

Publication number Publication date
TWI764014B (en) 2022-05-11

Similar Documents

Publication Publication Date Title
US6484217B1 (en) Managing shared devices in a data processing system
US4961140A (en) Apparatus and method for extending a parallel synchronous data and message bus
US6983337B2 (en) Method, system, and program for handling device interrupts
US6898751B2 (en) Method and system for optimizing polling in systems using negative acknowledgement protocols
US7103743B2 (en) System and method of accessing vital product data
US20150212959A1 (en) Inter-component communication including slave component initiated transaction
CN106502935A (en) FPGA isomery acceleration systems, data transmission method and FPGA
EP1681625A2 (en) Redundant storage virtualization subsystem and computer system having the same
US20230315675A1 (en) Techniques for deconflicting usb traffic in an extension environment
US6789142B2 (en) Method, system, and program for handling interrupt requests
CN100538684C (en) DMA controller, node, data transfer control method
CN116126613A (en) Position detection method and device of PCIe (peripheral component interconnect express) equipment, electronic equipment and storage medium
CN1969270B (en) Bus controller for handling split transactions
CN101310262B (en) Integrated circuit that enables multiple communication channels to operate independently
US7043589B2 (en) Bus system and bus interface
CN115576613A (en) PXE-based operating system installation method, computing device and communication system
US20080276009A1 (en) Enabling Efficient Communication Between a Host and Multiple USB Devices
CN102043741B (en) Circuit and method for pipe arbitration
CN120705094A (en) Interrupt processing method, PCIe system and storage medium
TWI764014B (en) An interrupt process system and method for pcie with the heterogeneous equipment
CN101520758B (en) Information processing apparatus and control method thereof
CN118860588A (en) Multi-channel register interrupt method, device, equipment, storage medium and program product
CN112241380B (en) Interrupt processing system and method applied to PCIE (peripheral component interface express) on heterogeneous equipment
CN100458725C (en) Method for testing by using universal serial bus port to connect testing device
US20060265523A1 (en) Data transfer circuit and data transfer method