Framework design system based on FPGA expansion ARM interface and driving method thereof

By designing an FPGA-based framework system on the ARM+FPGA platform, and using the SPI-FPGA communication layer and virtual interface layer to expand ARM IO resources, the problem of scarcity of ARM IO resources is solved, flexible configuration and optimization are achieved, and the system capability is improved Transplantability and performance.

CN118885433APending Publication Date: 2024-11-01CHENGDU ORANGE PEAK TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411003136.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-25
Publication Date
2024-11-01

AI Technical Summary

Technical Problem

In the development of existing ARM+FPGA embedded platform, FPGA rarely serves as a computing/communication module as an ARM IO expansion module, resulting in a lack of ARM IO resources and a lack of universal and portable IO expansion solutions.

Method used

Provide a framework design system based on FPGA expansion ARM interface, including the SPI-FPGA communication layer on the software side and FPGA side. Through the device Noos driver layer, virtual interface layer and virtual expansion interface layer, control of the FPGA SPI bus module and The expansion of other communication interfaces, such as UART, CAN, and I2C, uses shared memory and MMAP mapping to achieve virtual device management, and optimizes the parameters and transmission logic of the SPI bus.

Benefits of technology

It realizes flexible configuration and optimization of interface resources, avoids the high cost and complexity of hardware modification, improves the portability and flexibility of the system, and can effectively allocate and manage resources on different Linux-based CPU+FPGA platforms.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118885433A_ABST
    Figure CN118885433A_ABST
Patent Text Reader

Abstract

The invention relates to a framework design system based on an FPGA expansion ARM interface and a driving method thereof, the framework design system is applied to an ARM + FPGA platform, the framework design system comprises a software side and an FPGA side connected with the software side through an SPI-FPGA communication layer, the software side is sequentially composed of an equipment Noos driving layer, a virtual interface layer and a virtual expansion interface layer from bottom to top, and the equipment Noos driving layer, the virtual interface layer and the virtual expansion interface layer are connected with the FPGA side through an SPI-FPGA communication layer. The device Noos driving layer drives and corresponds to one actual device hung under the FPGA and is used for providing a universal fine-grained hardware function calling interface for the device layer; the virtual interface layer is connected with the equipment Noos layer by binding a virtual equipment interface, and is used for communicating with SPI equipment hung under an FPGA (Field Programmable Gate Array); one end of the virtual expansion interface layer is connected with the virtual interface layer, the other end of the virtual expansion interface layer is connected with the SPI module of the SPI-FPGA communication layer, and the virtual expansion interface layer is used for respectively adapting to a communication protocol of the FPGA SPI bus module on the FPGA side and controlling the FPGA SPI bus module by controlling an AXI register of the FPGA SPI module. Therefore, a specific technical scheme with relatively high universality and portability is formed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of radio communications, and relates to a framework design system based on FPGA-expanded ARM interface and a driving method thereof. Background Art

[0002] Currently, ARM+FPGA embedded platforms are becoming more and more versatile and practical. In many fields, many technologies are used to implement more efficient platform solutions. In the current development of ARM+FPGA embedded platforms, FPGA is used as a computing / communication module but rarely as an IO expansion module of ARM.

[0003] However, in reality, there is a shortage of ARM IO resources in many cases. For example, when conducting secondary development on an existing mature platform, because the platform solution is set, if the platform contains an FPGA chip, you can consider adjusting the allocation of FPGA resources to expand ARM IO. For example, if the chip select signal of the SPI interface is occupied, you can package the chip select signal into the communication package with the FPGA to achieve the effect of FPGA expanding multiple SPI interfaces; for example, if some SOC off-chip IC chips are directly connected to ARM, due to the particularity of these IC chips (such as complex communication logic), the communication process needs to be processed by FPGA (such as parallel communication after copying to control two or more IC chips at the same time), or the data directly transmitted by ARM and IC chips needs to be analyzed and converted; in system design, it can provide more flexible options for PCB layout and routing, such as what was previously connected to ARM can now be connected to FPGA. Therefore, ARM IO expansion through FPGA has certain use value.

