Patent Description:
A dynamic random access memory (dynamic random access memory, DRAM) is a common random access memory, and is widely used in the storage field. In a new non-Von Neumann computing architecture, data does not need to be exchanged between a processor and a memory in in-memory computing (computing is directly performed in the memory), to greatly reduce a delay and energy consumption. Therefore, in-memory computing attracts much attention.

Currently, the DRAM includes a plurality of memory banks, each bank includes a plurality of memory cell subarrays, and each subarray includes memory cells (memory cell, MC, which is a cell for short) disposed in an array. Each MC is connected to several word lines (word line, WL) and bit lines (bit line, BL), and there are a plurality of sense amplifiers (sense amplifier, SA) between adjacent subarrays. A positive input (BL) and a negative input (BL ) of each SA are respectively connected to bit lines of MCs in two adjacent subarrays. Each subarray includes Y BLs. An input/output data bus of each bank has X bits, and Y is greater than or equal to X.

Document <CIT> describes a prior art DRAM.

In the DRAM, mass batch bitwise logical operations are invoked as basic operators of in-memory computing. For example, when bitwise logical operations such as AND and OR (AND & OR) operations are performed on data of vectors a[<NUM>, <NUM>. m, n] (where when one memory cell stores <NUM>-bit data, the vector a is data stored in a row of memory cells, and a data bit width is <NUM>/<NUM>/<NUM> bits) and vectors b[<NUM>, <NUM>. m, n] (a data bit width is <NUM>/<NUM>/<NUM> bits) in a subarray i and a subarray i+<NUM> (as shown in <FIG>) of two adjacent memory cell subarrays in the bank of the DRAM, the data needs to be placed in a same subarray. Therefore, data migration is required.

During data migration (as shown in <FIG>), a vector i and a vector i+<NUM> are respectively mapped to MCs connected to two word lines (WL i and WL i+<NUM>) in the subarray i and the subarray i+<NUM>. Before a bitwise logical operation is performed on the two vectors, the two vectors need to be placed in a same subarray. For example, the vector i of the WL i in the subarray i needs to be migrated to the subarray i+<NUM>. In this case, a WL i in a subarray i in a bank_SRC needs to be activated first, and then data of a vector i of the WL i is sequentially read, and sequentially written into a subarray i in a bank_INT for temporary storage. Then, the data in the bank_INT is read and migrated to a subarray i+<NUM> in the bank_SRC. In this way, data in two adjacent subarrays is placed in a same subarray and is prepared for subsequent bitwise logical operations. In a data reading process performed on the MC, one activation operation and one precharge operation need to be performed on the BL connected to the MC, and in a data writing process performed on the MC, one activation operation and one precharge operation also need to be performed on the BL connected to the MC. Therefore, when data is migrated between adjacent subarrays in a same bank according to the method, if a data bit width is Y, and a data bus bit width between different banks is X, 4Y/X activation operations and 4Y/X precharge operations need to be performed in the entire process. Consequently, the entire data transmission process is slow, energy consumption is high, and efficiency is low.

This application provides a memory and a data migration method, to reduce time for implementing data migration between adjacent memory cell subarrays during in-memory computing in a DRAM, further reduce power consumption of the memory, and improve efficiency.

According to a first aspect, a memory is provided. The memory includes several memory banks. The bank includes a plurality of memory cell subarrays disposed in a column, each memory cell subarray includes memory cells disposed in an array, memory cells located in a same row in the memory cell subarray are connected to a same word line, and memory cells located in a same column are connected to a same bit line. A sense amplifier SA and a switch unit are disposed in a row at spacings between adjacent memory cell subarrays. Between adjacent memory cell subarrays, a sense amplifier is disposed on one of every two adjacent bit lines, and the other bit line is connected to a switch unit in series. In addition, on a same bit line, the sense amplifier and the switch unit are alternately disposed between the memory cell subarrays. When any switch unit is turned on, the SA connected to two rows of memory cell subarrays can be turned on. For example, a positive input BL of a first SA connected to a column of memory cells in a memory cell subarray i+<NUM> is connected to a negative input BL of a second SA connected to a column of memory cells in a memory cell subarray i+<NUM>. Then, when the positive input BL of the first SA reads data of any memory cell in the column of memory cells in the memory cell subarray i+<NUM>, the switch unit may transmit the data read by the first SA to the second SA. Finally, the second SA writes the received data into any memory cell in the column of memory cells in the memory cell subarray i+<NUM> connected to the second SA, to implement data migration between adjacent subarrays in a same bank without using different banks. Therefore, this can improve a speed of data transmission, reduce power consumption of data migration, and improve efficiency.

In a possible implementation, the bit line is divided into two sections by the sense amplifier disposed on the bit line, one section is connected to a positive input of the sense amplifier, and the other section is connected to a negative input of the sense amplifier.

In a possible implementation, a control end of the switch unit is connected to one word line, and when the switch unit is turned on by a control signal of the control end, the switch unit is configured to conduct a sense amplifier in a previous row and a sense amplifier in a next row, to transmit data between the sense amplifier in the previous row and the sense amplifier in the next row.

