Bit-level mixed-signal in-memory computing circuit based on RRAM

By integrating digital and analog in-memory computing subarrays within the RRAM memory array and employing dynamic bit allocation and precise gating, the contradiction between high precision and high energy efficiency in existing in-memory computing schemes is resolved, achieving a high-precision, low-power, and adaptive in-memory computing circuit.

CN123115047APending Publication Date: 2026-11-17XIAMEN IND TECH RES INST CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611346122.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-01
Publication Date
2026-11-17

AI Technical Summary

Technical Problem

Existing in-memory computing solutions present a contradiction in meeting the dual requirements of high precision and high energy efficiency, making it difficult to implement a high-precision, high-energy-efficiency, low-area-overhead, and dynamically configurable in-memory computing circuit on a single storage medium.

Method used

A bit-level mixed-signal in-memory computing circuit based on RRAM is adopted. By implementing a hybrid architecture of digital in-memory computing subarray and analog in-memory computing subarray in a single RRAM memory array, bit allocation is dynamically configured through a digital-analog scheduling control module, and power consumption is reduced by combining a precise gating unit.

Benefits of technology

It achieves high computational accuracy (8 to 12 bits) and low static power consumption (approximately 500 μW), while reducing chip area (approximately 2 mm²) and possessing adaptability to different inference tasks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123115047A_ABST
    Figure CN123115047A_ABST
Patent Text Reader

Abstract

This invention discloses a bit-level mixed-signal in-memory computing circuit based on RRAM, comprising: an RRAM storage array; a digital / analog scheduling control module that outputs a digital / analog ratio configuration signal according to task parameters; a digital in-memory computing subarray configured in the first part of the RRAM array, which uses a single-bit RRAM multiplication unit and a digital addition tree to implement in-memory multiplication and accumulation operations for the high-weight bits; an analog in-memory computing subarray configured in the second part of the RRAM array, which uses RRAM conductance-current multiplication and accumulation and on-chip ADC quantization to implement in-memory multiplication and accumulation operations for the low-weight bits; and a shift-accumulation fusion unit that aligns the digital and analog in-memory computing results according to their bit weights and adds them to output a complete multiplication and accumulation result; wherein the boundary between the digital and analog in-memory computing subarrays is dynamically defined by the configuration signal of the digital / analog scheduling control module; thereby, high-precision and high-energy-efficiency in-memory computing is achieved simultaneously, making it suitable for ultra-low-power edge AI applications such as brain-computer interfaces and AIoT.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of integrated circuits and in-memory computing technology, and in particular to a bit-level mixed-signal in-memory computing circuit based on RRAM. Background Technology

[0002] Among related technologies, Computing-in-Memory (CIM) technology performs multiplication and addition operations directly within the storage unit, avoiding the power consumption overhead caused by frequent data movement between the processor and memory in the traditional von Neumann architecture. This has become an important technological direction for low-power edge AI chips. However, existing CIM solutions present a contradiction in meeting the dual requirements of high precision and high energy efficiency, specifically manifested in the following four technical approaches all having shortcomings: (a) The von Neumann accelerator scheme adopts an architecture that separates the processor and memory. Although it can achieve a computational accuracy of more than 8 bits, its energy efficiency is only about 1 TOPS / W and its static power consumption exceeds 1mW, which exceeds the thermal safety threshold for applications such as intracranial implantable brain-computer interfaces.

[0003] (ii) The analog RRAM in-memory computing scheme utilizes the multi-resistance characteristics of RRAM devices to complete multiplication and accumulation operations in the analog domain, with an energy efficiency of 10~20 TOPS / W. However, due to noise and non-ideal factors in the analog circuit, the quantization accuracy is less than 6 bits, and it cannot identify weak neural electrical signals such as weak EEG signals, cortical EEG, local field potentials and neural peak potentials during the pre-seizure period.

[0004] (iii) Digital SRAM in-memory computing scheme: SRAM is used as the storage medium to complete the calculation in the digital domain. The accuracy meets the requirements, but SRAM is a volatile storage device that requires continuous power supply to refresh in order to maintain the weight data, resulting in high static power consumption. In addition, the chip area exceeds 3mm², which cannot meet the strict area and power consumption restrictions of brain-computer interface chips.

[0005] (iv) Existing hybrid architecture solutions use two independent physical storage arrays, SRAM and RRAM, to process the calculation of high significant bits and low significant bits respectively. The two physical arrays result in the chip area doubling, and the SRAM part is still a volatile device with high standby power consumption. At the same time, the bit segmentation boundary between digital and analog is fixed in the chip design stage and cannot be adjusted during operation, lacking the ability to adapt to different inference tasks.

[0006] Therefore, how to implement high-precision, high-efficiency, low-area-overhead, and dynamically configurable in-memory computing circuits on a single storage medium is a technical problem that urgently needs to be solved in this field. Summary of the Invention

[0007] This invention aims to at least partially solve one of the technical problems in the aforementioned technologies. To this end, one objective of this invention is to propose a bit-level mixed-signal in-memory computing circuit based on RRAM. Through a bit-level mixed-signal in-memory computing architecture within a single RRAM memory array and a dynamically configurable bit allocation mechanism, it reduces chip area and static power consumption while ensuring high computational accuracy, and also takes into account the adaptability to different inference tasks.