[0004] The present invention aims at the problem of versatility not being solved in the existing IO expansion schemes, and forms a specific framework design system and a driving method thereof which are highly universal and portable and which are based on FPGA to expand the ARM interface. Summary of the invention

[0005] In view of this, the purpose of the present invention is to provide a framework design system based on FPGA to expand the ARM interface and its driving method, so as to solve the general technical problems applicable to more scenarios, thereby forming a specific technical solution with strong universality and portability.

[0006] To achieve the above-mentioned purpose, the present invention provides a framework design system based on FPGA expansion of ARM interface, which is applied to ARM+FPGA platform, wherein the framework design system includes a software side and an FPGA side connected to the software side through an SPI-FPGA communication layer, wherein the software side is sequentially composed of a device Noos driver layer, a virtual interface layer and a virtual expansion interface layer from bottom to top, the device Noos driver layer drives an actual device corresponding to an FPGA mounted under the FPGA, and is used to provide a general fine-grained hardware function call interface for the device layer; the virtual interface layer is connected to the device Noos layer by binding a virtual device interface, and is used to communicate with the SPI device mounted under the FPGA; one end of the virtual expansion interface layer is connected to the virtual interface layer, and the other end is connected to the SPI module of the SPI-FPGA communication layer, and is used to adapt the communication protocol of the FPGA SPI bus module on the FPGA side and control the FPGA SPI bus module by controlling the AXI register of the FPGA SPI module, and finally control the device mounted thereunder.

[0007] Preferably, the FPGA SPI bus module includes an FPGA SPI communication module and an FPGA SPI device module, the FPGA SPI device module performs basic communication with the ARM, and the FPGA SPI communication module controls the ARM to enable the FPGA SPI module to communicate with the SPI device connected thereto.

[0008] Preferably, the virtual extended interface layer can expand a UART interface, a CAN interface and an I2C interface in addition to the SPI interface in the Linux application layer.

[0009] Further preferably, the ARM expands various communication interfaces through the communication bandwidth of the SPI-FPGA communication layer to transmit and control the communication module on the FPGA side, so as to ultimately control the devices under the communication bus module.

[0010] Preferably, the SPI-FPGA communication layer is the bottom layer of the ARM and FPGA communication logic. The communication layer is connected to the FPGA SPI interface by the ARMSPI controller to read and write the AXI registers of other communication modules inside the FPGA, thereby reading and writing the registers of the devices connected to the FPGA communication bus.

[0011] Preferably, the virtual interface layer, also known as the virtual device layer, uses a virtual device information management solution of static compilation, shared memory, and driver memory mapping to provide an abstract interface for virtual device management for the upper layer; wherein the shared memory is used to store virtual device management information and is shared among multiple processes, and the memory bound to the driver is mapped to the virtual interface layer through MMAP as a data channel from the user layer to the driver layer.

[0012] To achieve the above object, the present invention further provides a driving method applied to the framework design system based on FPGA expansion ARM interface as described above, wherein the driving method mainly includes the following:

[0013] First, after the driver is loaded, the Probe logic is triggered to complete the entire initialization process, and then the SPI bus bound to the device tree is configured to optimize the data link from the SPI framework to the SPI controller by optimizing the parameters of the SPI bus; then the configured SPI bus is used to start driving the optimized CPU-side SPI module; the IOCTL OPS is initialized to abstract the transmission control instructions of the SPI communication interface to the user, and the data and specific transmission parameters are copied in the user space using the driver memory mapped by MMAP; after the transmission instruction is issued, the driver will parse the contents of the specified memory to complete the transmission logic.

[0014] Preferably, the driver will parse the content in the specified memory to complete the specific steps of the transmission logic: receive the transmission control instruction from the user layer through IOCTL and selectively call the corresponding driver method, and its main transmission method is to call the internal specific transmission function, which adjusts the transmission logic of the underlying SPI by configuring the private parameters of the Linux SPI driver module device model to meet the communication timing between the bottom layer and the FPGA while improving the SPI bus bandwidth; finally, the kernel DMA chain is called through SPI_SYNC to realize the actual transmission.