In a possible implementation, the switch unit includes a switch transistor, and a source of the switch transistor and a drain of the switch transistor are respectively connected to bit lines of the adjacent memory cell subarrays. In this solution, the switch unit is mainly implemented by using a switch transistor. Because the memory cell includes an access transistor, the switch unit may alternatively be implemented in a form of a transistor. This facilitates production by using a same manufacturing process.

In a possible implementation, the memory further includes a word line control circuit, and the word line control circuit is connected to the control end of the switch unit through the word line, and is configured to input the control signal to the control end of the switch unit.

In a possible implementation, the sense amplifier includes the switch unit.

In a possible implementation, the memory cell includes an access transistor and a storage capacitor, one end of the storage capacitor is connected to a source line, the other end of the storage capacitor is connected to a first end of the access transistor, a second end of the access transistor is connected to the bit line, and a control end of the access transistor is connected to the word line.

According to a second aspect, a data migration method for the memory in the first aspect is provided. The method includes: reading, by a first sense amplifier, data of a first memory cell in a first memory cell subarray, where a first end of the first sense amplifier is connected to the first memory cell through a first bit line; controlling a switch unit to be turned on, and writing the data of the first memory cell into a second sense amplifier, where a first end of the switch unit is connected to the first end of the first sense amplifier through the first bit line, and a second end of the switch unit is connected to a second end of the second sense amplifier through a second bit line; and writing the data of the first memory cell into a second memory cell in a second memory cell subarray by using the second sense amplifier, where the second end of the second sense amplifier is connected to the second memory cell through the second bit line; and the first end of the first sense amplifier is a positive input, and the second end of the second sense amplifier is a negative input; or the first end of the first sense amplifier is a negative input, and the second end of the second sense amplifier is a positive input.

In a possible implementation, the first memory cell is further connected to a first word line, and before the reading, by a first sense amplifier, data of a first memory cell in a first memory cell subarray, the method further includes: activating the first word line.

In a possible implementation, the second memory cell is further connected to a second word line, and before the writing, by the second sense amplifier, the data of the first memory cell into a second memory cell in a second memory cell subarray, the method further includes: activating the second word line.

In a possible implementation, after the writing, by the second sense amplifier, the data of the first memory cell into a second memory cell in a second memory cell subarray, the method further includes: turning off the switch unit; and precharging the first bit line and the second bit line.

According to a third aspect, an integrated circuit is provided, and is applied to the memory in the first aspect. The integrated circuit includes a memory controller and a memory interface. The memory controller is configured to: read data of a first memory cell in a first memory cell subarray by using a first sense amplifier, where a first end of the first sense amplifier is connected to the first memory cell through a first bit line; control a switch unit to be turned on, and write the data of the first memory cell into a second sense amplifier, where a first end of the switch unit is connected to the first end of the first sense amplifier through the first bit line, and a second end of the switch unit is connected to a second end of the second sense amplifier through a second bit line; and write the data of the first memory cell into a second memory cell in a second memory cell subarray by using the second sense amplifier, where the second end of the second sense amplifier is connected to the second memory cell through the second bit line; and the first end of the first sense amplifier is a positive input, and the second end of the second sense amplifier is a negative input; or the first end of the first sense amplifier is a negative input, and the second end of the second sense amplifier is a positive input.

In a possible implementation, the first memory cell is further connected to a first word line, and the memory controller is further configured to: before reading the data of the first memory cell in the first memory cell subarray by using the first sense amplifier, activate the first word line.

In a possible implementation, the second memory cell is further connected to a second word line, and the memory controller is further configured to: before writing the data of the first memory cell into the second memory cell in the second memory cell subarray by using the second sense amplifier, activate the second word line.

In a possible implementation, the memory controller is further configured to: after writing the data of the first memory cell into the second memory cell in the second memory cell subarray by using the second sense amplifier, turn off the switch unit; and precharge the first bit line and the second bit line.

According to a fourth aspect, an electronic device is provided, and includes the integrated circuit and the memory. The integrated circuit includes a memory controller and a memory interface, and the memory is connected to the memory controller through the memory interface.

For technical effects brought by the second aspect to the fourth aspect, refer to technical effects brought by different implementations of the first aspect.

Construction and practice of various embodiments are discussed in detail below. However, it should be understood that a plurality of applicable inventive concepts provided in this application can be implemented in a plurality of specific environments. The specific embodiments discussed are merely illustrative of specific manners to implement and use the specification and the technologies, and do not limit the scope of this application.

Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by a person of ordinary skill in the art to which this disclosure belongs.

Each circuit or another component may be described as or referred to as "configured to" perform one or more tasks. In this case, "configured to" is used to imply a structure by indicating that the circuit/component includes a structure (for example, a circuit system) that performs one or more tasks during operation. Therefore, the circuit/component can be referred to as being configured to perform the task even when the specified circuit/component is not currently operational (for example, is not on). The circuit/component used with the term "configured to" includes hardware, for example, a circuit that performs an operation.

The following describes technical solutions in embodiments of this application with reference to the accompanying drawings in embodiments of this application. In this application, "at least one" means one or more, and "a plurality of" means two or more. "And/or" describes an association relationship between associated objects, and represents that three relationships may exist. For example, A and/or B may represent the following cases: Only A exists, both A and B exist, and only B exists, where A and B may be singular or plural. The character "/" usually indicates an "or" relationship between the associated objects. At least one of the following items (pieces) or a similar expression thereof refers to any combination of these items, including any combination of singular items (pieces) or plural items (pieces). For example, at least one of a, b, or c may represent: a, b, c, a and b, a and c, b and c, or a, b, and c, where a, b, and c may be singular or plural. In addition, in embodiments of this application, the terms such as "first" and "second" are not intended to limit a quantity or an execution sequence.

