SPI Flash backdoor reading and writing operating system, method and computer equipment

The SPI Flash backdoor reads and writes the SPI controller channel of the operating system and the system bus channel to access the SPI Flash chip in combination, which solves the problem of low efficiency of SPI Flash backdoor read and write verification in the existing technology, and enables rapid verification and verification in the early stage of chip design. Improvements have improved the efficiency of chip system development.

CN118295605BActive Publication Date: 2024-09-10CORIGINE (SHANGHAI) INC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410727086.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-06
Publication Date
2024-09-10
Estimated Expiration
2044-06-06

AI Technical Summary

Technical Problem

The existing technology is relatively lacking in research on SPI Flash backdoor read and write prototype verification, resulting in low chip verification efficiency, inability to carry out verification work in the early stages of chip design, and inability to quickly discover defects and errors in RTL design.

Method used

Provides an SPI Flash backdoor reading and writing operating system that accesses the external SPI Flash chip through the SPI controller channel and system bus channel. It combines the user reading and writing of the SPI controller channel and the backdoor reading and writing of the system bus channel to verify the written data and Read the data correctly and quickly locate problems in chip design.

Benefits of technology

It realizes chip startup, operating system startup, driver verification, application software verification and other work in the early stage of chip design, improves the efficiency of chip system development and verification, and can quickly discover and improve defects and errors in RTL design.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118295605B
    Figure CN118295605B
Patent Text Reader

Abstract

The present application provides an SPI Flash backdoor read-write operating system, method and computer equipment, and sets two channels for accessing an external SPI Flash chip: an SPI controller channel and a system bus channel, one of the system bus channel and the SPI controller channel is used to write data to the sector address specified by the SPI Flash chip, and the other reads data from the sector address specified by the SPI Flash chip to verify whether the written data is consistent with the read data. The SPI controller channel is used as a user-side channel, and the system bus channel is a backdoor channel. Through the user read-write of the SPI controller channel, combined with the backdoor read-write of the system bus channel, problems in chip design can be quickly located, and chip startup, operating system startup, driver verification, application software verification and other tasks can be carried out in the early stage of chip design, thereby improving the efficiency of chip system development and verification.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of FPGA (field programmable logic array) prototype verification technology, and in particular to a SPI Flash backdoor read and write operating system, method and computer device. Background Art

[0002] In recent years, my country's integrated circuits have entered a period of rapid development, and the demand for chip verification has continued to increase. In the chip design industry, the cost of taping out a designed chip is very high. Before taping out, it is necessary to verify that the code is fully functional, eliminate all errors in its front-end logic RTL (Register Transfer Level) design and architecture design, and support driver software and application software testing before chip taping out. Using an FPGA prototype verification platform is the most advanced method for chip verification today. FPGA can run the functions of the entire chip at a speed close to that of the actual chip. Compared with the speed defects of software simulation work, FPGA prototype verification is more likely to discover defects and errors in RTL design. It has become an important method for large-scale chip verification, and FPGA can be repeatedly erased and written, which can adapt to the repeated iterations of chip design verification.

[0003] SPI Flash is the most commonly used storage device, and of course it has become an important part of FPGA prototype verification. The existing technology is relatively scarce in the field of SPI Flash backdoor read and write prototype verification. However, SPI Flash backdoor read and write can more easily find defects and errors in RTL design, so the efficiency of chip verification is low, and verification work cannot be carried out in the early stage of chip design. Summary of the invention

[0004] In view of the shortcomings of the prior art described above, the purpose of this application is to provide an SPI Flash backdoor read and write operating system, method and computer device, which are used to solve the technical problems of chip startup, operating system startup, driver verification, application software verification and other tasks in the early stage of chip design, and improve the efficiency of chip system development and verification.

[0005] To achieve the above-mentioned purpose and other related purposes, the first aspect of the present application provides an SPI Flash backdoor read-write operating system for accessing an external SPI Flash chip, including an SPI controller channel and a system bus channel, wherein the SPI controller channel and the system bus channel can both write data to and read data from the SPI Flash chip; wherein: one of the system bus channel and the SPI controller channel is used to write data to a sector address specified by the SPI Flash chip, and the other reads data from a sector address specified by the SPI Flash chip to verify whether the written data is consistent with the read data; an SPI controller is provided on the SPI controller channel, and the SPI controller is connected to the system bus channel through a serial interface to the external SPI Flash chip performs read and write operations; a system bus control module, a synchronous conversion storage module and an SPI control module are arranged on the system bus channel, and the synchronous conversion storage module is respectively connected to the system bus control module and the SPI control module for communication, wherein: the system bus control module is used to decode the received operation instruction, and send the data generated after the corresponding operation is performed according to the decoding result of the operation instruction to the synchronous conversion storage module; the synchronous conversion storage module is used to cache the generated data and perform synchronous conversion, and send the synchronously converted data to the SPI control module; the SPI control module is used to decode the received operation instruction, lock the sector address specified in the SPIFlash chip according to the decoding result, and perform the corresponding operation on the synchronously converted data in the currently locked sector address.

[0006] In some embodiments of the first aspect of the present application, the synchronous conversion storage module includes a first clock synchronization module, a first data conversion module, a second clock synchronization module, and a second data conversion module;

