Configurable in-memory computing architecture and its compiler based on standard cells

Through a configurable in-memory computing architecture and compiler based on standard units, the problems of complex in-memory computing architecture design and difficult process migration are solved, and efficient multiplication calculations and result storage are achieved, which is suitable for artificial intelligence and big data processing, improving Computational efficiency and energy efficiency.

CN118503203BActive Publication Date: 2024-09-24NAT UNIV OF DEFENSE TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410923731.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-10
Publication Date
2024-09-24
Estimated Expiration
2044-07-10

AI Technical Summary

Technical Problem

The existing in-memory computing architecture has complex design, long development cycle, and difficult process migration. In addition, the traditional computing architecture has high delay and energy consumption during the data transmission process, which affects computing efficiency.

Method used

Design a configurable in-memory computing architecture based on standard cells, including serial shift multiplier storage subarray, global word line and control module, local word line, subarray selection signal module and output multi-selection module, through the compiler Automatically generate a full set of view files, allowing users to configure the calculation accuracy and number of multiplier subarrays to achieve automation and flexibility.

Benefits of technology

It simplifies the in-memory computing architecture design process, reduces time and labor costs, improves computing efficiency and energy efficiency, is suitable for artificial intelligence and big data processing, and is fully automatic, configurable and highly process-migrating.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118503203B
    Figure CN118503203B
Patent Text Reader

Abstract

The present application relates to a configurable in-memory computing architecture based on standard cells and its compiler. The in-memory computing architecture is designed based on standard cells, and includes m rows and n columns of serial shift multiplier storage subarrays, global word lines and control modules, local word lines, subarray selection signal modules, and output multiple selection modules. In the serial shift multiplier storage subarrays in the in-memory computing architecture, multiplication calculations and result storage can be efficiently completed, avoiding the delay and power consumption caused by data transmission. At the same time, a full set of view files of the in-memory computing architecture are automatically compiled and generated based on the design method of standard cells, which greatly simplifies the design process of the in-memory computing architecture and reduces time and labor costs. The generation of specific circuits under the in-memory computing architecture is fully automatic, configurable, and has strong process migration characteristics.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of integrated circuit technology, and in particular to a configurable in-memory computing architecture based on standard cells and a compiler thereof. Background Art

[0002] In modern computing systems, multiplication operations are at the core of many complex computing tasks, such as matrix multiplication and convolutional neural networks. Traditional computing architectures transfer data from memory to processing units for calculation, and then transfer the results back to memory. This data transfer process not only increases computing latency and energy consumption, but also leads to reduced system efficiency. Computing-In-Memory (CIM) can significantly reduce data transfer and improve computing efficiency and energy efficiency by integrating computing units directly into memory.

[0003] At present, there are mainly the following categories of in-memory computing: analog CIM, all-digital CIM, hybrid CIM and CIM based on new memories. Among them, although analog CIM can achieve high density and high energy efficiency, its main disadvantage is insufficient accuracy due to low signal-to-noise ratio. Hybrid CIM first uses analog circuits for preliminary calculations, and then uses digital circuits for correction, which improves accuracy. CIM based on new memories has the advantages of non-volatility, high density, and low power consumption, but its process maturity and reliability need to be improved. Most importantly, these four in-memory computing architectures all use fully customized designs, which have high design complexity, long development cycles, and are highly dependent on the knowledge and experience of design engineers. In addition, these architectures perform poorly in process migration and are difficult to adapt to different manufacturing process nodes. Summary of the invention

[0004] Based on this, it is necessary to provide a configurable in-memory computing architecture based on standard cells and its compiler to address the above technical issues.

[0005] A configurable in-memory computing architecture based on standard cells, the in-memory computing architecture is designed based on standard cells, and includes: m rows and n columns of serial shift multiplier storage subarrays, a global word line and control module, a local word line, a subarray selection signal module, and an output multi-select module;

[0006] The serial shift multiplier storage subarray is used as a basic storage subarray of the in-memory computing architecture to support multiplication calculation and result storage;

[0007] The global word line and control module is used to select and control the serial shift multiplier storage subarray, and each serial shift multiplier storage subarray is equipped with an independent local word line, and the internal logic of the serial shift multiplier storage subarray is precisely controlled through the local word line;

[0008] The subarray selection signal module is used to configure the number of storage subarrays of the serial shift multiplier participating in the multiplication calculation according to user input;

[0009] The output multiple selection module is used to output the multiplication result of the serial shift multiplier storage subarray.

[0010] In one embodiment, each serial shift multiplier storage subarray is composed of five rows of storage bit cells, one row of full adders, and one row of dot product logic;

[0011] Wherein, the storage bit unit is composed of a trigger, which is used to support the normal read-write mode and the in-memory calculation mode, including an output multiple-select bit unit, an input multiple-select bit unit and an input-output multiple-select bit unit; wherein the first row of storage bit units is an output multiple-select bit unit, the second row of storage bit units is a first input-output multiple-select bit unit, the third row of storage bit units is a second input-output multiple-select bit unit, the fourth row of storage bit units is a first input multiple-select bit unit, and the fifth row of storage bit units is a second input multiple-select bit unit;

[0012] The point multiplication logic is represented by an AND gate, located between the first row of storage bit cells and the second row of storage bit cells, and is used to perform point-by-point multiplication operations on the input operands of the serial shift multiplier storage subarray and the local operands output by the first row of storage bit cells in parallel;