It should be noted that, in this application, the word such as "example" or "for example" is used to represent giving an example, an illustration, or a description. Any embodiment or design scheme described as "example" or "for example" in this application should not be explained as having more advantages than another embodiment or design scheme. Specifically, usage of the word such as "example" or "for example" is intended to present a related concept in a specific manner.

<FIG> is a schematic diagram of an architecture of a computer system according to an embodiment of this application. As shown in <FIG>, a computer system <NUM> may include at least a processor (processor) <NUM>, a memory controller (memory controller) <NUM>, and a memory <NUM>. Usually, the memory controller <NUM> may be integrated into the processor <NUM>. The memory <NUM> may be used for internal storage. It should be noted that in the computer system provided in this embodiment of this application, in addition to the components shown in <FIG>, the computer system <NUM> may further include another component such as a communication interface and a disk that is used for external storage. This is not limited herein.

The processor <NUM> is a computing core and a control unit (control unit) of the computer system <NUM>. The processor <NUM> may include a plurality of cores (core) <NUM>. An operating system and another software program are installed in the processor <NUM>, to enable the processor <NUM> to access the memory <NUM>, a cache, and the disk. In this embodiment of this application, the core <NUM> in the processor <NUM> may be a central processing unit (central processing unit, CPU), an artificial intelligence (artificial intelligence, AI) processor, a digital signal processor (digital signal processor), a neural network processing unit, another application-specific integrated circuit (application-specific integrated circuit, ASIC), or the like. The memory controller <NUM> is a bus circuit controller that controls the memory <NUM> inside the computer system <NUM> and is configured to manage and plan data transmission from the memory <NUM> to the core <NUM>. The memory controller <NUM> may be used for data exchange between the memory <NUM> and the core <NUM>. The memory controller <NUM> may be an independent chip, and is connected to the core <NUM> through a system bus. The memory controller <NUM> may alternatively be integrated into the processor <NUM>, or disposed in a northbridge. A specific location of the memory controller <NUM> is not limited in this embodiment of this application. During actual application, the memory controller <NUM> may control necessary logic to write data into the memory <NUM> or read data from the memory <NUM>.

The memory <NUM> is a main memory of the computer system <NUM>. The memory <NUM> is connected to the memory controller <NUM> through a double data rate (double data rate, DDR) bus. The memory <NUM> is usually configured to store various running software in the operating system, input and output data, information exchanged with an external memory, and the like. A dynamic random access memory (dynamic random access memory, DRAM) is usually used as the memory <NUM>. The processor <NUM> can access the memory <NUM> at a high speed by using the memory controller <NUM>, and perform a read operation and a write operation on any memory cell in the memory <NUM>.

In this embodiment of this application, an example in which the memory <NUM> is a DRAM is used for description. The memory <NUM> may also be referred to as a DRAM <NUM>. Data is stored in a memory cell (which may also be referred to as a DRAM cell, MC) of the DRAM <NUM>. In this embodiment of this application, the memory cell is a minimum memory cell configured to store data. Usually, one memory cell may store <NUM>-bit (bit) data. The DRAM uses an amount of electricity stored in a capacitor to indicate data <NUM> or data <NUM>. Because the capacitor is subject to electricity leakage, if electric charges in the capacitor are insufficient, stored data may suffer an error. Therefore, the memory controller <NUM> refreshes data in the DRAM <NUM> at regular intervals, to prevent the DRAM <NUM> from losing data. In addition, the DRAM <NUM> is volatile. When the computer system <NUM> is powered off, information in the DRAM <NUM> is absent from storage. During actual application, MCs in the DRAM <NUM> are arranged and disposed into a matrix, and the matrix is referred to as a memory cell subarray. One bank includes several memory cell subarrays, and the memory controller <NUM> can locate any bit in the bank by using corresponding row and column decoders. One DRAM chip (which may also be referred to as a memory chip) may include a plurality of banks, and one rank may include a plurality of DRAM chips. A plurality of DRAM ranks may alternatively be integrated into a dual in-line memory module (dual in-line memory module, DIMM). For example, as shown in <FIG>, the DRAM <NUM> may include a plurality of channels (channel) <NUM>. Each channel <NUM> may include at least one rank, and each rank may include at least one bank. Each bank includes a plurality of memory cell subarrays. A person skilled in the art may learn that the rank is memory chips (chip) connected to a same chip select (chip select) signal. The memory controller <NUM> can perform a write operation on chips in a same rank, and chips in a same rank also share a same control signal. The memory controller <NUM> may access data in memory cells in each channel of the DRAM <NUM> by using a memory bus.

