OSPI control device and method

By introducing cache cache and FIFO memory into the OSPI controller, the problem of insufficient data transmission speed and operation efficiency of traditional OSPI controllers is solved, efficient read and write operations of external storage units are realized, and data transmission of chip systems is improved Real-time and efficiency.

CN110874337BActive Publication Date: 2024-11-22TIH MICROELECTRONIC TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN201911368327.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-12-26
Publication Date
2024-11-22
Estimated Expiration
2039-12-26

AI Technical Summary

Technical Problem

传统OSPI控制器在数据传输速度和操作效率方面存在不足,尤其是系统总线与外部存储单元之间的数据传输速度不匹配,并且XIP接口通路只能进行读操作,无法进行写操作,影响了传输 的实时性和工作效率。

Method used

Add cache cache and FIFO memory to the XIP interface path to realize data read and write operations, and support Flash memory writing through the automatic write erase control module to avoid frequent switching between the system interface and the XIP interface.

Benefits of technology

It improves data reading speed and writing efficiency, reduces the number of switching times during data transmission, enhances the real-time and working efficiency of the OSPI controller, and supports a variety of control requirements for external storage units.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN110874337B_ABST
    Figure CN110874337B_ABST
Patent Text Reader

Abstract

The present invention discloses an OSPI control device and method, including a central processing unit connected to an XIP interface of an OSPI controller through a bus, the OSPI controller connected to a cache memory cache through the XIP interface; the XIP interface of the OSPI controller connected to a FIFO memory, the FIFO memory connected to an external memory through the OSPI interface; the read data command of the central processing unit is sent to the cache memory cache through the bus through the XIP interface; the XIP interface receives the write data command and the written data of the central processing unit through the bus, and sends the write data command to the external memory through the OSPI interface; the written data is sent to the FIFO memory, and the FIFO memory sends the received written data to the external memory through the OSPI interface. A cache memory cache is added to the XIP interface path, and the read data and write operations are implemented in the XIP interface path through the connection of the XIP interface with the cache memory cache and the FIFO memory.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical field of controller storage and reading, and in particular to an OSPI control device and method. Background Art

[0002] The statements in this section merely provide background information related to the present disclosure and do not necessarily constitute prior art.

[0003] With the continuous advancement of science and technology and the continuous development of various emerging markets (such as artificial intelligence, Internet of Things and smart home, etc.), the requirements for various chip functions are getting higher and higher. As a result, the requirements for data transmission speed and storage capacity on the chip are also increasing. The cost of the storage unit inside the chip is very high, which requires the development of off-chip storage units. While the capacity of off-chip storage units continues to increase, the data transmission speed between chips also needs to be continuously improved.

[0004] Octal SPI (eight-wire SPI), or OSPI, is a gradual expansion of the SPI (serial peripheral interface) launched by Motorola. From SPI to two-wire, four-wire to the current eight-wire SPI, the traditional OSPI controller has two main disadvantages:

[0005] First, the data transmission speed between the OSPI controller and the system bus is much faster than the data transmission speed between the OSPI controller and the external storage unit, because the system bus always has a frequency of more than 200MHz, and the data line width is 32 or 64 bits, while the OSPI bus always has a frequency of 100MHz to 200MHz, and the data line width is at most 8 bits;

[0006] Second, the XIP interface can only perform read data operations, not write operations. When a write operation is required, it is necessary to switch from the XIP interface to the system slave interface to write data, which greatly affects the real-time transmission and the working efficiency of OSPI. Summary of the invention

[0007] In order to solve the above problems, the present disclosure proposes an OSPI control device and method, which adds a cache memory in the XIP interface path, and realizes data reading and writing operations in the XIP interface path through the connection between the XIP interface, the cache memory and the FIFO memory.

[0008] In order to achieve the above objectives, the present disclosure adopts the following technical solutions:

[0009] In a first aspect, the present disclosure provides an OSPI control device, comprising: a central processing unit, an OSPI controller, a cache memory, a FIFO memory, and an external memory;

[0010] The central processing unit is connected to the XIP interface of the OSPI controller via a bus, and the OSPI controller is connected to the cache memory cache via the XIP interface;

[0011] The XIP interface of the OSPI controller is connected to the FIFO memory, and the FIFO memory is connected to the external memory through the OSPI interface;

[0012] The data read command of the central processing unit is sent to the cache memory cache via the bus through the XIP interface;

[0013] The XIP interface receives the write data command and the written data from the central processing unit through the bus, sends the write data command to the external memory through the OSPI interface; sends the written data to the FIFO memory, and the FIFO memory sends the received written data to the external memory through the OSPI interface.

[0014] As some possible implementations, the XIP interface receives a read data command from the central processing unit through a bus, and sends the read data command to the external storage unit through an OSPI interface;

[0015] The external storage unit sends the target data to the FIFO memory through the OSPI interface.

[0016] As some possible implementations, the OSPI interface sends a write data command to the external memory, and also includes the OSPI interface receiving a data erase command and sending it to the external memory.

[0017] In a second aspect, the present disclosure provides an OSPI read data control method, comprising:

[0018] The CPU's read data command is sent to the cache memory cache via the bus through the XIP interface;

[0019] According to the address and data length of the read data command, it is determined whether the target data is stored in the cache memory, and if so, the target data is retrieved from the cache memory and returned to the central processing unit;

[0020] Otherwise, a read data command is sent to the external storage unit via the OSPI interface, the target data is received from the external storage unit, returned to the central processor, and stored in the cache memory cache.

[0021] In a third aspect, the present disclosure provides an OSPI write data control method, comprising:

[0022] The XIP interface receives the write data command and the written data through the bus, and stores the written data into the FIFO memory;

[0023] Determine whether the external storage unit is a Flash memory. If so, send a data erase command through the OSPI interface. After the data erase command is executed, send a data write command and send the written data to the Flash memory through the OSPI interface.

[0024] Otherwise, a write data command is directly sent to send the written data to the external storage unit through the OSPI interface.

[0025] In a fourth aspect, the present disclosure provides an OSPI control system, comprising a central processing unit, an OSPI controller and an external memory; the OSPI controller comprises an XIP command control module, a cache memory and an XIP data control module;

[0026] The central processing unit is used to send a read data command, a write data command and written data, and send them to the OSPI controller through a bus;

[0027] The external memory is used to respond to a read data command, and receive a write data command and store the written data;

[0028] The XIP command control module is used to send a read data command to the external memory through the OSPI interface according to the received miss signal; and is used to generate a data erase command and send it to the external memory through the OSPI interface;

[0029] The high-speed cache memory is used to receive a read data command from the XIP interface and retrieve the hit target data;

[0030] The XIP data control module is used to receive the written data from the XIP interface, store it, and send it to the external memory.

[0031] Compared with the prior art, the present invention has the following beneficial effects:

[0032] The present disclosure can be widely applied to a main controller of an external storage unit with a direct addressing path, and by adding a cache function to the direct addressing path, the speed and efficiency of data reading in the direct addressing path are greatly reduced;

[0033] The present disclosure improves the command control module in the direct addressing path, so that the direct addressing path can support data writing, avoids the switching between the direct command path and the system interface path during the data reading and writing process, can meet the different control requirements of the external storage unit, and greatly improves the reading and writing efficiency of the chip system to the external storage module;

[0034] The complete implementation architecture and method of the OSPI controller disclosed in the present invention have a good guiding and reference significance for the design and implementation of the main controller of external storage units such as Flash and Psram. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] The accompanying drawings constituting a part of the present disclosure are used to provide a further understanding of the present disclosure. The illustrative embodiments of the present disclosure and their descriptions are used to explain the present disclosure and do not constitute an improper limitation on the present disclosure.