[0007] A first clock synchronization module is used to cache data generated by the system bus control module after executing a corresponding operation according to a decoding result of an operation instruction and synchronize the clock domain, and send the data after the synchronization of the clock domain to the first data conversion module through the system bus control module; the operation instruction includes a write operation instruction; the generated data includes data written to a sector address specified by the SPI Flash chip;

[0008] A first data conversion module, used for caching data after synchronization of the clock domain and converting the data bit width, and sending the data after the data bit width conversion to the SPI control module;

[0009] The second clock synchronization module is used to cache the data generated by the SPI control module after executing the corresponding operation according to the decoding result of the operation instruction and synchronize the clock domain, and send the data after the synchronization of the clock domain to the second data conversion module through the system bus control module; the operation instruction includes a read operation instruction; the generated data includes data read from the sector address specified by the SPIFlash chip;

[0010] The second data conversion module is used to cache the data after the synchronization clock domain and convert the data bit width, and send the data after the data bit width conversion to the system bus control module.

[0011] In some embodiments of the first aspect of the present application, the system bus channel writes data to the SPIFlash chip in the following manner:

[0012] The system bus control module decodes the received operation instruction, and sends the data generated after executing the corresponding operation according to the decoding result of the operation instruction to the first clock synchronization module; the operation instruction includes a write operation instruction; the generated data includes data written to the sector address specified by the SPI Flash chip;

[0013] The first clock synchronization module caches the generated data and synchronizes the clock domain, and sends the data after the clock domain synchronization to the first data conversion module through the system bus control module;

[0014] The first data conversion module caches the data after the synchronization clock domain and converts the data bit width, and sends the data after the data bit width conversion to the SPI control module;

[0015] The SPI control module decodes the received write operation instruction, locks the sector address specified in the SPIFlash chip according to the decoding result, and writes the data after the data bit width is converted into the currently locked sector address.

[0016] In some embodiments of the first aspect of the present application, the system bus channel reads data from the SPIFlash chip in the following manner:

[0017] The SPI control module decodes the received operation instruction, locks the sector address specified in the SPI Flash chip according to the decoding result, and sends the data read from the currently locked sector address to the second clock synchronization module; the operation instruction includes a read operation instruction;

[0018] The second clock synchronization module caches the read data and synchronizes the clock domain, and sends the read data after the clock domain synchronization to the second data conversion module through the system bus control module;

[0019] The second data conversion module caches the data read after the synchronization clock domain and converts the data bit width, and sends the read data after the data bit width conversion to the system bus control module.

[0020] In some embodiments of the first aspect of the present application, a PCIe control module is also provided on the system bus channel, and the PCIe control module is communicatively connected to the system bus control module, and is used to convert operation instructions into a data type recognized by the system bus and send it to the system bus control module.

[0021] To achieve the above-mentioned purpose and other related purposes, the second aspect of the present application provides a SPI Flash backdoor read and write operation method, which is applied to the SPI Flash backdoor read and write operating system as described above, and the method includes:

[0022] Writing data to the sector address specified by the SPI Flash chip through the SPI controller channel;

[0023] The system bus channel reads the data written by the SPI controller channel from the sector address specified by the SPI Flash chip to verify whether the written data is consistent with the read data; or:

[0024] Writing data to the sector address specified by the SPI Flash chip through the system bus channel;

[0025] The SPI controller channel reads the data written through the system bus channel from the sector address specified by the SPI Flash chip to verify whether the written data is consistent with the read data; wherein:

[0026] The SPI controller channel is provided with an SPI controller, and the SPI controller is connected to the system bus channel through a serial interface to perform read and write operations on an external SPI Flash chip;

[0027] The system bus channel is provided with a system bus control module, a synchronous conversion storage module and an SPI control module, and the synchronous conversion storage module is respectively connected to the system bus control module and the SPI control module in communication, wherein:

[0028] The system bus control module is used to decode the received operation instruction and send the data generated after executing the corresponding operation according to the decoding result of the operation instruction to the synchronous conversion storage module;

[0029] A synchronous conversion storage module is used to cache the generated data and perform synchronous conversion, and send the synchronously converted data to the SPI control module;

[0030] The SPI control module is used to decode the received operation instruction, lock the sector address specified in the SPI Flash chip according to the decoding result, and perform corresponding operations on the synchronously converted data in the currently locked sector address.

[0031] In some embodiments of the second aspect of the present application, the system bus channel accesses the external SPI Flash chip in the following manner:

[0032] The system bus control module decodes the received operation instruction, and sends the data generated after executing the corresponding operation according to the decoding result of the operation instruction to the synchronous conversion storage module;

[0033] The synchronous conversion storage module caches the generated data and performs synchronous conversion, and sends the synchronously converted data to the SPI control module;

[0034] The SPI control module decodes the received operation instruction, locks the sector address specified in the SPI Flash chip according to the decoding result, and performs corresponding operations on the synchronously converted data in the currently locked sector address.

[0035] To achieve the above-mentioned purpose and other related purposes, the third aspect of the present application provides a computer device, which is loaded with the SPI Flash backdoor read-write operating system as described above; the computer device is externally connected to a SPI Flash chip; the computer device accesses the external SPI Flash chip through its built-in SPI Flash backdoor read-write operating system.