During actual application, the memory cell is separately connected to a word line (word line, WL) and a bit line (bit line, BL), the word line is connected to a plurality of memory cells in a horizontal direction, and the bit line is connected to a plurality of memory cells in a vertical direction. The word line is used to enable the memory cell, and the bit line is used to charge a capacitor in each memory cell, so that the amount of electricity stored in the capacitor can be used to indicate the data <NUM> and the data <NUM>. It may be understood that, when the bit line is at a high level, a large amount of electricity is stored in the capacitor, or a large quantity of charges are stored in the capacitor. When the bit line is at a low level, a small amount of electricity is stored in the capacitor, or a small quantity of charges are stored in the capacitor. During application, in one case, a large quantity of charges in the capacitor may indicate that data "<NUM>" is stored in the memory cell, and a small quantity of charges indicate that data "<NUM>" is stored. In another case, a large quantity of charges in the capacitor may alternatively indicate that data "<NUM>" is stored, and a small quantity of charges indicate that data "<NUM>" is stored.

Refer to <FIG>. The memory <NUM> may include a command decoder <NUM>, a control logic circuit <NUM>, a memory cell subarray <NUM>, and an input/output circuit <NUM>. This is not limited in a specific embodiment. More or fewer components may be included. The command decoder <NUM> may receive a command CMD (command, CMD) from the memory controller <NUM>, and may decode the received command CMD. For example, the command CMD may include a write command (write, WR), a read command (read, RD), an active command (active, ACT), and/or a precharge command (precharge, PRE).

The memory cell subarray <NUM> may include a plurality of memory cells MC. The plurality of MCs may be connected to a plurality of word lines and a plurality of bit lines. The word line may be connected to a word line control circuit (which is also referred to as a word line parser), and the bit line may be connected to a bit line control circuit (which is also referred to as a bit line parser). The control logic circuit <NUM> may control the components of the memory <NUM> based on a decoding result from the command decoder <NUM>. For example, when the decoding result of the command decoder <NUM> indicates that the received command CMD is an active command ACT, the control logic circuit <NUM> may control the word line control circuit to activate a word line corresponding to a row address (row address, RA) received together with the active command ACT. Then, data stored in the memory cell MC connected to the activated word line may be set (for example, transmitted, sent, or output) by using a sense amplifier (sense amplifier, SA) to the input/output circuit <NUM>. For example, when the decoding result of the command decoder <NUM> indicates that the received command CMD is a read command RD, the control logic circuit <NUM> may control the input/output circuit <NUM> to output data from a bit line corresponding to a column address (column address, CA) received together with the read command RD. When the decoding result of the command decoder <NUM> indicates that the received command CMD is a write command WR, the control logic circuit <NUM> may set write data received from the memory controller <NUM> to the input/output circuit <NUM>. The memory controller <NUM> may send a precharge command PRE to the memory <NUM>, to deactivate and/or disable the activated word line. For example, when the decoding result of the command decoder <NUM> indicates that the received command CMD is a precharge command PRE, the control logic circuit <NUM> may control the input/output circuit <NUM> and the bit line control circuit to precharge the bit line. The foregoing briefly describes basic principles of operations such as activation, read, write, and precharge. It may be understood that the operations such as activation, read, write, and precharge in the following solutions may be implemented in at least the manners described above.

<FIG> shows a diagram of a circuit of the memory cell subarray <NUM> in <FIG>. The memory cell subarray <NUM> may include a plurality of memory cells MC. Each memory cell MC may include an access transistor T and a storage capacitor C. A first end of the access transistor T of the memory cell MC is connected to one of a bit line BL <NUM> to a bit line BL m, and a second end of the access transistor T is connected to a first end of the storage capacitor C. A gate of the access transistor T is connected to one of a word line WL <NUM> to a word line WL n. A second end of the storage capacitor C may be connected to a voltage terminal. The voltage terminal may be connected to a voltage (for example, ground or a half-power supply voltage) of a specific level (for example, an expected voltage level) through a source line (source line, SL). In some embodiments, when any one of the word line WL <NUM> to the word line WL n is selected in response to the active command ACT from the memory controller <NUM>, and the selected word line can be activated, data stored in a memory cell connected to the selected word line may be provided to the input/output circuit <NUM> through the plurality of bit lines BL <NUM> to BL m and the SA.

In addition, as shown in <FIG>, a positive input BL and a negative input BL of the sense amplifier SA are respectively connected to two bit lines of two adjacent memory cell subarrays: a subarray i and a subarray i+<NUM>. For example, a BL <NUM> in the subarray i is connected to a negative input BL of a sense amplifier SA <NUM> in an ith row, and a BL <NUM> in the subarray i+<NUM> is connected to a positive input BL of a sense amplifier SA i in an ith row. After a word line WL i in any row in the subarray i+<NUM> is activated, the sense amplifier SA reads, through the positive input BL, data from a memory cell connected to the WL i in the memory cell subarray i+<NUM>. Alternatively, as shown in <FIG>, the input/output circuit <NUM> writes data into the memory cell through the corresponding BL <NUM>. Because structures of memory cells are all the same, in the following example, the memory cell subarray is simplified as a diagram shown in <FIG> in which a word line and a bit line intersect. It can be understood that there is one memory cell at an intersection between each word line and each bit line.