[0008] To achieve the above objectives, this invention proposes a bit-level mixed-signal in-memory computing circuit based on RRAM, comprising: an RRAM storage array including multiple RRAM storage cells arranged in rows and columns; a digital-to-analog scheduling control module that outputs a digital / analog ratio configuration signal according to task parameters; a digital in-memory computing subarray configured in the first part of the RRAM storage array, with its input connected to the output of the digital-to-analog scheduling control module, employing single-bit RRAM multiplication units and a digital addition tree to perform in-memory multiplication and accumulation operations on the high-weight bits to obtain the digital in-memory computing result; and an analog in-memory computing subarray configured in the RRAM storage array. The second part of the M-memory array has its input connected to the output of the analog-digital scheduling control module. It employs RRAM conductance-current multiplication and accumulation with on-chip ADC quantization to perform in-memory multiplication and accumulation operations on the low-weight bits, obtaining the analog in-memory calculation result. A shift-accumulation fusion unit, with its first input connected to the output of the digital in-memory calculation subarray and its second input connected to the output of the analog in-memory calculation subarray, adds the digital and analog in-memory calculation results after aligning them according to their bit weights, to output a complete multiplication and accumulation result. The boundary between the digital and analog in-memory calculation subarrays within the RRAM memory array is dynamically determined by the digital / analog ratio configuration signal output by the analog-digital scheduling control module.

[0009] In addition, the bit-level mixed-signal in-memory computing circuit based on RRAM proposed in the embodiments of the present invention may also have the following additional technical features: Optionally, the digital-analog scheduling control module includes: an AI model recognition module, which is used to recognize task parameters in the input data packet, wherein the task parameters include input size, number of output channels and number of loops; and a bit allocation module, which is connected to the AI ​​model recognition module and is used to allocate the bit width ratio of the digital in-memory computing subarray and the analog in-memory computing subarray according to the task parameters, and generate the digital / analog ratio configuration signal.

[0010] Furthermore, the data packets received at the input end of the AI ​​model recognition module correspond to at least one neural network structure among CNN, LSTM, and MLP.

[0011] Further, the bit allocation module determines the bit width allocation ratio of the digital in-memory computing subarray and the analog in-memory computing subarray according to the task parameters, and generates the corresponding digital / analog ratio configuration signal; wherein, the bit allocation module selects the bit width allocation ratio according to pre-configured statistical data, the statistical data including the mapping relationship between different task parameters and the optimal bit width allocation ratio.

[0012] Furthermore, it also includes a precision gating unit, the input of which is connected to the output of the analog-digital scheduling control module, and its output is connected to the word line driving circuit in the digital in-memory computing subarray, the ADC clock circuit in the analog in-memory computing subarray, and the enable terminal of the digital adder tree, respectively, so as to implement word line driving power-off, ADC clock gating, and digital adder tree enable shutdown for the subarray area without assigned computing tasks.

[0013] Optionally, the single-bit RRAM multiplication unit in the digital in-memory computing subarray includes an RRAM storage cell and a comparator. The RRAM storage cell encodes a 1-bit weight in high-impedance and low-impedance states. The transistor gate of the RRAM storage cell is connected to the word line, and the bit line of the RRAM storage cell is connected to the input of the comparator. The output of the comparator is connected to the input of the digital addition tree.

[0014] Furthermore, the digital in-memory computing subarray employs a time-division multiplexing readout method, completing the readout of different data rows in four clock cycles. Input activation is applied to the word lines in a time-division manner according to the data row. Specifically, in the first clock cycle, the word lines corresponding to the first group of data rows are turned on or off according to the input activation value. The comparator reads the current of each column of RRAM memory cells in this group of data rows and compares it with a reference value, outputting a Boolean product to obtain the first set of local summations. In the second clock cycle, the word lines corresponding to the second group of data rows are turned on or off according to the input activation value. The comparator reads the current of each column of RRAM memory cells in this group of data rows and compares it with a reference value, outputting a Boolean product to obtain the second set of local summations. The first set of local summations is then added to the second set of local summations. The process involves obtaining a first intermediate result; during the third clock cycle, the word line corresponding to the third data row is turned on or off according to the input activation value. The comparator reads the current of each column of RRAM memory cells in this data row and compares it with a reference value, outputting a Boolean product to obtain the third local summation result; during the fourth clock cycle, the word line corresponding to the fourth data row is turned on or off according to the input activation value. The comparator reads the current of each column of RRAM memory cells in this data row and compares it with a reference value, outputting a Boolean product to obtain the fourth local summation result; the third local summation result is added to the fourth local summation result to obtain the second intermediate result; the above process is repeated, and the first and second intermediate results corresponding to the current bit are shifted left by one bit and added to the previous accumulated result. This cycle is repeated until all input activation bits are processed, thus obtaining the digital in-memory calculation result.

[0015] Furthermore, the RRAM memory cells in the analog in-memory computing subarray encode the weight low-order bits with multi-resistance conductance values. The transistor gate of the RRAM memory cell is connected to the word line, and an input activation voltage is applied to the word line. The source line of the RRAM memory cell is connected to the current accumulation bus, and the current in the same column is accumulated on the current accumulation bus. The input terminal of the on-chip ADC is connected to the current accumulation bus.