[0013] The full adder is located between the second row storage bit units, and the full adder and the dot multiplication logic and the first input and output multiple selection bit unit and the second input and output multiple selection bit unit together form a serial shift multiplier;

[0014] Among them, the serial shift multiplier multiplies the current multiplier bit with the multiplicand for each bit of the multiplier to obtain a partial product; uses a full adder to add the partial product, the current partial sum and the current carry to obtain a new partial sum and a new carry; outputs the least significant bit of the new partial sum to the corresponding position of the result; and keeps the new partial sum and the new carry in the second row storage bit unit and the third row storage bit unit so as to be used as the current partial sum and the current carry in the next calculation.

[0015] In one embodiment, the serial shift multiplier storage subarray further includes:

[0016] In the normal read / write mode, the mode selection signal s_mode of all storage bit cells is set to 0, and the read / write data are read out through the normal read data signal line mem_out and written into the normal write data signal line mem_in of the storage bit cells respectively, and all storage bit cells are controlled by the global word line and the control module. At this time, the serial shift multiplier storage subarray is regarded as a normal storage array;

[0017] In the in-memory calculation mode, the mode selection signal s_mode of all storage bit cells is set to 1, wherein the first row of storage bit cells is used to output the local operands required for the multiplication calculation; the second row of storage bit cells is used to store and output the partial sum of the full adder; the third row of storage bit cells is used to store and output the carry output of the full adder; the fourth row of storage bit cells and the fifth row of storage bit cells are used to store the final multiplication results.

[0018] In one embodiment, when the serial shift multiplier storage subarray performs a 4bit×4bit multiplication calculation, the first row of storage bit cells of the serial shift multiplier storage subarray consists of four output multiple selection bit cells, which are represented from right to left as BC_OUT<0,0>, BC_OUT<0,1>, BC_OUT<0,2> and BC_OUT<0,3> respectively; the second row of storage bit cells consists of four first input and output multiple selection bit cells, which are represented from right to left as BC_ALL<1,0>, BC_ALL<1,1>, BC_ALL<1,2> ​​and BC_ALL<1,3> respectively; the third row of storage bit cells consists of four second input and output multiple selection bit cells, From right to left, they are BC_ALL<2,0>, BC_ALL<2,1>, BC_ALL<2,2> and BC_ALL<2,3> respectively; the fourth row of storage bit cells consists of 4 first input multiple selection bit cells, which are BC_IN<3,0>, BC_IN<3,1>, BC_IN<3,2> and BC_IN<3,3> respectively from right to left; the fifth row of storage bit cells consists of 4 second input multiple selection bit cells, which are BC_IN<4,0>, BC_IN<4,1>, BC_IN<4,2> and BC_IN<4,3> respectively from right to left; a row of point multiplication logic consists of 4 point multiplication logics, and a row of full adders consists of 4 full adders;

[0019] The specific process of performing 4-bit×4-bit multiplication calculation according to the serial shift multiplier storage subarray includes:

[0020] Before calculation, initialization is achieved by writing 0 to the storage bit cells in the second row to the fifth row;

[0021] During calculation, the multiplication calculation is completed within 8 cycles and the final multiplication calculation result is stored in the fourth row storage bit unit and the fifth row storage bit unit;

[0022] Among them, in the first 4 cycles, the input operands of the serial shift multiplier storage subarray are sequentially input into the first input ends of all 4 dot multiplication logics in order from low to high, and the local operands output by the 4 output multi-select bit units of the first row storage bit unit are respectively input into the second input ends of the 4 dot multiplication logics, and the input operands and the local operands are multiplied in parallel through the 4 dot multiplication logics to output 4 first addends, which are represented as FA_A0, FA_A1, FA_A2, and FA_A3 from right to left; the 4 first input and output multi-select bits of the second row storage bit unit are read. The 4 second addends output by the unit are represented as FA_B0, FA_B1, FA_B2, and FA_B3 from right to left; the 4 second inputs and outputs of the storage bit unit in the third row are read, and the 4 carry inputs output by the multiple selection bit unit are represented as FA_Cin0, FA_Cin1, FA_Cin2, and FA_Cin3 from right to left; the 4 first addends, 4 second addends, and 4 carry inputs are fully added according to the 4 full adders to obtain 4 partial sums and 4 carry outputs. The 4 partial sums are represented as FA_Sum0, FA_Su from right to left. m1, FA_Sum2, FA_Sum3, and the four carry outputs are represented from right to left as FA_Cout0, FA_Cout1, FA_Cout2, and FA_Cout3; after one cycle of calculation is completed, when the clock rising edge of the next cycle arrives, the high 3 bits and FA_Sum1, FA_Sum2, and FA_Sum3 are written into BC_ALL<1,0>, BC_ALL<1,1>, and BC_ALL<1,2> ​​of the second row of storage bit cells, and the lowest bit and FA_Sum0 are used as the final multiplication calculation. The calculation result is output to the corresponding positions of the storage bit cells in the fourth row and the fifth row; FA_Cout0, FA_Cout1, FA_Cout2, and FA_Cout3 are written into BC_ALL<2,0>, BC_ALL<2,1>, BC_ALL<2,2>, and BC_ALL<2,3> of the storage bit cells in the third row, respectively; wherein the input operands of the first four cycles of the serial shift multiplier storage subarray and the local operands output by the storage bit cells in the first row are both 4 bits, and the obtained output is the lower 4 bits of the final multiplication calculation result;

