A data cache management system in an SSD master controller
By designing a cache management system that combines software and hardware in the SSD main control, and using the hardware system to accelerate cache management, it solves the problems of long cache management time, large area, and high power consumption in the existing technology, and achieves more efficient cache use and Cost savings.
Patent Information
- Application Number
- CN202210667116.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-14
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2042-06-14
AI Technical Summary
The cache management in the existing SSD main control is completely implemented by software, which leads to problems such as long time, large number of caches, large area, high power consumption, and high cost.
Using a combination of software and hardware, we design a dedicated hardware system in the SSD master control, including a bus configuration interface, a configuration command parsing module, a hardware release interface, a release arbitration module and a cache management module to achieve efficient management and allocation of cache.
Through hardware accelerated cache management, the burden on the CPU is reduced, power consumption is reduced, cache usage efficiency is improved, chip area is reduced, and costs are saved.
Smart Images

Figure CN115098019B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of solid-state storage, and in particular to a data cache management system in an SSD master control. Background Art
[0002] When reading and writing SSD, data needs to be written from the host to NAND Flash or read from NAND Flash to the host. During the data transmission process, it needs to pass through the cache in the SSD master control (off-chip DRAM or on-chip SRAM), which involves a series of control processes such as cache allocation, use, release, and recycling. Existing cache management is all done by software. It takes a long time from cache allocation to recycling, so a large number of caches are required, and the software burden is heavy, resulting in a large area, high power consumption, and high cost for the entire chip. Summary of the invention
[0003] In view of the defects of the prior art, the present invention provides a data cache management system in an SSD master controller, which combines software and hardware and implements cache management through acceleration of dedicated hardware (this system) in the SSD master controller.
[0004] In order to solve the technical problem, the technical solution adopted by the present invention is: a data cache management system in an SSD master control, including a bus configuration interface, a configuration command parsing module, a hardware release interface, a release arbitration module and multiple cache management modules, the bus configuration interface is connected to the system bus, and the configuration information and read information are transmitted to the bus configuration interface through the system bus; the configuration command parsing module is connected to the bus configuration interface, and is used to check and classify the commands in the configuration information and read information, the hardware release interface and each hardware used for the cache have an independent interface, which is used to receive the cache release command and perform conversions in different clock domains, the release arbitration module is connected to the hardware release interface, and is used to select a path between software release and each hardware release, the cache management module is connected to the configuration command parsing module and the release president module, and is used to implement specific cache management, allocation and recovery according to initialization information, software configuration and hardware release.
[0005] Furthermore, the cache management module includes a control module, a status interface module and a status array. The status array is used to record the status of all caches. The status interface module is used to provide the currently available cache ID and quantity to the external interface. The control module is connected to the status interface module and the status array, and is used to initialize, obtain cache, release cache information according to the interface, scan the status array, and simultaneously update the contents of the status interface module and the status array.
[0006] Furthermore, the process of implementing cache allocation, recovery and redistribution in the SSD master control based on this system is as follows:
[0007] 1) Determine the location, quantity and size of each cache of the cache group to be allocated in SRAM or DRAM, select a cache management module, initialize the cache management module and enable it;
[0008] 2) Read the cache management module to obtain the available cache ID and quantity;
[0009] 3) According to the available cache ID and quantity, write the relevant registers of the cache management module to indicate that these caches have been used and can no longer be allocated;
[0010] 4) The control module also updates the current available cache ID and quantity of the status interface module for the next software use;
[0011] 5) Provide the obtained cache to the hardware module for use, and notify the hardware module to notify the cache management module to release the relevant cache when the use is completed;
[0012] 6) When the hardware module using the cache has finished using it, it notifies the cache management module that the relevant cache has been used up. The system obtains the command to release the cache through the hardware release interface, and then performs conversion of different clock domains. After conversion, it is transmitted to the release arbitration module. The release arbitration module receives the cache release command and arbitrates according to the cache management module to which the release command belongs. The arbitration is performed in a polling manner. After arbitration, the release command is sent to the cache management module;
[0013] 7) The cache management module receives the release notification and marks these caches as available;
[0014] 8) Repeat steps 2), 3), 4) and 5) to continuously obtain available cache from the cache management module and allocate it to the hardware module, and repeat steps 6) and 7) to release the cache in time after use; cache allocation and cache release are performed alternately.
[0015] Further, steps 1), 2), and 3) transmit the initialization command, the read command, and the cache occupancy command through the bus configuration interface, and then parse the command through the command parsing module. After parsing the initialization command, the control module in the cache management module initializes the content of the status array according to the quantity, and completes the initialization of the cache management module by updating the currently available cache ID and quantity in the status interface module; after parsing the read command, the currently available cache ID and quantity in the read interface module are passed to the MCU through the bus configuration interface; after parsing the cache occupancy command, first check whether the data format of the command is valid. If valid, pass the cache occupancy command to the cache management module, otherwise discard it; the control module in the cache management module finds that this is a cache occupancy command, updates the content of the status array according to the cache ID and quantity, and marks these caches as being in use and no longer available for allocation.
[0016] Furthermore, in step 4), if part of the cache in the status interface module is occupied, the cache ID and quantity are updated; if all the cache in the status interface module is occupied, the control module scans the status array to obtain the available cache ID and quantity, and then updates the status interface module; if all the cache in the status interface module is occupied, and the control module cannot obtain the available cache ID by scanning the status array, the available cache quantity in the interface module is recorded as 0, and it is necessary to wait for the external interface to be released before updating.
[0017] Furthermore, in step 7), after receiving the release notification, the control module of the cache management module updates the content of the status array according to the ID; if the available cache of the status array is 0 when it is updated in step 4), the control module is triggered to scan the status array again while updating the status array, and the status interface module is updated after obtaining the available cache.
[0018] Beneficial effects of the present invention: The present invention realizes cache management through the combination of software and hardware, and has strong versatility and flexibility. The cache management acceleration module is hung on the bus and has a private interface with other hardware, which improves the access efficiency of software and hardware. The management, allocation and recovery of the cache are all implemented by hardware, which reduces the burden on the CPU in the chip and reduces power consumption; the use of hardware recovery can also greatly improve the efficiency of cache usage, so that less on-chip cache can be used, the chip area can be reduced, and the cost can be effectively saved. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 This is the principle block diagram of this system;
[0020] Figure 2 This is a functional block diagram of the cache management module. DETAILED DESCRIPTION
[0021] The present invention will be further described below in conjunction with the accompanying drawings and specific embodiments.
[0022] Example 1
[0023] This embodiment discloses a data cache management system in an SSD master control, such as Figure 1 As shown, it includes a bus configuration interface APB_IF, a configuration command parsing module SG_DIST, several hardware release interfaces LBx_CDC, a release arbitration module RLS_ARB and n cache management modules BM (0, 1, 2...n-1).
[0024] The bus configuration interface APB_IF is hung on the system bus System bus and is used to receive relevant information that the MCU needs to configure and read. The configuration information includes the initialization of the cache settings and obtaining the ID and size of the available cache; the read information includes whether there is an available cache and the corresponding ID and size.
[0025] The configuration command parsing module SG_DIST is connected to the bus configuration interface APV_IF, and is used to check and classify the commands configured by the MCU, check whether the format of the command is correct, and then select which group of caches the command controls and what the type of command is, and send the command to different interfaces of different cache management modules.
[0026] The hardware release interface LBx_CDC is connected to the external hardware module. The hardware release interface LBx_CDC has an independent interface with each hardware that uses the cache in the system. Its function is to receive the hardware cache release command and perform conversion between different clock domains.
[0027] The release arbitration module RLS_ARB is connected to the hardware release interface LBx_CDC. Its function is to arbitrate between software release and various hardware releases and select one path for release.
[0028] The cache management module is connected to the configuration command parsing module and the release arbitration module. Its function is to perform specific cache management, allocation and recycling according to initialization information, software configuration and other hardware release commands.
[0029] In this embodiment, each cache management module corresponds to a data cache block, and multiple cache management modules can perform one-to-one management on multiple data cache blocks in the master. The cache management module and the data cache block are soft-bound, that is, the data cache block corresponding to the cache management module can be changed according to actual needs.
[0030] like Figure 2 As shown, the cache management module includes a control module BMx_CRTL, a status interface module BMx_Status and a status array Status array.
[0031] The status interface module is used to store the currently available cache ID and quantity and provide them to the external interface (command parsing module or release arbitration module).
[0032] The status array is used to record the status of all caches.
[0033] The control module is connected to the state interface module and the state array, and is used to scan the state array according to information such as interface initialization, obtaining available buffer ID and quantity, releasing buffer, and simultaneously updating the contents of the state interface module and the state array.
[0034] In this embodiment, according to the requirements of the software algorithm in the SSD master control for the number of caches, multiple data cache management modules are designed in the SSD master control, and each management module implements one-to-one management of multiple data cache blocks in the master control. Figure 1 As shown in the figure, the module is directly connected to the bus, including a bus configuration interface for algorithm software configuration and calling, and several private interface hardware release interfaces LBx_CDC to obtain information about cache release from other hardware modules (mainly hardware modules that process cache data). The module provides the software with available cache IDs in a timely manner based on the operation of the software and hardware on the relevant cache, making cache management more efficient.
[0035] In this embodiment, the steps of implementing cache allocation, recovery and redistribution in the SSD master control based on this system are as follows:
[0036] 1) Determine the location, quantity and size of each cache in the SRAM or DRAM of the cache group to be allocated according to the requirements, then select a cache management module BMx (x=0,1,2…n), initialize the cache management module and enable it. The process of initializing this system is as follows:
[0037] A) This system receives commands through the bus configuration interface APB_IF and transmits them to the configuration command parsing module SG_DIST;
[0038] B) The configuration command parsing module SG_DIST learns that this is the initialization configuration command of the cache management module BMx through the configured address and data, and transmits the initialization configuration command to the corresponding BMx module;
[0039] C) The control module BMx_CRTL in the BMx module finds that it is just an initialization command and initializes the content of the status array Status array according to the quantity;
[0040] C) The control module BMx_CRTL simultaneously updates the currently available cache ID and quantity in the status interface module BMx_Status, thereby completing the initialization of BMx.
[0041] 2) Read the cache management module BMx to obtain the available cache ID and quantity. The specific process is as follows:
[0042] A) This system obtains the read command through the bus configuration interface APB_IF and transmits it to the configuration command parsing module SG_DIST;
[0043] B) The configuration command parsing module SG_DIST learns from the read address that this is a read command for the available buffer ID and quantity of BMx, thereby reading the currently available buffer ID and quantity in the corresponding interface module BMx_Status;
[0044] C) The configuration command parsing module SG_DIST then transmits the available cache ID and quantity data to the software through the bus configuration interface APB_IF.
[0045] 3) The software obtains relevant information and writes the relevant registers of BMx to indicate that these caches are occupied. The specific process is as follows:
[0046] A) This system receives commands through the bus configuration interface APB_IF and transmits them to the configuration command parsing module SG_DIST;
[0047] B) The configuration command parsing module SG_DIST knows that this is the cache occupancy configuration of BMx through the configured address and data. It first checks whether the data format of the command is valid. If it is valid, it will pass the cache occupancy configuration to the corresponding BMx module. If it is invalid, it will be discarded;
[0048] C) The control module BMx_CRTL in the BMx module finds that this is a cache occupation command, and updates the content of the status array according to the ID and quantity, marking these caches as being in use and no longer available for allocation.
[0049] 4) The control module BMx_CRTL also updates the currently available cache ID and quantity in the status interface module BMx_Status for the next software use.
[0050] If part of the cache in the status interface module BMx_Status is occupied, just update the ID and quantity of the cache;
[0051] If all the caches in the status interface module BMx_Status are occupied, the control module BMx_CRTL will scan the status array (Status array) to obtain the available cache ID and quantity, and then update the status interface module BMx_Status;
[0052] If all the caches in the status interface module (BMx_Status) are occupied, and the control module BMx_CRTL cannot obtain an available cache ID by scanning the status array Status array, the number of available caches in the interface module BMx_Status is recorded as 0; in this case, it is necessary to wait for the external interface to be released before updating.
[0053] 5) The software provides the acquired caches to various hardware modules for use, and informs the hardware modules that they need to notify BMx to release the relevant caches when they are finished using them, without notifying the MCU; (this process does not require the participation of this system).
[0054] 6) The hardware modules using the cache use these caches to perform related DMA, calculation, encryption and other operations; when the use is completed, they notify BMx that some caches have been used up.
[0055] The system obtains the command that the cache is to be released through the hardware release interface LBx_CDC, and then performs conversion between different clock domains, and after conversion, passes it to the release arbitration module (RLS_ARB).
[0056] The release arbitration module RLS_ARB receives the cache release command and performs arbitration according to which BM the release command belongs to; the device uses a polling method to perform arbitration, and the release command enters BMx after arbitration.
[0057] 7) BMx receives the release notification and marks these caches as available, so that they can be called by the software again.
[0058] The control module BMx_CRTL in the BMx module finds that this is a release command and updates the content of the array Status array according to the ID.
[0059] If the available buffer of the status array Status array is 0 in step 4), updating the array Status array will trigger BMx_CRTL to scan the array Status array again, and update the status interface module BMx_Status after obtaining the available buffer.
[0060] The above steps are repeated in steps 2), 3), 4), and 5), where the software continuously obtains available cache from BMx and allocates it to the hardware module; in steps 6) and 7), BMx obtains available cache for software to call as soon as possible according to the release of external hardware modules; the two are performed alternately to ensure efficient use of the cache.
[0061] The above description is only the basic principle and preferred embodiments of the present invention. Improvements and substitutions made by those skilled in the art based on the present invention belong to the protection scope of the present invention.
Claims
1. A data cache management system in an SSD master controller, characterized in that: It includes a bus configuration interface, a configuration command parsing module, a hardware release interface, a release arbitration module and multiple cache management modules. The bus configuration interface is connected to the system bus, and the configuration information and the read information are transmitted to the bus configuration interface through the system bus; the configuration command parsing module is connected to the bus configuration interface, and is used to check and classify the commands in the configuration information and the read information. The hardware release interface and each hardware used for the cache have an independent interface, which is used to receive the cache release command and perform conversions in different clock domains. The release arbitration module is connected to the hardware release interface, and is used to select a path between software release and each hardware release. The cache management module is connected to the configuration command parsing module and the release president module, and is used to implement specific cache management, allocation and recycling according to initialization information, software configuration and hardware release; the cache management module includes a control module, a state interface module and a state array, and the state array is used to record the state of all caches. The state interface module is used to provide the currently available cache ID and quantity to the external interface. The control module is connected to the state interface module and the state array, and is used to initialize, obtain cache, release cache information according to the interface, scan the state array, and simultaneously update the contents of the state interface module and the state array; Based on this system, the process of implementing cache allocation, recycling and redistribution in the SSD master control is as follows: 1) Determine the location, quantity and size of each cache of the cache group to be allocated in SRAM or DRAM, select a cache management module, initialize the cache management module and enable it; 2) Read the cache management module to obtain the available cache ID and quantity; 3) According to the available cache ID and quantity, write the relevant registers of the cache management module to indicate that these caches have been used and can no longer be allocated; 4) The control module also updates the current available cache ID and quantity of the status interface module for the next software use; 5) Provide the obtained cache to the hardware module for use, and notify the hardware module to notify the cache management module to release the relevant cache when the use is completed; 6) When the hardware module using the cache has finished using it, it notifies the cache management module that the relevant cache has been used up. The system obtains the command to release the cache through the hardware release interface, and then performs conversion of different clock domains. After conversion, it is transmitted to the release arbitration module. The release arbitration module receives the cache release command and arbitrates according to the cache management module to which the release command belongs. The arbitration is performed in a polling manner. After arbitration, the release command is sent to the cache management module; 7) The cache management module receives the release notification and marks these caches as available; 8) Repeat steps 2), 3), 4) and 5) to continuously obtain available cache from the cache management module and allocate it to the hardware module, and repeat steps 6) and 7) to release the cache in time after use; cache allocation and cache release are performed alternately.
2. The data cache management system in the SSD master controller according to claim 1, characterized in that: Steps 1), 2), and 3) transmit the initialization command, read command, and cache occupancy command through the bus configuration interface, and then parse the command through the command parsing module. After parsing the initialization command, the control module in the cache management module initializes the content of the status array according to the quantity, and completes the initialization of the cache management module by updating the currently available cache ID and quantity in the status interface module; after parsing the read command, read the currently available cache ID and quantity in the interface module, and then pass the available cache ID and quantity to the MCU through the bus configuration interface; after parsing the cache occupancy command, first check whether the data format of the cache occupancy command is valid. If valid, pass the cache occupancy command to the cache management module, otherwise discard it; the control module in the cache management module finds that this is a cache occupancy command, updates the content of the status array according to the cache ID and quantity, and marks these caches as being in use and no longer available for allocation.
3. The data cache management system in the SSD master controller according to claim 1, characterized in that: In step 4), if part of the cache in the state interface module is occupied, the ID and quantity of the cache are updated; if all of the cache in the state interface module is occupied, the control module scans the state array to obtain the available cache ID and quantity, and then updates the state interface module; If all the caches in the status interface module are occupied and the control module cannot obtain an available cache ID by scanning the status array, the available cache quantity in the interface module is recorded as 0 and needs to be updated after the external interface is released.
4. The data cache management system in the SSD master controller according to claim 1, characterized in that: In step 7), after receiving the release notification, the control module of the cache management module updates the content of the status array according to the ID; if the available cache of the status array is 0 when it is updated in step 4), the control module is triggered to scan the status array again while updating the status array, and updates the status interface module after obtaining the available cache.