[0016] Furthermore, the quantization threshold of the on-chip ADC is adaptively adjusted according to the output current distribution, and the on-chip ADC is time-division multiplexed over multiple clock cycles; wherein, in the first clock cycle, the input activation voltage of the first group of data rows is applied to the word line, the conductance value of each RRAM memory cell is multiplied by the input activation voltage to generate a current, the current in the same column is accumulated on the current accumulation bus, the on-chip ADC performs one conversion, and outputs the first group of digital quantization results; in the second clock cycle, the input activation voltage of the second group of data rows is applied to the word line, the conductance value of each RRAM memory cell is multiplied by the input activation voltage to generate a current, the current in the same column is accumulated on the current accumulation bus, the on-chip ADC performs one conversion, and outputs the second group of digital quantization results; in the third clock cycle, the quantization threshold of the first ... The input activation voltage of the third data row is applied to the word line. The conductance value of each RRAM memory cell is multiplied by the input activation voltage to generate a current. The current in the same column is accumulated on the current accumulation bus. The on-chip ADC performs one conversion and outputs the third group of digital quantization results. In the fourth clock cycle, the input activation voltage of the fourth data row is applied to the word line. The conductance value of each RRAM memory cell is multiplied by the input activation voltage to generate a current. The current in the same column is accumulated on the current accumulation bus. The on-chip ADC performs one conversion and outputs the fourth group of digital quantization results. Using the number of bits CB stored in each RRAM memory cell as the shift step size, the digital quantization results output in the four clock cycles are grouped by column. Within each group, the bits are shifted left by CB bits and accumulated to obtain the analog in-memory calculation results.

[0017] Optionally, the shift-accumulate-fusion unit includes a shifter and an adder. The shifter shifts the output of the digital in-memory computation subarray to the left by the bit width of the analog in-memory computation subarray. The output of the shifter is connected to the first input of the adder, and the second input of the adder is connected to the output of the analog in-memory computation subarray. Attached Figure Description

[0018] Figure 1 This is a block diagram of a bit-level mixed-signal in-memory computing circuit based on RRAM according to an embodiment of the present invention; Figure 2 This is a structural block diagram of a digital model scheduling control module according to an embodiment of the present invention, which freely deploys and allocates data based on the data format of different AI tasks. Figure 3 This is a schematic diagram of the architecture of a simulated in-memory computing subarray according to an embodiment of the present invention; Figure 4 This is a schematic diagram of the architecture of a digital in-memory computing subarray according to an embodiment of the present invention. Detailed Implementation

[0019] Embodiments of the present invention are described in detail below, examples of which are illustrated in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain the present invention, and should not be construed as limiting the present invention.

[0020] To better understand the above technical solutions, exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present invention are shown in the drawings, it should be understood that the present invention can be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided to enable a more thorough understanding of the present invention and to fully convey the scope of the invention to those skilled in the art.

[0021] To better understand the above technical solutions, the following will provide a detailed explanation of the technical solutions in conjunction with the accompanying drawings and specific implementation methods.

[0022] The bit-level mixed-signal in-memory computing circuit based on RRAM according to an embodiment of the present invention will now be described with reference to the accompanying drawings.

[0023] refer to Figure 1 As shown, the bit-level mixed-signal in-memory computing circuit based on RRAM proposed in this embodiment of the invention includes an RRAM storage array 100, a digital-to-analog scheduling control module 200, a digital in-memory computing subarray 300, an analog in-memory computing subarray 400, and a shift-accumulate-fusion unit 500.

[0024] The RRAM storage array 100 includes multiple RRAM storage cells arranged in rows and columns. The analog-digital scheduling control module 200 outputs a digital / analog ratio configuration signal according to task parameters. The digital in-memory computing subarray 300 is configured in the first part of the RRAM storage array, with its input connected to the output of the analog-digital scheduling control module 200. It uses a single-bit RRAM multiplication unit 301 and a digital addition tree 302 to perform in-memory multiplication and accumulation operations on the high-order bits of the weights to obtain the digital in-memory calculation result. The analog in-memory computing subarray 400 is configured in the second part of the RRAM storage array, with its input connected to the output of the analog-digital scheduling control module 200. The output terminal is connected, and the RRAM conductance-current multiplication and accumulation and on-chip ADC quantization are used to realize the in-memory multiplication and accumulation operation of the weighted low bits to obtain the analog in-memory calculation result; the first input terminal of the shift accumulation fusion unit 500 is connected to the output terminal of the digital in-memory calculation subarray 300, and the second input terminal is connected to the output terminal of the analog in-memory calculation subarray 400. It is used to add the digital in-memory calculation result and the analog in-memory calculation result after aligning them according to the bit weight to output the complete multiplication and accumulation result; the partition boundary between the digital in-memory calculation subarray 300 and the analog in-memory calculation subarray 400 in the RRAM memory array is dynamically determined by the digital / analog ratio configuration signal output by the digital-analog scheduling control module.

