Functional module for generating corresponding data writing request according to hash table
By designing functional modules in memory, generating write data requests using hash tables, and scattering large chunks of data at different addresses, solving the problem of not being able to fully utilize the storage space in the prior art and achieving efficient data storage.
Patent Information
- Application Number
- CN202411510169.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-28
- Publication Date
- 2025-02-25
AI Technical Summary
The prior art is difficult to store large chunks of data in memory at different addresses and cannot fully utilize the storage space.
A functional module is designed to generate corresponding write data requests through a hash table, combine and split the fixed-width data according to the hash table, and generate an AXI write request that conforms to the bus width alignment.
It realizes the dispersed storage of large chunks of data on different addresses, making full use of storage space, and improving storage efficiency.
Smart Images

Figure CN119513088A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data storage, and in particular to a functional module that generates a corresponding write data request according to a hash table. Background Art
[0002] In order to make full use of the memory space, when storing data in the memory, the software usually hopes to store a large block of data in different addresses. This function is realized in the form of a hash table. The hash table gives the size of the data that can be stored at each address, and the address and data size can be arbitrary values. However, the data generated each time on the hardware is of fixed width. The fixed width makes it impossible to make the address and data size arbitrary values, which is inconsistent with the hash table. Therefore, it is necessary to design a new hardware module to implement the hash table function. Summary of the invention
[0003] To achieve the above-mentioned purpose and other related purposes, the present invention discloses a functional module for generating a corresponding write data request according to a hash table, comprising: The functional modules are respectively connected with the hash table reading module, the data storage module and the request conversion module, wherein: The hash table reading module is responsible for reading the hash table and parsing the content of each table item, and sending the parsed data to the functional module; The data storage module is used to receive data that other modules need to store, and the data width is a fixed value; The functional module is used to read the corresponding amount of data from the data storage module according to the data size given by the hash table reading module, and generate a non-aligned write request to the request conversion module; The request conversion module is used to convert the non-aligned write request into an AXI write request that is aligned according to the bus width and complies with the protocol.
[0004] Furthermore, the hash table includes one or more entries, the 0th word of each entry represents the starting address of data storage, the 0th to 30th bits of the 1st word represent the number of bytes of data that can be stored starting from the starting address, the 31st bit is the end bit, 0 indicates that this entry is not the last entry in the hash table, and 1 indicates that this entry is the last entry in the hash table.
[0005] Furthermore, the size of the word is 4 bytes.
[0006] Furthermore, the workflow of the functional module includes: S1: Obtain the starting address of data storage in a table entry and the data size y that can be stored at the corresponding address from the hash table reading module; S2: If the data size y that can be stored is greater than the preset size threshold, then request 16 beats of data from the data storage module continuously; otherwise, request x beats of data from the data storage module, where x satisfies: x=roundup(y / 16), where roundup() is rounded up; S3: Every time a beat of data is received from the data storage module, the valid data counter is recorded as 16; S4: The number of times the write request is sent to the request conversion module is the same as the number of times the data is requested from the data storage module in S2; S5: Each time a write request is sent to the request conversion module, the data size y that can be stored is reduced by 16. When the last write request is sent, S51: If the data size y that can be stored is greater than 16, 16 bytes of data are sent to the request conversion module, and the data size y that can be stored is reduced by 16; S52: If the data size y that can be stored is less than 16, send data of the data size y that can be stored to the request conversion module, and at the same time, reduce the valid data counter by y, obtain the starting address of the data storage of the next table item and the data size y that can be stored at the corresponding address from the hash table reading module, and send a single-shot write request to the request conversion module, send data to the request module, and the amount of data sent is min (the remaining data size in the valid data counter, y), and update the count of the valid data counter. If the updated number in the valid data counter is not 0, repeat this step until the updated number of the valid data counter is 0. S6: If the data size y that can be stored after sending a write request is greater than zero, repeat steps S2-S6; if the data size y that can be stored is 0, repeat S1-S6 until all the table entry data with the end bit 1 are sent.
[0007] Furthermore, the preset size threshold is 256 bytes.
[0008] By adopting the above technical solution, the input fixed-width data can be combined and split according to the hash table to generate a write data request for the corresponding bus, and large blocks of complete data can be stored in different addresses in a dispersed manner. The storage space can be fully utilized, the implementation process is simple, and the storage efficiency is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure. In the accompanying drawings, the same or similar reference numerals represent the same or similar elements, among which:
[0010] Figure 1It is a schematic diagram of the connection between the functional module and other modules; Figure 2 This is a schematic diagram of the hash table structure; Figure 3 This is a schematic diagram of the table entry format. DETAILED DESCRIPTION
[0011] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0012] Reference Figure 1 The embodiment of the present invention provides a functional module for generating a corresponding write data request according to a hash table, and the functional module is respectively connected to a hash table reading module, a data storage module and a request conversion module.
[0013] Among them, in the drawings of this embodiment, the functional module is the resize module, the hash table reading module is the sgt_get module, the data storage module is the fifo module, and the request conversion module is the bus_ctrl module.
[0014] The hash table reading module is responsible for reading the hash table and parsing the content of each table item, and sending the parsed data to the functional module; The data storage module is used to receive data that other modules need to store, and the data width is a fixed value; The functional module is used to read the corresponding amount of data from the data storage module according to the data size given by the hash table reading module, and generate a non-aligned write request to the request conversion module; The request conversion module is used to convert the non-aligned write request into an AXI write request that is aligned according to the bus width and complies with the protocol.
[0015] Reference Figure 2 and Figure 3 The hash table contains one or more entries, and the 0th word of each entry indicates the starting address of data storage. The 0th to 30th bits of the 1st word indicate the number of bytes of data that can be stored starting from the starting address, and the 31st bit is the end bit. 0 indicates that this entry is not the last entry in the hash table, and 1 indicates that this entry is the last entry in the hash table.
[0016] Specifically, the workflow of the above functional modules includes the following steps: S1: Obtain the starting address of data storage in a table entry and the data size y that can be stored at the corresponding address from the hash table reading module; S2: If the data size y that can be stored is greater than the preset size threshold, then request 16 beats of data from the data storage module continuously; otherwise, request x beats of data from the data storage module, where x satisfies: x=roundup(y / 16), where roundup() is rounded up; S3: Every time a beat of data is received from the data storage module, the valid data counter is recorded as 16; S4: The number of times the write request is sent to the request conversion module is the same as the number of times the data is requested from the data storage module in S2; S5: Each time a write request is sent to the request conversion module, the data size y that can be stored is reduced by 16. When the last write request is sent, S51: If the data size y that can be stored is greater than 16, 16 bytes of data are sent to the request conversion module, and the data size y that can be stored is reduced by 16; S52: If the data size y that can be stored is less than 16, send data of the data size y that can be stored to the request conversion module, and at the same time, reduce the valid data counter by y, obtain the starting address of the data storage of the next table item and the data size y that can be stored at the corresponding address from the hash table reading module, and send a single-shot write request to the request conversion module, send data to the request module, and the amount of data sent is min (the remaining data size in the valid data counter, y), and update the count of the valid data counter. If the updated number in the valid data counter is not 0, repeat this step until the updated number of the valid data counter is 0. S6: If the data size y that can be stored after sending a write request is greater than zero, repeat steps S2-S6; if the data size y that can be stored is 0, repeat S1-S6 until all the table entry data with the end bit 1 are sent.
[0017] An embodiment of the present invention provides a functional module that generates corresponding write data requests according to a hash table, which can combine and split the input fixed-width data according to the hash table to generate write data requests for the corresponding bus, store large blocks of complete data in different addresses in a dispersed manner, and can make full use of storage space. The implementation process is simple and the storage efficiency is improved.
[0018] Those skilled in the art will appreciate that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as those generally understood by those skilled in the art in the art to which the present invention belongs. It should also be understood that terms such as those defined in general dictionaries should be understood to have meanings consistent with the meanings in the context of the prior art, and will not be interpreted with idealized or overly formal meanings unless specifically defined.
[0019] For the method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should know that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.
[0020] It can be known from the description of the above implementation modes that those skilled in the art can clearly understand that the present application can be implemented by means of software plus a necessary general hardware platform. Based on such an understanding, the technical solution of the present application can be essentially or partly contributed to the prior art in the form of a software product, which can be stored in a storage medium such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes several instructions for enabling a computer device (which can be a personal computer, a server or a network device, etc.) to execute the methods described in the various implementation modes of the present application or certain parts of the implementation modes.
[0021] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A functional module for generating a corresponding write data request according to a hash table, characterized in that: The functional modules are respectively connected with the hash table reading module, the data storage module and the request conversion module, wherein: The hash table reading module is responsible for reading the hash table and parsing the content of each table item, and sending the parsed data to the functional module; The data storage module is used to receive data that other modules need to store, and the data width is a fixed value; The functional module is used to read the corresponding amount of data from the data storage module according to the data size given by the hash table reading module, and generate a non-aligned write request to the request conversion module; The request conversion module is used to convert the non-aligned write request into an AXI write request that is aligned according to the bus width and complies with the protocol.
2. A functional module for generating a corresponding write data request according to a hash table according to claim 1, characterized in that: The hash table includes one or more entries, the 0th word of each entry indicates the starting address of data storage, the 0th to 30th bits of the 1st word indicate the number of bytes of data that can be stored starting from the starting address, the 31st bit is the end bit, 0 indicates that this entry is not the last entry in the hash table, and 1 indicates that this entry is the last entry in the hash table.
3. The functional module for generating a corresponding write data request according to a hash table according to claim 2, characterized in that: The size of the word is 4 bytes.
4. The functional module for generating a corresponding write data request according to a hash table according to claim 2, characterized in that: The workflow of the functional module includes: S1: Obtain the starting address of data storage in a table entry and the data size y that can be stored at the corresponding address from the hash table reading module; S2: If the data size y that can be stored is greater than the preset size threshold, then request 16 beats of data from the data storage module continuously; otherwise, request x beats of data from the data storage module, where x satisfies: x=roundup(y / 16), where roundup() is rounded up; S3: Every time a beat of data is received from the data storage module, the valid data counter is recorded as 16; S4: The number of times the write request is sent to the request conversion module is the same as the number of times the data is requested from the data storage module in S2; S5: Each time a write request is sent to the request conversion module, the data size y that can be stored is reduced by 16. When the last write request is sent, S51: If the data size y that can be stored is greater than 16, 16 bytes of data are sent to the request conversion module, and the data size y that can be stored is reduced by 16; S52: If the data size y that can be stored is less than 16, send data of the data size y that can be stored to the request conversion module, and at the same time, reduce the valid data counter by y, obtain the starting address of the data storage of the next table item and the data size y that can be stored at the corresponding address from the hash table reading module, and send a single-shot write request to the request conversion module, send data to the request module, and the amount of data sent is min (the remaining data size in the valid data counter, y), and update the count of the valid data counter. If the updated number in the valid data counter is not 0, repeat this step until the updated number of the valid data counter is 0. S6: If the data size y that can be stored after sending a write request is greater than zero, repeat steps S2-S6; if the data size y that can be stored is 0, repeat S1-S6 until all the table entry data with the end bit 1 are sent.
5. The functional module for generating a corresponding write data request according to a hash table according to claim 4, characterized in that: The preset size threshold is 256 bytes.