Based on the memory, during data migration (as shown in <FIG>), for example, a vector i of the WL i in the subarray i needs to be migrated to the subarray i+<NUM>. In this case, a WL i in a subarray i in a bank_SRC needs to be activated first, and then data a[<NUM>, <NUM>. m, n] of a vector i of the WL i is sequentially read, and sequentially written into a subarray i in a bank_INT for temporary storage. Then, the data in the bank_INT is read and migrated to a subarray i+<NUM> in the bank_SRC. In this way, data in two adjacent subarrays is placed in a same subarray and is prepared for subsequent bitwise logical operations. When data is migrated between adjacent subarrays in a same bank according to the method, if a data bit width is Y, and a data bus bit width between different banks is X, 4Y/X activation operations and 4Y/X precharge operations need to be performed in the entire process. Consequently, the entire data transmission process is slow, energy consumption is high, and efficiency is low.

To resolve the foregoing problems, a memory is provided. The memory includes several memory banks. As shown in <FIG>, the bank includes a plurality of memory cell subarrays (a subarray i to a subarray i+<NUM> shown in <FIG>) disposed in a column, each memory cell subarray includes memory cells disposed in an array, memory cells located in a same row in the memory cell subarray are connected to a same word line, and memory cells located in a same column are connected to a same bit line (connection manners between the memory cell and the word line and between the memory cell and the bit line are shown in <FIG> and <FIG>). As shown in <FIG>, a sense amplifier SA and a switch unit M are disposed in a row at spacings between adjacent memory cell subarrays, each sense amplifier SA corresponds to a column of memory cells MC, and each switch unit M corresponds to another column of memory cells MC. A positive input BL and a negative input BL of the sense amplifier SA are respectively connected to bit lines of first columns of memory cells in two adjacent memory cell subarrays, and two ends of the switch unit M are respectively connected to bit lines of second columns of memory cells in two adjacent memory cell subarrays. In a direction of a same column of memory cells, the sense amplifier SA and the switch unit M are disposed at spacings between the memory cell subarrays.

<FIG> is described by using an example of two adjacent rows of memory cell subarrays: a subarray i and a subarray i+<NUM>. A sense amplifier SA and a switch unit M are disposed in a row (an ith row) at spacings between the subarray i and the subarray i+<NUM>. Between adjacent memory cell subarrays, a sense amplifier is disposed on one of every two adjacent bit lines, and the other bit line is connected to a switch unit in series. For example, the bit line is divided into two sections by the sense amplifier SA disposed on the bit line, one section is connected to a positive input BL of the sense amplifier SA, and the other section is connected to a negative input BL of the sense amplifier. A sense amplifier SA <NUM> and a switch unit M2 in the ith row are used as an example. The sense amplifier SA <NUM> divides a bit line BL <NUM> into a section in the subarray i+<NUM> and a section in the subarray i. Then, a positive input BL of the sense amplifier SA <NUM> is connected to a bit line BL <NUM> of a first column of memory cells MC in the subarray i+<NUM>, and a negative input BL of the sense amplifier SA <NUM> is connected to a bit line BL <NUM> of a first column of memory cells MC in the subarray i. One end of the switch unit M2 is connected to a bit line BL <NUM> of a second column of memory cells MC in the subarray i+<NUM>, and the other end of the switch unit M2 is connected to a bit line BL <NUM> of a second column of memory cells MC in the subarray i. In a direction of memory cells in a same column as the SA <NUM>, one end of a switch unit M1 between the subarray i+<NUM> and a subarray i+<NUM> is connected to the bit line BL <NUM> of the first column of memory cells MC in the subarray i+<NUM>, and the other end of the switch unit M1 is connected to a bit line BL <NUM> of a first column of memory cells MC in the subarray i+<NUM>. On a same bit line, the sense amplifier and the switch unit are alternately disposed between the memory cell subarrays. For example, in a direction of a bit line BL <NUM> of a first column of memory cells MC in each subarray, the sense amplifier SA <NUM> is located between the subarray i and the subarray i+<NUM>, the switch unit M1 is located between the subarray i+<NUM> and the subarray i+<NUM>, and a sense amplifier SA <NUM> is located between the subarray i+<NUM> and a subarray i+<NUM>.

When any switch unit is turned on, the SA connected to two rows of memory cell subarrays can be turned on. For example, a positive input BL of a first SA connected to a column of memory cells in the memory cell subarray i+<NUM> is connected to a negative input BL of a second SA connected to a column of memory cells in the memory cell subarray i+<NUM>. In this case, when the positive input BL of the first SA reads data of any memory cell in the column of memory cells in the memory cell subarray i+<NUM>, the switch unit may transmit the data read by the first SA to the second SA. Finally, the second SA writes the received data into any memory cell in the column of memory cells in the memory cell subarray i+<NUM> connected to the second SA, to implement data migration between adjacent subarrays in a same bank without using different banks. Therefore, this can improve a speed of data transmission, reduce power consumption of data migration, and improve efficiency.

A control end of the switch unit M is connected to one word line. As shown in <FIG>, the control end of the switch unit in the ith row is connected to a word line WL-isoi, and a control end of a switch unit in an (i+<NUM>)th row is connected to a word line WL-isoi+<NUM>. When the switch unit is turned on by a control signal of the control end, the switch unit is configured to conduct a sense amplifier in a previous row and a sense amplifier in a next row, to transmit data between the sense amplifier in the previous row and the sense amplifier in the next row. In addition, the control end of the switch unit may be connected to a word line control circuit through a word line, and the word line control circuit may be the word line control circuit shown in <FIG>. The word line control circuit is configured to input the control signal to the control end of the switch unit M.