[0025] In other words, within the same RRAM physical array, the mapping is split according to the neural network weight bits: the most significant bit (MSB) is mapped to the Digital In-Memory Computation (DCIM) subarray, which uses single-bit RRAM multiplication and digital addition trees for execution; the least significant bit (LSB) is mapped to the Analog In-Memory Computation (ACIM) subarray, which uses RRAM conductance-current parallel accumulation for execution. Both share the same RRAM physical device, and the DCIM / ACIM boundary is dynamically defined by configuration signals, flexibly allocated on the same RRAM physical array without the need for discrete storage media. The DCIM subarray (MSB) works as follows: First, the single-bit RRAM encodes 1 bit weight using high impedance (HRS) / low impedance (LRS); then, a word line voltage is applied to the high-order bits of the activation value, and the column direction comparator reads the Boolean product; finally, the digital addition tree accumulates the multiplications of each column to obtain the MAC sum of the high-order bits. The working principle of the ACIM subarray (LSB) is as follows: First, the conductance value of the multi-resistance RRAM is encoded into the low-order bits, which are multiplied with the input voltage to generate current. Then, the column currents are naturally accumulated in parallel (Kirchhoff's law), and the MAC is completed with low power consumption. Finally, the on-chip adaptive ADC quantizes the column currents and outputs the sum of the low-order bits.

[0026] As one embodiment, the digital-analog scheduling control module 200 includes an AI model recognition module 201 and a bit allocation module 202.

[0027] The AI ​​model recognition module 201 is used to recognize the task parameters in the input data packet, including the input size, the number of output channels, and the number of loops. The bit allocation module 202 is connected to the AI ​​model recognition module 201 and is used to allocate the bit width ratio of the digital in-memory computing subarray and the analog in-memory computing subarray according to the task parameters, and generate a digital / analog ratio configuration signal.

[0028] As a specific embodiment, the data packets received by the input end of the AI ​​model recognition module 201 correspond to at least one neural network structure among CNN, LSTM, and MLP.

[0029] As a specific embodiment, the bit allocation module 202 determines the bit width allocation ratio between the digital in-memory computing subarray and the analog in-memory computing subarray according to the task parameters, and generates a corresponding digital / analog ratio configuration signal; wherein, the bit allocation module selects the bit width allocation ratio according to pre-configured statistical data, the statistical data including the mapping relationship between different task parameters and the optimal bit width allocation ratio.

[0030] It should be noted that traditional in-memory computing chips have a fixed deployment scheme after the AI ​​task is determined; however, this application... Figure 2 As shown, the analog-to-digital (A / D) scheduling and control module 200 freely deploys and allocates data according to the data format of different AI tasks. The A / D scheduling and control module 200 consists of two parts: an AI model recognition module 201 and a bit allocation module 202. The AI ​​model recognition module 201 identifies the input size, number of output channels, number of loops, etc., in the data packet information. The bit allocation module 202 allocates bit schemes based on pre-defined statistical data and allocates the activation ratio of DCIM and ACIM according to the bit schemes. The unallocated cell wrappers and their connected edge circuits are turned off to save power, while the allocated and activated computational parts operate normally.

[0031] As an example, such as Figure 1 As shown, the bit-level mixed-signal in-memory computing circuit based on RRAM also includes a precision gating unit 600. The input of the precision gating unit 600 is connected to the output of the analog-to-digital scheduling control module 200, and its output is connected to the word line driving circuit in the digital in-memory computing subarray 300, the ADC clock circuit in the analog in-memory computing subarray 400, and the enable terminal of the digital addition tree, respectively, so as to implement word line driving power-off, ADC clock gating, and digital addition tree enable shutdown for the subarray area without assigned computing tasks.

[0032] Specifically, the analog-to-digital scheduling control module 200 dynamically adjusts the bit width allocation of DCIM and ACIM during runtime based on the inference task type (CNN / LSTM / MLP) and accuracy / energy efficiency requirements. This is achieved simply by switching routes via control signals, without reprogramming the weights. After determining the D:A ratio, precise gating (word line drive power-off, ADC clock gating, adder tree enable shutdown) is implemented on subarrays without assigned computational tasks, eliminating dynamic power consumption. The non-volatile nature of RRAM ensures that weight data is not lost in power-off regions, eliminating the need for reloading and reducing static power consumption to approximately 500μW.

[0033] In other words, the analog-to-digital scheduling control module 200 supports a configurable D:A ratio—taking an 8-bit total bit width as a typical example, including but not limited to 2D6A, 4D4A, and 6D2A; the total quantized bit width can be expanded to 12 bits (such as 10D2A, 8D4A, 6D6A, etc.) or customized according to user needs. Dynamic switching during runtime is achieved by controlling word line routing and adder tree enable signals, without the need to reprogram the weights. The precision gating unit 600 implements word line drive power-off, ADC clock gating, and adder tree enable shutdown for inactive subarray regions, eliminating dynamic power consumption; the non-volatile nature of RRAM ensures that weight data in power-off regions is not lost.

[0034] As an example, the single-bit RRAM multiplication unit 301 in the digital in-memory computing subarray 300 includes an RRAM memory cell and a comparator. The RRAM memory cell encodes a 1-bit weight in high-impedance and low-impedance states. The transistor gate of the RRAM memory cell is connected to the word line, and the bit line of the RRAM memory cell is connected to the input of the comparator. The output of the comparator is connected to the input of the digital addition tree.

[0035] As a specific embodiment, the digital in-memory computing subarray 300 adopts a time-division multiplexing readout method, completing the readout of different data rows in four clock cycles. The input activation is applied to the word line in a time-division manner according to the data row. Specifically, in the first clock cycle, the word line corresponding to the first group of data rows is turned on or off according to the input activation value. The comparator reads the current of each column of RRAM memory cells in this group of data rows and compares it with a reference value, outputting a Boolean product to obtain the first set of local summation results. In the second clock cycle, the word line corresponding to the second group of data rows is turned on or off according to the input activation value. The comparator reads the current of each column of RRAM memory cells in this group of data rows and compares it with a reference value, outputting a Boolean product to obtain the second set of local summation results. The first set of local summation results are then compared with the second set of local summation results. The first intermediate result is obtained by adding the results together. During the third clock cycle, the word line corresponding to the third data row is turned on or off according to the input activation value. The comparator reads the current of each column of RRAM memory cells in this data row and compares it with the reference value, outputting a Boolean product to obtain the third local summation result. During the fourth clock cycle, the word line corresponding to the fourth data row is turned on or off according to the input activation value. The comparator reads the current of each column of RRAM memory cells in this data row and compares it with the reference value, outputting a Boolean product to obtain the fourth local summation result. The third local summation result is added to the fourth local summation result to obtain the second intermediate result. The above process is repeated, and the first and second intermediate results corresponding to the current bit are shifted left by one bit and added to the previous accumulated result. This cycle continues until all input activation bits are processed, thus obtaining the digital in-memory calculation result.

[0036] It should be noted that, as Figure 4 As shown, Data Size: 128×64(8k), Data Size represents the scale of weight data stored in the array, where W[11:8] represents different bits of the same data, 128×64 means that the weights in the entire array have 128 data rows and 64 data columns, and the weights of the same data rows should be ANDed with the same IA.

[0037] Array Size: 256 128 (32K), Array Size represents the actual physical size of the RRAM in the array. As can be seen from the figure, each red dashed box has 4 columns and 4 rows, 4 columns × 32 = 128 columns, 4 rows × 64 = 256 rows.

[0038] The weight (weight(W)) is represented by HRS / LRS of RRAM as 0 / 1, and the naming format is: "W data row, data column [bit]".

[0039] Since both W127,63[11:8] and W127,62[11:8] need to be ANDed with the same IA, and considering the limitation on the number of digital addition trees, they are deployed simultaneously in two rows of 8 RRAMs.

[0040] Input activation (IA) is controlled by the word line (WL) connected to T in 1T1R; it is 1 when on and 0 when off. Its naming format is: "IA data line_working clock", where IA126_T2 represents the IA data of 126 data lines input under clock T2. Identical data lines indicate the same IA value; for example, IA126_T2 and IA126_T4 have the same IA value within their respective working clocks.

[0041] The time division is divided into four clocks: T1→T2→T3→T4, and four service areas (SAs) are in one group (red dashed box).

[0042] The control logic for IA here is as follows: the priority of T1~T4 is higher than the data 01 priority of IA. If it is not within the current row's working clock, WL remains closed regardless of whether the value of IA in this row is 1 or 0. If it is within the current row's working clock, WL is turned on or off according to the value of IA as 1 or 0. If IA is 0, then the switch T is off, and SA reads the current as 0, indicating that 0(IA) × whether it is 0 or 1(W) is 0; if IA is 1, then the switch T is on, and SA reads the current. If Weight is 0, RRAM is HRS, and SA reads the current as 0, indicating that 1(IA) × 0(W) = 0(O); if Weight is 1, RRAM is LRS, and SA reads the current as 1, indicating that 1(IA) × 1(W) = 1(O); thus, the "vector-matrix multiplication" of the first bit in IA127~0 with the 128×64 weight is completed. Then, the second bit in IA127~0 repeats this operation, and so on, until the last bit of IA127~0, completing the "matrix-matrix multiplication" of IA and W. Finally, the number of output bits is: 4×32×64=8192 (8k).

[0043] Specifically, IA_global[63:0] is used as 64 global inputs. These are connected to IAn_T1, IAn-1_T2, IAn_T3, and IAn-1_T4 via a 4-to-1 mux. The mux's control end uses a decoder to cyclically connect to T1~T4. The output of the local adder tree is the local sum of [9:0], with a total of 32 columns of [9:0] local sums input into shift&adder.

[0044] The module signal logic before the shift adder is as follows: Four clock cycles, T1 to T4, are used. Each clock cycle provides one [9:0] calculation result per column. Therefore, each column of the four clock cycles provides four [9:0] calculation results. The calculation results of T1 and T2 are R127_T1, R126_T2, R125_T1, R124_T2, ..., R1_T1, R0_T2. The suffixes of these 128 calculation results represent the clocks of T1 and T2. The calculation results of T1 and T2 have the same bit weight, so the summation results of the two [9:0] local summations of T1 and T2 can be directly added together without shifting. The output after the summation is the first output of this column. The calculation results of T3 and T4 are R127_T3, R126_T4, R125_T3, R124_T4, ..., R1_T3, R0_T4. The suffixes of these 128 calculation results represent the clocks of T3 and T4. The calculation results of T3 and T4 have the same bit weight, so the summation results of the two [9:0] local summations of T3 and T4 can be directly added together without shifting. The output after the summation is the second output of this column.

[0045] Thus, from T1 to T4, the shift adder inputs are four [9:0] (T1 to T4), and the shift adder has two outputs per column, so the two outputs for 32 columns become 64 outputs. The four [9:0] inputs for the next T1 to T4 clock cycle are the high-order bits of the [9:0] inputs from the previous T1 to T4 clock cycle, so they need to be shifted before being added to the previous one.

[0046] The data width is 4 [9:0] inputs for each T1 to T4 to the shift adder, and a total of 32 columns of 4 clock [9:0] are summed. T1 and T2 are summed, T3 and T4 are summed, for a total of 64 calculation results. Then the summation of T1 to T4 of the next IA bit is performed, and then the result is shifted and added to the 64 calculation results of the previous IA bit.

[0047] In this example, IA is 4 bits, so the loop from T1 to T4 is repeated 4 times, meaning the shifting operation needs to be performed 4 times. The entire shifter adder outputs a result of 64 calculations after 4 iterations of T1 to T4 (each of the 4 IA bits has 64 calculation results).

[0048] As an example, the RRAM memory cells in the analog in-memory computing subarray 400 encode the weight low-order bits with multi-resistance conductance values. The transistor gate of the RRAM memory cell is connected to the word line, and the input activation voltage is applied to the word line. The source line of the RRAM memory cell is connected to the current accumulation bus, and the current on the same column is accumulated on the current accumulation bus. The input terminal of the on-chip ADC is connected to the current accumulation bus.

[0049] As a specific embodiment, the quantization threshold of the on-chip ADC is adaptively adjusted according to the output current distribution. The on-chip ADC is time-division multiplexed across multiple clock cycles. Specifically, in the first clock cycle, the input activation voltage of the first data row is applied to the word line. The conductance value of each RRAM memory cell is multiplied by the input activation voltage to generate a current. The current in the same column is accumulated on the current accumulation bus. The on-chip ADC performs one conversion and outputs the first set of digital quantization results. In the second clock cycle, the input activation voltage of the second data row is applied to the word line. The conductance value of each RRAM memory cell is multiplied by the input activation voltage to generate a current. The current in the same column is accumulated on the current accumulation bus. The on-chip ADC performs one conversion and outputs the second set of digital quantization results. In the third clock cycle... The input activation voltage of the third data row is applied to the word line. The conductance value of each RRAM memory cell is multiplied by the input activation voltage to generate a current. The current in the same column is accumulated on the current accumulation bus. The on-chip ADC performs one conversion and outputs the third set of digital quantization results. In the fourth clock cycle, the input activation voltage of the fourth data row is applied to the word line. The conductance value of each RRAM memory cell is multiplied by the input activation voltage to generate a current. The current in the same column is accumulated on the current accumulation bus. The on-chip ADC performs one conversion and outputs the fourth set of digital quantization results. Using the number of bits CB stored in each RRAM memory cell as the shift step size, the digital quantization results output in the four clock cycles are grouped by column. Within each group, the bits are shifted left by CB bits and accumulated to obtain the analog in-memory calculation results.

[0050] Specifically, such as Figure 3 As shown, the Data Size is 128×64 (8k), consistent with the DCIM data size, and the array size is 64kbit (128kb). 8 64 = 65536, which is exactly twice that of DCIM, because the weight bit count of ACIM is W[7:0], and the weight bit count of DCIM is W[11:8]). The naming format of W is: "W row, group[bit]", where 8 horizontal bits represent the same data. Due to the large area of ​​the ADC, the ADC is multiplexed, and the timing below is used. The conversion time of the ADC is 1 CLK mentioned in DCIM. It is 4 CLKs (T1~T4) for 4 conversions, and the processing time is also 4 CLKs. The summation in ACIM is analog domain summation, which is achieved by accumulating the current or voltage on the SL line. Therefore, it is necessary to ensure that the number of W bits accumulated each time before performing analog accumulation is the same bit.