[0015] The beneficial effects of the present invention are as follows: the framework design scheme of the present invention adopts a framework that separates actual interfaces from virtual interfaces, realizes flexible configuration and optimization of interface resources, avoids the high cost and complexity of hardware modification, and thus saves development and upgrade costs; it also uses the driver framework that is naturally decoupled from the underlying interface of Noos, which is characterized by high decoupling and simplicity, making the entire system easy to be ported to different Linux-based CPU+FPGA platforms. This feature is particularly suitable for changing business environments and technology iterations, providing enterprises with a flexible technology adaptation path; thus, by using FPGA to expand ARM IO, resources can be allocated and managed more effectively. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to make the purpose, technical solution and beneficial effects of the present invention clearer, the present invention provides the following drawings for illustration:

[0017] Figure 1 This is a data flow diagram of a framework design system based on FPGA expansion of ARM interface according to the first embodiment of the present invention;

[0018] Figure 2This is a driving flow chart of the framework design system based on FPGA expansion of ARM interface described in Example 2 of the present invention. DETAILED DESCRIPTION

[0019] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0020] It should be noted that in the current development of ARM+FPGA embedded platforms, FPGA is used as a computing / communication module but rarely as an IO expansion module for ARM. However, in reality, there is a shortage of ARM IO resources in many cases. Here are three scenarios:

[0021] Scenario 1: When performing secondary development on an existing mature platform, since the platform solution is set, if the platform contains an FPGA chip, you can consider adjusting the allocation of FPGA resources to expand ARM IO. For example, if the chip select signal of the SPI interface is occupied, you can package the chip select signal into the communication package with the FPGA to achieve the effect of expanding the FPGA to multiple SPI interfaces;

[0022] Scenario 2: If some SOC off-chip IC chips are directly connected to ARM, due to the particularity of these IC chips (such as complex communication logic), the communication process needs to be processed by FPGA (such as parallel communication after replication to control two or more IC chips at the same time), or the data directly transmitted between ARM and IC chips needs to be analyzed and converted;

[0023] Scenario 3: During system design, more flexible options can be provided for PCB layout and routing. For example, what was previously connected to ARM can now be connected to FPGA.

[0024] In response to the above three scenario requirements, the present invention provides a highly versatile framework design system based on FPGA expansion of ARM interface. The bottom layer is a driver layer of the virtual interface layer, which is used to drive the interface between the ARM bottom layer and the FPGA communication. This solution selects SPI, an interface that has both versatility and speed. For higher speed requirements, it can be adjusted to a Serdes interface. The upper layer is an interface layer of the virtual interface layer organized by the driver framework imitating Noos (independent system), and the underlying driver layer is used to continue to expose virtual expansion interfaces to the upper layer, such as I2C, SPI, UART, CAN and other commonly used serial busses. The versatility and portability of the solution of the present invention mainly come from this framework design: 1) using a framework that separates the actual interface and the virtual interface, 2) using the driver framework that is naturally decoupled from the underlying interface of Noos. The FPGA side only needs to create a module, expose the module registers to the software side, and allocate FPGA IO resources to the module. Software testing is based on the software framework. After obtaining the interface documents of the registers of the modules exposed by the FPGA, the underlying driver programs that drive these modules can be written, that is, the modules of the virtual interface layer can be added. Generally, it is only necessary to modify the access logic of the registers of the devices mounted under the FPGA bus. It can be seen that the degree of decoupling is good. At the same time, the interface simplifies the debugging process of the interface at the user level. In order to better illustrate the framework design system based on FPGA expansion of ARM interface provided by the present invention, the following specific embodiments are described by taking the SPI device as an example. Of course, it can also be other commonly used peripheral buses such as UART, CAN, I2C, etc.

[0025] Embodiment 1

