NVMe SSD storage method and system based on programmable fusion chip
By using NVMe SSD storage method with programmable fusion chips in the SSD storage system, using editable logical array PL and 4-core processor PS, the file system management of NVMe SSD is realized, and the lack of flexibility in the existing technology is solved. Problem, providing flexible interface management and efficient storage performance.
Patent Information
- Application Number
- CN202111451927.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-01
- Publication Date
- 2024-12-03
- Estimated Expiration
- 2041-12-01
AI Technical Summary
The existing SSD storage methods lack flexibility in file system management, and FPGAs are difficult to implement file system management, and the CPU peripheral interface resources are limited, so the CPU needs to be replaced to adapt to different data source interfaces, which lacks flexibility.
Using the NVMe SSD storage method based on programmable fusion chips, the file system management of NVMe SSD is realized through editable logical array PL and 4-core processor PS, and internal interconnection is used by PCIe bus and AXI bus, combining DDR memory and NVRAM. Provides non-real-time write and real-time write modes, simulates PCIe cores through programmable logical array PL to realize flexible interface management of NVMe SSDs.
Realize file system management of NVMe SSD without changing the CPU for interface adaptation, improves system flexibility and storage performance, provides diversified data source interfaces and efficient storage mode, ensuring data security and reliability .
Smart Images