[0051] The scheduling of ACIM and shift adder is determined based on the number of bits stored in each cell and the number of bits allocated to the weight in ACIM. Let CB be the number of bits stored in each cell and WB be the total number of bits in the weight. Then, the number of cells (cols) occupied by one weight is: NC = WB / CB. T1~T4 read 128cols respectively. 4 = 512 channels of 8-bit data. NC cols form one output group, and the 512 channels are divided into (512 / NC) output groups. In each output group, the 8-bit calculation result of each col in the NC cols is left-shifted by CB bits and accumulated. The number of bits in each channel is truncated to 15 bits, so a total of 10 configurations are shown in Table 1 below: Table 1: ACIM Shift Adder Configuration Parameters

[0052] As an example, such as Figure 1 As shown, the shift-accumulate-fusion unit 500 includes a shifter 501 and an adder 502. The shifter 501 shifts the output of the digital in-memory computation subarray to the left by the bit width of the analog in-memory computation subarray. The output of the shifter 501 is connected to the first input of the adder 502, and the second input of the adder 502 is connected to the output of the analog in-memory computation subarray 400.

[0053] In other words, the shift-accumulate fusion unit shifts the high-order multiply-accumulate result output by the digital in-memory computation subarray to the left by the bit width of the analog in-memory computation subarray, adds it to the low-order multiply-accumulate result output by the analog in-memory computation subarray, aligns the bit weights, and outputs the multiply-accumulate result with full precision.