[0026] like Figure 1 As shown, an embodiment of the present invention provides a framework design system based on FPGA expansion of ARM interface, which is applied to ARM+FPGA platform, wherein the framework design system includes a software side and an FPGA side connected to the software side through an SPI-FPGA communication layer, wherein the software side is sequentially composed of a device Noos driver layer, a virtual interface layer and a virtual extension interface layer from bottom to top, the device Noos driver layer drives an actual device corresponding to an FPGA mounted under the FPGA, and is used to provide a general fine-grained hardware function call interface for the device layer; the virtual interface layer is connected to the device Noos layer by binding a virtual device interface, and is used to communicate with the SPI device mounted under the FPGA; one end of the virtual extension interface layer is connected to the virtual interface layer, and the other end is connected to the SPI module of the SPI-FPGA communication layer, and is used to adapt the communication protocol of the FPGA SPI bus module on the FPGA side and control the FPGA SPI bus module by controlling the AXI register of the FPGA SPI module.

[0027] In an embodiment of the present invention, the FPGA SPI bus module includes an FPGA SPI communication module and an FPGA SPI device module. The FPGA SPI device module performs basic communication with the ARM, and the FPGA SPI communication module controls the ARM to enable the FPGA SPI module to communicate with the SPI device connected thereto.

[0028] In an embodiment of the present invention, the virtual extension interface layer can expand the UART interface, CAN interface and I2C interface in addition to the SPI interface in the Linux application layer. The ARM expands various communication interfaces through the communication bandwidth of the SPI-FPGA communication layer to transmit and control the communication module on the FPGA side, so as to ultimately control the devices under the communication bus module. The SPI-FPGA communication layer is the bottom layer of the ARM and FPGA communication logic. The communication layer is connected to the FPGA SPI interface by the ARM SPI controller to read and write the AXI registers of other communication modules inside the FPGA, thereby reading and writing the registers of the devices connected to the FPGA communication bus.

[0029] Furthermore, the virtual interface layer, also known as the virtual device layer, uses a virtual device information management solution of static compilation, shared memory, and driver memory mapping to provide an abstract interface for virtual device management for the upper layer; the shared memory is used to store virtual device management information and is shared among multiple processes, while the memory bound to the driver is mapped to the virtual interface layer through MMAP as a data channel from the user layer to the driver layer.

[0030] First, explain the overall framework data flow diagram, using a top-down explanation approach (taking SPI devices as an example)

[0031] (1) The device Noos driver corresponds to an actual device mounted under an FPGA. Its main function is to provide a general fine-grained hardware function call interface for the upper HAL (Hardware Abstraction Layer) layer.

[0032] (2) The Noos driver needs to bind a virtual device interface. This virtual interface layer is mainly used to communicate with the SPI device attached to the FPGA, so it mainly defines the communication protocol with the specific device. Although they are all based on the SPI bus, the communication protocols (instructions, data structures, etc.) of each chip are different.

[0033] (3) Next, the data reaches the SPI virtual interface layer, which is a very critical layer. It defines the communication protocol with the FPGA SPI device communication module. The SPI bus under the FPGA is controlled by controlling the AXI register of the FPGA SPI module.

[0034] ① Here we need to distinguish between the FPGA SPI device communication module and the FPGA SPI communication module. Both are FPGA SPI bus modules, but the former is mainly used for basic communication with ARM, while the latter is used by ARM to control the FPGA SPI to communicate with the SPI devices attached to it. The latter's communication is based on the former's communication. This is also the origin of the name of the virtual interface.

[0035] ②Then this interface layer can easily expand other interfaces in the Linux application layer, such as UART, CAN and other interfaces. Different virtual buses correspond to the actual bus modules on the FPGA side.

[0036] ③ All codes above this level have good portability. The porting of this layer of code mainly depends on the FPGA chip, but the main code logic should be the same.

[0037] ④ It is worth mentioning that this layer of interface adds a read-write mutex lock to make its read and write operations atomic, so that the communication between devices on the same bus is mutually exclusive.

[0038] ⑤ For different virtual buses, they actually correspond to the actual bus modules on the FPGA side, so their registers are mutually exclusive, that is, the virtual buses are structurally mutually exclusive, so there is no need to lock them.

[0039] (4) SPI-FPGA communication layer: This is the driver layer that controls how the CPU controls the CPU’s SPI module to communicate with the FPGA’s SPI module.

