Data table query method, device and computer readable storage medium
By generating modules for data table query in high-level synthesis tools, the problems of low development efficiency and maintenance difficulties in traditional RTL logic design are solved, and efficient table lookup process and system performance improvement are achieved.
Patent Information
- Application Number
- CN202210238340.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-10
- Publication Date
- 2025-03-18
- Estimated Expiration
- 2042-03-10
AI Technical Summary
In the prior art, traditional RTL logic design is used to implement the table lookup process, which has problems such as low development efficiency, difficulty in realizing reuse design, low simulation efficiency, and difficulty in maintaining and upgrading.
By inputting the data table query code into a high-level comprehensive tool, modules for data table query are generated, including the table lookup request module, the table lookup request interface, the table lookup module, the table lookup response interface and the table lookup response module. The streaming data input and output and unified interface are used to avoid the use of state machines and realize automatic pipeline design.
Improve development efficiency, simplify the table lookup process, realize ease of development, reuse, maintenance and management, and improve system performance.
Smart Images

Figure CN114610756B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a data table query method, device and computer-readable storage medium. Background Art
[0002] In many digital chips, internal or external RAM (Random Access Memory) is needed to cache configuration tables, variable tables or other table items, so table lookup has become a very common function. Table lookup is mostly used in network device queries, such as querying MAC (Media Access Control), VLAN (Virtual Local Area Network), routing, ACL (Access Control List) and other tables. There are also register tables in processor chips. When performing calculations, it is also necessary to query intermediate variable tables or configuration parameter tables.
[0003] As the size of the chip increases, the number of table entries increases, and the table lookup process becomes more and more complex. The performance of the table lookup can easily affect the performance of the entire system.
[0004] In the digital chip design of related technologies, the traditional RTL (Register-Transfer Level) logic design is used to implement the table lookup process. Summary of the invention
[0005] After analyzing the relevant technologies, the inventors found that the following problems exist when using traditional RTL logic design to implement the table lookup process.
[0006] 1. Low development efficiency and long development cycle: RTL has a low level of abstraction, and its design is strongly related to the underlying circuit implementation. Therefore, developers need to be familiar with both logic and circuit design. RTL is a parallel design method, which requires designers to manually coordinate the work synchronization between modules.
[0007] 2. Difficult to achieve reused design: The RTL design module structure and interface are also strongly related to the underlying circuit implementation, making it difficult to reuse the design.
[0008] 3. Low simulation efficiency: The efficiency of logic simulation and waveform simulation is very low.
[0009] 4. Difficult to maintain and upgrade: RTL is a parallel design method. After the design is completed, if new functions are added, existing functions are modified, or interfaces are modified, it is necessary to re-allocate the synchronization and coordination between modules. This requires the maintenance personnel to have a good understanding of the design, so the requirements for maintenance personnel are very high.
[0010] A technical problem to be solved by the embodiments of the present invention is: how to provide a table lookup solution that is easy to develop, reuse, maintain and manage.
[0011] According to a first aspect of some embodiments of the present invention, a data table query method is provided, comprising: inputting a data table query code into a high-level synthesis tool so that the high-level synthesis tool generates a plurality of modules for data table query based on the data table query code, wherein the modules for data table query include: a table query request module configured to read input data from an input interface; generate a table query address according to the input data; determine a corresponding table query request interface according to the table query address; output the table query address to the corresponding table query request interface; one or more table query request interfaces, wherein each table query request interface corresponds to a table module; and a One or more table modules are configured to obtain a table lookup address from a table lookup request interface; query a table cache corresponding to the table module according to the table lookup address to obtain a table lookup result; output the table lookup result to a table lookup response interface corresponding to the table module; one or more table lookup response interfaces, wherein each table lookup response interface corresponds to a table module; and a table lookup response module is configured to obtain a table lookup result from the table lookup response interface; generate processing result data according to the table lookup result; output the processing result data; obtain an intermediate file generated by a high-level synthesis tool based on a module for data table query; and generate a circuit with a data table query function based on the intermediate file.
[0012] In some embodiments, the data table query module also includes: a default request interface; a default response interface; and a pseudo table module, which is connected to the table query request module through the default request interface, and connected to the table query response module through the default response interface, and is configured to output the data in the default request interface from the default response interface; and the table query request module is further configured to input the input data to the default table query interface when the input data is not table query data.
[0013] In some embodiments, the table lookup request interface, the response interface, and the data interface are first-in-first-out caches.
[0014] In some embodiments, the input interface obtains input data once every at least one clock cycle.
[0015] In some embodiments, the table cache is stored inside the digital chip, or in an external storage of the digital chip.
[0016] In some embodiments, the module for data table query also includes: a data interface; the table query request module is further configured to determine intermediate data based on the input data; send the intermediate data to the data interface; and the table query response module is further configured to generate processing result data based on the intermediate data and the table query result.
[0017] In some embodiments, the intermediate file is an RTL file or a netlist.
[0018] In some embodiments, the data table query code includes the following processing logic: the table query request module generates a table query address based on the input data read from the input interface; the table query request module outputs the table query address to the table query request interface corresponding to the table query address, wherein each table query request interface corresponds to a table module; the table module obtains the table query address from the table query request interface; the table module queries the table cache corresponding to the table module based on the table query address to obtain the table query result; the table module outputs the table query result to the table query response interface corresponding to the table module, wherein each table query response interface corresponds to a table module; the table query response module obtains the table query result from the table query response interface; the table query response module generates processing result data based on the table query result, and outputs the processing result data.
[0019] In some embodiments, the data table query code further includes: a table query request module generates intermediate data according to input data; and sends the intermediate data to a data interface so that a table query response module generates processing result data according to the intermediate data and the table query result.
[0020] In some embodiments, the data table query code further includes: when the input data is not table query data, the table query request module inputs the table query address to the default table query interface; and the pseudo table module outputs the data in the default request interface from the default response interface to the table query response module.
[0021] According to a second aspect of some embodiments of the present invention, a data table query device is provided, comprising: an input module, configured to input a data table query code into a high-level synthesis tool, so that the high-level synthesis tool generates a module for data table query based on the data table query code, wherein the module for data table query comprises: a table query request module, configured to read input data from an input interface; generate a table query address according to the input data; determine a corresponding table query request interface according to the table query address; output the table query address to the corresponding table query request interface; one or more table query request interfaces, wherein each table query request interface corresponds to a table module; one or more table modules; A block is configured to obtain a table lookup address from a table lookup request interface; query a table cache corresponding to a table module according to the table lookup address to obtain a table lookup result; output the table lookup result to a table lookup response interface corresponding to the table module; one or more table lookup response interfaces, wherein each table lookup response interface corresponds to a table module; and a table lookup response module is configured to obtain a table lookup result from a table lookup response interface; generate processing result data according to the table lookup result; and output the processing result data; an acquisition module is configured to obtain an intermediate file generated by a high-level synthesis tool based on a module for data table query; and a generation module is configured to generate a circuit with a data table query function based on the intermediate file.
[0022] According to a third aspect of some embodiments of the present invention, a module for data table query is provided, comprising: a memory; and a processor coupled to the memory, the processor being configured to execute any of the aforementioned data table query methods based on instructions stored in the memory.
[0023] According to a fourth aspect of some embodiments of the present invention, there is provided a computer-readable storage medium having a computer program stored thereon, wherein the program, when executed by a processor, implements any one of the aforementioned data table query methods.
[0024] Some embodiments of the above invention have the following advantages or beneficial effects. The embodiments of the present invention use streaming data input and output commonly used in computing, thereby utilizing a similar computing method to implement control logic. The embodiments of the present invention unify the interface and can adapt to the limitations of high-level synthesis. In addition, the present invention does not use a state machine, which overcomes the problem that the existing high-level synthesis tools implement complex state machines, resulting in difficulty in timing convergence. Therefore, the embodiments of the present invention automatically implement pipeline design, simplify the table lookup process, improve development efficiency, and are also easy to develop, reuse, maintain and manage.
[0025] Further features and advantages of the present invention will become apparent from the following detailed description of exemplary embodiments of the present invention with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0027] Figure 1A A schematic flow chart of a data table query method according to some embodiments of the present invention is shown.
[0028] Figure 1B A schematic structural diagram of a module for data table query according to some embodiments of the present invention is shown.
[0029] Figure 2 A schematic structural diagram of a module for data table query according to other embodiments of the present invention is shown.
[0030] Figure 3 A schematic structural diagram of a module for data table query according to yet other embodiments of the present invention is shown.
[0031] Figure 4 A schematic structural diagram of a table lookup system according to some further embodiments of the present invention is shown.
[0032] Figure 5 A flow chart showing the processing logic of data table query code according to some embodiments of the present invention is shown.
[0033] Figure 6 A flow chart showing the processing logic of data table query code according to some embodiments of the present invention is shown.
[0034] Figure 7 A flow chart showing the processing logic of data table query code according to some embodiments of the present invention is shown.
[0035] Figure 8 A schematic structural diagram of a data table query device according to some embodiments of the present invention is shown.
[0036] Fig. 9 A schematic structural diagram of a data table query device according to some other embodiments of the present invention is shown.
[0037] Fig.10 A schematic structural diagram of a data table query device according to some further embodiments of the present invention is shown. DETAILED DESCRIPTION
[0038] 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, rather than all the embodiments. The following description of at least one exemplary embodiment is actually only illustrative and is by no means intended to limit the present invention and its application or use. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0039] The relative arrangement of components and steps, the numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present invention unless specifically stated otherwise.
[0040] At the same time, it should be understood that for the convenience of description, the sizes of the various parts shown in the drawings are not drawn according to the actual proportional relationship.
[0041] Technologies, methods, and apparatus known to ordinary technicians in the relevant field may not be discussed in detail, but where appropriate, such technologies, methods, and apparatus should be considered part of the authorization specification.
[0042] In all examples shown and discussed herein, any specific values should be interpreted as merely exemplary and not as limiting. Therefore, other examples of the exemplary embodiments may have different values.
[0043] It should be noted that like reference numerals and letters refer to similar items in the following figures, and therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.
[0044] Figure 1A FIG. 2 shows a flow chart of a data table query method according to some embodiments of the present invention. Figure 1A As shown, the data table query method of this embodiment includes steps S102 to S106.
[0045] In step S102 , the data table query code is input into a high-level synthesis tool, so that the high-level synthesis tool generates a module for data table query based on the data table query code.
[0046] Figure 1B FIG. 4 is a schematic diagram showing a structure of a module for querying a data table according to some embodiments of the present invention. Figure 1B As shown, the module for data table query in this embodiment includes a table query request module 101, one or more table query request interfaces 102, one or more table modules 103, one or more table query response interfaces 104 and a table query response module 105, wherein each table query request interface corresponds to a table module, and each table query response interface corresponds to a table module.
[0047] The table lookup request module 101 is configured to read input data from an input interface and generate a table lookup address according to the input data; determine a corresponding table lookup request interface 102 according to the table lookup address; and output the table lookup address to the corresponding table lookup request interface 102 .
[0048] The table module 103 is configured to obtain a table lookup address from a table lookup request interface; query a table cache corresponding to the table module according to the table lookup address to obtain a table lookup result; and output the table lookup result to a table lookup response interface 104 corresponding to the table module.
[0049] In some embodiments, the table cache is stored inside the digital chip or in the external storage RAM of the digital chip. The table in the table cache includes, for example, a cache configuration table, a variable table, a MAC table, a vlan table, a routing table, an ACL table, a register table, an intermediate variable table, or a configuration parameter table, etc.
[0050] The table lookup response module 105 is configured to obtain a table lookup result from the table lookup response interface; generate processing result data according to the table lookup result; and output the processing result data.
[0051] In step S104, an intermediate file generated by a high-level synthesis tool based on a module for data table query is obtained.
[0052] In some embodiments, the intermediate file is an RTL file or a netlist.
[0053] In step S106, a circuit with a data table query function is generated based on the intermediate file, for example, by using an FPGA or ASIC method.
[0054] In related technologies, high-level synthesis tools are mainly used for algorithm design, and it is difficult to implement control logic, while table entry lookup is mainly for control logic; the module interface provided by the high-level synthesis tool is fixed, and it is not friendly to the control logic implementation; the tool mainly uses the state machine to design the table lookup control logic, which makes it impossible to have an input in every working clock cycle, the iteration interval is too large, and the throughput is low.
[0055] The above-mentioned embodiments can overcome the existing problems of high-level synthesis tools. The embodiments of the present invention use the streaming data input and output commonly used in calculations, thereby utilizing a similar calculation method to implement control logic. The embodiments of the present invention unify the interface and can adapt to the limitations of high-level synthesis. In addition, the present invention does not use a state machine, which overcomes the problem that the existing high-level synthesis tools implement complex state machines, resulting in difficulty in timing convergence.
[0056] In addition, high-level synthesis tools are used to implement table lookup logic. The following problems can be solved in development: C language is used for development, with a high level of abstraction, and the design is weakly related to the underlying circuit, so the development tool can automatically coordinate the work between modules; it is easy to implement reuse, for example, template functions and structure definitions in C language can be used to implement reuse; because logic simulation is implemented at the C language level, the efficiency is more than 10 times that of directly using RTL for logic simulation; maintenance and upgrades are easier, because C language design is easy to master and understand, and if modifications are required, they are much simpler than RTL.
[0057] In addition, the use of high-level synthesis tools to implement table lookup logic can solve the following problems in the design structure: the development tool can automatically implement pipeline design without the need for manual adjustment; it can be achieved that there can be an input in each clock cycle, that is, the iteration interval is equal to 1, to achieve the highest efficiency under the same working clock; the development tool automatically implements timing optimization, without the need for manual adjustment.
[0058] Therefore, the above embodiment automatically realizes pipeline design, simplifies the table lookup process, improves development efficiency, and is easy to develop, reuse, maintain and manage.
[0059] In some embodiments, the input interface obtains input data once in at least one clock cycle. That is, the module for data table query in the embodiment of the present invention can obtain one input data in each clock cycle, that is, the iteration interval is 1, achieving the highest efficiency under the same working clock.
[0060] In some embodiments, the table lookup request interface, response interface and data interface are FIFO (First Input First Output) caches. Thus, the data output by each module first has a time sequence, and the next processing module can also read and process the data in sequence according to the order in the cache. Therefore, developers and designers do not need to care about the interface timing, which simplifies the design and improves the development efficiency. In addition, the FIFO cache itself has the ability to input and output a data in each clock cycle, so it can support efficient table lookup operations of the entire device.
[0061] In the related art, a state machine is usually used to design the control logic of the table lookup, which makes it impossible to have an input data in each clock cycle, resulting in a large iteration interval and low throughput. The above method of the present invention does not need to use a state machine, and can achieve an input data in each clock cycle, thereby improving work efficiency.
[0062] Figure 2 FIG. 2 shows a schematic diagram of a structure of a module for querying a data table according to some other embodiments of the present invention. Figure 2 As shown, the module for data table query in this embodiment includes a table query request module 201, one or more table query request interfaces 202, one or more table modules 203, one or more table query response interfaces 204, and a table query response module 205. The specific implementation of these modules is shown in FIG. Figure 1B In addition, the module 20 for querying the data table further includes: a data interface 206 .
[0063] The table lookup request module 201 is further configured to determine intermediate data according to the input data and send the intermediate data to the data interface 206. The table lookup response module 205 is further configured to generate processing result data according to the intermediate data and the table lookup result.
[0064] For example, the input data includes query requirements at multiple levels. The table lookup address generated by the table lookup request module is for the query requirements at one level. After obtaining the table lookup result, it is equivalent to obtaining the query result corresponding to the query requirement at one level. For query requirements at other levels, the table lookup request module intercepts relevant data from the input data and passes it to the table lookup response module. The table lookup response module outputs the query results of the current level and the query requirements at other levels, for example, to another table lookup request module to perform a query at the next level.
[0065] Therefore, the above embodiment can realize multi-level query requirements.
[0066] In some embodiments, the input data includes not only table lookup data but also non-table lookup data. In order to uniformly process these two types of data, the module for data table query in some embodiments of the present invention also provides a pseudo table module. Figure 3 An embodiment of a module for querying a data table according to the present invention is described.
[0067] Figure 3 FIG. 4 shows a schematic diagram of a structure of a module for querying a data table according to some other embodiments of the present invention. Figure 3 As shown, the module for data table query in this embodiment includes a table query request module 301, one or more table query request interfaces 302, one or more table modules 303, one or more table query response interfaces 304, and a table query response module 305. The specific implementation of these modules is shown in FIG. Figure 1B and Figure 2 The embodiment will not be described in detail here. As required, the module 30 for querying the data table may further include a data interface 306 .
[0068] In addition, the module 30 for data table query also includes: a default request interface 307 , a pseudo table module 308 and a default response interface 309 .
[0069] The pseudo table module 308 is connected to the table lookup request module 301 via the default request interface 307 and to the table lookup response module 205 via the default response interface 309 , and is configured to output the data in the default request interface 307 from the default response interface 309 .
[0070] The table lookup request module is further configured to input the input data to a default table lookup interface if the input data is not table lookup data.
[0071] The pseudo table module is not a real table module, and there is no internal cache for storing tables. Therefore, the data input to the module for data table query, whether it is table query data or non-table query data, can be normalized, which simplifies the processing logic of the table query request module and the table query response module, and does not need to be implemented with a state machine.
[0072] Some embodiments of the present invention can also implement multi-level query. Figure 4 An embodiment of the table lookup system of the present invention is described.
[0073] Figure 4 FIG. 2 shows a schematic diagram of a structure of a module for querying a data table according to some further embodiments of the present invention. Figure 4As shown, the module 4 for data table query in this embodiment includes a first module 41 for data table query and a second module 42 for data table query. The specific implementation methods of the first module 41 for data table query and the second module 42 for data table query refer to the modules for data table query in the aforementioned embodiments, which will not be repeated here.
[0074] The first module for data table query 41 inputs the processing result data of the first module for data table query 41 to the table query request module of the second module for data table query through the input interface of the second module for data table query 42, thereby realizing a cascaded table query structure. As needed, the system can also include more modules for data table query, which will not be repeated here.
[0075] Reference below Figure 5 An embodiment of the data table query method of the present invention is described.
[0076] Figure 5 FIG. 2 is a flow chart showing the processing logic of the data table query code according to some embodiments of the present invention. Figure 5 As shown, the processing logic of this embodiment includes steps S502 to S514.
[0077] In step S502, the table lookup request module generates a table lookup address according to input data read from the input interface.
[0078] In some embodiments, the table lookup address includes at least one of an index and a matching item.
[0079] In some embodiments, the table lookup request module monitors whether the input interface is not empty, and if so, reads input data therefrom.
[0080] In some embodiments, the table lookup request module determines the table entry to be read according to the input data, and further obtains the table lookup address of the table entry to be read.
[0081] In step S504, the table lookup request module outputs the table lookup address to the table lookup request interface corresponding to the table lookup address, wherein each table lookup request interface corresponds to a table module.
[0082] In step S506, the table module obtains a table lookup address from the table lookup request interface.
[0083] In step S508, the table module queries the table cache corresponding to the table module according to the table query address to obtain the table query result.
[0084] In step S510, the table module outputs the table lookup result to the table lookup response interface corresponding to the table module, wherein each table lookup response interface corresponds to a table module.
[0085] In step S512, the table lookup response module obtains the table lookup result from the table lookup response interface.
[0086] In some embodiments, the table lookup response module monitors whether each table lookup response interface is non-empty, and reads the table lookup result in the non-empty table lookup response interface.
[0087] In step S514, the table lookup response module generates processing result data according to the table lookup result, and outputs the processing result data.
[0088] Through the above embodiment, the table query request module, table module and table query response module independently process the request, query table cache and response operations, and the three modules are connected through interfaces. Each module only cares about reading data from the interface, processing and outputting data from the interface, and can process the next data without waiting for the entire table query process to be completed. Thus, the pipeline design is automatically realized, the table query process is simplified, the development efficiency is improved, and it is also easy to develop, reuse, maintain and manage.
[0089] Figure 6 FIG. 2 is a flow chart showing the processing logic of the data table query code according to some embodiments of the present invention. Figure 6 As shown, the processing logic of this embodiment includes steps S602 to S620.
[0090] In step S602, the table lookup request module generates a table lookup address according to input data read from the input interface.
[0091] In some embodiments, the table lookup address includes at least one of an index and a matching item.
[0092] In step S604, the table lookup request module outputs the table lookup address to the table lookup request interface corresponding to the table lookup address, wherein each table lookup request interface corresponds to a table module.
[0093] In step S606, the table lookup request module determines the intermediate data according to the input data.
[0094] In step S608, the table lookup request module sends the intermediate data to the data interface.
[0095] In step S610, the table module obtains a table lookup address from the table lookup request interface.
[0096] In step S612, the table module queries the table cache corresponding to the table module according to the table query address to obtain the table query result.
[0097] In step S614, the table module outputs the table lookup result to the table lookup response interface corresponding to the table module, wherein each table lookup response interface corresponds to a table module.
[0098] In step S616, the table lookup response module obtains intermediate data from the data interface.
[0099] In step S618, the table lookup response module obtains the table lookup result from the table lookup response interface.
[0100] In step S620, the table lookup response module generates processing result data according to the intermediate data and the table lookup result, and outputs the processing result data.
[0101] Therefore, the above embodiment can realize multi-level query requirements.
[0102] Figure 7 FIG. 2 is a flow chart showing the processing logic of the data table query code according to some embodiments of the present invention. Figure 7 As shown, the processing logic of this embodiment includes steps S702 to S720.
[0103] In step S702, the table lookup request module generates a table lookup address according to input data read from the input interface.
[0104] In some embodiments, the table lookup address includes at least one of an index and a matching item.
[0105] In some embodiments, the table lookup request module monitors whether the input interface is not empty, and if so, reads input data therefrom.
[0106] In some embodiments, the table lookup request module determines the table entry to be read according to the input data, and further obtains the table lookup address of the table entry to be read.
[0107] In step S704, the table lookup request module determines whether the input data read from the input interface is table lookup data.
[0108] When the input data is table lookup data, execute steps S706 to S712 ; when it is not table lookup data, execute steps S714 to S716 .
[0109] In step S706, the table lookup request module outputs the table lookup address to the table lookup request interface corresponding to the table lookup address, wherein each table lookup request interface corresponds to a table module.
[0110] In step S708, the table module obtains a table lookup address from the table lookup request interface.
[0111] In step S710, the table module queries the table cache corresponding to the table module according to the table query address to obtain the table query result.
[0112] In step S712, the table module outputs the table lookup result to the table lookup response interface corresponding to the table module, wherein each table lookup response interface corresponds to a table module.
[0113] In step S714, the table lookup request module inputs the table lookup address to the default table lookup interface.
[0114] In step S716, the pseudo table module outputs the data in the default request interface from the default response interface to the table lookup response module.
[0115] In step S718, the table lookup response module obtains data from the table lookup response interface and the default table lookup.
[0116] In some embodiments, the table lookup response module monitors whether each table lookup response interface is non-empty, and reads data in the non-empty table lookup response interface.
[0117] In step S720, the table lookup response module generates processing result data according to the table lookup result, and outputs the processing result data.
[0118] Therefore, the data input into the module for data table query, whether it is table lookup data or non-table lookup data, can be normalized, which simplifies the processing logic of the table lookup request module and the table lookup response module and does not need to be implemented by a state machine.
[0119] Figure 8 FIG. 4 is a schematic diagram showing the structure of a data table query device according to some embodiments of the present invention. Figure 8 As shown, the data table query device 80 of this embodiment includes:
[0120] The input module 810 is configured to input the data table query code into the high-level synthesis tool, so that the high-level synthesis tool generates a module for data table query based on the data table query code, wherein the module for data table query includes:
[0121] The table lookup request module is configured to read input data from the input interface; generate a table lookup address according to the input data; determine a corresponding table lookup request interface according to the table lookup address; and output the table lookup address to the corresponding table lookup request interface;
[0122] One or more table lookup request interfaces, wherein each table lookup request interface corresponds to a table module;
[0123] One or more table modules are configured to obtain a table lookup address from a table lookup request interface; query a table cache corresponding to the table module according to the table lookup address to obtain a table lookup result; and output the table lookup result to a table lookup response interface corresponding to the table module;
[0124] One or more table lookup response interfaces, wherein each table lookup response interface corresponds to a table module; and
[0125] The table lookup response module is configured to obtain the table lookup result from the table lookup response interface; generate processing result data according to the table lookup result; and output the processing result data;
[0126] An acquisition module 820 is configured to acquire an intermediate file generated by a high-level synthesis tool based on a module for data table query;
[0127] The generating module 830 is configured to generate a circuit with a data table query function based on the intermediate file.
[0128] Fig. 9 FIG. 2 shows a schematic diagram of a data table query device according to some other embodiments of the present invention. Fig. 9 As shown, the module 90 for data table query of this embodiment includes: a memory 910 and a processor 920 coupled to the memory 910, and the processor 920 is configured to execute the data table query method in any one of the aforementioned embodiments based on the instructions stored in the memory 910.
[0129] The memory 910 may include, for example, a system memory, a fixed non-volatile storage medium, etc. The system memory may store, for example, an operating system, an application program, a boot loader, and other programs.
[0130] Fig.10 FIG. 2 shows a schematic diagram of a data table query device according to some other embodiments of the present invention. Fig.10 As shown, the module 100 for data table query of this embodiment includes: a memory 1010 and a processor 1020, and may also include an input / output interface 1030, a network interface 1040, a storage interface 1050, etc. These interfaces 1030, 1040, 1050 and the memory 1010 and the processor 1020 may be connected, for example, via a bus 1060. Among them, the input / output interface 1030 provides a connection interface for input / output devices such as a display, a mouse, a keyboard, and a touch screen. The network interface 1040 provides a connection interface for various networked devices. The storage interface 1050 provides a connection interface for external storage devices such as SD cards and USB flash drives.
[0131] An embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, wherein the program implements any of the aforementioned data table query methods when executed by a processor.
[0132] It should be understood by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable non-transient storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0133] The present invention is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate a device for implementing the functions specified in one process or multiple processes in the flowchart and / or one box or multiple boxes in the block diagram.
[0134] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device that implements the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.
[0135] These computer program instructions may also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, whereby the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.
[0136] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A data table query method, comprising: The data table query code is input into a high-level synthesis tool so that the high-level synthesis tool generates a plurality of modules for data table query based on the data table query code, wherein the modules for data table query include: The table lookup request module is configured to read input data from an input interface; generate a table lookup address according to the input data; determine a corresponding table lookup request interface according to the table lookup address; and output the table lookup address to the corresponding table lookup request interface; One or more table lookup request interfaces, wherein each table lookup request interface corresponds to a table module; One or more table modules are configured to obtain the table lookup address from the table lookup request interface; query the table cache corresponding to the table module according to the table lookup address to obtain the table lookup result; and output the table lookup result to the table lookup response interface corresponding to the table module; One or more table lookup response interfaces, wherein each table lookup response interface corresponds to a table module; and A table lookup response module is configured to obtain the table lookup result from the table lookup response interface; generate processing result data according to the table lookup result; and output the processing result data; Acquire an intermediate file generated by the high-level synthesis tool based on the module for data table query; Based on the intermediate file, a circuit with a data table query function is generated.
2. The data table query method according to claim 1, wherein: The module for data table query also includes: Default request interface; The default reply interface; and a pseudo table module, connected to the table lookup request module via the default request interface, and connected to the table lookup response module via the default response interface, and configured to output the data in the default request interface from the default response interface; and The table lookup request module is further configured to input the input data to a default table lookup interface if the input data is not table lookup data.
3. The data table query method according to claim 1, wherein: The table lookup request interface, the response interface and the data interface are first-in-first-out caches.
4. The data table query method according to claim 1 or 3, wherein: The input interface obtains input data once every at least one clock cycle.
5. The data table query method according to claim 1, wherein: The table cache is stored inside the digital chip or in an external storage of the digital chip.
6. The data table query method according to claim 1, wherein: The module for data table query also includes: a data interface; The table lookup request module is further configured to determine intermediate data according to the input data; send the intermediate data to the data interface; and, The table lookup response module is further configured to generate processing result data according to the intermediate data and the table lookup result.
7. The data table query method according to claim 1, wherein: The intermediate file is an RTL file or a netlist.
8. The data table query method according to claim 1, wherein: The data table query code includes the following processing logic: The table lookup request module generates a table lookup address according to the input data read from the input interface; The table lookup request module outputs the table lookup address to a table lookup request interface corresponding to the table lookup address, wherein each table lookup request interface corresponds to a table module; The table module obtains the table lookup address from the table lookup request interface; The table module queries the table cache corresponding to the table module according to the table lookup address to obtain the table lookup result; The table module outputs the table lookup result to the table lookup response interface corresponding to the table module, wherein each table lookup response interface corresponds to a table module; The table lookup response module obtains the table lookup result from the table lookup response interface; The table lookup response module generates processing result data according to the table lookup result, and outputs the processing result data.
9. The data table query method according to claim 8, wherein: The data table query code also includes: The table lookup request module generates intermediate data according to the input data; The intermediate data is sent to the data interface so that the table lookup response module generates processing result data according to the intermediate data and the table lookup result.
10. The data table query method according to claim 2, wherein: The data table query code includes: The table lookup request module inputs the table lookup address to the default table lookup interface when the input data is not table lookup data; The pseudo table module outputs the data in the default request interface from the default response interface to the table lookup response module.
11. A data table query device, comprising: An input module is configured to input the data table query code into a high-level synthesis tool, so that the high-level synthesis tool generates a module for data table query based on the data table query code, wherein the module for data table query includes: The table lookup request module is configured to read input data from an input interface; generate a table lookup address according to the input data; determine a corresponding table lookup request interface according to the table lookup address; and output the table lookup address to the corresponding table lookup request interface; One or more table lookup request interfaces, wherein each table lookup request interface corresponds to a table module; One or more table modules are configured to obtain the table lookup address from the table lookup request interface; query the table cache corresponding to the table module according to the table lookup address to obtain the table lookup result; and output the table lookup result to the table lookup response interface corresponding to the table module; One or more table lookup response interfaces, wherein each table lookup response interface corresponds to a table module; and A table lookup response module is configured to obtain the table lookup result from the table lookup response interface; generate processing result data according to the table lookup result; and output the processing result data; An acquisition module configured to acquire an intermediate file generated by the high-level synthesis tool based on the module for data table query; The generating module is configured to generate a circuit with a data table query function based on the intermediate file.
12. A data table query device, comprising: Memory; as well as A processor coupled to the memory, the processor being configured to execute the data table query method according to any one of claims 1 to 10 based on instructions stored in the memory.
13. A computer-readable storage medium having a computer program stored thereon, wherein when the program is executed by a processor, the data table query method according to any one of claims 1 to 10 is implemented.
Citation Information
Patent Citations
Data storage system and data query method and device
CN111563125A
Data table query method and device and storage medium
CN111639095A