As shown in <FIG>, the switch unit M includes a switch transistor, and a source of the switch transistor and a drain of the switch transistor are respectively connected to bit lines of the adjacent memory cell subarrays. For example, a source of a switch transistor M1 between the subarray i+<NUM> and the subarray i+<NUM> is connected to the bit line BL <NUM> of the first column of memory cells MC in the subarray i+<NUM>, and a drain of the switch transistor M1 is connected to the bit line BL <NUM> of the first column of memory cells MC in the subarray i+<NUM>. Alternatively, a drain of a switch transistor M1 is connected to the bit line BL <NUM> of the first column of memory cells MC in the subarray i+<NUM>, and a source of the switch transistor M1 is connected to the bit line BL <NUM> of the first column of memory cells MC in the subarray i+<NUM>. A gate of the switch transistor M1 serves as the control end, and is connected to the word line WL-isoi+<NUM>. In this solution, the switch unit is mainly implemented by using a switch transistor. Because the memory cell includes an access transistor, the switch unit may alternatively be implemented in a form of a transistor. This facilitates production by using a same manufacturing process.

In some examples, the sense amplifier SA usually uses a circuit including a plurality of transistors that are connected, the switch unit usually uses a switch transistor, and the sense amplifier and the switch unit are similar in manufacturing processes. Therefore, the switch unit M may be integrated into the sense amplifier SA, and the sense amplifier SA includes the switch unit M.

Based on the memory shown in <FIG>, an embodiment of this application provides a data migration method. As shown in <FIG>, the following describes the method.

S101: A first sense amplifier reads data of a first memory cell in a first memory cell subarray, where a first end of the first sense amplifier is connected to the first memory cell through a first bit line.

S102: Control a switch unit to be turned on, and write the data of the first memory cell into a second sense amplifier, where a first end of the switch unit is connected to the first end of the first sense amplifier through the first bit line, and a second end of the switch unit is connected to a second end of the second sense amplifier through a second bit line.

S103: The second sense amplifier writes the data of the first memory cell into a second memory cell in a second memory cell subarray, where the second end of the second sense amplifier is connected to the second memory cell through the second bit line.

The first end of the first sense amplifier is a positive input, and the second end of the second sense amplifier is a negative input; or the first end of the first sense amplifier is a negative input, and the second end of the second sense amplifier is a positive input.

With reference to the memory shown in <FIG> and <FIG>, the memory cell is further connected to a word line. With reference to the foregoing descriptions, after the word line connected to the memory cell is activated, data may be read from or written into the memory cell. Therefore, the first memory cell is further connected to a first word line. Optionally, before step S101, the first word line needs to be activated. The second memory cell is further connected to a second word line. Optionally, before step S102, the second word line needs to be activated. After step S103, the switch unit is turned off, and the first bit line and the second bit line are precharged.

Specifically, with reference to <FIG>, <FIG>, and <FIG>, a data migration method for an odd column and an even column in a subarray i+<NUM> is specifically described as follows:.

The following is described by using an example in which data of an odd column of memory cells connected to a word line WL i+<NUM> in the subarray i+<NUM> is migrated to a subarray i+<NUM>. A positive input BL of an SA <NUM> in an ith row is connected to a bit line BL <NUM> of a first column of memory cells in the subarray i+<NUM>, a negative input BL of an SA <NUM> in an (i+<NUM>)th row is connected to a bit line BL <NUM> of a first column of memory cells in the subarray i+<NUM>, one end of a switch unit M1 in an (i+<NUM>)th row is connected to the bit line BL <NUM> of the first column of memory cells in the subarray i+<NUM>, and the other end of the switch unit M1 is connected to the bit line BL <NUM> of the first column of memory cells in the subarray i+<NUM>. Specific operation steps of data migration are as follows (details are shown in <FIG>):.

S201: Activate the word line WL i+<NUM> in the subarray i+<NUM>, and the SA <NUM> reads, through the positive input BL, data a1 of a memory cell on the first bit line BL <NUM> corresponding to the word line WL i+<NUM> in the subarray i+<NUM>, and latches the data a1.

An operation manner of another SA in the ith row is similar to that of the SA <NUM>. Therefore, SAs in the ith row read all data (a1,. ) of memory cells on odd bit lines corresponding to the word line WL i+<NUM> in the subarray i+<NUM>.

S202: Enable a WL-isoi+<NUM> signal in the (i+<NUM>)th row, control a switch unit M1 in the (i+<NUM>)th row to be turned on, and write the data a1 of the SA <NUM> into the SA <NUM> through the negative input of the SA <NUM> in the (i+<NUM>)th row.

Another switch unit M in the (i+<NUM>)th row is also turned on under control of the WL-isoi+<NUM> signal. An operation manner of another SA in the (i+<NUM>)th row is similar to that of the SA <NUM>. Therefore, SAs in the (i+<NUM>)th row write all the data (a1,. ) of the memory cells on the odd bit lines corresponding to the word line WL i+<NUM> in the subarray i+<NUM>.

S203: Activate a word line WL i+<NUM> in the subarray i+<NUM>, and write the data a1 of the SA <NUM> in the (i+<NUM>)th row into a memory cell on the first bit line BL <NUM> corresponding to the word line WL i+<NUM> in the subarray i+<NUM>.