[0036] As described above, the SPI Flash backdoor read-write operating system, method and computer device of the present application have the following beneficial effects: the external SPI Flash chip is accessed through the two channels of the set SPI controller channel and the system bus channel, the SPI controller channel is used as the user-side channel, and the user can read and write the SPI Flash chip from the channel, and the system bus channel is the backdoor channel, and the SPI Flash chip can also be read and written. The user writes data to the sector address specified by the SPI Flash chip through the SPI controller channel, and then reads the data written by the user from the sector address specified by the SPI Flash chip through the system bus channel to verify the correctness of the user's read and write data. Through the user read and write of the SPI controller channel, combined with the backdoor read and write of the system bus channel, problems in chip design can be quickly located, and chip startup, operating system startup, driver verification, application software verification and other tasks are realized in the early stage of chip design, thereby improving the efficiency of chip system development and verification. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Figure 1 Shown is a schematic diagram of the structure of the SPI Flash backdoor read-write operating system in one embodiment of the present application.

[0038] Figure 2 Shown is a flowchart of a SPI Flash backdoor read and write operation method in one embodiment of the present application.

[0039] Figure 3 Shown is a flowchart of another SPI Flash backdoor read and write operation method in an embodiment of the present application.

[0040] Figure 4 Shown is a schematic diagram of a process of a system bus channel accessing an external SPI Flash chip in one embodiment of the present application.

[0041] Figure 5 It is a schematic diagram showing the process of writing data from a system bus channel to a SPI Flash chip in one embodiment of the present application.

[0042] Figure 6 Shown is a schematic diagram of a process of reading data from a SPI Flash chip via a system bus channel in an embodiment of the present application.

[0043] Figure 7 Shown is a schematic diagram of the structure of a computer device in one embodiment of the present application. DETAILED DESCRIPTION

[0044] The following describes the embodiments of the present application through specific examples, and those skilled in the art can easily understand other advantages and effects of the present application from the contents disclosed in this specification. The present application can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present application. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict.

[0045] It should be noted that in the following description, with reference to the accompanying drawings, several embodiments of the present application are described in the accompanying drawings. It should be understood that other embodiments may also be used, and mechanical composition, structure, electrical and operational changes may be made without departing from the spirit and scope of the present application. The following detailed description should not be considered restrictive, and the scope of the embodiments of the present application is limited only by the claims of the published patents. The terms used here are only for describing specific embodiments and are not intended to limit the present application. Spatially related terms, such as "upper", "lower", "left", "right", "below", "below", "lower", "above", "upper", etc., may be used in the text to facilitate the description of the relationship between an element or feature shown in the figure and another element or feature.

[0046] Furthermore, as used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless there is an indication to the contrary in the context. It should be further understood that the terms "comprise", "include" indicate the presence of the described features, operations, elements, components, items, kinds, and / or groups, but do not exclude the presence, occurrence or addition of one or more other features, operations, elements, components, items, kinds, and / or groups. The terms "or" and "and / or" used herein are interpreted as inclusive, or mean any one or any combination. Therefore, "A, B or C" or "A, B and / or C" means "any of the following: A; B; C; A and B; A and C; B and C; A, B and C". Exceptions to this definition will only occur when the combination of elements, functions or operations is inherently mutually exclusive in some way.

[0047] In the chip design industry, the cost of taping out a designed chip is very high. Before taping out, it is necessary to verify that the code is fully functional, eliminate all errors in the front-end logic RTL (Register Transfer Level) design and architecture design, and support the testing of driver software and application software before the chip is taped out. Using an FPGA prototype verification platform is the most advanced method for chip verification. SPI Flash is the most commonly used storage device and an important part of FPGA prototype verification. The existing technology is relatively scarce in the field of SPI Flash backdoor read and write prototype verification. However, SPI Flash backdoor read and write can more easily discover defects and errors in RTL design. Therefore, the efficiency of chip verification is low, and verification work cannot be carried out in the early stages of chip design.

[0048] In order to solve the problems in the above-mentioned background technology, the present invention provides an SPI Flash backdoor read-write operating system, method and computer device, aiming to solve the problems of chip startup, operating system startup, driver verification, application software verification and the like in the early stage of chip design, and improve the efficiency of chip system development and verification.

[0049] At the same time, in order to make the purpose, technical solution and advantages of the present invention more clear, the technical solution in the embodiment of the present invention is further described in detail through the following embodiments and in combination with the accompanying drawings. It should be understood that the specific embodiments described here are only used to explain the present invention and are not used to limit the invention.

[0050] Before further describing the present invention in detail, the nouns and terms involved in the embodiments of the present invention are explained. The nouns and terms involved in the embodiments of the present invention are applicable to the following interpretations:

[0051] <1> Chip tape-out: refers to the manufacture of chips through a series of process steps like an assembly line. In the field of integrated circuit design, "tape-out" refers to "trial production."

[0052] <2> FPGA (Field Programmable Gate Array) Prototyping: Used to verify application-specific integrated circuits by porting RTL to field programmable gate arrays (FPGAs). ), special standards (ASSP) and System-on-Chip (SoC) functionality and performance.

[0053] <3> System bus: A bus used to transfer data between the processor and other computer components. It is the basic structure of the computer system and is a serial bus.

[0054] <4> PCIe (Peripheral Component Interconnect Express) bus: is a high-speed bus used to connect data transmission between processors and other components, a parallel bus.

[0055] <5> RTL (Register Transfer Level): A hardware description language used to describe the abstract level of operation of synchronous digital circuits.