[0040] ① This is SPI-FPGA communication, but this solution also implements mdio-FPGA communication. The underlying communication interface is not limited. Due to the flexibility of FPGA, even Ethernet interfaces with larger bandwidth such as serdis or gmii interfaces can be used. The premise is that the CPU or platform needs to support such interfaces.

[0041] ②The migration of this layer depends on the CPU and FPGA chips, and the communication interface finally selected.

[0042] ③This layer will call the Kernel's IO framework to enhance portability and shorten the development cycle. For example, the SPI-FPGA driver of the current process will set the SPI parameters and implement the optimized SPI basic read and write interface to efficiently utilize the bandwidth of the communication interface.

[0043] ④This layer is the bottom layer of ARM and FPGA communication logic. The upper virtual interface layer is built on this layer. The communication bandwidth of this layer is used to expand various communication interfaces of the upper layer to share the bandwidth of this layer. This is also one of the concepts of virtualization, resource pooling. Here is the pooling of communication resources.

[0044] (5) The next step is the communication between specific hardware modules: ARM operates various communication modules of FPGA through the SPI-FPGA communication layer, and ultimately controls the devices under these communication module buses. Here we only take SPI devices as an example. Due to the flexibility of FPGA, it can also control various FPGA communication modules, such as UART, CAN, etc.

[0045] ① It is worth noting that this layer reflects the overall logic of transferring ARM IO resources to FPGA to achieve ARM IO expansion. ARM only moves IO resources to FPGA through the SPI communication module.

[0046] The framework design scheme described in the present invention adopts a framework that separates actual interfaces from virtual interfaces, realizes flexible configuration and optimization of interface resources, avoids the high cost and complexity of hardware modification, and thus saves development and upgrade costs; it also uses the driver framework that is naturally decoupled from the underlying interface of Noos, which is characterized by high decoupling and simplicity, making the entire system easy to be ported to different Linux-based CPU+FPGA platforms. This feature is particularly suitable for changing business environments and technology iterations, providing enterprises with a flexible technology adaptation path; thus, by using FPGA to expand ARM IO, resources can be allocated and managed more effectively.

[0047] Embodiment 2

[0048] like Figure 2 As shown, the present invention further provides a driving method applied to the framework design system based on FPGA expansion ARM interface as described above, wherein the driving method mainly includes the following:

[0049] First, after the driver is loaded, the Probe logic is triggered to complete the entire initialization process, and then the SPI bus bound to the device tree is configured to optimize the parameters of the SPI bus, thereby optimizing the data link from the SPI framework to the SPI controller. Then, the SPI controller on the ARM side of the driver is started using the configured SPI bus parameters, and the IOCTL OPS is initialized to abstract the transmission instructions of the SPI communication interface to the user, while the data and specific transmission parameters are copied in the user space using the driver memory mapped by MMAP; after the transmission instruction is issued, the driver will parse the contents of the specified memory to complete the specific transmission logic.

[0050] It should be noted that the above-mentioned data and specific transmission parameters are further explained, wherein the data is mainly the specific sequence content of the SPI, that is, the data sequence that needs to be transmitted to the SPI module (also called the SPI controller); the specific transmission parameters include the virtual device ID, the SPI sequence length and the read-write method screening parameters.

[0051] In the embodiment of the present invention, the driver will parse the content in the specified memory to complete the specific transmission logic. The specific steps are: receiving the transmission control instruction from the user layer through IOCTL to selectively call the driver method, and its main transmission method is to call the internal specific transmission function, which adjusts the transmission logic of the underlying SPI by configuring the private parameters of the Linux SPI driver module device model, such as the number of words in a CS signal, the byte order selection, the rise and fall period of the CS chip select signal, the SPI rate, etc.; in order to meet the communication timing between the bottom layer and the FPGA while increasing the SPI bus bandwidth as much as possible. Finally, the kernel DMA chain is called through SPI_SYNC to realize the actual transmission.