An operation manner of another SA in the (i+<NUM>)th row is similar to that of the SA <NUM>. Therefore, the SAs in the (i+<NUM>)th row write all the data (a1,. ) into the memory cells on the odd bit lines corresponding to the word line WL i+<NUM> in the subarray i+<NUM>.

S204: Negate the WL-isoi+<NUM> signal in the (i+<NUM>)th row, and turn off the switch unit M1 in the (i+<NUM>)th row.

Another switch unit M in the (i+<NUM>)th row may also be turned off under control of the negated WL-isoi+<NUM> signal.

Finally, precharge is performed on a bit line connected to a positive input BL of each SA in the ith row and a bit line connected to a negative input BL of each SA in the (i+<NUM>)th row.

The following is described by using an example in which data of an even column of memory cells connected to a word line WL i+<NUM> in the subarray i+<NUM> is migrated to a subarray i. A negative input BL of an SA <NUM> in an (i+<NUM>)th row is connected to a bit line BL <NUM> of a second column of memory cells in the subarray i+<NUM>, a positive input BL of an SA <NUM> in an (i-<NUM>)th row is connected to a bit line BL <NUM> of a second column of memory cells in the subarray i, one end of a switch unit M2 in an ith row is connected to the bit line BL <NUM> of the second column of memory cells in the subarray i+<NUM>, and the other end of the switch unit M2 is connected to the word line BL <NUM> of the second column of memory cells in the subarray i. Specific operation steps of data migration are as follows (details are shown in <FIG>):.

S301: Activate the word line WL i+<NUM> in the subarray i+<NUM>, and the SA <NUM> reads, through the negative input BL , data b1 of a memory cell on the second bit line corresponding to the word line WL i+<NUM> in the subarray i+<NUM>, and latches the data b1.

An operation manner of another SA in the (i+<NUM>)th row is similar to that of the SA <NUM>. Therefore, SAs in the (i+<NUM>)th row read all data (b1,. ) of memory cells on even bit lines corresponding to the word line WL i+<NUM> in the subarray i+<NUM>.

S302: Enable a WL-isoi signal in the ith row, control a switch unit M2 in the ith row to be turned on, and write the data b1 of the SA <NUM> into the SA <NUM> through the positive input BL of the SA <NUM> in the (i-<NUM>)th row.

Another switch unit M in the ith row is also turned on under control of the WL-isoi signal. An operation manner of another SA in the (i-<NUM>)th row is similar to that of the SA <NUM>. Therefore, SAs in the (i-<NUM>)th row write all the data (b1,. ) of the memory cells on the even bit lines corresponding to the word line WL i+<NUM> in the subarray i+<NUM>.

S303: Activate a word line WL i in the subarray i, and write the data b1 of the SA <NUM> in the (i-<NUM>)th row into a memory cell on the second bit line corresponding to the word line WL i in the subarray i.

An operation manner of another SA in the (i-<NUM>)th row is similar to that of the SA <NUM>. Therefore, the SAs in the (i-<NUM>)th row write all the data (b1,. ) into the memory cells on the even bit lines corresponding to the word line WL i in the subarray i.

S304: Negate the WL-isoi signal in the ith row, and turn off the switch unit M2 in the ith row.

Another switch unit M in the ith row may also be turned off under control of the negated WL-isoi signal.

Finally, precharge is performed on a bit line that is connected to a positive input BL of each SA in the (i-<NUM>)th row and connected to a negative input BL of each SA in the (i+<NUM>)th row.

After the foregoing steps, data migration between adjacent memory cell subarrays can be successfully implemented in in-memory computing in the DRAM. In the existing DRAM structure, when data is migrated between adjacent subarrays of a same bank, if a data bit width is 512b, and a data bit width between different banks is 128b, <NUM> × (<NUM>/<NUM>) activation operations and <NUM> × (<NUM>/<NUM>) precharge operations need to be performed during migration. It is assumed that it takes <NUM> ns to activate a WL, and <NUM> ns to precharge, and time for reading and writing data is ignored. In the current data solution, time required for data migration is about <NUM> × (<NUM>/<NUM>) × (<NUM>+<NUM>) ns, namely, <NUM> ns. However, only about <NUM> ns (including time required for two activation operations and one precharge operation) is required when the solutions provided in embodiments of this application are used. This can increase a speed of data migration by four times, further greatly reduce energy consumption, and improve efficiency.

The foregoing mainly describes the solutions provided in embodiments of this application from a perspective of the method steps. It may be understood that, to implement the foregoing functions, the computer includes a corresponding hardware structure and/or a software module for performing the function. A person skilled in the art should be easily aware that, in combination with example modules and algorithm steps described in the embodiments disclosed in this specification, this application can be implemented by a combination of hardware and computer software.

In the embodiments of this application, a data migration apparatus may be divided into function modules based on the foregoing method examples. For example, function modules corresponding to the functions may be obtained through division, or two or more functions may be integrated into one processing module. The integrated module may be implemented in a form of hardware, or may be implemented in a form of a software functional module. It should be noted that, in embodiments of this application, division into the modules is an example, and is merely logical function division. During actual implementation, another division manner may be used.