[0056] <6> FIFO (First In First Out): is a first-in-first-out data storage and buffer.

[0057] The embodiment of the present invention provides an SPI Flash backdoor read-write operating system, method and computer device. As for the implementation of an SPI Flash backdoor read-write operating system, the embodiment of the present invention will illustrate an exemplary implementation scenario of the SPI Flash backdoor read-write operating system.

[0058] like Figure 1 As shown, a schematic diagram of the structure of the SPI Flash backdoor read-write operating system in an embodiment of the present invention is shown. The SPI Flash backdoor read-write operating system of the present invention is used to access an external SPI Flash chip. The SPI Flash backdoor read-write operating system 100 includes: an SPI controller channel 101 and a system bus channel 102, and the SPI controller channel 101 and the system bus channel 102 can both write data to and read data from the SPI Flash chip; wherein:

[0059] One of the system bus channel 102 and the SPI controller channel 101 is used to write data to the sector address specified by the SPI Flash chip, and the other is used to read data from the sector address specified by the SPI Flash chip to verify whether the written data is consistent with the read data.

[0060] In this embodiment, data is written to the sector address specified by the SPI Flash chip through the SPI controller channel 101; the system bus channel 102 reads the data written by the SPI controller channel from the sector address specified by the SPI Flash chip to verify whether the written data is consistent with the read data.

[0061] In this embodiment, data is written to the sector address specified by the SPI Flash chip through the system bus channel 102; the SPI controller channel 101 reads the data written through the system bus channel from the sector address specified by the SPI Flash chip to verify whether the written data is consistent with the read data.

[0062] In this embodiment, the data in the sector address specified by the SPI Flash chip is erased through the SPI controller channel 101 or the system bus channel 102 .

[0063] In this embodiment, the SPI Flash chip generally refers to the SPI type supported by the FPGA, including but not limited to single-wire, dual-wire, and quad-wire.

[0064] In this embodiment, the SPI controller channel 101 is provided with an SPI controller 1011, and the SPI controller 1011 is connected to the system bus channel 102 through a serial interface to perform read and write operations on the external SPI Flash chip. When the chip is verified by FPGA prototype, the SPI controller channel 101 is used as a user-side channel to write RTL code data to the sector address specified by the SPI Flash chip through the SPI controller 1011 configured inside the FPGA chip. The system bus channel 102 is used as a backdoor for FPGA prototype verification, reads the RTL code data written by the user to the sector address specified by the SPI Flash chip, and verifies whether the written RTL code data is consistent with the read RTL code data. If consistent, it is determined that the RTL code data written by the user is correct, and there are no defects and errors in the RTL code of the corresponding chip design; if inconsistent, it is determined that the RTL code data written by the user is wrong, and there are defects and errors in the RTL code of the corresponding chip design, so as to improve the RTL code of the chip design, thereby realizing chip startup, operating system startup, driver verification, application software verification and other tasks in the early stage of chip design, and improving the efficiency of chip system development verification. The data read and written to the SPI Flash chip is RTL code data. The RTL code data is only an embodiment of the present invention and is not used to limit the present invention. In actual applications, other types of data can be written, read or erased to the SPI Flash chip according to usage requirements.

[0065] It is worth noting that the present invention is provided with two channels, SPI controller channel 101 and system bus channel 102, to access the external SPI Flash chip. The SPI controller channel 101 is used as a user-side channel, and the user can read and write the SPI Flash chip from the channel. The system bus channel 102 is a backdoor channel, and can also read and write the SPI Flash chip. The user writes data to the sector address specified by the SPI Flash chip through the SPI controller channel 101, and then reads the data written by the user from the sector address specified by the SPI Flash chip through the system bus channel 102, so as to verify the correctness of the user's read and write data. Through the user's read and write of the SPI controller channel 101, combined with the backdoor read and write of the system bus channel 102, the problems existing in the chip design can be quickly located, and the efficiency of chip system development and verification is improved.

[0066] In this embodiment, the system bus channel 102 is provided with a system bus control module 1021, a synchronous conversion storage module 1022 and an SPI control module 1023, and the synchronous conversion storage module 1022 is respectively connected to the system bus control module 1021 and the SPI control module 1023. The functions of each module provided on the system bus channel 102 are explained in detail below:

[0067] The system bus control module 1021 is used to decode the received operation instruction and send the data generated after executing the corresponding operation according to the decoding result of the operation instruction to the synchronous conversion storage module 1022.

[0068] The synchronous conversion storage module 1022 is used to cache the generated data and perform synchronous conversion, and send the synchronously converted data to the SPI control module 1023.

[0069] The SPI control module 1023 is used to decode the received operation instruction, lock the sector address specified in the SPIFlash chip according to the decoding result, and perform corresponding operations on the synchronously converted data in the currently locked sector address.

[0070] In this embodiment, the operation instruction includes one or a combination of multiple of a write operation instruction, a read operation instruction and an erase operation instruction.

[0071] In this embodiment, the system bus channel 102 is also provided with a PCIe control module 1024, which is in communication with the system bus control module 1021 and is used to convert the operation instruction into a data type recognized by the system bus and send it to the system bus control module 1021. When the chip is subjected to FPGA prototype verification, the system bus channel 102 is used as a backdoor for FPGA prototype verification, and is connected to the system bus converted by the computer or server through the interface of the PCIe control module, and the highest clock frequency can be up to 100MHz. The PCIe control module 1024 converts the operation instruction sent by the computer or server into a data type recognized by the system bus and sends it to the system bus control module 1021.