[0023] Considering that only the lowest bit of the partial sum is output in the first four cycles, and the high-order partial sum and carry have not been processed, in the next four cycles, 0 is input as the input operand into the 4 point multiplication logics, and no new partial product is generated. By accumulating the high-order partial sum and carry, all the remaining partial sums and carries are gradually processed until the high 4 bits of the final multiplication result are output;

[0024] After 8 cycles, an 8-bit multiplication calculation result is finally output, wherein only one bit of multiplication calculation result is output in each cycle, and the multiplication calculation results are output in sequence from low to high. The first 4 cycles output the low 4-bit multiplication calculation result to the 4 first input multiple-select bit units of the fourth row of storage bit units, and the last 4 cycles output the high 4-bit multiplication calculation result to the 4 second input multiple-select bit units of the fifth row of storage bit units.

[0025] In one embodiment, the output multi-select bit unit is used to store and read and write local operands, the local operands are written and stored in the output multi-select bit unit in the normal read and write mode, and are read out and subsequent dot multiplication and accumulation operations are performed in the in-memory calculation mode;

[0026] Among them, in the normal read-write mode, the mode selection signal s_mode of the output multiple selection bit unit is set to 0. When reading data, the value in the output multiple selection bit unit is read from the normal read data signal line mem_out through the multiple selector, and finally transmitted to the read data bus in the normal read-write mode; when writing data, the output multiple selection bit unit is selected through the global word line and the control module, and the data is written into the output multiple selection bit unit from the normal write data signal line mem_in;

[0027] In the in-memory calculation mode, the mode selection signal s_mode of the output multiple-select bit unit is set to 1. At this time, the output multiple-select bit unit does not perform data writing operations; when reading data, the value in the output multiple-select bit unit is transmitted from the in-memory calculation output signal line cim_out through the multiplexer and connected to other units for subsequent calculations.

[0028] In one embodiment, the input-output multi-select bit unit is used to store and output partial sums and carry outputs of the full adder;

[0029] Among them, in the normal read-write mode, the mode selection signal s_mode of the input-output multi-select bit unit is set to 0. When reading data, the value in the input-output multi-select bit unit is read from the normal read data signal line mem_out through the multiplexer, and finally transmitted to the read data bus in the normal read-write mode; when writing data, the input-output multi-select bit unit is selected through the global word line and the control module, and the data is written into the input-output multi-select bit unit from the normal write data signal line mem_in through the multiplexer;

[0030] In the in-memory calculation mode, the mode selection signal s_mode of the input / output multi-select bit unit is set to 1. When reading data, the value in the input / output multi-select bit unit is transmitted from the in-memory calculation output signal line cim_out through the multiplexer and connected to other units for subsequent calculation; when writing data, the input / output multi-select bit unit is selected through the local word line, and the calculation results obtained from other units are written into the input / output multi-select bit unit from the in-memory calculation input signal line cim_in through the multiplexer.

[0031] In one of the embodiments, the input multiple selection bit unit is used to store the final multiplication result;

[0032] Among them, in the normal read-write mode, the mode selection signal s_mode of the input multiple selection bit unit is set to 0. When reading data, the value in the input multiple selection bit unit is read from the normal read data signal line mem_out, and finally transmitted to the read data bus in the normal read-write mode; when writing data, the input multiple selection bit unit is selected through the global word line and the control module, and the data is written into the input multiple selection bit unit through the multiple selector from the normal write data signal line mem_in;

[0033] In the in-memory calculation mode, the mode selection signal s_mode of the input multi-select bit unit is set to 1. At this time, the input multi-select bit unit does not perform data read operations; when writing data, the input multi-select bit unit is selected through the local word line, and the calculation results obtained from other units are written into the input multi-select bit unit from the in-memory calculation input signal line cim_in through the multiple selector.

[0034] In one embodiment, the capacity of the m-row and n-column serial shift multiplier storage subarray is H×W, wherein H=5×m represents the depth of the array, W=c×n represents the bit width of the array, and c represents the calculation precision.

[0035] A compiler is provided, which is based on a standard cell library and automatically compiles and generates a complete set of view files of the above-mentioned configurable in-memory computing architecture based on standard cells through circuit compilation according to user input.

[0036] In one embodiment, the compilation process of the compiler includes:

[0037] Get user input;

[0038] Generate a single serial shift multiplier storage subarray RTL description according to the calculation precision input by the user;

[0039] Generate a complete array RTL description based on the array depth and array width input by the user;

[0040] Determine the array capacity according to the calculation accuracy, array depth and array bit width input by the user, and generate the word line and control logic RTL description according to the array capacity calculation;

[0041] The generated RTL description is mapped using the standard cell library to generate a netlist file. The netlist file is verified and automatically laid out and routed to generate and output a full set of view files for a configurable in-memory computing architecture based on standard cells.

[0042] The above-mentioned configurable in-memory computing architecture based on standard cells and its compiler can efficiently complete multiplication calculations and result storage in the serial shift multiplier storage subarrays in the in-memory computing architecture, avoiding the delay and power consumption caused by data transmission. The parallel computing architecture in the storage subarray ensures computing power and energy efficiency, and can be applied to technical fields such as artificial intelligence and big data processing. At the same time, the full set of view files of the in-memory computing architecture are automatically compiled and generated based on the design method of standard cells, which greatly simplifies the design process of the in-memory computing architecture, reduces time and labor costs, and supports the determination of calculation accuracy and the number of multiplier subarrays based on user input, thereby further determining the capacity of the entire array and the peripheral circuit design. The generation of specific circuits under this in-memory computing architecture is fully automatic, configurable, and highly process-migratable, and has broad application prospects and commercial value. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] Figure 1 is a schematic diagram of a configurable in-memory computing architecture based on standard cells in one embodiment;

