Reconfiguration optimization method and encoding / decoding circuit of non-volatile FPGA based on lookup table input inversion
By using lookup table input inversion and encoding and decoding circuit optimization in non-volatile FPGA, the problems of high energy consumption and long time consumption in the traditional reconstruction process are solved, achieving more efficient logic matching and energy consumption reduction, and improving MLC Reconfiguration performance of non-volatile FPGAs.
Patent Information
- Application Number
- CN202411129018.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-16
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2044-08-16
AI Technical Summary
In non-volatile FPGA chips, there are problems of high energy consumption and long time consumption in the traditional reconstruction process, mainly due to the high cost of writing operations, especially in MLC storage mode, writing hard bits and soft bits The energy consumption is large, and the reconstruction of the logical truth table requires a large number of updates, resulting in performance and energy consumption bottlenecks.
Using the lookup table input inversion method, by analyzing the flexibility of input inversion, a variety of input inversion schemes are generated, the reconstruction energy of each scheme is calculated, the scheme with the smallest energy is selected to rearrange the contents of the lookup table, and the encoding and decoding circuit is designed To optimize the write cost.
It effectively reduces the time and energy consumption of MLC non-volatile FPGA during reconstruction. Through the input inversion optimization strategy, it maximizes the matching of new and old logic, reduces the number of rewrites of hard bits, and improves reconstruction efficiency and performance.
Smart Images