[0072] In this embodiment, the synchronous conversion storage module 1022 includes a first clock synchronization module FIFO 0, a first data conversion module FIFO 2, a second clock synchronization module FIFO 3, and a second data conversion module FIFO 1. The functions of each module are explained in detail below:

[0073] The first clock synchronization module FIFO 0 is used to cache the data generated by the system bus control module 1021 after performing the corresponding operation according to the decoding result of the operation instruction and synchronize the clock domain, and send the data after the synchronization of the clock domain to the first data conversion module FIFO 2 through the system bus control module 1021. The operation instruction includes a write operation instruction; the generated data includes data written to the sector address specified by the SPI Flash chip.

[0074] The first data conversion module FIFO 2 is used to cache the data after the synchronization clock domain and convert the data bit width, and send the data after the data bit width conversion to the SPI control module 1023.

[0075] The second clock synchronization module FIFO 3 is used to cache the data generated by the SPI control module 1023 after executing the corresponding operation according to the decoding result of the operation instruction and synchronize the clock domain, and send the data after the synchronization of the clock domain to the second data conversion module FIFO 1 through the system bus control module 1021. The operation instruction includes a read operation instruction; the generated data includes data read from the sector address specified by the SPI Flash chip.

[0076] The second data conversion module FIFO 1 is used to cache the data after the synchronization clock domain and convert the data bit width, and send the data after the data bit width conversion to the system bus control module 1021.

[0077] In this embodiment, the FIFO 0 to FIFO 3 are synchronous FIFOs, i.e., first-in-first-out memories, which exchange address and data information with the system bus control module 1021 and the SPI control module 1023. The FIFO first-in-first-out memory is different from other ordinary memories in that it has no external read and write address lines, which makes it very simple to use. The FIFO first-in-first-out memory caches continuous data streams to prevent data loss during machine input and storage operations. The FIFO first-in-first-out memory collects data for stacking and storage, which can avoid frequent bus operations and reduce the burden on the CPU.

[0078] In this embodiment, the system bus channel 102 writes data to the SPI Flash chip in the following manner:

[0079] (1) The system bus control module 1021 decodes the received operation instruction, and sends the data generated after executing the corresponding operation according to the decoding result of the operation instruction to the first clock synchronization module FIFO 0. The operation instruction includes a write operation instruction; the generated data includes data written to the sector address specified by the SPI Flash chip.

[0080] In this embodiment, after the system bus control module 1021 decodes the received write operation instruction and executes the write operation, the generated data to be written into the specified sector address of the SPI Flash chip is sent to the first clock synchronization module FIFO 0.

[0081] (2) The first clock synchronization module FIFO 0 caches the generated data and synchronizes the clock domain, and sends the data after the clock domain synchronization to the first data conversion module FIFO 2 through the system bus control module 1021 .

[0082] In this embodiment, the first clock synchronization module FIFO 0 caches the data written into the specified sector address of the SPI Flash chip and synchronizes the clock domain to keep it consistent with the clock frequency on the SPI bus.

[0083] (3) The first data conversion module FIFO 2 caches the data after the synchronization clock domain and converts the data bit width, and sends the data after the data bit width conversion to the SPI control module 1023.

[0084] In this embodiment, the first data conversion module FIFO 2 caches the data in the sector address specified by the SPI Flash chip after the synchronization clock domain and converts the data bit width to make it consistent with the data bit width on the SPI bus. For example, the data bit width on the system bus is 256 bits, and the data bit width on the SPI bus is 8 bits.

[0085] (4) The SPI control module 1023 decodes the received operation instruction, locks the sector address specified in the SPIFlash chip according to the decoding result, and writes the data after the data bit width is converted into the currently locked sector address.

[0086] In this embodiment, the SPI control module 1023 decodes the write operation instruction sent by the system bus control module 1021, and executes the operation of writing the data after the data bit width is converted into the locked sector address.

[0087] It is worth noting that data written into the SPI Flash chip through the system bus channel 102 can be read out through the SPI controller channel 101 to verify the consistency of the written data and the read data.

[0088] In this embodiment, the system bus channel 102 reads data from the SPI Flash chip in the following manner:

[0089] (1) The SPI control module 1023 decodes the received operation instruction, locks the sector address specified in the SPIFlash chip according to the decoding result, and sends the data read from the currently locked sector address to the second clock synchronization module FIFO 3. The operation instruction includes a read operation instruction.

[0090] In this embodiment, the SPI control module 1023 decodes the read operation instruction sent by the system bus control module 1021 and executes the operation of reading data from the sector address specified by the SPI Flash chip.

[0091] (2) The second clock synchronization module FIFO 3 caches the read data and synchronizes the clock domain, and sends the read data after the clock domain synchronization to the second data conversion module FIFO 1 through the system bus control module 1021 .

[0092] In this embodiment, the second clock synchronization module FIFO 3 caches the data read from the sector address specified by the SPI Flash chip and synchronizes the clock domain to keep it consistent with the clock frequency on the system bus.

[0093] (3) The second data conversion module FIFO 1 caches the data read after the synchronization clock domain and converts the data bit width, and sends the read data after the data bit width conversion to the system bus control module 1021.