[0044] Figure 2 is a schematic structural diagram of a serial shift multiplier storage subarray in one embodiment;

[0045] Figure 3 It is a schematic diagram of the principle of outputting a multi-selection bit unit in one embodiment;

[0046] Figure 4 It is a schematic diagram of the principle of an input and output multi-select bit unit in one embodiment;

[0047] Figure 5 A schematic diagram of the principle of inputting a multi-selection unit in one embodiment;

[0048] Figure 6 The figure is a schematic diagram of the compilation process of a compiler in one embodiment. DETAILED DESCRIPTION

[0049] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0050] In one embodiment, Figure 1 As shown, a configurable in-memory computing architecture based on standard cells is provided, and the in-memory computing architecture is designed based on standard cells, including: m rows and n columns of serial shift multiplier storage subarrays, a global word line and control module, a local word line, a subarray selection signal module, and an output multi-select module;

[0051] The serial shift multiplier storage subarray is used as a basic storage subarray of the in-memory computing architecture to support multiplication calculation and result storage;

[0052] The global word line and control module is used to select and control the serial shift multiplier storage subarray, and each serial shift multiplier storage subarray is equipped with an independent local word line, and the internal logic of the serial shift multiplier storage subarray is precisely controlled through the local word line;

[0053] The subarray selection signal module is used to configure the number of storage subarrays of the serial shift multiplier participating in the multiplication calculation according to user input;

[0054] The output multiple selection module is used to output the multiplication result of the serial shift multiplier storage subarray.

[0055] in, Figure 1 Where H×W represents the capacity of the storage subarray of m rows and n columns of serial shift multipliers; where H=5×m represents the depth of the array, W=c×n represents the bit width of the array, and c represents the calculation accuracy.

[0056] In one embodiment, if Figure 2 As shown, taking 4-bit precision as an example, the capacity of the serial shift multiplier storage subarray is 5x4 bits, and each serial shift multiplier storage subarray is composed of five rows of storage bit units, one row of full adders and one row of dot multiplication logic.

[0057] Among them, the storage bit unit is composed of triggers to support normal read and write mode and in-memory calculation mode, including an output multiple-select bit unit (BC_OUT), an input multiple-select bit unit (BC_IN) and an input-output multiple-select bit unit (BC_ALL); among them, the first row of storage bit units are output multiple-select bit units, the second row of storage bit units are first input-output multiple-select bit units, the third row of storage bit units are second input-output multiple-select bit units, the fourth row of storage bit units are first input multiple-select bit units, and the fifth row of storage bit units are second input multiple-select bit units.

[0058] The point multiplication logic is represented by an AND gate, which is located between the first row of storage bit cells and the second row of storage bit cells. It is used to perform point-by-point multiplication operations in parallel on the input operands of the serial shift multiplier storage subarray input from the in-memory calculation data input line (CIM_DATA_IN) and the local operands output by the first row of storage bit cells.

[0059] The full adder is located between the second row of storage bit units, represented by a circle addition, and the full adder and the dot multiplication logic together with the first input and output multiple selection bit unit and the second input and output multiple selection bit unit form a serial shift multiplier;

[0060] Among them, the serial shift multiplier multiplies the current multiplier bit with the multiplicand for each bit of the multiplier to obtain a partial product; uses a full adder to add the partial product, the current partial sum and the current carry to obtain a new partial sum and a new carry; outputs the least significant bit of the new partial sum to the corresponding position of the result; and keeps the new partial sum and the new carry in the second row storage bit unit and the third row storage bit unit so as to be used as the current partial sum and the current carry in the next calculation.

[0061] Furthermore, the serial shift multiplier storage subarray further includes:

[0062] In normal read / write mode, the mode selection signal s_mode of all storage bit cells is set to 0, and the read / write data is read out through the normal read data signal line mem_out and written into the normal write data signal line mem_in of the storage bit cells respectively, and all storage bit cells are controlled by the global word line and control module. At this time, the serial shift multiplier storage subarray is regarded as a normal storage array with a bit width of 4 bits and a depth of 5;

[0063] In the in-memory calculation mode, the mode selection signal s_mode of all storage bit cells is set to 1, wherein the first row of storage bit cells is used to output the local operands required for the multiplication calculation; the second row of storage bit cells is used to store and output the partial sum of the full adder; the third row of storage bit cells is used to store and output the carry output of the full adder; the fourth row of storage bit cells and the fifth row of storage bit cells are used to store the final multiplication results.

[0064] Further,

[0065] When the serial shift multiplier storage subarray performs a 4bit×4bit multiplication calculation, the first row of storage bit cells of the serial shift multiplier storage subarray consists of 4 output multiple selection bit cells, which are represented as BC_OUT<0,0>, BC_OUT<0,1>, BC_OUT<0,2> and BC_OUT<0,3> from right to left; the second row of storage bit cells consists of 4 first input and output multiple selection bit cells, which are represented as BC_ALL<1,0>, BC_ALL<1,1>, BC_ALL<1,2> ​​and BC_ALL<1,3> from right to left; the third row of storage bit cells consists of 4 second input and output multiple selection bit cells, which are represented as BC_ALL<1,0>, BC_ALL<1,1>, BC_ALL<1,2> ​​and BC_ALL<1,3> from right to left; The fourth row of storage bit cells consists of 4 first-input multi-select bit cells, which are represented as BC_IN<3,0>, BC_IN<3,1>, BC_IN<3,2> and BC_IN<3,3> from right to left; the fifth row of storage bit cells consists of 4 second-input multi-select bit cells, which are represented as BC_IN<4,0>, BC_IN<4,1>, BC_IN<4,2> and BC_IN<4,3> from right to left; a row of point multiplication logic consists of 4 point multiplication logics, and a row of full adders consists of 4 full adders.