[0052] Specifically, the specific transmission function called inside mainly includes the function FPGA_SPI_multi_write_read function for executing a single read and write sequence; FPGA_SPI_write_read_sequence can execute the read and write sequence bound to the virtual device according to the passed-in parameters. The maximum sequence length used by each virtual device is 256 bytes, and reading and writing can be interspersed. The read data is stored in the kernel memory mapped to the virtual interface layer through MMAP in the previous application according to the order, and the virtual interface layer uses the same structure pointer to access this kernel memory to realize the data transfer from the kernel layer to the user layer; FPGA_SPI_multi_write function supports the transmission of large amounts of data, and will copy the data according to the memory location specified by the user space after re-applying for the kernel memory space. After that, the transmission process optimized for large files is carried out, and the transferable file transfer size is limited by the size of the memory space. The methods of adapting these functions to the underlying SPI transmission are to adjust the transmission logic of the underlying SPI by configuring the private parameters exposed by the Linux SPI driver module device model that comes with the Linux subsystem to meet the communication timing between the underlying layer and the FPGA while improving the SPI bus bandwidth. It is specially noted here that the driver module will call the interface of the Linux SPI driver module, and the Linux SPI subsystem is a common system in this field.

[0053] In order to better understand the embodiments of the present invention, the implementation of the underlying communication interface driver (based on SPI / mdio): take the SPI_FPGA.ko driver process as an example.

[0054] (1) After the driver is loaded, the probe logic is triggered and the entire initialization process is completed in the probe logic.

[0055] (2) First, configure the SPI bus bound to the device tree, and further configure the parameters of the SPI bus to better adapt to the SPI module at the bottom of the FPGA.

[0056] (3) Using the configured parameters, an optimized SPI communication interface is implemented in this driver.

[0057] ①It is worth noting that the FPGA_SPI_multi_write_read interface is implemented, which can achieve continuous write-and-read operations. This greatly optimizes the SPI communication rate, because many SPI upper-layer operations require writing before reading.

[0058] (4) Then, IOCTL OPS is initialized. This is a framework for the kernel to expose interfaces to the user layer. The various optimized SPI communication interfaces mentioned above are bound to it for the user layer to call.

[0059] (5) Finally, it should be noted that some SPI communication interfaces are also exposed to other drivers at the same level through the EXPORT declaration in this driver. Drivers at the same level can use the interfaces exposed by this driver to communicate with the FPGA chip.

[0060] In summary, the present invention has the following beneficial effects:

[0061] Cost efficiency: In the existing ARM+FPGA platform, there are usually restrictions on the adjustment of hardware resources, especially when the platform has become mature or the modification space is limited, such as when the platform has only mismatched interface resources and the interface rate can meet the requirements. The present invention realizes flexible configuration and optimization of interface resources through a software framework, avoiding the high cost and complexity of hardware modification, thereby saving development and upgrade costs.

[0062] High portability: Due to the adoption of the Noos-based driver framework, which is characterized by high decoupling and simplicity, the entire system can be easily ported to different Linux-based CPU+FPGA platforms. This feature is particularly suitable for changing business environments and technology iterations, providing enterprises with a flexible technology adaptation path.

[0063] Design flexibility: In the early stage of system design, by adopting the solution of the present invention, developers can achieve effective expansion of IO resources without changing the hardware layout. This not only increases the flexibility of the design, but also allows for rapid response without major changes when project requirements change or technology is updated.

[0064] Improve system performance and reliability: By using FPGA to expand ARM IO, resources can be allocated and managed more effectively. The high programmability and parallel processing capabilities of FPGA make data processing more efficient, while reducing the burden on the ARM processor and enhancing the overall performance and stability of the system.

[0065] Easy to maintain and update: The software framework has a clear structure, which is easy for developers to understand and maintain. Any updates to IO expansion requirements, such as adding new communication interface support, can be achieved by simply updating the underlying driver and virtual interface layer modules without complex hardware redesign.

[0066] Finally, it should be noted that the above preferred embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail through the above preferred embodiments, those skilled in the art should understand that various changes can be made in form and details without departing from the scope defined by the claims of the present invention.