Figure CN118643006B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of chips, in particular to a non-volatile FPGA chip, and in particular to a non-volatile FPGA reconstruction optimization method and a coding and decoding circuit based on lookup table input inversion. Background Art
[0002] Field-Programmable Gate Array (FPGA) is a semi-customized integrated circuit based on configurable logic blocks and configurable wiring resources. It can repeatedly configure circuit logic on a chip according to the needs of different applications or functions. Compared with dedicated integrated circuit ASIC, FPGA has higher development flexibility and debuggability. Compared with EPLD and CPLD, FPGA has an advantage in the scale of configurable gate circuits. Due to its advantages such as fast reconfiguration and high parallelism, FPGA has been widely used in 5G communications, network switching, video processing, Internet of Things and other fields.
[0003] In FPGA, the combinational logic and sequential logic that implement program functions are divided into a large number of interrelated truth tables and stored in the logic resources of the FPGA chip. When used, the original circuit operation is replaced by the lookup logic to achieve higher performance and lower energy consumption. The basic unit of logic resources in FPGA is the lookup table (LUT, Look-UpTable). Each lookup table stores a specific logic truth table, which corresponds to a part of the simple logic of the target application circuit. Through the connection and combination between different lookup tables, FPGA can realize complex combinational logic and sequential logic, thereby realizing any application deployed on the chip. The capacity of the lookup table is determined by the number of its inputs. The more inputs, the more content needs to be stored in a single truth table, but the access performance will be slower. At present, common FPGAs usually use 4 to 6 input lookup tables, which take into account the capacity and performance of the lookup table and provide high flexibility for logic synthesis.
[0004] At present, most mainstream FPGAs use storage cells based on SRAM technology to construct lookup tables. This type of storage cell has a series of problems such as limited storage density and high static power consumption. However, emerging big data-related applications have put forward high requirements on the on-chip logic resources of FPGAs. In order to solve this contradiction, some people have proposed to use a new type of non-volatile storage to replace the SRAM used on existing FPGA chips to construct lookup tables. Non-volatile storage has excellent characteristics such as non-volatility, low static power consumption and high storage density, so it is very suitable to replace SRAM as an on-chip storage resource of FPGA. In addition, some non-volatile memories such as phase change memory can support working in MLC storage mode (MLC, Multi-Level Cell). At this time, each storage cell will store multiple bits of data, which are divided into soft bits and hard bits. Compared with the ordinary single-layer storage mode (SLC, Single-Level Cell), the storage density is further improved. The emergence of MLC non-volatile FPGAs has broken the bottleneck of traditional FPGAs in storage, making high-speed processing of large-scale data possible.
[0005] Figure 1 The structure of a typical MLC non-volatile lookup table is shown, which includes two split lookup tables (fLUT1 and fLUT2) that can be used independently. Due to the use of MLC non-volatile storage, each split lookup table can be further regarded as a hard split lookup table (hard fLUT) composed of hard bits and a soft split lookup table (soft fLUT) composed of soft bits. These lookup tables can be used independently or combined into a larger lookup table. Therefore, the MLC non-volatile lookup table can have a variety of working modes, corresponding to different split lookup table organization forms. Due to the limitation of the number of lookup table inputs, the specific organization form of the split lookup table is constrained by the lookup table input. The query results of each lookup table are selected by the subsequent multiplexer (MUX, multiplexer) group, and finally the corresponding logic result is given. The selection of the multiplexer is controlled by the highest two bits of the input.
[0006] However, some common non-volatile memories have the characteristics of asymmetric read and write performance, that is, the speed and energy consumption of their write operations are much worse than those of read operations. At the same time, when the non-volatile memory works in MLC mode, the cost of each write is further increased because the stored data needs to be verified more accurately in MLC storage mode. Taking the spin transfer torque random access memory (STT-RAM, Shared Transistor Technology Random Access Memory) as an example, when a write operation only needs to modify the soft bit, it takes an average of 25.31 cycles and consumes 0.843nJ of energy; when only the hard bit needs to be modified, it takes an average of 31.19 cycles and consumes 1.659nJ of energy; when two bits need to be modified at the same time, it takes an average of 56.50 cycles and consumes 2.502nJ of energy. It can be seen that the cost of modifying the hard bit is much higher than that of modifying the soft bit. Therefore, the content of the newly written logic truth table is closely related to the speed and energy consumption of reconstruction. By preprocessing the written data and reducing the required modifications to the hard bit portion of the lookup table, the time and energy consumption of the MLC non-volatile FPGA during reconstruction can be reduced.
[0007] In the traditional FPGA usage model, the logic truth table is directly assigned to each lookup table during reconstruction, so there will be a large amount of content to be written that conflicts with the existing content in the lookup table, requiring a large number of updates, resulting in time-consuming and energy-intensive reconstruction. Common write optimization strategies are often very complex. In non-volatile FPGAs where logic resources are very precious, the use of existing write optimization strategies is accompanied by high performance and area costs, because the encoding and decoding logic of these strategies need to use the logic resources inside the FPGA to implement.
[0008] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present application, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention
[0009] In order to provide a basic understanding of some aspects of the disclosed embodiments, a brief summary is given below. The summary is not an extensive review, nor is it intended to identify key / critical elements or delineate the scope of protection of these embodiments, but rather serves as a prelude to the detailed description that follows.
[0010] The technical problem to be solved by the present invention is to provide a non-volatile FPGA reconstruction optimization method and encoding and decoding circuit based on lookup table input inversion, which utilizes the similarity between the new logic to be written and the existing logic in the lookup table, and adopts lightweight lookup table input inversion to rearrange the new logic to be written, so as to maximize the matching degree between the new logic and the existing logic, and reduce the reconstruction time and energy consumption as much as possible.
[0011] In order to solve the technical problem, the present invention adopts the lookup table input inversion as a lightweight encoding method to optimize the write cost. In the present invention, the inversion flexibility of each input of the lookup table is first analyzed, and then the flexibility guides the exploration of subsequent input inversion combinations. In order to ensure that the circuit logic implemented in the FPGA remains unchanged, the present invention designs a corresponding encoding and decoding circuit. Based on the auxiliary circuit designed for input inversion, the present invention further integrates the write optimization strategy based on bit inversion to achieve a further reduction in the write cost.
[0012] Specifically, the non-volatile FPGA reconstruction optimization method based on lookup table input inversion includes the following steps:
[0013] A non-volatile FPGA reconstruction optimization method based on lookup table input inversion is characterized by comprising the following steps:
[0014] S01), for the lookup table structure in the MLC non-volatile FPGA, define the inversion flexibility of the lookup table input, and use the inversion flexibility as an indicator to determine whether each input can be inverted;
[0015] S02), analyzing the inversion flexibility of all inputs, and generating a variety of different input inversion schemes based on the results of the input inversion flexibility analysis;
[0016] S03), calculating the reconstruction energy of each input inversion scheme, and using the input inversion scheme with the minimum reconstruction energy to rearrange the contents inside the lookup table;
[0017] The reconstruction energy is calculated as:
[0018] (1),
[0019] in represents the reconstruction energy, Indicates the number of hard bits that need to be rewritten in the hard split lookup table. represents the energy consumption of rewriting a hard bit, Indicates the number of soft bits that need to be rewritten in the soft split lookup table. Represents the energy consumption of rewriting one soft bit.
[0020] Furthermore, the rules for defining the inversion flexibility of the lookup table input are as follows: the inversion flexibility of the highest bit input of the lookup table is low, and the inversion flexibility of the other bit inputs of the lookup table is high; in a single lookup table, inputs with low inversion flexibility are not inverted; in a composite lookup table composed of multiple lookup tables, the inversion priority of inputs with low inversion flexibility is lower than the inversion priority of inputs with high inversion flexibility.
[0021] Furthermore, in step S02, all the bits of the input are reversed once in an arrangement and combination manner based on the constraint of the inversion flexibility, and each arrangement and combination forms a different input inversion scheme.
[0022] Furthermore, it also includes the inversion of the lookup table content. The granularity of the inversion of the lookup table content is the split lookup table level, that is, the content of the same split lookup table is completely inverted or not inverted. Whether the split lookup table content is inverted is determined by the corresponding reconstruction energy before and after the inversion. The reconstruction energy is calculated by formula (1).
[0023] Furthermore, if the hard bits and soft bits after the split lookup table content is inverted are consistent with the hard bits and soft bits of the original input, then , unchanged, if the hard bits after the split lookup table content is inverted are consistent with the hard bits of the original input, and if the soft bits after the split lookup table content is inverted are inconsistent with the soft bits of the original input, then constant, Add 1 if the hard bits after the split lookup table content is inverted are not consistent with the hard bits of the original input, and if the soft bits after the split lookup table content is inverted are consistent with the soft bits of the original input, then Add 1, Add 1 if the hard bits after the split lookup table content is inverted are inconsistent with the hard bits of the original input, and if the soft bits after the split lookup table content is inverted are inconsistent with the soft bits of the original input, then Add 1, constant.
[0024] Furthermore, a vector fLUT_Tags is set to record whether the split lookup table is content-inverted. For a lookup table composed of multiple split lookup tables, the combined classification lookup tables have the same fLUT_Tags.
[0025] The invention discloses a coding and decoding circuit of an FPGA lookup table. The lookup table content is inverted through the lookup table input and the lookup table content. The circuit comprises a coding circuit connected to the input end of the lookup table and a decoding circuit connected to the output end of the lookup table. The coding circuit comprises a coding XOR gate. The input of the coding XOR gate is the original input of the lookup table and a vector Input_Tags. The length of the vector Input_Tags is k, which is also the number of inputs of the lookup table. Each bit of the vector Input_Tags represents whether the corresponding input is inverted. The original input and the vector Input_Tags are passed through the coding XOR gate to generate an actual input. The actual input is input into the lookup table. The decoding circuit comprises a decoding XOR gate. The input of the decoding XOR gate is the coding output of the lookup table and a vector fLUT_Tag. The length of the vector fLUT_Tag is j, which is also the number of split lookup tables in the lookup table. The vector fLUT_Tag represents whether each split lookup table in the lookup table is inverted. The coding output and the vector fLUT_Tag are passed through the decoding XOR gate to generate the actual output of the lookup table.
[0026] Furthermore, the circuit is used for real-time encoding and decoding, that is, decoding is performed immediately when the lookup table output is generated.
[0027] The invention discloses a coding and decoding circuit of an FPGA lookup table. The content of the lookup table is inverted through the lookup table input and the lookup table content. The circuit comprises a first XOR gate and a second XOR gate connected between a lookup table I and a lookup table II. The input of the first XOR gate is a vector Input_Tags and a vector fLUT_Tag. The length of the vector Input_Tags is k, which is also the number of inputs of the lookup table II. Each bit of the vector Input_Tags represents whether the corresponding input is to be inverted. The length of the vector fLUT_Tag is j, which is also the number of split lookup tables in the lookup table I. The vector fLUT_Tag indicates whether each split lookup table in the lookup table I is inverted. The vector Input_Tags and the vector fLUT_Tag are passed through the first XOR gate to generate a final tag Final_Tag. The input of the second XOR gate is the encoded output of the lookup table I and the output Final_Tag of the first XOR gate. The encoded output of the lookup table I and the output Final_Tag of the first XOR gate are passed through the second XOR gate to generate an actual input, which is input to the lookup table II.
[0028] Furthermore, the circuit is used for delayed decoding, that is, the output of the lookup table remains in the encoded state for transmission until it is used as input by other lookup tables for decoding; Final_Tag is completed in the offline design stage.
[0029] Beneficial effects of the present invention: The present invention defines the inversion flexibility for the input of each lookup table to measure whether a specific lookup table input inversion will affect the performance of the final FPGA; the lookup table is rearranged based on input inversion, and the input inversion solution with the optimal reconstruction cost is found by traversing the reconstruction consumption under different input inversion combinations, and a corresponding encoding and decoding method is designed to ensure that the circuit logic implemented by the FPGA remains unchanged; on this basis, the write cost optimization based on content inversion is realized, and the reconstruction consumption of the MLC non-volatile FPGA is further optimized at a negligible cost by sharing the circuit with the input inversion function. By applying the present invention, the energy consumption of the MLC non-volatile FPGA during reconstruction can be effectively reduced at a very small performance cost and logic cost.
[0030] The above general description and the following description are exemplary and explanatory only and are not intended to limit the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] One or more embodiments are exemplarily described by corresponding drawings, which do not limit the embodiments. Elements with the same reference numerals in the drawings are shown as similar elements, and the drawings do not constitute a scale limitation, and wherein:
[0032] Figure 1 This is a typical MLC non-volatile lookup table structure diagram.
[0033] Figure 2 Schematic diagram of content redistribution based on inversion of lookup table input.
[0034] Figure 3 It is the flow chart of the present invention and a typical FPGA synthesis flow chart.
[0035] Figure 4 It is a schematic diagram of the lookup table input decoding process in the present invention.
[0036] Figure 5 are schematic diagrams of codec circuits, wherein (a) is a schematic diagram of the codec circuit described in Example 3, and (b) is a schematic diagram of the codec circuit described in Example 4. DETAILED DESCRIPTION
[0037] In order to be able to understand the features and technical contents of the embodiments of the present disclosure in more detail, the implementation of the embodiments of the present disclosure is described in detail below in conjunction with the accompanying drawings. The attached drawings are for reference only and are not used to limit the embodiments of the present disclosure. In the following technical description, for the convenience of explanation, a full understanding of the disclosed embodiments is provided through multiple details. However, one or more embodiments can still be implemented without these details. In other cases, to simplify the drawings, well-known structures and devices can be simplified for display.
[0038] The terms "first", "second", etc. in the specification and claims of the embodiments of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the terms used in this way can be interchanged where appropriate, so as to describe the embodiments of the embodiments of the present disclosure described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions.
[0039] Unless otherwise stated, the term "plurality" means two or more.
[0040] In the embodiment of the present disclosure, the character " / " indicates that the preceding and following objects are in an "or" relationship. For example, A / B indicates: A or B.
[0041] The term "and / or" is a description of the association relationship between objects, indicating that three relationships can exist. For example, A and / or B means: A or B, or, A and B.
[0042] The term "correspondence" may refer to an association relationship or a binding relationship. The correspondence between A and B means that there is an association relationship or a binding relationship between A and B.
[0043] Example 1
[0044] This embodiment discloses a non-volatile FPGA reconstruction optimization method based on lookup table input inversion, which includes three parts: 1. defining inversion flexibility; 2. generating different input inversion schemes; 3. traversing the reconstruction costs under different input inversion schemes to find the input inversion solution with the optimal reconstruction cost.
[0045] During the configuration process of the FPGA, the logic truth table is stored in each physical lookup table. When the application is executed, the lookup table returns the result of the corresponding logic operation according to different inputs. The actual process is equivalent to forming an address according to the input and accessing it in the lookup table. Therefore, by adjusting the input of the lookup table, its content can be remapped. The present invention uses the input inversion method to remap the content of the lookup table. Figure 2 As shown in the figure, each time an input of the lookup table is reversed, it is equivalent to swapping the content of the lookup table in half. The position of the reversed input determines the range of the content reversal. For example, reversing the highest bit of the input will cause the content of the first half of the lookup table to be swapped with the content of the second half; while reversing the lowest bit of the input will cause all bits in the lookup table to be swapped.
[0046] Therefore, the inversion of different inputs will bring different effects. Based on some characteristics of MLC non-volatile FPGA, the flexibility of inversion of some inputs will be limited. The lookup table of MLC non-volatile FPGA can be regarded as composed of two parts, namely, the hard lookup table (hard fLUT) composed of hard bits and the soft lookup table (soft fLUT) composed of soft bits, which can store different logical truth tables respectively. Since the speed of reading data from hard bits is slower than that of soft bits in MLC non-volatile processors, the reading performance of hard lookup tables is also weaker than that of soft lookup tables. To address this problem, when deploying applications on FPGA chips, the logic on the critical path of program execution will be avoided from being allocated to the hard lookup table, so that the frequency of FPGA design is higher and the performance is better, so that the program can be executed quickly. However, exchanging the highest bit of the lookup table will cause the contents of the soft lookup table and the hard lookup table in the current lookup table to be exchanged, so that the logic with higher reading speed requirements may be exchanged to the hard lookup table with slower reading speed, resulting in performance loss.
[0047] In order to prevent this from happening, it is necessary to avoid arbitrarily reversing the highest bit of the lookup table. Therefore, the present invention stipulates that the reversal flexibility of the highest bit input of the lookup table is low, and the reversal flexibility of the other bit inputs of the lookup table is high. In a single lookup table, the input with low reversal flexibility is not reversed. In a composite lookup table composed of multiple lookup tables, the reversal priority of the input with low reversal flexibility is lower than the reversal priority of the input with high reversal flexibility. In subsequent reversal operations, these inputs defined as low reversal flexibility will be less likely to be reversed, thereby ensuring that the performance of the FPGA design is not affected.
[0048] Based on the above defined lookup table input inversion flexibility, this embodiment proposes a reconstruction energy consumption optimization method based on lookup table input inversion. The overall FPGA design process is as follows: Figure 3 As shown, this method is at the end of the overall FPGA design process, that is, Figure 3 The steps included in the dotted box on the right are based on the original logic synthesis, packaging, layout and routing ( Figure 3 After that, all the lookup tables are resynthesized in-place, thus reducing the energy consumption during reconstruction.
[0049] First, the outer loop of the present invention is oriented to each lookup table in the MLC non-volatile FPGA circuit. For any lookup table, the present invention will first analyze the inversion freedom of all its inputs, which will determine whether these inputs can be inverted in the subsequent process. We have observed that most of the lookup tables on the critical path are soft split lookup tables (soft fLUT) composed of soft bits. Therefore, exchanging the content of the soft split lookup table and the content of the hard split lookup table (hard fLUT) inside the lookup table will most likely lead to an extension of the critical path of the FPGA, that is, performance degradation, because the delay of the hard split lookup table is significantly higher than that of the soft split lookup table. Therefore, the present invention tends to avoid inverting inputs with low inversion freedom such as the highest bit output.
[0050] Based on the results of the input inversion freedom analysis, the present invention will try to generate a variety of different input inversion schemes. Specifically, all input bits are inverted once in an arrangement and combination manner under the constraint of the inversion flexibility, and each arrangement and combination forms a different input inversion scheme. For example Figure 2 In the case of 4-bit input, based on the constraint of inversion flexibility, the highest bit is not inverted, that is, 0. There are eight other cases: 0100, 0101, 0110, 0111, 0000, 0001, 0010, and 0011. 1 indicates that the corresponding bit is inverted, and 0 indicates that the corresponding bit is not inverted.
[0051] Different inputs are inverted in different input inversion schemes, so that the content of the lookup table changes non-repetitively. In the inner loop of the present invention, these generated input inversion schemes will be detected one by one and their corresponding reconstruction energies will be calculated.
[0052] In the present invention, each input inversion scheme is represented by a vector Input_Tags of length k, where k is the number of inputs in the lookup table, and each bit represents whether the corresponding input is to be inverted. According to this vector, the content of the lookup table will be redistributed, and the reconstruction energy cost corresponding to the input inversion scheme is shown in formula (1).
[0053] (1),
[0054] in represents the reconstruction energy, Indicates the number of hard bits that need to be rewritten in the hard split lookup table. represents the energy consumption of rewriting a hard bit, Indicates the number of soft bits that need to be rewritten in the soft split lookup table. Indicates the energy consumption of rewriting a soft bit. When the input is inverted, the content of the lookup table written into the lookup table is compared with the existing content in the lookup table (such as the previous circuit) to obtain the number of soft bits and hard bits that need to be rewritten. If there are two split lookup tables that can be used independently in the lookup table, then include , , include , , formula (1) is transformed into:
[0055] (2).
[0056] After the reconstruction energy costs of all input inversion schemes are obtained, the input inversion scheme with the smallest cost will be adopted.
[0057] When the FPGA is actually configured, the redistributed logical lookup table content will be loaded into the corresponding lookup table, and the physical lookup table will also record the input inversion vector Input_Tags of the corresponding input inversion scheme. At runtime, the actual input will be generated by the XOR operation of the original input and the corresponding input Input_Tag. The specific process is as follows Figure 4 shown.
[0058] Example 2
[0059] The content redistribution technology based on lookup table input inversion described in Example 1 only changes the distribution of the lookup table content. This embodiment also implements an optimization method based on lookup table content inversion, further reducing the reconstruction cost of the MLC non-volatile FPGA.
[0060] Since the structure of the MLC non-volatile lookup table includes four split lookup tables (fLUT, fractured LUT), each of which has its own independent output, the present embodiment specifies that the granularity of the lookup table content inversion is the split lookup table level, that is, the contents of the same split lookup table will be either completely inverted or not inverted. Whether the split lookup table content is inverted or not depends on which form will correspond to less reconstruction cost, which depends on the number of bits that need to be rewritten in the table under each form, and is also calculated by formula (1). Different from the inversion operation in a single-layer non-volatile lookup table, in the MLC non-volatile lookup table, inverting a hard bit will simultaneously overwrite its corresponding soft bit. Therefore, the number of bits that need to be rewritten in the soft split lookup table is highly correlated with the corresponding hard split lookup table. Table 1 summarizes the MLC non-volatile lookup table in terms of counting the number of bits that need to be rewritten (i.e. ) when the law.
[0061] Table 1 Statistics rules for updating the number of bits in the MLC non-volatile lookup table
[0062]
[0063] In this table, the contents to be written into the lookup table are compared with the existing contents in the lookup table (such as the previous circuit), and a decision is made based on the comparison result whether the contents need to be inverted.
[0064] For each lookup table, the present invention also uses a vector fLUT_Tags of length 4 to record whether each split lookup table is inverted, that is, if the fLUT_Tag corresponding to a split lookup table is 1, its content will be completely inverted, and vice versa. In the MLC non-volatile lookup table, multiple split lookup tables may be combined into a larger lookup table. In this case, the present invention needs to ensure that these combined split lookup tables have the same fLUT_Tag, that is, they will be inverted at the same time or not. This is because if the multiple split lookup tables that make up a large lookup table have different inversion situations, it will cause inconsistencies when selecting the final output at the subsequent multiplexer of the lookup table.
[0065] Example 3
[0066] After the inversion of the lookup table content is achieved, the output of the lookup table becomes encoded and needs to be decoded to produce the real lookup table output. The decoding process is to perform an XOR operation on the original output and the corresponding fLUT_Tag to get the real output. However, if you need to decode directly at the output of the lookup table, you need to introduce a new set of decoding logic at the output of each split lookup table, such as Figure 5 As shown in (a). The content of the lookup table is inverted after the input of the lookup table and the content of the lookup table are inverted, including an encoding circuit connected to the input end of the lookup table and a decoding circuit connected to the output end of the lookup table. The encoding circuit includes an encoding XOR gate. The input of the encoding XOR gate is the original input of the lookup table and the vector Input_Tags. The length of the vector Input_Tags is k, which is also the number of inputs of the lookup table. Each bit of the vector Input_Tags represents whether the corresponding input is inverted. The original input and the vector Input_Tags are passed through the encoding XOR gate to generate the actual input, and the actual input is input into the lookup table; the decoding circuit includes a decoding XOR gate. The input of the decoding XOR gate is the encoding output of the lookup table and the vector fLUT_Tag. The length of the vector fLUT_Tag is j, which is also the number of split lookup tables in the lookup table. The vector fLUT_Tag indicates whether each split lookup table in the lookup table is inverted. The encoding output and the vector fLUT_Tag are passed through the decoding XOR gate to generate the actual output of the lookup table.
[0067] This circuit is a real-time encoding and decoding circuit, that is, decoding is performed immediately when the lookup table output is generated. This will bring a great logic cost. Based on this, further development is carried out and embodiment 4 is proposed.
[0068] Example 4
[0069] Note that for any lookup table, its output will inevitably become the input of other lookup tables (or other components), so it is unnecessary to decode the output immediately when it is generated. Since the input inversion-based method proposed in the present invention has introduced decoding logic based on XOR operation at the input of each lookup table, the output decoding required for the reconstruction cost optimization based on content inversion can completely share the same set of auxiliary logic with the input decoding. Figure 5 The codec circuit shown in (b) is shown in Figure 1.
[0070] first Figure 5 In (b), the lookup table content is inverted after the lookup table input and the lookup table content are inverted. The encoding and decoding circuit includes a first XOR gate and a second XOR gate connected between the lookup table I and the lookup table II. The input of the first XOR gate is the vector Input_Tags and the vector fLUT_Tag. The length of the vector Input_Tags is k, which is also the number of inputs of the lookup table II. Each bit of the vector Input_Tags represents whether the corresponding input is to be inverted. The length of the vector fLUT_Tag is j, which is also the number of split lookup tables in the lookup table I. The vector fLUT_Tag indicates whether each split lookup table in the lookup table I is inverted. The vector Input_Tags and the vector fLUT_Tag are passed through the first XOR gate to generate the final tag Final_Tag. The input of the second XOR gate is the encoded output of the lookup table I and the output Final_Tag of the first XOR gate. The encoded output of the lookup table I and the output Final_Tag of the first XOR gate are passed through the second XOR gate to generate the actual input, which is input to the lookup table II.
[0071] The encoding and decoding circuit shown in this embodiment is delayed decoding, that is, the output of the lookup table will remain in the encoded state for transmission until it is used as input by other lookup tables for decoding. Therefore, the tags used in the decoding of the two technologies also need to be XORed to obtain the final tags actually involved in the decoding. However, since the connection in the FPGA can be determined in the offline design stage, the generation process of this real tag is completed offline, and will not introduce the time cost of the FPGA runtime, thereby ensuring that the performance of the FPGA is not affected.
[0072] Through the above method, the present invention realizes FPGA reconstruction cost optimization based on lookup table content inversion at a very low cost, further improving the effect of the present invention in reducing the reconstruction cost of MLC non-volatile FPGA.
[0073] The above description is only the basic principle and preferred embodiments of the present invention. Equivalent 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 non-volatile FPGA reconfiguration optimization method based on lookup table input inversion, characterized in that: The following steps are involved: S01), for the lookup table structure in the MLC non-volatile FPGA, define the inversion flexibility of the lookup table input, and use the inversion flexibility as an indicator to determine whether each input can be inverted; S02), analyzing the inversion flexibility of all inputs, and generating a variety of different input inversion schemes based on the results of the input inversion flexibility analysis; S03), calculating the reconstruction energy of each input inversion scheme, and using the input inversion scheme with the minimum reconstruction energy to rearrange the contents inside the lookup table; The reconstruction energy is calculated as: (1), in represents the reconstruction energy, Indicates the number of hard bits that need to be rewritten in the hard split lookup table. represents the energy consumption of rewriting a hard bit, Indicates the number of soft bits that need to be rewritten in the soft split lookup table. Represents the energy consumption of rewriting one soft bit.
2. The non-volatile FPGA reconstruction optimization method based on lookup table input inversion according to claim 1 is characterized in that: The rules for defining the inversion flexibility of the lookup table input are as follows: the inversion flexibility of the highest bit input of the lookup table is low, and the inversion flexibility of the other bit inputs of the lookup table is high. In a single lookup table, inputs with low inversion flexibility are not inverted. In a composite lookup table composed of multiple lookup tables, the inversion priority of inputs with low inversion flexibility is lower than the inversion priority of inputs with high inversion flexibility.
3. The non-volatile FPGA reconstruction optimization method based on lookup table input inversion according to claim 1 or 2, characterized in that: In step S02, all bits of the input are reversed once in an arrangement and combination manner based on the constraint of the inversion flexibility, and each arrangement and combination forms a different input inversion scheme.
4. The non-volatile FPGA reconstruction optimization method based on lookup table input inversion according to claim 1 is characterized in that: It also includes the inversion of the lookup table content. The granularity of the inversion of the lookup table content is the split lookup table level, that is, the content of the same split lookup table is completely inverted or not inverted. Whether the split lookup table content is inverted is determined by the corresponding reconstruction energy before and after the inversion. The reconstruction energy is calculated by formula (1).
5. The non-volatile FPGA reconstruction optimization method based on lookup table input inversion according to claim 4 is characterized in that: If the hard bits and soft bits after the split lookup table content is inverted are consistent with the hard bits and soft bits of the original input, then , unchanged, if the hard bits after the split lookup table content is inverted are consistent with the hard bits of the original input, and if the soft bits after the split lookup table content is inverted are inconsistent with the soft bits of the original input, then constant, Add 1 if the hard bits after the split lookup table content is inverted are not consistent with the hard bits of the original input, and if the soft bits after the split lookup table content is inverted are consistent with the soft bits of the original input, then Add 1, Add 1 if the hard bits after the split lookup table content is inverted are inconsistent with the hard bits of the original input, and if the soft bits after the split lookup table content is inverted are inconsistent with the soft bits of the original input, then Add 1, constant.
6. The non-volatile FPGA reconfiguration optimization method based on lookup table input inversion according to claim 4, characterized in that: Set a vector fLUT_Tags to record whether the split lookup table is content-inverted. For a lookup table composed of multiple split lookup tables, the combined classification lookup tables have the same fLUT_Tags.
7. A coding and decoding circuit for an FPGA lookup table, wherein the content of the lookup table is inverted after the input of the lookup table is inverted and the content of the lookup table is inverted, characterized in that: The encoding and decoding circuit is used to implement the reconstruction optimization method of the non-volatile FPGA based on the inversion of the lookup table input as described in any one of claims 1 to 6, including an encoding circuit connected to the input end of the lookup table and a decoding circuit connected to the output end of the lookup table, the encoding circuit includes an encoding XOR gate, the input of the encoding XOR gate is the original input of the lookup table and the vector Input_Tags, the length of the vector Input_Tags is k, k is also the number of inputs of the lookup table, each bit of the vector Input_Tags represents whether the corresponding input is inverted, the original input and the vector Input_Tags are passed through the encoding XOR gate to generate the actual input, and the actual input is input into the lookup table; the decoding circuit includes a decoding XOR gate, the input of the decoding XOR gate is the encoding output of the lookup table and the vector fLUT_Tag, the length of the vector fLUT_Tag is j, j is also the number of split lookup tables in the lookup table, the vector fLUT_Tag indicates whether each split lookup table in the lookup table is inverted, and the encoding output and the vector fLUT_Tag are passed through the decoding XOR gate to generate the actual output of the lookup table.
8. The coding and decoding circuit of the FPGA lookup table according to claim 7, characterized in that: This circuit is used for real-time encoding and decoding, that is, decoding is performed immediately when the lookup table output is generated.
9. A coding and decoding circuit of an FPGA lookup table, characterized in that: The encoding and decoding circuit is used to implement the reconstruction optimization method of a non-volatile FPGA based on lookup table input inversion as described in any one of claims 1 to 6, including a first XOR gate and a second XOR gate connected between lookup table I and lookup table II, the input of the first XOR gate is a vector Input_Tags and a vector fLUT_Tag, the length of the vector Input_Tags is k, k is also the number of inputs of lookup table II, each bit of the vector Input_Tags represents whether the corresponding input is to be inverted, the length of the vector fLUT_Tag is j, j is also the number of split lookup tables in lookup table I, the vector fLUT_Tag indicates whether each split lookup table in lookup table I is inverted, the vector Input_Tags and the vector fLUT_Tag pass through the first XOR gate to generate a final tag Final_Tag, the input of the second XOR gate is the encoded output of lookup table I and the output Final_Tag of the first XOR gate, the encoded output of lookup table I and the output Final_Tag of the first XOR gate pass through the second XOR gate to generate an actual input, which is input to lookup table II.
10. The coding and decoding circuit of the FPGA lookup table according to claim 9, characterized in that: This circuit is used for delayed decoding, that is, the output of the lookup table remains encoded for transmission until it is used as input by other lookup tables for decoding; Final_Tag is done during the offline design phase.
Citation Information
Patent Citations
Low complexity high-order syndrome calculator for block codes and method of calculating high-order syndrome
CN104917535A
Adjustable trade-off between quality and computation complexity in video codecs
US20230171436A1