[0066] The specific process of performing 4-bit×4-bit multiplication calculation according to the serial shift multiplier storage subarray includes:

[0067] Before calculation, initialization is achieved by performing a write-0 operation on the storage bit cells in the second row to the fifth row.

[0068] During calculation, the multiplication calculation is completed within 8 cycles and the final multiplication calculation result is stored in the fourth row storage bit unit and the fifth row storage bit unit.

[0069] Among them, in the first 4 cycles, the input operands of the serial shift multiplier storage subarray are sequentially input into the first input ends of all 4 dot multiplication logics in order from low to high, and the local operands output by the 4 output multi-select bit units of the first row storage bit unit are respectively input into the second input ends of the 4 dot multiplication logics, and the input operands and the local operands are multiplied in parallel through the 4 dot multiplication logics to output 4 first addends, which are represented as FA_A0, FA_A1, FA_A2, and FA_A3 from right to left; the 4 first input and output multi-select bits of the second row storage bit unit are read. The 4 second addends output by the unit are represented as FA_B0, FA_B1, FA_B2, and FA_B3 from right to left; the 4 second inputs and outputs of the storage bit unit in the third row are read, and the 4 carry inputs output by the multiple selection bit unit are represented as FA_Cin0, FA_Cin1, FA_Cin2, and FA_Cin3 from right to left; the 4 first addends, 4 second addends, and 4 carry inputs are fully added according to the 4 full adders to obtain 4 partial sums and 4 carry outputs. The 4 partial sums are represented as FA_Sum0, FA_Su from right to left. m1, FA_Sum2, FA_Sum3, and the four carry outputs are represented from right to left as FA_Cout0, FA_Cout1, FA_Cout2, and FA_Cout3; after one cycle of calculation is completed, when the clock rising edge of the next cycle arrives, the high 3 bits and FA_Sum1, FA_Sum2, and FA_Sum3 are written into BC_ALL<1,0>, BC_ALL<1,1>, and BC_ALL<1,2> ​​of the second row of storage bit cells, and the lowest bit and FA_Sum0 are used as the final multiplication calculation. The calculation result is output to the corresponding positions of the fourth row storage bit unit and the fifth row storage bit unit; FA_Cout0, FA_Cout1, FA_Cout2, FA_Cout3 are written into BC_ALL<2,0>, BC_ALL<2,1>, BC_ALL<2,2> and BC_ALL<2,3> of the third row storage bit unit respectively; wherein, the input operands of the first 4 cycles of the serial shift multiplier storage subarray and the local operands output by the first row storage bit unit are both 4 bits, and the obtained output is the lower 4 bits of the final multiplication calculation result. Among them, due to strict clock control, the second addend, partial sum, carry input and carry output of the full adder are reused, and the shift addition operation is realized;

[0070] Considering that only the lowest bit of the partial sum is output in the first four cycles, and the high-order partial sum and carry have not been processed, in the next four cycles, 0 is input as the input operand into the 4 dot multiplication logics, and no new partial product is generated. By accumulating the high-order partial sum and carry, all the remaining partial sums and carries are gradually processed until the high 4 bits of the final multiplication result are output. This ensures that all carries are processed correctly.

[0071] After 8 cycles, an 8-bit multiplication result is finally output, wherein only one bit of multiplication result is output in each cycle, and the multiplication result is output from the in-memory calculation data output line (CIM_DATA_OUT) in order from low to high. The first 4 cycles output the low 4-bit multiplication result to the 4 first input multiple selection bit units of the fourth row of storage bit units, and the last 4 cycles output the high 4-bit multiplication result to the 4 second input multiple selection bit units of the fifth row of storage bit units.

[0072] Furthermore, the principle design of the output multi-selection unit is as follows Figure 3 As shown, the output multi-select bit unit is used to store and read and write local operands. The local operands are written and stored in the output multi-select bit unit in the normal read and write mode, and are read out in the in-memory calculation mode and perform subsequent point multiplication and accumulation operations. Therefore, this bit unit only needs to select the read path through the mode selection signal in the output part.

[0073] Among them, in the normal read-write mode, the mode selection signal s_mode of the output multi-select bit unit is set to 0. When reading data, the value in the output multi-select bit unit is read from the normal read data signal line mem_out through the multiplexer, and finally transmitted to the read data bus in the normal read-write mode; when writing data, the output multi-select bit unit is selected through the global word line and control module, and the data is written into the output multi-select bit unit from the normal write data signal line mem_in.

[0074] In the in-memory calculation mode, the mode selection signal s_mode of the output multiple-select bit unit is set to 1. At this time, the output multiple-select bit unit does not perform data writing operations; when reading data, the value in the output multiple-select bit unit is transmitted from the in-memory calculation output signal line cim_out through the multiplexer and connected to other units for subsequent calculations.