[0054] In summary, the bit-level mixed-signal in-memory computing circuit based on RRAM proposed in this embodiment of the invention integrates both digital and analog in-memory computing subarrays within a single RRAM array. Furthermore, it employs a digital-analog scheduling control module to dynamically configure the bit width allocation ratio of DCIM and ACIM during runtime. Therefore, 1) only a single RRAM array is needed to support both digital and analog in-memory computing modes, avoiding the area doubling problem caused by discrete storage media, reducing the chip area to approximately 2mm²; 2) the non-volatile nature of RRAM allows for weighted data in power-off regions. 1. It can be maintained without refreshing. Combined with the precise gating unit, it implements word line drive power-off, ADC clock gating and adder tree enable shutdown for subarrays with unassigned computing tasks, eliminating dynamic power consumption and reducing static power consumption to about 500μW, solving the inherent defect of high standby power consumption of SRAM solutions; 2. The DCIM subarray uses single-bit RRAM multiplication and digital adder tree to achieve high-precision calculation of high-bit bits, and the ACIM subarray uses RRAM conductance-current parallel accumulation to achieve high-efficiency calculation of low-bit bits. The combination of the two makes the quantization accuracy reach 8 to 12 bits while maintaining an energy efficiency level of more than 10 to 20 TOPS / W, overcoming the limitation of pure analog RRAM in-memory calculation accuracy of less than 6 bits; 3. The digital-analog scheduling control module can dynamically adjust the D:A ratio during runtime according to different inference task types such as CNN, LSTM, MLP, etc., without reprogramming the weights, realizing adaptive configuration for different AI tasks and expanding the application scenario adaptability of the chip.