[0094] In this embodiment, the second data conversion module FIFO 1 caches the data read after the synchronization clock domain and converts the data bit width to make it consistent with the data bit width on the system bus. For example, the data bit width on the system bus is 256 bits, and the data bit width on the SPI bus is 8 bits.

[0095] In this embodiment, the system bus control module 1021 sends the received read data to the computer or server through the PCIe control module, so as to verify whether the written data is consistent with the read data.

[0096] It is worth noting that the SPI controller channel 101 serves as a user-side channel, and the user can write data to the sector address specified by the SPIFlash chip through the channel. The address and data information are converted through the system bus control module 1021, the synchronous conversion storage module FIFO 0 ~ FIFO 3 and the SPI control module 1023 set on the system bus channel 102, and the data written by the user in the specified sector address can be read back to verify whether the written data is consistent with the read data, thereby discovering the defects of the chip design and quickly locating the problems in the chip design, realizing chip startup, operating system startup, driver verification, application software verification and other tasks in the early stage of chip design, and improving the efficiency of chip system development and verification.

[0097] Furthermore, the present invention provides a means of accessing SPI Flash chip data through a backdoor, which is convenient for debugging during FPGA prototype verification. For example, the bootloader (boot program) and kernel (operating system kernel) can be written to a specific address segment of the SPI Flash chip in advance through the SPI controller channel 101, and directly read from the system bus channel 102 to verify whether the written data is consistent with the read code data. In addition, data at certain addresses in the SPI Flash chip can be read at any time during the debugging process through the system bus channel 102. Finally, the present invention realizes the use of an SPI Flash chip that can support FPGA prototype verification of multiple chips, that is, it supports reading and writing data using 4-bit addresses, and also supports reading and writing data using 3-bit addresses.

[0098] Furthermore, when the present invention performs FPGA prototype verification on the chip, protocol conversion is directly performed in the system bus control module 1021, avoiding the model of accessing the SPI Flash chip. That is to say, no matter what type of SPI Flash is used in the chip design, it is only necessary to directly connect the interface of the SPI controller to the system bus channel 102 to achieve FPGA prototype verification of multiple chips.

[0099] like Figure 2 As shown, a flow chart of a SPI Flash backdoor read and write operation method in an embodiment of the present invention is shown, which is applied to the SPI Flash backdoor read and write operating system as described above, and the method includes:

[0100] S201: Writing data to a sector address specified by the SPI Flash chip through the SPI controller channel.

[0101] In this embodiment, the SPI controller channel 101 is provided with an SPI controller 1011 . The SPI controller 1011 is connected to the system bus channel 102 via a serial interface to perform read and write operations on an external SPI Flash chip.

[0102] S202: The system bus channel reads the data written by the SPI controller channel from the sector address specified by the SPI Flash chip to verify whether the written data is consistent with the read data.

[0103] In this embodiment, the system bus channel 102 is provided with a system bus control module 1021, a synchronous conversion storage module 1022, an SPI control module 1023 and a PCIe control module 1024. The synchronous conversion storage module 1022 is respectively connected to the system bus control module 1021 and the SPI control module 1023 in communication, and the PCIe control module 1024 is connected to the system bus control module 1021 in communication. The synchronous conversion storage module 1022 includes a first clock synchronization module FIFO 0, a first data conversion module FIFO 2, a second clock synchronization module FIFO 3, and a second data conversion module FIFO 1. The structures and functions of the various modules provided on the system bus channel 102 have been described above and will not be repeated here.

[0104] In this embodiment, when the chip is verified by FPGA prototype, the SPI controller channel 101 is used as the channel of the user end, and the RTL code data is written to the sector address specified by the SPI Flash chip through the SPI controller 1011 configured inside the FPGA chip. The system bus channel 102 is used as the backdoor of the FPGA prototype verification, and reads the RTL code data written by the user to the sector address specified by the SPI Flash chip, and verifies whether the written RTL code data is consistent with the read RTL code data. If consistent, it is determined that the RTL code data written by the user is correct, and there are no defects and errors in the RTL code of the corresponding chip design; if inconsistent, it is determined that the RTL code data written by the user is wrong, and there are defects and errors in the RTL code of the corresponding chip design, so as to improve the RTL code of the chip design, thereby realizing the chip startup, operating system startup, driver verification, application software verification and other work in the early stage of chip design, and improving the efficiency of chip system development verification. The data read and written to the SPI Flash chip is RTL code data, which is only an embodiment of the present invention and is not used to limit the present invention. In actual applications, other types of data can be written, read or erased to the SPI Flash chip according to usage requirements.

[0105] like Figure 3As shown, a flow chart of another SPI Flash backdoor read and write operation method in an embodiment of the present invention is shown, which is applied to the SPI Flash backdoor read and write operating system as described above, and the method includes:

[0106] S301: Writing data to a sector address specified by the SPI Flash chip through the system bus channel.

[0107] S302: The SPI controller channel reads the data written through the system bus channel from the sector address specified by the SPI Flash chip to verify whether the written data is consistent with the read data.

[0108] In this embodiment, data is written into the SPI Flash chip through the system bus channel 102 and can be read out through the SPI controller channel 101 to verify the consistency of the written data and the read data.