[0075] Furthermore, the principle design of the input and output multi-select bit unit is as follows Figure 4 As shown, the input and output multiple selection bit unit is used to store and output the partial sum and carry output of the full adder. This bit unit needs to support the selection of whether to write normal read data or the intermediate result of multiplication calculation when writing, and needs to select normal reading or for the next step of calculation when reading. Therefore, multiple selectors are set in both the input and output parts to select the correct signal transmission line.

[0076] Among them, in the normal read-write mode, the mode selection signal s_mode of the input-output multi-select bit unit is set to 0. When reading data, the value in the input-output multi-select bit unit is read from the normal read data signal line mem_out through the multiplexer, and finally transmitted to the read data bus in the normal read-write mode; when writing data, the input-output multi-select bit unit is selected through the global word line and the control module, and the data is written into the input-output multi-select bit unit from the normal write data signal line mem_in through the multiplexer;

[0077] In the in-memory calculation mode, the mode selection signal s_mode of the input / output multi-select bit unit is set to 1. When reading data, the value in the input / output multi-select bit unit is transmitted from the in-memory calculation output signal line cim_out through the multiplexer and connected to other units for subsequent calculation; when writing data, the input / output multi-select bit unit is selected through the local word line, and the calculation results obtained from other units are written into the input / output multi-select bit unit from the in-memory calculation input signal line cim_in through the multiplexer.

[0078] In one embodiment, the principle design of the input multiple selection unit is as follows Figure 5 As shown, the input multiple selection bit unit is used to store the final multiplication result. This bit unit only needs to choose whether to write normal read data or multiplication result when writing, so the multiple selector is only set in the input part.

[0079] Among them, in the normal read-write mode, the mode selection signal s_mode of the input multiple selection bit unit is set to 0. When reading data, the value in the input multiple selection bit unit is read from the normal read data signal line mem_out, and finally transmitted to the read data bus in the normal read-write mode; when writing data, the input multiple selection bit unit is selected through the global word line and the control module, and the data is written into the input multiple selection bit unit through the multiple selector from the normal write data signal line mem_in;

[0080] In the in-memory calculation mode, the mode selection signal s_mode of the input multi-select bit unit is set to 1. At this time, the input multi-select bit unit does not perform data read operations; when writing data, the input multi-select bit unit is selected through the local word line, and the calculation results obtained from other units are written into the input multi-select bit unit from the in-memory calculation input signal line cim_in through the multiple selector.

[0081] in, Figures 3 to 5 CLK in the bit unit principle diagram represents the system clock, wwl represents the result of ANDing the global word line with the local word line and then with the write enable signal, which means whether the bit unit should perform a write operation, EN represents the enable signal of the trigger, D represents the input end of the trigger, and Q represents the output end of the trigger.

[0082] In one embodiment, a compiler is provided. The compiler is based on a standard cell library and automatically compiles and generates a complete set of view files of the above-mentioned configurable in-memory computing architecture based on standard cells through circuit compilation according to user input.

[0083] The compilation process of the compiler is as follows: Figure 6 As shown, the following steps are included:

[0084] Get user input;

[0085] Generates a single serial shift multiplier storage subarray RTL (register-transfer level) description based on the calculation precision entered by the user;

[0086] Generate a complete array RTL description based on the array depth and array width input by the user;

[0087] Determine the array capacity according to the calculation accuracy, array depth and array bit width input by the user, and generate the word line and control logic RTL description according to the array capacity calculation;

[0088] The generated RTL description is mapped using the standard cell library to generate a netlist file. The netlist file is verified and automatically laid out and routed to generate and output a full set of view files for a configurable in-memory computing architecture based on standard cells.

[0089] The key point of the compilation process is the generation of RTL description, and the rest follows the standard digital design process. The generation of its RTL description depends on the proposed configurable in-memory computing architecture, which is generated in the order of first generating the serial shift multiplier storage subarray, then generating the complete array, and finally generating the peripheral word lines and control logic.

[0090] After the RTL description is generated, it is mapped with the standard cell library to generate a netlist file, which is then verified and automatically laid out and routed. In the process, the corresponding views are generated, and finally a full set of view files for a configurable in-memory computing architecture based on standard cells can be output. Since the process can be changed by changing the standard cell library, and the whole process is fully automatic, this method greatly shortens the development time and has strong process migration, solving the problems of difficult process migration, high design complexity, and long development cycle in existing in-memory computing circuits.