When each functional module is obtained through division based on corresponding function, <FIG> shows a data migration apparatus. The data migration apparatus may be a chip. The data migration apparatus <NUM> includes:.

Optionally, the first memory cell is further connected to a first word line, and the data migration apparatus further includes an activation unit <NUM>, configured to: before reading the data of the first memory cell in the first memory cell subarray by using the first sense amplifier, activate the first word line.

Optionally, the second memory cell is further connected to a second word line, and the activation unit <NUM> is configured to: before writing the data of the first memory cell into the second memory cell in the second memory cell subarray by using the second sense amplifier, activate the second word line.

Optionally, a precharge unit <NUM> is configured to: after writing the data of the first memory cell into the second memory cell in the second memory cell subarray by using the second sense amplifier, turn off the switch unit; and precharge the first bit line and the second bit line.

All related content of the steps in the foregoing method embodiments may be cited in function descriptions of corresponding functional modules.

For example, an embodiment of this application further provides an integrated circuit. As shown in <FIG>, the integrated circuit <NUM> includes a memory interface <NUM> and a memory controller <NUM>.

The memory interface <NUM> is configured to communicate with another apparatus or device, for example, communicate with a memory. The memory controller <NUM> is configured to: read data of a first memory cell in a first memory cell subarray by using a first sense amplifier, where a first end of the first sense amplifier is connected to the first memory cell through a first bit line; control a switch unit to be turned on, and write the data of the first memory cell into a second sense amplifier, where a first end of the switch unit is connected to the first end of the first sense amplifier through the first bit line, and a second end of the switch unit is connected to a second end of the second sense amplifier through a second bit line; and write the data of the first memory cell into a second memory cell in a second memory cell subarray by using the second sense amplifier, where the second end of the second sense amplifier is connected to the second memory cell through the second bit line; and the first end of the first sense amplifier is a positive input, and the second end of the second sense amplifier is a negative input; or the first end of the first sense amplifier is a negative input, and the second end of the second sense amplifier is a positive input.

Optionally, the first memory cell is further connected to a first word line, and the memory controller <NUM> is further configured to: before reading the data of the first memory cell in the first memory cell subarray by using the first sense amplifier, activate the first word line.

Optionally, the second memory cell is further connected to a second word line, and the memory controller <NUM> is further configured to: before writing the data of the first memory cell into the second memory cell in the second memory cell subarray by using the second sense amplifier, activate the second word line.

Optionally, the memory controller <NUM> is further configured to: after writing the data of the first memory cell into the second memory cell in the second memory cell subarray by using the second sense amplifier, turn off the switch unit; and precharge the first bit line and the second bit line.

In view of this, an embodiment of this application further provides an electronic device, and the electronic device includes the integrated circuit and the memory. The integrated circuit includes a memory controller and a memory interface, and the memory is connected to the memory controller through the memory interface. Optionally, the electronic device is different types of user equipment or terminal devices such as the computer system, a mobile phone, a tablet computer, a wearable device, and a vehicle-mounted device. Alternatively, the electronic device may be a network device such as a base station. For related descriptions of the memory in the electronic device, refer to descriptions of the memory in the foregoing embodiments. Details are not described herein again in this embodiment of this application.

According to another aspect, this application further provides a non-transitory computer-readable storage medium used with a computer. The computer includes software for creating an integrated circuit, the computer-readable storage medium stores one or more computer-readable data structures, and the one or more computer-readable data structures include optical mask data for manufacturing the memory in any figure.

Methods or algorithm steps described in combination with the content disclosed in this application may be implemented by hardware, or may be implemented by a processor by executing a software instruction. The software instruction may include a corresponding software module. The software module may be stored in a random access memory (random access memory, RAM), a flash memory, an erasable programmable read-only memory (erasable programmable ROM, EPROM), an electrically erasable programmable read-only memory (electrically EPROM, EEPROM), a register, a hard disk, a removable hard disk, a compact disc read-only memory (CD-ROM), or any other form of storage medium known in the art. For example, a storage medium is coupled to the processor, to enable the processor to read information from the storage medium and write information into the storage medium. It is clear that the storage medium may be a component of the processor. The processor and the storage medium may be located in an ASIC.

A person skilled in the art should be aware that in the foregoing one or more examples, functions described in this application may be implemented by hardware, software, firmware, or any combination thereof. When the functions are implemented by software, the functions may be stored in a computer-readable medium or transmitted as one or more instructions or code in a computer-readable medium. The computer-readable medium includes a computer storage medium and a communication medium. The communication medium includes any medium that facilitates transmission of a computer program from one place to another. The storage medium may be any available medium accessible to a general-purpose computer or a special-purpose computer.

Claim 1:
A memory, comprising several memory banks, wherein the bank comprises a plurality of memory cell subarrays disposed in a column, each memory cell subarray comprises memory cells disposed in an array, memory cells located in a same row in the memory cell subarray are connected to a same word line, and memory cells located in a same column are connected to a same bit line;
a sense amplifier and a switch unit are disposed in a row at spacings between adjacent memory cell subarrays, and between adjacent memory cell subarrays, a sense amplifier is disposed on one bit line of every two adjacent bit lines, and the other bit line is connected to a switch unit in series; and
on a same bit line, the sense amplifier and the switch unit are alternately disposed between the memory cell subarrays.