[0036] Figure 1 This is the block diagram of the OSPI control system;

[0037] Figure 2 This is the block diagram of the traditional OSPI controller module;

[0038] Figure 3 This is a block diagram of the OSPI controller disclosed in the present invention;

[0039] Figure 4 It is the block diagram of XIP pathway structure;

[0040] Figure 5 It is the XIP path data reading process;

[0041] Figure 6 This is the XIP path data writing process. DETAILED DESCRIPTION

[0042] The present disclosure is further described below in conjunction with the accompanying drawings and embodiments.

[0043] It should be noted that the following detailed descriptions are all illustrative and are intended to provide further explanation of the present disclosure. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present disclosure belongs.

[0044] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present disclosure. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprising" and / or "including" are used in this specification, it indicates the presence of features, steps, operations, devices, components and / or combinations thereof.

[0045] like Figure 1As shown, the OSPI controller is a control module for data transmission between the chip system and the external storage unit through the OSPI bus protocol. When the chip system needs to send data to the external storage unit, the CPU or other modules that can actively issue commands (hereinafter referred to as the main module) first send the command and data to the OSPI controller through the system bus, such as AXI or AHB; then the OSPI controller converts the commands and data received from the chip system into commands and data that comply with the OSPI protocol, and sends them to the external storage unit through the OSPI bus.

[0046] When the chip system needs to obtain data from an external storage unit, the CPU or other main module first sends the command to the OSPI controller through the system bus, such as AXI or AHB; then the OSPI controller sends the command to the external storage unit through the OSPI bus, and then receives the data from the external storage unit through the OSPI bus, and finally notifies the chip system to read the data.

[0047] like Figure 2 As shown, there are generally two interfaces between a traditional OSPI controller and a system bus (AXI or AHB, AHB is taken as an example below): a system slave interface and an XIP (eXecute-In-Place, direct addressing execution) interface.

[0048] The system slave interface generally includes the configuration of the relevant control registers of the OSPI controller, as well as the reading and writing of data with the external storage. In particular, the reading and writing of large quantities of data must be performed through the system slave interface.

[0049] The XIP interface uses direct addressing and generally only performs data read operations. Because when the external storage is Flash, data needs to be erased before writing, and the write operation takes a long time, so it is not performed through the XIP interface. The advantage of the XIP interface is that it performs address addressing operations directly. For example, the address sent by the CPU to the XIP interface of the OSPI controller through the AHB bus is the address of the external storage unit (and the address sent to the system slave interface is the address of the internal register of the OSPI controller). In this way, no additional driver is required, and the CPU can directly read data from the external storage unit. At this time, the external storage unit is equivalent to the expansion of the internal storage unit of the chip, and in most cases it is used to store the instructions that the CPU needs to execute the operating system.

[0050] The above-mentioned traditional OSPI controller has two main disadvantages. First, the data transmission speed between the OSPI controller and the system bus is much faster than the data transmission speed between the OSPI controller and the external storage unit, because the system bus has a constant frequency of generally above 200MHz, and the data line width is 32 bits or 64 bits, while the constant frequency of the OSPI bus is generally between 100MHz and 200MHz, and the data line width is at most 8 bits;

[0051] Second, the XIP interface can only perform read data operations, not write operations. When a write operation is required, it is necessary to switch from the XIP interface to the system slave interface to write data, which greatly affects the real-time transmission and the working efficiency of OSPI.

[0052] To solve the above problems, the present disclosure adds a cache function in the XIP interface path. The cache is used to store the data read by the chip system from the external storage unit through the XIP interface and record the key part of the address corresponding to the data. When the chip system reads the data of the same address from the XIP interface next time, it does not need to read from the external storage unit, and can directly give the data in the cache to the chip system, which can greatly reduce the data reading time.