[0109] In this embodiment, if Figure 4 As shown, a schematic diagram of the process of the system bus channel accessing the external SPIFlash chip in an embodiment of the present invention is shown, which mainly includes the following steps:

[0110] S401: The system bus control module decodes the received operation instruction, and sends the data generated after executing the corresponding operation according to the decoding result of the operation instruction to the synchronous conversion storage module.

[0111] In this embodiment, the operation instruction includes one or a combination of multiple of a write operation instruction, a read operation instruction and an erase operation instruction.

[0112] S402: The synchronous conversion storage module caches the generated data and performs synchronous conversion, and sends the synchronously converted data to the SPI control module.

[0113] S403: The SPI control module decodes the received operation instruction, locks the sector address specified in the SPIFlash chip according to the decoding result, and performs corresponding operations on the synchronously converted data in the currently locked sector address.

[0114] In this embodiment, if Figure 5 As shown, a schematic diagram of a process of writing data from a system bus channel to a SPI Flash chip in an embodiment of the present invention is shown, which mainly includes the following steps:

[0115] S501: The system bus control module decodes the received operation instruction and sends the data generated after executing the corresponding operation according to the decoding result of the operation instruction to the first clock synchronization module. The operation instruction includes a write operation instruction; the generated data includes data written to the sector address specified by the SPI Flash chip.

[0116] S502: The first clock synchronization module caches the generated data and synchronizes the clock domain, and sends the clock domain synchronized data to the first data conversion module through the system bus control module.

[0117] S503: The first data conversion module caches the data after the synchronization clock domain and converts the data bit width, and sends the data after the data bit width conversion to the SPI control module.

[0118] S504: The SPI control module decodes the received operation instruction, locks the sector address specified in the SPIFlash chip according to the decoding result, and writes the data after the data bit width is converted into the currently locked sector address.

[0119] In this embodiment, if Figure 6 FIG. 1 is a flow chart showing a process of reading data from a SPI Flash chip via a system bus channel according to an embodiment of the present invention, which mainly includes the following steps:

[0120] S601: The SPI control module decodes the received operation instruction, locks the sector address specified in the SPIFlash chip according to the decoding result, and sends the data read from the currently locked sector address to the second clock synchronization module. The operation instruction includes a read operation instruction.

[0121] S602: The second clock synchronization module caches the read data and synchronizes the clock domain, and sends the read data after the clock domain synchronization to the second data conversion module through the system bus control module.

[0122] S603: The second data conversion module caches the data read after the synchronization clock domain and converts the data bit width, and sends the read data after the data bit width conversion to the system bus control module.

[0123] like Figure 7 As shown, a schematic diagram of the structure of a computer device in an embodiment of the present invention is shown. The computer device 700 is loaded with the SPI Flash backdoor read-write operating system 100 as described above; the computer device is externally connected to a SPI Flash chip; the computer device accesses the external SPI Flash chip through its built-in SPI Flash backdoor read-write operating system.

[0124] In summary, the SPI Flash backdoor read-write operating system, method and computer device provided by the present application are provided with two channels, the SPI controller channel and the system bus channel, to access the external SPI Flash chip. The SPI controller channel is used as the user-side channel, and the user can read and write the SPI Flash chip from the channel. The system bus channel is a backdoor channel, and can also read and write the SPI Flash chip. The user writes data to the sector address specified by the SPI Flash chip through the SPI controller channel, and then reads the data written by the user from the sector address specified by the SPI Flash chip through the system bus channel to verify the correctness of the user's read and write data. Through the user's read and write of the SPI controller channel, combined with the backdoor read and write of the system bus channel, the problems existing in the chip design can be quickly located, and the chip startup, operating system startup, driver verification, application software verification and other tasks are realized in the early stage of chip design, and the efficiency of chip system development verification is improved. Therefore, the present application effectively overcomes the various shortcomings in the prior art and has a high industrial utilization value.

[0125] The above embodiments are merely illustrative of the principles and effects of the present application and are not intended to limit the present application. Anyone familiar with the technology may modify or change the above embodiments without violating the spirit and scope of the present application. Therefore, all equivalent modifications or changes made by a person of ordinary skill in the art without departing from the spirit and technical ideas disclosed in the present application shall still be covered by the claims of the present application.

Claims

1. A SPI Flash backdoor read-write operating system for accessing an external SPI Flash chip. It is characterized in that It includes an SPI controller channel and a system bus channel, and both the SPI controller channel and the system bus channel can write data to and read data from the SPIFlash chip; wherein: One of the system bus channel and the SPI controller channel is used to write data to the sector address specified by the SPI Flash chip, and the other is used to read data from the sector address specified by the SPI Flash chip to verify whether the written data is consistent with the read data; The SPI controller channel is provided with an SPI controller, and the SPI controller is connected to the system bus channel through a serial interface to perform read and write operations on an external SPI Flash chip; The system bus channel is provided with a system bus control module, a synchronous conversion storage module and an SPI control module, and the synchronous conversion storage module is respectively connected to the system bus control module and the SPI control module in communication, wherein: The system bus control module is used to decode the received operation instruction and send the data generated after executing the corresponding operation according to the decoding result of the operation instruction to the synchronous conversion storage module; A synchronous conversion storage module is used to cache the generated data and perform synchronous conversion, and send the synchronously converted data to the SPI control module; The SPI control module is used to decode the received operation instruction, lock the sector address specified in the SPI Flash chip according to the decoding result, and perform corresponding operations on the synchronously converted data in the currently locked sector address.

