The present application claims the priority of Chinese patent application No. 202310364014.0, filed on Apr. 7, 2023, and entitled “Memory Array Balancing Influence of Voltage Drop”, which is incorporated herein by reference in its entirety.
The application belongs to the technical field of memory and Compute-In-Memory (CIM) in semiconductor and in CMOS Ultra Large-Scale Integration.
With the development of artificial intelligence and deep learning technology, artificial neural networks have been widely used in fields such as natural language processing, image recognition, autonomous driving, and graph neural networks. However, the increasing size of the network causes a consumption of large amount of energy during a transfer of data between the memory and the traditional processing device such as CPU or GPU, which is known as the von Neumann bottleneck. The computation that occupies the most significant part of the artificial neural network algorithm is the matrix-vector multiplication. In a CIM based on memory array, weights are stored in memory cells and matrix-analog-vector multiplication is processed in the array, which avoids the frequent transfers of data between the memory and the processing unit, and is considered to be a promising solution to the problem of von Neumann bottleneck.
The present disclosure provides a compute-in-memory (CIM) circuit. The CIM circuit includes a memory array. The memory array includes n1 memory blocks arranged in sequence from top to bottom, and each memory block includes n2 rows of memory-cell rows arranged in sequence, wherein n1≥2, n2≥1.
Each odd memory block and an adjacent even memory block arranged therebelow form a memory group.
Each memory group includes n2 pairs of memory-cell rows, and a k-th pair of memory-cell rows in each memory group includes a k-th memory-cell row and a (2n2+1−k)-th memory-cell row in the corresponding memory group, and it is satisfied that 1≤k≤n2.
The memory array is divided into n2 memory subarrays configured to be turned on in sequence, where a k-th memory subarray includes the k-th pair of memory-cell rows in each memory group.
In one of the embodiments, the CIM circuit further includes multiple complementary multiplexer (MUX) groups. Each complementary MUX group includes an MUX and a flip-flop MUX. Outputs of the MUX and outputs of the flip-flop MUX in each complementary MUX group are connected to the memory-cell rows of a memory group in a one-to-one correspondence.
In one of the embodiments, the outputs of the MUX in each complementary MUX group are connected to memory-cell rows in an odd memory block of a memory group in a one-to-one correspondence. The outputs of the flip-flop MUX in a corresponding complementary MUX group are connected to memory-cell rows in an even memory block of a corresponding memory group in a one-to-one correspondence.
In one of the embodiments, each complementary MUX group includes at least N control lines, and the MUX and the flip-flop MUX in each complementary MUX group share the at least N control lines, and 2N=n2.
In one of the embodiments, the CIM circuit further includes multiple digital-to-analog converters (DACs) or buffers, and an output of each DAC or buffer is connected to a memory-cell row of the memory array.
In one of the embodiments, the CIM circuit further includes multiple ADCs, and inputs of the multiple ADCs are connected to bit lines (BLs) of the memory array, respectively.
In one of the embodiments, the CIM circuit further includes a controller, and the controller is connected to each complementary MUX group through a plurality of control lines.
In one of the embodiments, each memory-cell row includes multiple memory cells.
In one of the embodiments, n1 is an even number.
In one of the embodiments, the n2 rows of memory-cell rows in each memory block are arranged in sequence at equal intervals.
In one of the embodiments, the multiple memory cells are SRAM or DRAM volatile memory cells, or FLASH, RRAM, PCRAM, or MRAM non-volatile memory cells.
The present disclosure further provides a control method of CIM circuit. The control method of CIM circuit includes: dividing a memory array into n1 memory blocks in sequence from top to bottom, and arranging n2 rows of memory-cell rows in sequence in each memory block, where n1≥2, n2≥1; forming a memory group by each odd memory block and an adjacent even memory block arranged therebelow; dividing each memory group into n2 pairs of memory-cell rows, and forming a k-th pair of memory-cell rows in each memory group by a k-th memory-cell row and a (2n2+1−k)-th memory-cell row in the corresponding memory group, wherein 1≤k≤n2; forming a k-th memory subarray by the k-th pair of memory-cell rows in each memory group; and controlling memory subarrays to be turned on in turn for calculation.
In one of the embodiments, before dividing the memory array into n1 memory blocks in sequence from top to bottom, and arranging the n2 rows of memory-cell rows in sequence in each memory block, the control method of CIM circuit further includes: setting the number n2 of rows of memory-cell rows arranged in sequence in each memory block to be the same as the number of times of turning on the memory subarrays in sequence for calculation; and calculating the number of memory blocks to be
according to a total row number n of the memory-cell rows in the memory array and the number n2 of rows of memory-cell rows arranged in sequence in each memory block.
In one of the embodiments, the control method of CIM circuit further includes arranging the n2 rows of memory-cell rows in each memory block at equal intervals in sequence.
In one of the embodiments, controlling the memory subarrays to be turned on in turn for calculation includes: controlling a first memory subarray, a second memory subarray, a third memory subarray, and a fourth memory subarray to be turned on in sequence for calculation.
The technical effects of the present disclosure are as follows: the CIM circuit of the present disclosure includes a memory array. The memory array includes n1 memory blocks arranged in sequence from top to bottom, and each memory block includes n2 rows of memory-cell rows arranged in sequence, wherein n1≥2, n2≥1. Each odd memory block and an adjacent even memory block arranged therebelow form a memory group. Each memory group includes n2 pairs of memory-cell rows, and a k-th pair of memory-cell rows in each memory group includes a k-th memory-cell row and a (2n2+1−k)-th memory-cell row in the corresponding memory group, and it is satisfied that 1≤k≤n2. The memory array is divided into n2 memory subarrays configured to be turned on in sequence for calculation, where a k-th memory subarray includes the k-th pair of memory-cell rows in each memory group. When the memory array is computing, the memory subarrays may be controlled to be turned on in turn for calculation. The k-th memory subarray, as an example of the memory subarray controlled to be turned on each time, is formed by the k-th row of memory-cell row and the (2n2+1−k)-th row of memory-cell row selected from each memory group, where 1≤k≤n2. Accordingly, for each memory group, a sum of in-group sequence numbers of the memory-cell rows forming a memory subarray is equal to a sum of in-group sequence numbers of memory-cell rows forming any other memory subarray, and the sum is a constant 2n2+1. Thus, it may be ensured that, for each memory group, a resistance sum of BLs connecting a pair of memory-cell rows forming a memory subarray to other circuit devices arranged at the bottom is equal to a resistance sum of BLs connecting a pair of memory-cell rows forming any other memory subarray to other circuit devices arranged at the bottom. Accordingly, the memory array is finally divided into n2 non-overlapped memory subarrays, and a sum of in-memory-array row sequence numbers of all memory-cell rows in each memory subarray, is the same, that is, a total resistance of the BLs connecting all memory-cell rows in the memory subarray to other circuit devices arranged at the bottom is the same, thereby effectively balancing the impact of the voltage drop during the calculation of each memory subarray, and reducing the deviation of the calculation result of the memory array caused by the unbalanced voltage drops.
In order to make the purposes, technical solutions and advantages of the embodiments of the present disclosure clearer, the technical solutions of the present disclosure will be described clearly and completely hereinafter with reference to the drawings of the embodiments. Obviously, the described embodiments are part of the embodiments of the disclosure, rather than all embodiments. Based on the embodiments in the disclosure, all other embodiments obtained by those of ordinary skill in the art without involving creative work fall within the scope of protection of the disclosure.
In view of the above existing problems in the prior art, the present disclosure provides a CIM circuit. As shown in
In such an arrangement, when the memory array is computing, the memory subarrays may be controlled to be turned on in turn for calculation. The k-th memory subarray, as an example of the memory subarray controlled to be turned on each time, is formed by the k-th row of memory-cell row and the (2n2+1−k)-th row of memory-cell row selected from each memory group, where 1≤k≤n2. Accordingly, for each memory group, a sum of in-group sequence numbers of the memory-cell rows forming a memory subarray is equal to a sum of in-group sequence numbers of memory-cell rows forming any other memory subarray, and the sum is a constant 2n2+1. Thus, it may be ensured that, for each memory group, a resistance sum of BLs connecting a pair of memory-cell rows forming a memory subarray to other circuit devices arranged at the bottom is equal to a resistance sum of BLs connecting a pair of memory-cell rows forming any other memory subarray to other circuit devices arranged at the bottom. Accordingly, the memory array is finally divided into n2 non-overlapped memory subarrays, and a sum of in-memory-array row sequence numbers of all memory-cell rows in each memory subarray, is the same, that is, a total resistance of the BLs connecting all memory-cell rows in the memory subarray to other circuit devices arranged at the bottom is the same, thereby effectively balancing the impact of the voltage drop during the calculation of each memory subarray, and reducing the deviation of the calculation result of the memory array caused by the unbalanced voltage drops.
In an embodiment of the disclosure, n1 is an even number, and in other embodiments, n1 may be an odd number, which is not limited in the disclosure.
The CIM circuit of the disclosure is described hereinafter in detail by taking a specific memory array as an example. As shown in
In an embodiment of the disclosure, as shown in
In an embodiment of the disclosure, the CIM circuit further includes multiple complementary Multiplexer (MUX) groups. As shown in
In one of the embodiments, the outputs of the MUX in each complementary MUX group are connected to the memory-cell rows in the odd memory block of a memory group in a one-to-one correspondence, and the outputs of the flip-flop MUX in the corresponding complementary MUX group are connected to the memory-cell rows in the even memory block of the corresponding memory group in a one-to-one correspondence. Such an arrangement may realize the selection and turning-on of the memory subarrays.
In one of the embodiments, each complementary MUX group includes at least N control lines. Further, in order to make the structure of the CIM circuit simple, the MUX and the flip-flop MUX in each complementary MUX group share the N control lines. In order to realize the selection and turning-on of the memory subarray, the number N of the control lines satisfies that 2N=n2, where, n2 denotes the number of sequentially arranged memory-cell rows included in each memory block.
Referring to
The CIM circuit of the disclosure is described in detail by taking a specific memory array as an example. Referring to
In an embodiment of the disclosure, as shown in
As shown in
In an embodiment of the disclosure, as shown in
Referring to
In an embodiment of the disclosure, the memory cells are SRAM or DRAM volatile memory cells, or FLASH, RRAM, PCRAM, or MRAM non-volatile memory cells, which are not limited in the disclosure.
The disclosure further provides a control method of CIM circuit, as shown in
At Step S1, a memory array is divided into n1 memory blocks in sequence from top to bottom. and n2 rows of memory-cell rows are arranged in sequence in each memory block, where n1≥2, n2≥1.
At Step S2, a memory group is formed by each odd memory block and an adjacent even memory block arranged therebelow.
At Step S3, each memory group is divided into n2 pairs of memory-cell rows, and a k-th pair of memory-cell rows in each memory group is formed by a k-th memory-cell row and a (2n2+1−k)-th memory-cell row in the corresponding memory group, and it is satisfied that 1≤k≤n2.
At Step S4: a k-th memory subarray is formed by the k-th pair of memory-cell rows in each memory group.
At Step S5: memory subarrays are controlled to be turned on in turn for calculation.
According to the control method of CIM circuit of the present disclosure, when the memory array is computing, the memory subarrays may be controlled to be turned on in turn for calculation. The k-th memory subarray, as an example of the memory subarray controlled to be turned on each time, is formed by the k-th row of memory-cell row and the (2n2+1−k)-th row of memory-cell row selected from each memory group, where 1≤k≤n2. Accordingly, for each memory group, a sum of in-group sequence numbers of the memory-cell rows forming a memory subarray is equal to a sum of in-group sequence numbers of memory-cell rows forming any other memory subarray, and the sum is a constant 2n2+1. Thus, it may be ensured that, for each memory group, a resistance sum of BLs connecting a pair of memory-cell rows forming a memory subarray to other circuit devices arranged at the bottom is equal to a resistance sum of BLs connecting a pair of memory-cell rows forming any other memory subarray to other circuit devices arranged at the bottom. Accordingly, the memory array is finally divided into n2 non-overlapped memory subarrays, and a sum of in-memory-array row sequence numbers of all memory-cell rows in each memory subarray is the same, that is, a total resistance of the BLs connecting all memory-cell rows in the memory subarray to other circuit devices arranged at the bottom is the same, thereby effectively balancing the impact of the voltage drop during the calculation of each memory subarray, and reducing the deviation of the calculation result of the memory array caused by the unbalanced voltage drops.
When performing calculations in the memory array, the memory subarrays may be controlled to be turned on in turn for calculation. For an example of controlling a memory array including 128 memory-cell rows and turning on four memory subarrays of the memory array for calculation for four times, the first memory subarray, the second memory subarray, the third memory subarray, and the fourth memory subarray are controlled to be turned on, which may be implemented in a manner as follows: the first memory subarray is controlled to be turned on for the first time, the second memory subarray is controlled to be turned on for the second time, the third memory subarray is controlled to be turned on for the third time, and the fourth memory subarray is controlled to be turned on for the fourth time. The four memory subarrays may also be controlled to be turned on in any other order, which is not limited in the disclosure.
In an embodiment of the disclosure, before dividing the memory array into n1 memory blocks in sequence from top to bottom, and arranging n2 rows of memory-cell rows in sequence in each memory block, the control method of CIM circuit also includes: calculating the number of memory blocks to be
according to the total row number n of memory-cell rows in the memory array and the number n2 of times of turning on the memory subarrays in sequence for calculation, thereby dividing the memory array into multiple memory blocks.
In an embodiment of the disclosure, controlling the memory subarrays to be turned on in turn for calculation includes: controlling the memory subarrays to be turned on in turn for calculation of matrix-analog-vector multiplication. The control method of CIM circuit of the present disclosure can reduce the deviation of the calculation result of the memory array caused by the unbalanced voltage drops when the memory array is used to perform the matrix-analog-vector multiplication.
In an embodiment of the disclosure, the control method of CIM circuit includes arranging n2 rows of the memory-cell rows in each memory block in sequence at equal intervals, thereby ensuring that when the memory array is used to perform the matrix-analog-vector multiplication, the deviation of the calculation result of the memory array caused by the unbalanced voltage drops may be reduced as much as possible.
The technical features of the embodiments above 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 are no contradictions in the combinations of these technical features, all of the combinations should be considered to be within the scope of the specification.
The embodiments above only represent several implementation modes of the present application, and the description thereof is relatively specific and detailed, but it should not be construed as limiting the scope of the patent. It should be noted that for those skilled in the art, various modifications and improvements may be made without departing from the concept of the present application, and all these modifications and improvements belong to the protection scope of the present application. Therefore, the scope of protection of the patent application should be subject to the appended claims.
Number | Date | Country | Kind |
---|---|---|---|
202310364014.0 | Apr 2023 | CN | national |