[0055] In the description of this invention, it should be understood that the terms "center," "longitudinal," "lateral," "length," "width," "thickness," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," "outer," "clockwise," and "counterclockwise," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this invention.

[0056] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this invention, "a plurality of" means two or more, unless otherwise explicitly specified.

[0057] In this invention, unless otherwise explicitly specified and limited, the terms "installation," "connection," "linking," and "fixing," etc., should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral part; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; they can refer to the internal communication of two components or the interaction between two components. Those skilled in the art can understand the specific meaning of the above terms in this invention according to the specific circumstances.

[0058] In this invention, unless otherwise explicitly specified and limited, "above" or "below" the second feature can include direct contact between the first and second features, or contact between the first and second features through another feature between them. Furthermore, "above," "over," and "on top" of the second feature includes the first feature directly above or diagonally above the second feature, or simply indicates that the first feature is at a higher horizontal level than the second feature. "Below," "below," and "under" the second feature includes the first feature directly below or diagonally below the second feature, or simply indicates that the first feature is at a lower horizontal level than the second feature.

[0059] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the invention. The illustrative expressions of the above terms in this specification should not be construed as necessarily referring to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. In addition, those skilled in the art can combine and integrate the different embodiments or examples described in this specification.

[0060] Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of the present invention.

Claims

1. A bit-level mixed-signal in-memory computing circuit based on RRAM, characterized in that, include: An RRAM storage array, comprising multiple RRAM storage cells arranged in rows and columns; A digital-analog scheduling control module, which outputs a digital / analog ratio configuration signal according to task parameters; A digital in-memory computing subarray is configured in the first part of the RRAM storage array. Its input end is connected to the output end of the digital-to-analog scheduling control module. It uses a single-bit RRAM multiplication unit and a digital addition tree to implement in-memory multiplication and accumulation operations of the weight high-order bits to obtain the digital in-memory computing result. An analog in-memory computing subarray is configured in the second part of the RRAM memory array. Its input is connected to the output of the analog-digital scheduling control module. The in-memory multiplication and accumulation operation of the weight low-order bits is realized by using RRAM conductance-current multiplication and accumulation and on-chip ADC quantization to obtain the analog in-memory computing result. A shift-accumulate fusion unit, wherein the first input terminal of the shift-accumulate fusion unit is connected to the output terminal of the digital in-memory calculation subarray, and the second input terminal is connected to the output terminal of the analog in-memory calculation subarray, is used to add the digital in-memory calculation result and the analog in-memory calculation result after aligning them according to their bit weights, so as to output a complete multiplication-accumulate result; The boundary between the digital in-memory computing subarray and the analog in-memory computing subarray in the RRAM storage array is dynamically determined by the digital / analog ratio configuration signal output by the digital-analog scheduling control module.

2. The bit-level mixed-signal in-memory computing circuit based on RRAM according to claim 1, characterized in that, The digital-analog scheduling and control module includes: The AI ​​model recognition module is used to identify task parameters in the input data packet, wherein the task parameters include input size, number of output channels, and number of loops; A bit allocation module, connected to the AI ​​model recognition module, is used to allocate the bit width ratio of the digital in-memory computing subarray and the analog in-memory computing subarray according to the task parameters, and generate the digital / analog ratio configuration signal.

3. The bit-level mixed-signal in-memory computing circuit based on RRAM according to claim 2, characterized in that, The data packets received at the input end of the AI ​​model recognition module correspond to at least one neural network structure among CNN, LSTM, and MLP.

4. The bit-level mixed-signal in-memory computing circuit based on RRAM according to claim 2, characterized in that, The bit allocation module determines the bit width allocation ratio between the digital in-memory computing subarray and the analog in-memory computing subarray based on the task parameters, and generates the corresponding digital / analog ratio configuration signal; wherein, the bit allocation module selects the bit width allocation ratio based on pre-configured statistical data, the statistical data including the mapping relationship between different task parameters and the optimal bit width allocation ratio.