[0053] At the same time, an automatic write-erase control module is added to allow data to be written to the external storage unit through the XIP interface when the external storage unit is Flash. Through the above improvements, the data reading speed can be effectively improved, and the frequent switching between the system interface and the XIP interface can be avoided, which greatly improves the real-time performance and work efficiency of OSPI transmission.

[0054] Example 1

[0055] like Figure 3 As shown, this embodiment provides an OSPI control device, including: a central processing unit, an OSPI controller, a cache memory, a FIFO memory and an external memory;

[0056] The central processing unit is connected to the XIP interface of the OSPI controller via a bus, and the OSPI controller is connected to the cache memory cache via the XIP interface;

[0057] The XIP interface of the OSPI controller is connected to the FIFO memory, and the FIFO memory is connected to the external memory through the OSPI interface;

[0058] The data read command of the central processing unit is sent to the cache memory cache via the bus through the XIP interface;

[0059] The XIP interface receives the write data command and the written data from the central processing unit through the bus, sends the write data command to the external memory through the OSPI interface; sends the written data to the FIFO memory, and the FIFO memory sends the received written data to the external memory through the OSPI interface.

[0060] The XIP interface receives a data read command from a central processing unit through a bus, and also includes sending the data read command to an external storage unit through an OSPI interface; the external storage unit sends the target data to a FIFO memory through the OSPI interface.

[0061] The OSPI interface sends a write data command to the external memory, and also includes an OSPI interface receiving a data erase command and sending it to the external memory.

[0062] The external memory includes a Flash memory and a Psram memory.

[0063] Example 2

[0064] The OSPI controller also includes two system bus interfaces, system slave and XIP. The configuration and reading of the relevant registers of the OSPI controller and the configuration commands of the relevant registers in the external storage unit must be entered from the system slave interface. This part is basically the same as the traditional OSPI controller and will not be described in detail here.

[0065] For the XIP interface path, this embodiment provides an OSPI read data control method, including:

[0066] The CPU sends a read data command that complies with the AHB protocol through the system bus (taking AHB as an example). After receiving the corresponding command, the XIP interface parses it and determines whether the required data is stored in the cache based on the address and data length in the command. If so, the data is directly returned to the chip system.

[0067] If not, the XIP command control module generates the corresponding data read command and gives it to the OSPI interface;

[0068] The OSPI interface converts the received commands into commands that comply with the OSPI bus protocol and sends them to the external storage unit. It also receives the response data, returns the data to the chip system, and stores it in the cache.

[0069] like Figure 4 As shown in FIG. 1 , the cache includes address mapping, replacement control, tag SRAM and data SRAM. The specific data reading process in the XIP interface path is as follows: Figure 5 :

[0070] The XIP interface receives the data read command from the AHB bus, converts the command, and then sends the read / write signal, address, and data length to the address mapping module;

[0071] The address mapping module reads the tag in the tag SRAM according to the middle bits of the received address, and then compares the tag with the upper bits of the address. If they are the same, it means a hit. After a hit, the corresponding data is read from the data SRAM and returned to the XIP interface.

[0072] If it misses, the XIP command control module is notified. After receiving the miss information, the XIP command control module sends the relevant information received from the XIP interface to the OSPI interface. The OSPI interface converts the read command into a command that complies with the OSPI protocol and sends it out.

[0073] Receive data from the external storage unit and cache the data in the data FIFO; the replacement control module reads the data from the data FIFO, the replacement control module first returns the data to the XIP interface, and the XIP interface returns the data to the AHB bus; at the same time, replace the tag in the tag SRAM, and then store the data in the data SRAM.

[0074] Example 3

[0075] This embodiment provides an OSPI write data control method, including:

[0076] The CPU sends a write data command and the data to be written that conforms to the AHB protocol through the system bus (taking AHB as an example). After receiving the corresponding command, the XIP interface parses it and stores the data in the data FIFO.

[0077] Before sending the command to the OSPI interface, first determine whether the external storage module is Flash. If so, first generate a data erase command through the XIP command control module and send it out through the OSPI interface;