[0091] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0092] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A configurable in-memory computing architecture based on standard cells, characterized in that: The in-memory computing architecture is designed based on standard cells, and includes: m rows and n columns of serial shift multiplier storage subarrays, a global word line and control module, a local word line, a subarray selection signal module, and an output multi-select module; The serial shift multiplier storage subarray is used as a basic storage subarray of the in-memory computing architecture to support multiplication calculations and result storage; The global word line and control module is used to select and control the serial shift multiplier storage subarray, and each serial shift multiplier storage subarray is equipped with an independent local word line, through which the internal logic of the serial shift multiplier storage subarray is precisely controlled; The subarray selection signal module is used to configure the number of serial shift multiplier storage subarrays participating in the multiplication calculation according to user input; The output multiple selection module is used to output the multiplication result of the serial shift multiplier storage subarray; Each serial shift multiplier storage subarray is composed of five rows of storage bit units, one row of full adders and one row of dot product logic; Wherein, the storage bit unit is composed of a trigger, which is used to support a normal read-write mode and an in-memory calculation mode, and includes an output multiple-select bit unit, an input multiple-select bit unit, and an input-output multiple-select bit unit; wherein the first row of storage bit units is an output multiple-select bit unit, the second row of storage bit units is a first input-output multiple-select bit unit, the third row of storage bit units is a second input-output multiple-select bit unit, the fourth row of storage bit units is a first input multiple-select bit unit, and the fifth row of storage bit units is a second input multiple-select bit unit; The dot multiplication logic is represented by an AND gate, located between the first row of storage bit cells and the second row of storage bit cells, and is used to perform a dot-wise multiplication operation on the input operand of the serial shift multiplier storage subarray and the local operand output by the first row of storage bit cells in parallel; The full adder is located between the second row storage bit units, and the full adder, the dot multiplication logic, the first input-output multiple bit selection unit, and the second input-output multiple bit selection unit together form a serial shift multiplier; The serial shift multiplier multiplies the current multiplier bit with the multiplicand for each bit of the multiplier to obtain a partial product; uses the full adder to add the partial product, the current partial sum and the current carry to obtain a new partial sum and a new carry; outputs the least significant bit of the new partial sum to the corresponding position of the result; and stores the new partial sum and the new carry in the second row storage bit unit and the third row storage bit unit so as to be used as the current partial sum and the current carry in the next calculation; Wherein, the serial shift multiplier storage subarray further includes: In the normal read / write mode, the mode selection signal s_mode of all storage bit cells is set to 0, and the read / write data is read out through the normal read data signal line mem_out and written into the normal write data signal line mem_in of the storage bit cells respectively, and all storage bit cells are controlled by the global word line and the control module. At this time, the serial shift multiplier storage subarray is regarded as a normal storage array; In the in-memory calculation mode, the mode selection signal s_mode of all storage bit units is set to 1, wherein the first row of storage bit units is used to output the local operands required for the multiplication calculation; the second row of storage bit units is used to store and output the partial sum of the full adder; the third row of storage bit units is used to store and output the carry output of the full adder; the fourth row of storage bit units and the fifth row of storage bit units are used to store the final multiplication result.

2. The configurable in-memory computing architecture based on standard cells according to claim 1, characterized in that: When the serial shift multiplier storage subarray performs a 4bit×4bit multiplication calculation, the first row of storage bit cells of the serial shift multiplier storage subarray consists of 4 output multiple selection bit cells, which are represented from right to left as BC_OUT<0,0>, BC_OUT<0,1>, BC_OUT<0,2> and BC_OUT<0,3> respectively; the second row of storage bit cells consists of 4 first input and output multiple selection bit cells, which are represented from right to left as BC_ALL<1,0>, BC_ALL<1,1>, BC_ALL<1,2> ​​and BC_ALL<1,3> respectively; the third row of storage bit cells consists of 4 second input and output multiple selection bit cells, which are represented from right to left as BC_ALL<1,0>, BC_ALL<1,1>, BC_ALL<1,2> ​​and BC_ALL<1,3> respectively. The left row is represented by BC_ALL<2,0>, BC_ALL<2,1>, BC_ALL<2,2> and BC_ALL<2,3> respectively; the fourth row of storage bit cells consists of 4 first input multiple selection bit cells, which are represented by BC_IN<3,0>, BC_IN<3,1>, BC_IN<3,2> and BC_IN<3,3> from right to left; the fifth row of storage bit cells consists of 4 second input multiple selection bit cells, which are represented by BC_IN<4,0>, BC_IN<4,1>, BC_IN<4,2> and BC_IN<4,3> from right to left; a row of point multiplication logic consists of 4 point multiplication logics, and a row of full adders consists of 4 full adders; The specific process of performing 4-bit×4-bit multiplication calculation according to the serial shift multiplier storage subarray includes: Before calculation, initialization is achieved by writing 0 to the storage bit cells in the second row to the fifth row; During calculation, the multiplication calculation is completed within 8 cycles and the final multiplication calculation result is stored in the fourth row storage bit unit and the fifth row storage bit unit; In the first four cycles, the input operands of the serial shift multiplier storage subarray are sequentially input into the first input ends of all four dot multiplication logics in order from low to high, and the local operands output by the four output multi-select bit units of the first row of storage bit units are respectively input into the second input ends of the four dot multiplication logics, and the input operands and the local operands are multiplied in parallel by the four dot multiplication logics to obtain four first addends, which are represented as FA_A0, FA_A1, FA_A2, and FA_A3 from right to left; the four first input and output bits of the second row of storage bit units are read. The 4 second addends output by the multiple-select bit unit are represented as FA_B0, FA_B1, FA_B2, and FA_B3 from right to left; the 4 second inputs of the third row storage bit unit are read and the 4 carry inputs output by the multiple-select bit unit are represented as FA_Cin0, FA_Cin1, FA_Cin2, and FA_Cin3 from right to left; the 4 first addends, the 4 second addends, and the 4 carry inputs are fully added according to the 4 full adders to obtain 4 partial sums and 4 carry outputs, and the 4 partial sums are represented as FA_Sum0, FA_Sin1, FA_Sin2, and FA_Sin3 from right to left. FA_Sum1, FA_Sum2, FA_Sum3, the 4 carry outputs are represented as FA_Cout0, FA_Cout1, FA_Cout2, FA_Cout3 from right to left; after one cycle of calculation is completed, when the clock rising edge of the next cycle arrives, the high 3 bits and FA_Sum1, FA_Sum2, FA_Sum3 are written into BC_ALL<1,0>, BC_ALL<1,1>, BC_ALL<1,2> ​​of the second row of storage bit cells respectively, and the lowest bit and FA_Sum0 are used as the final multiplication calculation. The result is output to the corresponding positions of the fourth row storage bit unit and the fifth row storage bit unit; FA_Cout0, FA_Cout1, FA_Cout2, FA_Cout3 are written into BC_ALL<2,0>, BC_ALL<2,1>, BC_ALL<2,2> and BC_ALL<2,3> of the third row storage bit unit respectively; wherein the input operands of the first 4 cycles of the serial shift multiplier storage subarray and the local operands output by the first row storage bit unit are both 4 bits, and the obtained output is the lower 4 bits of the final multiplication calculation result; Considering that only the lowest bit of the partial sum is output in the first four cycles, and the high-order partial sum and carry have not been processed, in the next four cycles, 0 is input as the input operand into the 4 point multiplication logics, and no new partial product is generated. By accumulating the high-order partial sum and carry, all the remaining partial sums and carries are gradually processed until the high 4 bits of the final multiplication result are output; After 8 cycles, an 8-bit multiplication calculation result is finally output, wherein only one bit of multiplication calculation result is output in each cycle, and the multiplication calculation results are output in sequence from low to high. The first 4 cycles output the low 4-bit multiplication calculation result to the 4 first input multiple-selection bit units of the fourth row of storage bit units, and the last 4 cycles output the high 4-bit multiplication calculation result to the 4 second input multiple-selection bit units of the fifth row of storage bit units.