5. The bit-level mixed-signal in-memory computing circuit based on RRAM according to claim 1, characterized in that, It also includes a precision gating unit, whose input is connected to the output of the analog-digital scheduling control module, and whose output is connected to the word line driving circuit in the digital in-memory computing subarray, the ADC clock circuit in the analog in-memory computing subarray, and the enable terminal of the digital adder tree, respectively, so as to implement word line driving power-off, ADC clock gating, and digital adder tree enable shutdown for the subarray area without assigned computing tasks.

6. The bit-level mixed-signal in-memory computing circuit based on RRAM according to claim 1, characterized in that, The single-bit RRAM multiplication unit in the digital in-memory computing subarray includes an RRAM storage cell and a comparator. The RRAM storage cell encodes a 1-bit weight in high-impedance and low-impedance states. The transistor gate of the RRAM storage cell is connected to the word line, and the bit line of the RRAM storage cell is connected to the input of the comparator. The output of the comparator is connected to the input of the digital addition tree.

7. The bit-level mixed-signal in-memory computing circuit based on RRAM according to claim 6, characterized in that, The digital in-memory computing subarray employs a time-division multiplexing readout method, completing the readout of different data rows in four clock cycles. Input activation is applied to the word line in a time-division manner according to the data row; wherein, During the first clock cycle, the word line corresponding to the first group of data rows is turned on or off according to the input activation value. The comparator reads the current of each column of RRAM storage cell in the data row and compares it with the reference value, outputs a Boolean product, and obtains the first group of local summation results. During the second clock cycle, the word line corresponding to the second set of data rows is turned on or off according to the input activation value. The comparator reads the current of each column of RRAM storage cell in the data row and compares it with the reference value, outputs a Boolean product, and obtains the second set of local summation results. Add the first set of local summation results to the second set of local summation results to obtain the first intermediate result; During the third clock cycle, the word line corresponding to the third set of data rows is turned on or off according to the input activation value. The comparator reads the current of each column of RRAM storage cell in the data row and compares it with the reference value, outputs a Boolean product, and obtains the third set of local summation results. During the fourth clock cycle, the word line corresponding to the fourth group of data rows is turned on or off according to the input activation value. The comparator reads the current of each column of RRAM storage cell in the data row and compares it with the reference value, outputs a Boolean product, and obtains the fourth group of local summation results. Add the third set of local summation results to the fourth set of local summation results to obtain the second intermediate result; Repeat the above process, shifting the first and second intermediate results corresponding to the current bit one bit to the left and adding them to the previous accumulated result. Repeat this process until all input bits are activated, thus obtaining the in-memory calculation result.

8. The bit-level mixed-signal in-memory computing circuit based on RRAM according to claim 1, characterized in that, The RRAM memory cells in the analog in-memory computing subarray encode the weight low-order bits with multi-resistance conductance values. The transistor gate of the RRAM memory cell is connected to the word line, and the input activation voltage is applied to the word line. The source line of the RRAM memory cell is connected to the current accumulation bus, and the current on the same column is accumulated on the current accumulation bus. The input terminal of the on-chip ADC is connected to the current accumulation bus.

9. The bit-level mixed-signal in-memory computing circuit based on RRAM according to claim 8, characterized in that, The quantization threshold of the on-chip ADC is adaptively adjusted according to the output current distribution, and the on-chip ADC is time-division multiplexed across multiple clock cycles; wherein, During the first clock cycle, the input activation voltage of the first data row is applied to the word line. The conductance value of each RRAM memory cell is multiplied by the input activation voltage to generate current. The current on the same column is accumulated on the current accumulation bus. The on-chip ADC performs one conversion and outputs the first set of digital quantization results. During the second clock cycle, the input activation voltage of the second set of data rows is applied to the word line. The conductance value of each RRAM memory cell is multiplied by the input activation voltage to generate current. The current on the same column is accumulated on the current accumulation bus. The on-chip ADC performs one conversion and outputs the second set of digital quantization results. During the third clock cycle, the input activation voltage of the third data row is applied to the word line. The conductance value of each RRAM memory cell is multiplied by the input activation voltage to generate current. The current on the same column is accumulated on the current accumulation bus. The on-chip ADC performs one conversion and outputs the third set of digital quantization results. During the fourth clock cycle, the input activation voltage of the fourth data row is applied to the word line. The conductance value of each RRAM memory cell is multiplied by the input activation voltage to generate current. The current on the same column is accumulated on the current accumulation bus. The on-chip ADC performs one conversion and outputs the fourth digital quantization result. Using the number of bits CB stored in each RRAM memory cell as the shift step size, the digital quantization results output in the four clock cycles are grouped by column, and each group is shifted left by CB bits and accumulated to obtain the analog in-memory calculation results.

10. The bit-level mixed-signal in-memory computing circuit based on RRAM according to claim 1, characterized in that, The shift-accumulate-fusion unit includes a shifter and an adder. The shifter shifts the output of the digital in-memory computation subarray to the left by the bit width of the analog in-memory computation subarray. The output of the shifter is connected to the first input of the adder, and the second input of the adder is connected to the output of the analog in-memory computation subarray.