Figure CN114116527B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of SSD storage technology, and specifically relates to an NVMe SSD storage method and system based on a programmable fusion chip. Background Art
[0002] SSD devices have been widely used in many fields such as home computers, cloud storage, and big data storage due to their large capacity, fast storage rate, and low power consumption.
[0003] There are two main methods for SSD storage: 1) Use FPGA to simulate PCIe core as RC end, connect NVMeSSD for storage. This storage method mostly uses data stream mode to achieve high-speed data storage, but it is difficult for FPGA to implement file system management for SSD. For SSD with file system management, users do not need to pay attention to the specific physical location of data storage, and can access SSD by operating file reading and writing; 2) Use CPU's PCIe controller as RC end to connect NVMeSSD, and use CPU to manage NVMe SSD file system, but CPU peripheral interface resources are limited. When the data source interface is changed, it is often necessary to replace the new CPU for interface adaptation, which lacks flexibility. Summary of the invention
[0004] In order to solve the above-mentioned technical problems, the present invention provides an NVMe SSD storage method and system based on a programmable fusion chip. The storage method realizes the management of the SSD file system and does not require the replacement of the CPU for interface adaptation, thereby increasing the flexibility of the system.
[0005] The technical solution adopted by the present invention is:
[0006] An NVMe SSD storage method based on a programmable fusion chip includes the following steps:
[0007] S1, the editable logic array PL obtains one or more data sources according to different addresses, and splits the file information of the data source into a MSG part and a DATA part and caches them in a DDR controller;
[0008] The MSG part is the command attribute, including the file command type and data length, and the DATA part is the data to be saved;
[0009] S2. The editable logic array PL maps the DDR controller storage space to the PS. The PS divides the DATA part into several data blocks according to the physical address alignment. The several data blocks form a circular queue. The PS parses the MSG part and records the tail pointer of the MSG that has been parsed. After completing the data storage operation, the tail pointer of the DATA that has been stored is recorded.
[0010] S3. When the data source file flows into the PL end, the PL records the current pointer address of MSG, i.e., the last MSG pointer address in the current cache, and the current pointer address of DATA, i.e., the last DATA pointer address in the current cache;
[0011] S4, check whether the difference between the MSG tail pointer and the MSG current pointer is greater than the set threshold: if it is greater than the threshold, update the MSG current pointer and proceed to the next step; if it is not greater than the threshold, return to the step before checking to wait for the MSG tail pointer to be updated;
[0012] S5, check whether the difference between the DATA tail pointer and the current DATA pointer is greater than the set threshold: if it is greater than the threshold, start the PS interrupt detection service program; if it is not greater than the threshold, return to the step before checking to wait for the MSG current pointer to be updated;
[0013] S6. Whether the PS interrupt detection service routine detects an interrupt: if detected, enter the interrupt processing; if not, return to the state before the interrupt detection;
[0014] The interrupt processing is specifically as follows: traverse each partition MSG current pointer to see if it is updated: if updated, execute the command given in the protocol header and update the MSG tail pointer;
[0015] S7, start the storage task service line program and wait for the acquisition signal;
[0016] S8, after updating the MSG tail pointer, release the semaphore of the storage task to the waiting acquisition signal of the storage task service line program;
[0017] S9, the storage task service line program parses the MSG information, calls the corresponding disk writing operation SSD, and updates the DATA tail pointer after the disk writing is completed;
[0018] S10, pull down the PS interrupt detection service program to notify the PL that the instruction is finished.
[0019] Furthermore, after the completion of step S10, it also includes opening the file, and the specific operations are as follows: after the PS receives the open file instruction, it creates a file descriptor; after closing the file, the specific operations are as follows: after the PS receives the close file instruction, it calls the fsync interface for the specified file, and after completing the data storage, it closes the file descriptor.
[0020] Furthermore, the storage mode of the data source is set to a non-real-time writing mode and a real-time writing mode.
[0021] Furthermore, the non-real-time write mode is completed in conjunction with the flush interface: a window threshold value of 128KB is set on the PS, and when the amount of data in the DATA buffer reaches the threshold value, a write operation is executed to write to the disk, and at the same time, the O_DIRECT mode is used without kernel cache to directly write data to the disk. Through the flush instruction, the remaining data less than 128KB in the DATA buffer is written to the SSD, and the DATA tail pointer is updated after completion.
[0022] Furthermore, the specific operation of the real-time write mode is as follows: when the real-time write file flows into the PL end, the PL stores the file name and corresponding data in the NVRAM for backup, and pulls the flag bit high, indicating that the data has not yet been written to the disk; when the PS parses the MSG as a real-time write instruction, it immediately writes the corresponding data to the disk, and calls fsync to write the data to the disk. After completion, the DATA tail pointer is updated and the flag bit is pulled low; during the next power-on initialization process, the flag bit status is judged: if it is high, the data is flushed into the file according to the file name in the NVRAM; if it is low, the NVRAM is cleared.
[0023] An NVMe SSD storage system based on a programmable fusion chip comprises a plurality of data source modules and a host computer running on a PC, and also comprises a programmable fusion chip and an NVMe SSD. The programmable fusion chip adopts an FMQL45T900 chip, which integrates a PS of a 4-core processor and a PL of a programmable logic array, and the PL and the PS are respectively externally connected with DDR memories; the NVMe SSD is connected to the PL through a PCIe bus; one end of the PS is internally interconnected with the PL through an AXI bus, and the other end of the PS is connected to the host computer through a standard Ethernet interface.
[0024] Furthermore, the PL is externally equipped with a non-volatile memory NVRAM.
[0025] Furthermore, the PS end is provided with an Ethernet controller, which is connected to the PHY controller via an RGMII interface, the PHY controller is connected to an RJ45, and the RJ45 is connected to the host computer.
[0026] Furthermore, the Ethernet controller has a Gigabit network port that is extended outwardly through the RGMII interface and the PHY controller.
[0027] The invention has the following beneficial effects: 1) taking the FMQL45T900 programmable fusion chip as a carrier, the PL end thereof simulates a PCIe core and an external NVMe SSD, and the PS end controls the PCIe core via the AXI bus inside the chip to realize the management of the NVMe SSD file system; 2) utilizing the flexible and programmable characteristics of the PL to make the data source interface diverse and flexible with high portability; 3) by aligning and planning the physical address and adopting direct IO management, the disk storage performance of the system is improved; 4) the data source disk storage mode is provided with a non-real-time write mode and a real-time write mode: the non-real-time write mode is used for storing large amounts of data and is used in conjunction with a flush instruction; the real-time write mode is used for recording important data and is used for re-flushing the data that has not been completed in the NVRAM into the SSD file after an abnormal power failure; 5) the PS end leads out an RGMII interface and is interconnected with a PC through an Ethernet PHY to realize the management of the SSD file system by the PC. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the accompanying drawings in the embodiments of the present invention.
[0029] Figure 1 It is a structural schematic diagram of an NVMe SSD storage system based on a programmable fusion chip of the present invention;
[0030] Figure 2 It is a flowchart of file system management in an NVMe SSD storage method based on a programmable fusion chip of the present invention;
[0031] Figure 3 It is a file storage flow chart of an NVMe SSD storage method based on a programmable fusion chip of the present invention.
[0032] The numbers in the figure are as follows: 1. Data source module; 2. Programmable fusion chip; 201. PL; 202. PS; 3. Host computer; 4. SSD; 5. DDR memory; 6. NVRAM; 7. PHY controller; 8. RJ45. DETAILED DESCRIPTION
[0033] The relevant abbreviations mentioned in the present invention are as follows: NVMe—Non-Volatile Memory Express; SSD—Solid State Disk; PL—Progarmmable Logic; PS—Processing System; RC—Root Complex; NVRAM—Non-Volatile Random Access Memory.
[0034] Example 1
[0035] like Figure 1 As shown, an NVMe SSD storage system based on a programmable fusion chip includes several data source modules 1, a host computer 3 running on a PC, a programmable fusion chip 2 and an NVMe SSD 4. The programmable fusion chip 2 adopts an FMQL45T900 chip, which integrates a 4-core processor PS202 and a programmable logic array PL201. The PS202 end is externally mounted with a 1GB Ziguang DDR memory 5 for running uboot, Linux kernel, root file system and application programs. The PL201 end is externally mounted with a 1GB Ziguang DDR memory 5 and a non-volatile memory NVRAM6. The DDR memory 5 is used to cache data to be stored, and the entire DDR space is mapped to PS202 for access by PS202; the non-volatile memory NVRAM6 is used to recover data in the event of abnormal power failure. The NVMe SSD4 is connected to PL201 via a PCIe bus; one end of the PS202 is internally interconnected with PL201 via an AXI bus, and the other end is communicatively connected to the host computer 3 via a standard Ethernet interface, specifically as follows: the PS202 end is provided with an Ethernet controller, which is connected to the PHY controller 7 via an RGMII interface, the PHY controller 7 is connected to RJ458, and the RJ458 is connected to the host computer 3, so that PS202 can perform system management functions on NVMe SSD4 files.
[0036] Further in this embodiment, the Ethernet controller is extended with a Gigabit network port through the RGMII interface and the PHY controller 7 .
[0037] The working principle of the NVMe SSD storage system based on programmable fusion chip is as follows: the PL end simulates the PCIe core as the RC end of the PCIe bus, and the NVMe SSD is used as the EP end. The PCIe core is connected to multiple data source modules and communicates with one or more data sources through different addresses; after the PL end configures the PCIe core rate and the BAR space address, the PCIe core register is mapped to the PS through the AXI bus. The Linux operating system runs on the PS, accesses the PCIe core through ioremap in the kernel space, configures the BAR space address, and registers the MSI interrupt. The specific operation of the PS is as follows: the PS modifies the device tree according to the mapping address and the BAR space address, and the Linux kernel initializes the PCIE controller by interpreting the device tree configuration. After the kernel runs, the nvme0 device description file is found in the / dev directory, and the NVMe SSD is partitioned, formatted, and mounted by fdisk to prepare for subsequent file access.
[0038] Example 2
[0039] like Figure 2The figure shows the flow chart of SSD file system management. The operation steps are as follows: 1) The host computer starts and sends a connection request code; 2) Determine whether the connection request code is correct: If it is correct, the PS receives network data, parses and processes the host computer's commands for obtaining SSD information, formatting SSD, repartitioning SSD, and importing and exporting files; 3) After processing the instructions, traverse each partition of the SSD, upload the file name, file size and file time information in each partition to the host computer, and the host computer displays the information of each partition of the SSD.
[0040] The SSD file system management includes: 1) obtaining SSD file information: the upper computer sends an instruction to obtain partition information, and the lower computer program on the PS side traverses each partition and uploads the file name, file size, file index number and other information of each partition to the upper computer for display; 2) importing and exporting SSD files: the PS side builds an FTP server on the Linux operating system, and the upper computer imports and exports SSD files through FTP instructions; 3) re-partitioning SSD files: the upper computer sends an SSD re-partitioning instruction and the size information of each partition, and the lower computer program on the PS side calls the fdisk instruction to re-partition the SSD according to the size requirements, and after completion, upload the information of each partition to the upper computer for display; 4) erasing / deleting SSD files: the upper computer sends an erase instruction and file path, the PS side receives the information, deletes the specified file, and re-uploads the file name, file size, file index number and other information of each partition to the upper computer for display.
[0041] Specifically, Figure 3 As shown, an NVMe SSD storage method based on a programmable fusion chip includes the following steps:
[0042] S1, the editable logic array PL obtains one or more data sources according to different addresses, and splits the file information of the data source into a MSG part and a DATA part and caches them in a DDR controller;
[0043] The MSG part is the command attribute, including the file command type and data length, and the DATA part is the data to be saved;
[0044] S2. The editable logic array PL maps the DDR controller storage space to the PS. The PS divides the DATA part into several data blocks according to the physical address alignment. The several data blocks form a circular queue. The PS parses the MSG part and records the tail pointer of the MSG that has been parsed. After completing the data storage operation, the tail pointer of the DATA that has been stored is recorded.
[0045] S3. When the data source file flows into the PL end, the PL records the current pointer address of MSG, i.e., the last MSG pointer address in the current cache, and the current pointer address of DATA, i.e., the last DATA pointer address in the current cache;
[0046] S4, check whether the difference between the MSG tail pointer and the MSG current pointer is greater than the set threshold: if it is greater than the threshold, update the MSG current pointer and proceed to the next step; if it is not greater than the threshold, return to the step before checking to wait for the MSG tail pointer to be updated;
[0047] S5, check whether the difference between the DATA tail pointer and the current DATA pointer is greater than the set threshold: if it is greater than the threshold, start the PS interrupt detection service program; if it is not greater than the threshold, return to the step before checking to wait for the MSG current pointer to be updated;
[0048] S6. Whether the PS interrupt detection service routine detects an interrupt: if detected, enter the interrupt processing; if not, return to the state before the interrupt detection;
[0049] The interrupt processing is specifically as follows: traverse each partition MSG current pointer to see if it is updated: if updated, execute the command given in the protocol header and update the MSG tail pointer;
[0050] S7, start the storage task service line program and wait for the acquisition signal;
[0051] S8, after updating the MSG tail pointer, release the semaphore of the storage task to the waiting acquisition signal of the storage task service line program;
[0052] S9, the storage task service line program parses the MSG information, calls the corresponding disk writing operation SSD, and updates the DATA tail pointer after the disk writing is completed;
[0053] S10, pull down the PS interrupt detection service program to notify the PL that the instruction is finished.
[0054] Further, in this embodiment, after completion of step S10, it also includes opening a file, and the specific operations are as follows: after the PS receives the command to open a file, it creates a file descriptor; after closing a file, the specific operations are as follows: after the PS receives the command to close a file, it calls the fsync interface for the specified file, and after completing the data storage, it closes the file descriptor.
[0055] Further in this embodiment, the storage mode of the data source is set to a non-real-time writing mode and a real-time writing mode.
[0056] Further, in this embodiment, the non-real-time write mode is completed in conjunction with the flush interface: a window threshold value of 128KB is set on the PS, and when the amount of data in the DATA buffer reaches the threshold value, a write operation is executed to write to the disk, and at the same time, the O_DIRECT mode is used without kernel cache to directly write data to the disk. Through the flush instruction, the remaining data less than 128KB in the DATA buffer is written to the SSD, and the DATA tail pointer is updated after completion.
[0057] Further, the real-time write mode is specifically operated as follows: when a real-time write file flows into the PL end, the PL stores the file name and corresponding data in the NVRAM for backup, and pulls the flag bit high, indicating that the data has not yet been written to the disk; when the PS parses the MSG as a real-time write instruction, the corresponding data is immediately written to the disk, and fsync is called to write the data to the disk. After completion, the DATA tail pointer is updated and the flag bit is pulled low; during the next power-on initialization process, the flag bit status is judged: if it is high, the data is flushed into the file according to the file name in the NVRAM; if it is low, the NVRAM is cleared.
[0058] The present invention adopts the FMQL45T900 programmable fusion chip of Fudan Microelectronics, which integrates PL (programmable logic array FPGA) and PS (quad-core cortex-a7 ARM) at the same time. The PL end simulates the PCIe core as the RC end, and the PS end controls the PCIe core to realize file system management for NVMe SSD. The PL end can simultaneously expand multiple high-speed interfaces such as PCIe interface and SRIO as the interface of the data source, which greatly enriches the data source interface.
[0059] The embodiments described above are merely descriptions of preferred implementation modes of the present invention and are not intended to limit the scope of the present invention. Without departing from the principles and essence of the present invention, various modifications and improvements made to the technical solutions of the present invention by ordinary technicians in this field should all fall within the scope of protection determined by the claims of the present invention.
Claims
1. An NVMe SSD storage method based on a programmable fusion chip, characterized in that: The steps include: S1, the editable logic array PL obtains one or more data sources according to different addresses, and splits the file information of the data source into a MSG part and a DATA part and caches them in a DDR controller; The MSG part is the command attribute, including the file command type and data length, and the DATA part is the data to be saved; S2. The editable logic array PL maps the DDR controller storage space to the PS. The PS divides the DATA part into several data blocks according to the physical address alignment. The several data blocks form a circular queue. The PS parses the MSG part and records the tail pointer of the MSG that has been parsed. After completing the data storage operation, the tail pointer of the DATA that has been stored is recorded. S3. When the data source file flows into the PL end, the PL records the current pointer address of MSG, i.e., the last MSG pointer address in the current cache, and the current pointer address of DATA, i.e., the last DATA pointer address in the current cache; S4. Check whether the difference between the MSG tail pointer and the MSG current pointer is greater than the set threshold: if it is greater than the threshold, update the MSG current pointer and proceed to the next step; If it is not greater than the threshold, return to the step before checking and wait for the MSG tail pointer to be updated; S5, check whether the difference between the DATA tail pointer and the current DATA pointer is greater than the set threshold: if it is greater than the threshold, start the PS interrupt detection service program; if it is not greater than the threshold, return to the step before checking to wait for the MSG current pointer to be updated; S6. Whether the PS interrupt detection service routine detects an interrupt: if detected, enter the interrupt processing; if not, return to the state before the interrupt detection; The interrupt processing is specifically as follows: traverse each partition MSG current pointer to see if it is updated: if updated, execute the command given in the protocol header and update the MSG tail pointer; S7, start the storage task service line program and wait for the acquisition signal; S8, after updating the MSG tail pointer, release the semaphore of the storage task to the waiting acquisition signal of the storage task service line program; S9, the storage task service line program parses the MSG information, calls the corresponding disk writing operation SSD, and updates the DATA tail pointer after the disk writing is completed; S10, pull down the PS interrupt detection service program to notify the PL that the instruction is finished.
2. According to the NVMe SSD storage method based on a programmable fusion chip according to claim 1, it is characterized in that: After the completion of step S10, the step also includes opening a file, and the specific operations are as follows: after the PS receives the command to open a file, it creates a file descriptor; after the PS receives the command to close a file, it calls the fsync interface for the specified file, and after completing the data storage, it closes the file descriptor.
3. The NVMe SSD storage method based on a programmable fusion chip according to claim 1, characterized in that: The storage mode of the data source is set to a non-real-time writing mode and a real-time writing mode.
4. The NVMe SSD storage method based on a programmable fusion chip according to claim 3, characterized in that: The non-real-time write mode is completed in conjunction with the flush interface: a window threshold of 128KB is set on the PS, and when the amount of data in the DATA buffer reaches the threshold, a write operation is executed to write to the disk, and at the same time, the O_DIRECT mode is used without kernel cache to directly write data to the disk. Through the flush instruction, the remaining data less than 128KB in the DATA buffer is written to the SSD, and the DATA tail pointer is updated after completion.
5. The NVMe SSD storage method based on a programmable fusion chip according to claim 3, characterized in that: The specific operation of the real-time write mode is as follows: when the real-time write file flows into the PL end, the PL stores the file name and the corresponding data in the NVRAM for backup, and pulls the flag bit high, indicating that the data has not been written to the disk this time; when the PS parses the MSG as a real-time write instruction, it immediately writes the corresponding data to the disk, and calls fsync to write the data to the disk. After completion, the DATA tail pointer is updated and the flag bit is pulled low; during the next power-on initialization process, the flag bit state is judged: if it is high, the data is flushed into the file according to the file name in the NVRAM; If low, clear NVRAM.
6. A system for implementing the NVMe SSD storage method based on a programmable fusion chip according to any one of claims 1 to 5, characterized in that: The system includes several data source modules and a host computer running on a PC, and is characterized in that it also includes a programmable fusion chip and an NVMe SSD. The programmable fusion chip adopts an FMQL45T900 chip, which integrates a PS of a 4-core processor and a PL of a programmable logic array, and the PL and PS are respectively externally connected with a DDR memory; the NVMe SSD is connected to the PL through a PCIe bus; one end of the PS is internally interconnected with the PL through an AXI bus, and the other end is connected to the host computer through a standard Ethernet interface.
7. The NVMe SSD storage system based on a programmable fusion chip according to claim 6, characterized in that: The PL is externally equipped with a non-volatile memory NVRAM.
8. The NVMe SSD storage system based on a programmable fusion chip according to claim 6, characterized in that: The PS end is provided with an Ethernet controller, which is connected to the PHY controller via an RGMII interface. The PHY controller is connected to an RJ45, and the RJ45 is connected to the host computer.
9. The NVMe SSD storage system based on a programmable fusion chip according to claim 8, characterized in that: The Ethernet controller is extended with a Gigabit network port through the RGMII interface and the PHY controller.
Citation Information
Patent Citations
A system and method for negative feedback cache data flushing in a primary storage system
CN109324752A
Industrial visual memory management system based on ZYNQ platform
CN213876689U
Secondary storage facility with serial transfer of control messages
US4183084A