[0078] Then, according to the address and data length in the command, a response write data command is sent, and the data in the data FIFO is given to the OSPI interface. Finally, the command and data are sent to the external storage unit according to the OSPI protocol.

[0079] like Figure 6 As shown, the XIP path data writing process is:

[0080] The XIP interface receives the data write command and corresponding data from the AHB bus, then converts the command, sends the read / write signal, address, and data length to the XIP command control module, and sends the data to the XIP data control module;

[0081] The XIP command control module makes a judgment based on the information given by the OSPI control register. If the external storage unit is Flash, it reads the data length to be erased from the OSPI register, sends the erase command to the OSPI interface, and then sends the write data command to the OSPI interface;

[0082] The OSPI interface first sends an erase command to the external storage unit in a form that complies with the OSPI protocol, then reads the data written by the XIP data control module from the data FIFO, and finally sends the write command and write data to the external storage unit.

[0083] Example 4

[0084] An OSPI control system includes a central processing unit, an OSPI controller and an external memory; the OSPI controller includes an XIP command control module, a high-speed cache memory and an XIP data control module;

[0085] The central processing unit is used to send a read data command, a write data command and written data, and send them to the OSPI controller through a bus;

[0086] The external memory is used to respond to a read data command, and receive a write data command and store the written data;

[0087] The XIP command control module is used to send a read data command to the external memory through the OSPI interface according to the received miss signal; and is used to generate a data erase command and send it to the external memory through the OSPI interface;

[0088] The high-speed cache memory is used to receive a read data command from the XIP interface and retrieve the hit target data;

[0089] The XIP data control module is used to receive the written data from the XIP interface, store it, and send it to the external memory.

[0090] The above are only preferred embodiments of the present disclosure and are not intended to limit the present disclosure. For those skilled in the art, the present disclosure may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.

[0091] Although the above describes the specific implementation methods of the present disclosure in conjunction with the accompanying drawings, it is not intended to limit the scope of protection of the present disclosure. Technical personnel in the relevant field should understand that on the basis of the technical solution of the present disclosure, various modifications or variations that can be made by those skilled in the art without creative work are still within the scope of protection of the present disclosure.

Claims

1. An OSPI read data control method, characterized in that: include: An OSPI control device is used, comprising: a central processing unit, an OSPI controller, a high-speed cache memory, a FIFO memory and an external memory; The central processing unit is connected to the XIP interface of the OSPI controller via a bus, and the OSPI controller is connected to the cache memory cache via the XIP interface; The XIP interface of the OSPI controller is connected to the FIFO memory, and the FIFO memory is connected to the external memory through the OSPI interface; The data read command of the central processing unit is sent to the cache memory cache via the bus through the XIP interface; The XIP interface receives a write data command and written data from the central processing unit through the bus, and sends the write data command to the external memory through the OSPI interface; the written data is sent to the FIFO memory, and the FIFO memory sends the received written data to the external memory through the OSPI interface; The XIP interface receives a read data command from the central processing unit through the bus, and sends the read data command to the external storage unit through the OSPI interface; The external storage unit sends the target data to the FIFO memory through the OSPI interface; The OSPI interface sends a write data command to the external memory, and also includes an OSPI interface receiving a data erase command and sending it to the external memory; The CPU's read data command is sent to the cache memory cache via the bus through the XIP interface; According to the address and data length of the read data command, it is determined whether the target data is stored in the cache memory, and if so, the target data is retrieved from the cache memory and returned to the central processing unit; Otherwise, a read data command is sent to the external storage unit via the OSPI interface, the target data is received from the external storage unit, returned to the central processor, and stored in the cache memory cache.