Claims

1. A framework design system based on FPGA expansion of ARM interface, applied to ARM+FPGA platform, characterized in that: The framework design system includes a software side and an FPGA side connected to the software side through an SPI-FPGA communication layer, wherein the software side is composed of a device Noos driver layer, a virtual interface layer and a virtual extension interface layer from bottom to top, wherein the device Noos driver layer drives an actual device corresponding to an FPGA mounted under the device, and is used to provide a general fine-grained hardware function call interface for the device layer; the virtual interface layer is connected to the device Noos layer by binding a virtual device interface, and is used to communicate with the SPI device mounted under the FPGA; one end of the virtual extension interface layer is connected to the virtual interface layer, and the other end is connected to the SPI module of the SPI-FPGA communication layer, and is used to adapt the communication protocol of the FPGA SPI bus module on the FPGA side and control the FPGA SPI bus module by controlling the AXI register of the FPGA SPI module, and finally control the device mounted thereunder.

2. According to claim 1, the framework design system based on FPGA expansion ARM interface is characterized in that: The FPGASPI bus module includes an FPGA SPI communication module and an FPGA SPI device module. The FPGA SPI device module performs basic communication with the ARM. The FPGA SPI communication module controls the ARM to enable the FPGA SPI module to communicate with the SPI device connected thereto.

3. According to the framework design system based on FPGA expansion ARM interface according to claim 1, it is characterized in that: The virtual extended interface layer can extend the UART interface, CAN interface and I2C interface in addition to the SPI interface in the Linux application layer.

4. According to claim 3, the framework design system based on FPGA expansion ARM interface is characterized in that: The ARM expands various communication interfaces through the communication bandwidth of the SPI-FPGA communication layer to transmit and control the communication module on the FPGA side, so as to ultimately control the devices under the communication bus module.

5. According to claim 1, the framework design system based on FPGA expansion ARM interface is characterized in that: The SPI-FPGA communication layer is the bottom layer of the ARM and FPGA communication logic. The communication layer is connected to the FPGA SPI interface by the ARM SPI controller to read and write the AXI registers of other communication modules inside the FPGA, thereby reading and writing the registers of the devices connected to the FPGA communication bus.

6. The framework design system based on FPGA expansion ARM interface according to claim 1 is characterized in that: The virtual interface layer, also known as the virtual device layer, uses a virtual device information management solution of static compilation, shared memory, and driver memory mapping to provide an abstract interface for virtual device management for the upper layer; the shared memory is used to store virtual device management information and is shared among multiple processes, while the memory bound to the driver is mapped to the virtual interface layer through MMAP as a data channel from the user layer to the driver layer.

7. A driving method applied to the framework design system based on FPGA expansion ARM interface as claimed in any one of claims 1 to 6, characterized in that: The driving method mainly includes the following: First, after the driver is loaded, the Probe logic is triggered to complete the entire initialization process, and then the SPI bus bound to the device tree is configured to optimize the data link from the SPI framework to the SPI controller by optimizing the parameters of the SPI bus; then the configured SPI bus is used to start driving the optimized CPU-side SPI module; the IOCTL OPS is initialized to abstract the transmission control instructions of the SPI communication interface to the user, and the data and specific transmission parameters are copied in the user space using the driver memory mapped by MMAP; after the transmission instruction is issued, the driver will parse the contents of the specified memory to complete the transmission logic.

8. The driving method according to claim 7, characterized in that: The driver will parse the contents in the specified memory to complete the specific steps of the transmission logic: receiving transmission control instructions from the user layer through IOCTL and selectively calling the corresponding driver method, and its main transmission method is through calling the internal specific transmission function, receiving transmission control instructions from the user layer through IOCTL and selectively calling the corresponding driver method, and its main transmission method is through calling the internal specific transmission function, which adjusts the transmission logic of the underlying SPI by configuring the private parameters of the Linux SPI driver module device model to meet the communication timing between the underlying layer and the FPGA while improving the SPI bus bandwidth.

Citation Information

Cited By

  • Multifunctional controller based on SPI bus

    CN121387797A