3. The configurable in-memory computing architecture based on standard cells according to claim 1 or 2, characterized in that: The output multi-select bit unit is used to store and read and write local operands. The local operands are written and stored in the output multi-select bit unit in the normal read-write mode, and are read out in the in-memory calculation mode and perform subsequent point multiplication and accumulation operations; Wherein, in the normal read-write mode, the mode selection signal s_mode of the output multiple selection bit unit is set to 0. When reading data, the value in the output multiple selection bit unit is read from the normal read data signal line mem_out through the multiple selector, and finally transmitted to the read data bus in the normal read-write mode; when writing data, the output multiple selection bit unit is selected through the global word line and the control module, and the data is written into the output multiple selection bit unit from the normal write data signal line mem_in; In the in-memory calculation mode, the mode selection signal s_mode of the output multi-select bit unit is set to 1. At this time, the output multi-select bit unit does not perform data writing operations; when reading data, the value in the output multi-select bit unit is transmitted from the in-memory calculation output signal line cim_out through the multiplexer and connected to other units for subsequent calculations.

4. The configurable in-memory computing architecture based on standard cells according to claim 1 or 2, characterized in that: The input and output multi-select bit unit is used to store and output partial sums and carry outputs of the full adder; Wherein, in the normal read-write mode, the mode selection signal s_mode of the input-output multiple-select bit unit is set to 0. When reading data, the value in the input-output multiple-select bit unit is read from the normal read data signal line mem_out through the multiplexer, and finally transmitted to the read data bus in the normal read-write mode; when writing data, the input-output multiple-select bit unit is selected through the global word line and the control module, and the data is written into the input-output multiple-select bit unit from the normal write data signal line mem_in through the multiplexer; In the in-memory calculation mode, the mode selection signal s_mode of the input-output multi-select bit unit is set to 1. When reading data, the value in the input-output multi-select bit unit is transmitted from the in-memory calculation output signal line cim_out through the multiplexer and connected to other units for subsequent calculation; when writing data, the input-output multi-select bit unit is selected through the local word line, and the calculation results obtained from other units are written into the input-output multi-select bit unit from the in-memory calculation input signal line cim_in through the multiplexer.

5. The configurable in-memory computing architecture based on standard cells according to claim 1 or 2, characterized in that: The input multiple selection bit unit is used to store the final multiplication calculation result; Wherein, in the normal read-write mode, the mode selection signal s_mode of the input multiple selection bit unit is set to 0. When reading data, the value in the input multiple selection bit unit is read from the normal read data signal line mem_out, and finally transmitted to the read data bus in the normal read-write mode; when writing data, the input multiple selection bit unit is selected through the global word line and the control module, and the data is written into the input multiple selection bit unit through the multiple selector from the normal write data signal line mem_in; In the in-memory calculation mode, the mode selection signal s_mode of the input multi-select bit unit is set to 1. At this time, the input multi-select bit unit does not perform data read operation; when writing data, the input multi-select bit unit is selected through the local word line, and the calculation results obtained from other units are written into the input multi-select bit unit from the in-memory calculation input signal line cim_in through the multiplexer.

6. The configurable in-memory computing architecture based on standard cells according to claim 1, characterized in that: The capacity of the m-row and n-column serial shift multiplier storage subarray is H×W, wherein H=5×m represents the depth of the array, W=c×n represents the bit width of the array, and c represents the calculation accuracy.

7. A compiler, characterized in that The compiler is based on a standard cell library and automatically compiles and generates a full set of view files of a configurable in-memory computing architecture based on standard cells as described in any one of claims 1 to 6 through circuit compilation according to user input.

8. The compiler according to claim 7, characterized in that The compilation process of the compiler includes: Get user input; Generate a single serial shift multiplier storage subarray RTL description according to the calculation precision input by the user; Generate a complete array RTL description based on the array depth and array width input by the user; Determine the array capacity according to the calculation accuracy, array depth and array bit width input by the user, and generate the word line and control logic RTL description according to the array capacity calculation; The generated RTL description is mapped using a standard cell library to generate a netlist file, and a full set of view files of a configurable in-memory computing architecture based on standard cells is generated and output by verifying and automatically placing and routing the netlist file.