2. An OSPI read data control method as claimed in claim 1, characterized in that, The cache memory includes an address mapping module, a replacement control module, a tag SRAM module and a data SRAM module, and the specific process of reading data is as follows: The XIP interface receives a read data command through the bus, performs address mapping on the read data command, obtains a read / write signal, address and data length, and sends them to an address mapping module in the cache memory; The address mapping module compares the received address with the tag in the tag SRAM module. If they are the same, it means a hit. After a hit, the target data is read from the data SRAM module and returned to the central processor through the XIP interface. If there is no hit, the target data sent by the external storage unit is received, the replacement control module replaces the tag in the tag SRAM module, and the target data is stored in the data SRAM module.

3. An OSPI read data control method as claimed in claim 2, characterized in that, The specific process of reading data also includes: If it misses, a miss signal is sent to the XIP command control module of the OSPI controller, and the XIP command control module sends the read data command to the external storage unit through the OSPI interface; The external storage unit returns the target data to the OSPI controller through the OSPI interface and caches the target data in the FIFO memory; The replacement control module reads the target data from the FIFO memory and returns the target data to the central processing unit through the XIP interface.

4. An OSPI write data control method, characterized in that: include: An OSPI control device is used, comprising: a central processing unit, an OSPI controller, a high-speed cache memory, a FIFO memory and an external memory; The central processing unit is connected to the XIP interface of the OSPI controller via a bus, and the OSPI controller is connected to the cache memory cache via the XIP interface; The XIP interface of the OSPI controller is connected to the FIFO memory, and the FIFO memory is connected to the external memory through the OSPI interface; The data read command of the central processing unit is sent to the cache memory cache via the bus through the XIP interface; The XIP interface receives a write data command and written data from the central processing unit through the bus, and sends the write data command to the external memory through the OSPI interface; the written data is sent to the FIFO memory, and the FIFO memory sends the received written data to the external memory through the OSPI interface; The XIP interface receives a read data command from the central processing unit through the bus, and sends the read data command to the external storage unit through the OSPI interface; The external storage unit sends the target data to the FIFO memory through the OSPI interface; The OSPI interface sends a write data command to the external memory, and also includes an OSPI interface receiving a data erase command and sending it to the external memory; The XIP interface receives the write data command and the written data through the bus, and stores the written data into the FIFO memory; Determine whether the external storage unit is a Flash memory. If so, send a data erase command through the OSPI interface. After the data erase command is executed, send a data write command and send the written data to the Flash memory through the OSPI interface. Otherwise, a write data command is directly sent to send the written data to the external storage unit through the OSPI interface.

5. An OSPI write data control method as claimed in claim 4, characterized in that, The XIP interface receives the write data command and the written data through the bus, performs address mapping on the write data command, obtains the read / write signal, address and data length, and sends it to the XIP command control module of the OSPI controller; The written data is sent to the XIP data control module of the OSPI controller, the XIP data control module stores the written data in the FIFO memory, reads the written data from the FIFO memory and sends it to the external storage unit.

6. An OSPI write data control method as claimed in claim 5, characterized in that, The XIP command control module judges the external storage unit. If the external storage unit is a Flash memory, the XIP command reads the data erase command from the OSPI register and sends the data erase command to the external storage unit through the OSPI interface. If the external storage unit is not a Flash memory, the write data command and the written data are directly sent to the external storage unit through the OSPI interface.

7. An OSPI control system, characterized in that: It includes a central processing unit, an OSPI controller and an external memory; the OSPI controller includes an XIP command control module, a high-speed cache memory and an XIP data control module; The central processing unit is used to send a read data command, a write data command and written data, and send them to the OSPI controller through a bus; The external memory is used to respond to a read data command, and receive a write data command and store the written data; The XIP command control module is used to send a read data command to the external memory through the OSPI interface according to the received miss signal; and is used to generate a data erase command and send it to the external memory through the OSPI interface; The high-speed cache memory is used to receive a read data command from the XIP interface and retrieve the hit target data; The XIP data control module is used to receive the written data from the XIP interface, store it, and send it to the external memory.