2. The SPI Flash backdoor read-write operating system according to claim 1, It is characterized in that The synchronous conversion storage module includes a first clock synchronization module, a first data conversion module, a second clock synchronization module, and a second data conversion module; A first clock synchronization module is used to cache data generated by the system bus control module after executing a corresponding operation according to a decoding result of an operation instruction and synchronize the clock domain, and send the data after synchronizing the clock domain to the first data conversion module through the system bus control module; the operation instruction includes a write operation instruction; the generated data includes data written to a sector address specified by the SPIFlash chip; A first data conversion module, used for caching data after synchronization of the clock domain and converting the data bit width, and sending the data after the data bit width conversion to the SPI control module; A second clock synchronization module is used to cache data generated after the SPI control module performs a corresponding operation according to a decoding result of an operation instruction and synchronize the clock domain, and send the data after the synchronization of the clock domain to the second data conversion module through the system bus control module; the operation instruction includes a read operation instruction; the generated data includes data read from a sector address specified by the SPI Flash chip; The second data conversion module is used to cache the data after the synchronization clock domain and convert the data bit width, and send the data after the data bit width conversion to the system bus control module.

3. The SPI Flash backdoor read-write operating system according to claim 2, It is characterized in that The system bus channel writes data to the SPI Flash chip in the following manner: The system bus control module decodes the received operation instruction, and sends the data generated after executing the corresponding operation according to the decoding result of the operation instruction to the first clock synchronization module; the operation instruction includes a write operation instruction; the generated data includes data written to the sector address specified by the SPI Flash chip; The first clock synchronization module caches the generated data and synchronizes the clock domain, and sends the data after the clock domain synchronization to the first data conversion module through the system bus control module; The first data conversion module caches the data after the synchronization clock domain and converts the data bit width, and sends the data after the data bit width conversion to the SPI control module; The SPI control module decodes the received operation instruction, locks the sector address specified in the SPI Flash chip according to the decoding result, and writes the data with the converted data bit width into the currently locked sector address.

4. The SPI Flash backdoor read-write operating system according to claim 2, It is characterized in that The system bus channel reads data from the SPI Flash chip in the following way: The SPI control module decodes the received operation instruction, locks the sector address specified in the SPI Flash chip according to the decoding result, and sends the data read from the currently locked sector address to the second clock synchronization module; the operation instruction includes a read operation instruction; The second clock synchronization module caches the read data and synchronizes the clock domain, and sends the read data after the clock domain synchronization to the second data conversion module through the system bus control module; The second data conversion module caches the data read after the synchronization clock domain and converts the data bit width, and sends the read data after the data bit width conversion to the system bus control module.

5. The SPI Flash backdoor read-write operating system according to claim 1, It is characterized in that The system bus channel is also provided with a PCIe control module, which is in communication connection with the system bus control module and is used for converting the operation instruction into a data type recognized by the system bus and sending the data to the system bus control module.

6. A SPI Flash backdoor read and write operation method, applied to the SPI Flash backdoor read and write operating system as described in any one of claims 1 to 5, It is characterized in that The method comprises: Write data to the sector address specified by the SPI Flash chip through the SPI controller channel; The system bus channel reads the data written by the SPI controller channel from the sector address specified by the SPI Flash chip to verify whether the written data is consistent with the read data; or: Writing data to the sector address specified by the SPI Flash chip through the system bus channel; The SPI controller channel reads the data written through the system bus channel from the sector address specified by the SPI Flash chip to verify whether the written data is consistent with the read data; wherein: The SPI controller channel is provided with an SPI controller, and the SPI controller is connected to the system bus channel through a serial interface to perform read and write operations on an external SPI Flash chip; The system bus channel is provided with a system bus control module, a synchronous conversion storage module and an SPI control module, and the synchronous conversion storage module is respectively connected to the system bus control module and the SPI control module in communication, wherein: The system bus control module is used to decode the received operation instruction and send the data generated after executing the corresponding operation according to the decoding result of the operation instruction to the synchronous conversion storage module; A synchronous conversion storage module is used to cache the generated data and perform synchronous conversion, and send the synchronously converted data to the SPI control module; The SPI control module is used to decode the received operation instruction, lock the sector address specified in the SPI Flash chip according to the decoding result, and perform corresponding operations on the synchronously converted data in the currently locked sector address.

7. The SPI Flash backdoor read-write operation method according to claim 6, It is characterized in that The method of accessing the external SPI Flash chip through the system bus channel includes: The system bus control module decodes the received operation instruction, and sends the data generated after executing the corresponding operation according to the decoding result of the operation instruction to the synchronous conversion storage module; The synchronous conversion storage module caches the generated data and performs synchronous conversion, and sends the synchronously converted data to the SPI control module; The SPI control module decodes the received operation instruction, locks the sector address specified in the SPI Flash chip according to the decoding result, and performs corresponding operations on the synchronously converted data in the currently locked sector address.

8. A computer device, It is characterized in that The computer device is loaded with the SPI Flash backdoor read-write operating system according to any one of claims 1 to 5; the computer device is externally connected to a SPI Flash chip; the computer device accesses the external SPI Flash chip through its built-in SPI Flash backdoor read-write operating system.