WO2022183314A1 - Memory - Google Patents

Memory Download PDF

Info

Publication number
WO2022183314A1
WO2022183314A1 PCT/CN2021/078446 CN2021078446W WO2022183314A1 WO 2022183314 A1 WO2022183314 A1 WO 2022183314A1 CN 2021078446 W CN2021078446 W CN 2021078446W WO 2022183314 A1 WO2022183314 A1 WO 2022183314A1
Authority
WO
WIPO (PCT)
Prior art keywords
bit
data
circuit
input terminal
field effect
Prior art date
Application number
PCT/CN2021/078446
Other languages
French (fr)
Chinese (zh)
Inventor
景蔚亮
王正波
洪荣峰
崔靖杰
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to CN202180089639.XA priority Critical patent/CN116670766A/en
Priority to PCT/CN2021/078446 priority patent/WO2022183314A1/en
Publication of WO2022183314A1 publication Critical patent/WO2022183314A1/en

Links

Images

Classifications

    • GPHYSICS
    • G11INFORMATION STORAGE
    • G11CSTATIC STORES
    • G11C15/00Digital stores in which information comprising one or more characteristic parts is written into the store and in which information is read-out by searching for one or more of these characteristic parts, i.e. associative or content-addressed stores
    • G11C15/04Digital stores in which information comprising one or more characteristic parts is written into the store and in which information is read-out by searching for one or more of these characteristic parts, i.e. associative or content-addressed stores using semiconductor elements
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Definitions

  • the present application relates to the field of computer technology, and in particular, to a memory.
  • Bloom filter In computer systems, in order to quickly detect whether an element is in a target set, people invented the Bloom filter (Bloom Filter).
  • Bloom Filter The principle of Bloom filter is: when an element is added to the set, the element is mapped to K positions in a bit array Vector through K hash values, and the value of these K positions is set to 1 .
  • the processor needs to address the memory of the target Vector and the four target locations of the target Vector, and then the processor also needs to access the memory from each target.
  • the position reads the data for judgment, and then writes the updated data to the target position.
  • each addressing and writing update process of the Bloom filter needs to consume multiple instruction cycles, resulting in a long delay in addressing and writing updates, and the data needs to be passed multiple times and frequently.
  • the bus is moved between the processor and memory, resulting in significant power consumption for addressing and write updates.
  • an embodiment of the present application provides a memory.
  • an embodiment of the present application provides a memory, the memory includes: a cell array, the cell array includes a plurality of storage cells; a plurality of circuit units, the plurality of circuit units are respectively connected with at least one storage unit; wherein, the circuit unit Used for: receiving the first bit value of the bit-addressed data input from the outside; reading the second bit value in the target storage unit pointed to by the bit-addressing data; when the first bit value is different from the second bit value, the target The memory cell is updated to the first bit value.
  • the processor when the processor needs to perform the Bloom filter operation, it only needs to input the bit addressing data to the circuit unit, and the rest of the addressing and writing update processes can be performed by the circuit unit according to the bit search process.
  • the address data is completed in the memory and does not require the participation of the processor, so there will not be too much data migration on the bus between the memory and the processor, avoiding bus conflicts, shortening the system response time, and improving the bloom filter. efficiency.
  • a plurality of the memory cells are distributed into multiple rows and columns, the memory cells in each row are connected by a word line, the memory cells in each column are connected by a bit line, and the memory cells in each row are connected by a word line.
  • each of the bit lines is connected with one of the circuit units; the first bit values received by different circuit units correspond to different bits of the bit addressing data.
  • the circuit unit includes a filter circuit and an update circuit;
  • the filter circuit includes a bit-addressable input terminal, a data input terminal, and a filter output terminal; the bit-addressable input terminal is used to receive the first A bit value, the data input terminal is connected to the storage unit for reading the second bit value;
  • the filter circuit is configured to, when the first bit value is different from the second bit value, A first enable signal is output at the filter output terminal;
  • the update circuit includes a data output terminal, the data output terminal is connected to the storage unit; the update circuit is used for outputting the first enable signal at the filter circuit When the signal is enabled, the target storage unit is updated to the first bit value.
  • the filter circuit includes a first field effect transistor, a second field effect transistor and a third field effect transistor; the source of the first field effect transistor is grounded, and the gate of the first field effect transistor is For the bit addressing input terminal, the drain of the first field effect transistor is connected to the source of the second field effect transistor; the gate of the second field effect transistor is the data input terminal, and the first field effect transistor is the data input terminal.
  • the drain of the second field effect transistor is connected to the source of the third field effect transistor; the gate of the third field effect transistor is the input end of the filter enable signal, and the drain of the third field effect transistor is the filter output.
  • three field effect transistors are connected in series to form a three-stage filtering structure, wherein the first field effect transistor is used for receiving the first bit value of the bit addressing data, and the second field effect transistor is used for receiving the second bit value stored in the memory unit.
  • the filtering circuit is specifically configured to receive a second enable signal at the filter enable signal input terminal, and when the first bit value is different from the second bit value, The filter output terminal outputs the first enable signal.
  • the filter circuit can activate the update unit when the first bit value is different from the second bit value, so as to realize the filtering function of the Bloom filter.
  • the first field effect transistor, the second field effect transistor and the third field effect transistor are all N-type field effect transistors.
  • the update circuit includes a tri-state buffer, an inverse tri-state buffer, a first data selector and a second data selector; the first input of the first data selector is a write an enable signal input terminal, the second input terminal of the first data selector is used for receiving the inversion signal of the first enable signal, the output terminal of the first data selector is connected to the tri-state buffer
  • the enable terminal of the second data selector is connected to the enable terminal of the inverse tri-state buffer; the second input terminal of the second data selector is connected to the bit addressing input terminal or high potential, and the second data selector
  • the output end of the buffer is connected to the input end of the tri-state buffer and the input end of the inverse tri-state buffer; the output end of the tri-state buffer and the output end of the inverse tri-state buffer are the data output.
  • the update circuit can enable the tri-state buffer and the inverse tri-state buffer by filtering the low signal at the output terminal, so as to write update data to the storage unit, so as to to
  • the first enable signal is a high-level signal
  • the update circuit is specifically configured to, when the value of the first bit is 1 and the value of the second bit is 0,
  • the target storage unit is updated to the first bit value.
  • the update circuit can implement the update function of the Bloom filter and write 1 to the mapping value of the new element.
  • the update circuit includes an AND gate unit, a tri-state buffer, an inverse tri-state buffer, a first data selector and a second data selector; the first input terminal of the AND gate unit Connected with the filter output end, used for receiving the inversion signal of the first enable signal; the second input end of the AND gate unit is the write enable signal input end; the output end of the AND gate unit is the same as the The second input end of the first data selector is connected; the first input end of the first data selector is connected to the write enable signal input end, and the output end of the first data selector is connected to the The enable terminal of the tri-state buffer is connected to the enable terminal of the inverse tri-state buffer; the second input terminal of the second data selector is connected to the bit addressing input terminal or high potential, the The output end of the second data selector is connected to the input end of the tri-state buffer and the input end of the inverse tri-state buffer; the output end of the tri-state buffer and the inverse tri-state buffer The output terminal is the
  • the first enable signal is a high level signal
  • the update circuit is specifically configured to input a high level at the input end of the write enable signal
  • the first bit value is 1
  • the target storage unit is updated to the first bit value.
  • the update circuit can implement the update function of the Bloom filter and write 1 to the mapping value of the new element.
  • the bit line includes a first bit line and a second bit line, the output end of the tri-state buffer is connected to the first bit line, and the output end of the inverse tri-state buffer is connected to the second bit line;
  • the bit value in the memory cell is 1;
  • the bit value in the memory cell is 1.
  • the bit value is 0.
  • the tri-state buffer can output a high level on the first bit line, and the reverse tri-state buffer can output a low level on the second bit line, so that the bit value of the storage unit can be updated to 1.
  • the data selection terminal of the first data selector and the data selection terminal of the second data selector are used to receive the working mode selection signal; when the working mode selection signal is at a low level, the first data selector The output terminal and the output terminal of the second data selector both output the signal of the respective first input terminal; when the working mode selection signal is at a high level, the output terminal of the first data selector and the output terminal of the second data selector both output the respective signals of the first input terminal. signal at the second input.
  • the memory can be switched between the traditional read-write mode and the Bloom filter mode through different working mode selection signals.
  • the data input end is connected to the bit line through a sense amplifier;
  • the sense amplifier includes two input ends, which are respectively connected to the first bit line and the second bit line;
  • the sense amplifier further includes an output end, which is connected to the data input end
  • the sense amplifier When the first bit line is high level and the second bit line is low level, the sense amplifier outputs low level; when the first bit line is low level and the second bit line is high level, The sense amplifier outputs a high level.
  • the sense amplifier can input a high level to the data input terminal of the filter circuit, so that the filter circuit can activate the update circuit.
  • the filter circuit further includes a fourth field effect transistor, the source of the fourth field effect transistor is coupled to a high potential, the drain of the fourth field effect transistor is connected to the filter output end, and the gate of the fourth field effect transistor Extremely precharge signal input terminal; wherein, when the precharge signal input terminal is input with a low level, the fourth field effect transistor is turned on to pull the filter output terminal to a high level to realize the initialization and reset of the circuit unit.
  • the fourth field effect transistor is a P-type field effect transistor.
  • multiple circuit units share the same filter enable signal input terminal.
  • multiple circuit units share the same write enable signal input terminal.
  • multiple circuit units share the same filter output.
  • the circuit structure can be simplified and the circuit area can be saved.
  • the latch further includes a control signal input terminal for receiving an external control signal, wherein when the external control signal is at a low level, the latch is used for receiving and latching the one-hot encoded data, and when the external control signal is at a low level When the control signal is at a high level, the latch is used to input the bit values of different bits of the one-hot encoded data to the addressing input terminals of each circuit unit in a one-to-one correspondence.
  • the Bloom filter can receive the addressing data in the Hash Value format, convert it into one-hot encoded data in the form of one-hot encoding, and then input it to each circuit unit.
  • the bit-addressable data is a binary array.
  • the processor can directly input the binary value of each bit of the bit-addressable data into each circuit unit, and there is no need to set a latch, so there is no need to add a latch in the system circuit composed of memory and processing.
  • the related circuit simplifies the system circuit structure and reduces the circuit area.
  • the present application also provides a computer storage medium.
  • the computer storage medium computer instructions, when executed on a computer, cause the computer to perform the methods in the above-described aspects and implementations thereof.
  • the present application also provides a computer program product comprising instructions, which, when run on a computer, cause the computer to perform the methods in the above aspects and implementations thereof.
  • Figure 1 is the architecture diagram of the current von Neumann computer
  • Fig. 2 is a schematic diagram of a Bloom filter addressing and updating process based on a von Neumann-type computer
  • FIG. 3 is a schematic diagram of an in-memory computing architecture provided by an embodiment of the present application.
  • FIG. 4 is a schematic structural diagram of an SRAM shown in an embodiment of the present application.
  • FIG. 5 is a schematic structural diagram of a Bloom filter functional circuit shown in an embodiment of the present application.
  • FIG. 6 is a schematic diagram of a circuit connection between a circuit unit and a storage unit provided by an embodiment of the present application
  • FIG. 7 is a schematic structural diagram of a filter circuit provided by an embodiment of the present application.
  • FIG. 8 is a schematic structural diagram of an update circuit provided by an embodiment of the present application.
  • FIG. 9 is a specific circuit diagram of the connection between a circuit unit and a storage unit provided by an embodiment of the present application.
  • FIG. 10 is a sequence diagram of a circuit control method provided by an embodiment of the present application.
  • FIG. 11 is a schematic structural diagram of another update circuit provided by an embodiment of the present application.
  • FIG. 12 is a specific circuit diagram of another circuit unit connected to a storage unit provided by an embodiment of the present application.
  • FIG. 13 is a sequence diagram of another circuit control method provided by an embodiment of the present application.
  • FIG. 14 is a schematic structural diagram of another functional circuit of a bloom filter provided by an embodiment of the present application.
  • Bloom filter In computer systems, in order to quickly detect whether an element is in a target set, people invented the Bloom filter (Bloom Filter).
  • Bloom Filter The principle of Bloom filter is: when an element is added to the set, the element is mapped to K positions in a bit array Vector through K hash values, and the value of these K positions is set to 1 .
  • FIG. 1 is an architecture diagram of a current von Neumann computer. As shown in FIG. 1 , the processor 10 and the memory 20 of the von Neumann computer are set separately, and communication between the processor 10 and the memory 20 can be performed through a bus 30 For data exchange, the processor 10 may further include a cache 11 , which may be used to temporarily store data read from the memory 20 or data to be written into the memory 20 .
  • a cache 11 may be used to temporarily store data read from the memory 20 or data to be written into the memory 20 .
  • a hash value can be used to pair the data stored in the memory 20, such as static random access memory (SRAM), by means of a hash value.
  • SRAM static random access memory
  • Bit array Vector for addressing and mapping.
  • Figure 2 is a schematic diagram of a Bloom filter addressing and updating process based on a von Neumann-type computer implementation.
  • the SRAM may include an M-level SRAM array array, where M is a positive integer, and each level of the array array may include a plurality of bit arrays Vector, and the length of each Vector is, for example, 16 bytes.
  • the hash value Hash Value can include the high-order segment HSB and the low-order segment LSB. Taking the current common hash value Hash Value with a length of 64 bits as an example, the length of the high-order segment HSB can be, for example, 44 bits, and the length of the low-order segment can be, for example, is 20 bits.
  • the high-order segment HSB part is used to address the specific bit array Vector in the SRAM array; the low-order segment LSB can be divided into four groups of arrays, which are respectively used to address four positions in the bit array Vector.
  • the addressing and write update functions of the Bloom filter can be implemented in the following four steps:
  • Step 1 The processor finds the target Vector by addressing the high-order segment HSB of the Hash Value in the SRAM array.
  • Step 2 The processor divides the target Vector into 4 groups, each group is marked as Vector', and the length of each Vector' is 4 bytes, that is, 32 bits.
  • Step 4 The processor reads the data of the four target positions in the target Vector respectively, and judges whether the values of the four target positions are all 1; if the values of the four target positions are all 1, it means that the detected element has It may be included in the target set; if at least one of the values of the four target positions is 0, it means that the detected element must not exist in the target set and belongs to a new data stream. At this time, the target position with a value of 0 is updated. is 1.
  • the Bloom filter scheme based on von Neumann computer needs to address the memory of the target Vector and the four elements of the target Vector when performing addressing and writing update each time.
  • the addressing of the target location, and then the processor also needs to read data from each target location for judgment, and then write updated data to the target location.
  • each addressing and writing update process of the Bloom filter needs to consume multiple instruction cycles, resulting in a long delay in addressing and writing updates, and the data needs to be passed multiple times and frequently.
  • the bus is moved between the processor and memory, resulting in significant power consumption for addressing and write updates.
  • the embodiment of the present application provides a bloom filter device function circuit.
  • FIG. 3 is a schematic diagram of an in-memory computing architecture provided by an embodiment of the present application.
  • the in-memory computing architecture includes a processor 100 and a memory 200. Communication and data exchange can be performed between the processor 100 and the memory 200 through a bus 300.
  • the processor 100 can also include a cache 110, which can be used for temporary To store data read from the memory 200 or data to be written into the memory 200, the memory 200 not only stores data (for example, the SRAM array 210), but also includes an in-memory computing circuit 220, and the in-memory computing circuit 220 can be used to store data in the memory 200. The processing of the data is completed in the memory 200 .
  • a cache 110 which can be used for temporary
  • the memory 200 not only stores data (for example, the SRAM array 210), but also includes an in-memory computing circuit 220, and the in-memory computing circuit 220 can be used to store data in the memory 200. The processing of the data is completed in the memory 200 .
  • the in-memory computing circuit 220 may include, for example, the bloom filter function circuit provided by the embodiment of the present application, so that the bloom filter function circuit of the embodiment of the present application implements the bloom filter function in the memory , such as addressing and write updates.
  • FIG. 4 is a schematic structural diagram of an SRAM shown in an embodiment of the present application.
  • the SRAM includes an SRAM cell array (SRAM array), and the SRAM cell array may include a plurality of memory cells, and the plurality of memory cells are distributed into multiple rows and columns.
  • Each row of memory cells in the SRAM array can be used to store a Vector, and each row of memory cells is connected by a word line (WL).
  • Each column of memory cells in the SRAM array corresponds to the same bit of a different Vector and is connected by a bit line (bit line, BL).
  • the processor or other devices can word address the SRAM cell array through the word line WL to find the target Vector, and can read and write each memory cell used to store the target Vector through each bit line BL.
  • the bit width of the SRAM array may be 16 bytes, that is, 128 bits, so each word line WL may include 128 memory cells, and each memory cell stores 1 of the Vector. bits, so that the memory cells on each word line WL of the SRAM array can store a Vector with a length of 16 bytes.
  • the SRAM array may include 128 bit lines BL in total.
  • FIG. 4 divides the 128 bit lines BL into four groups according to the correspondence between the 128 bit lines BL and the 128 bits of the Vector, and each group of 32 bit lines BL corresponds to the 0th bit of the Vector. ⁇ 31 bits, 32nd to 63rd bits, 64th to 95th bits, and 96th to 127th bits, so each group of bit lines BL corresponds to a Vector' with a length of 4 bytes. Among them, when an element is mapped to the four target positions in the Vector, the bits on each group of BLs include one target position.
  • the above-mentioned features of the SRAM array shown in the embodiments of the present application are 16 bytes in bit width, 16 bytes in length of Vector, and 128 bit lines BL are included in the SRAM array.
  • Example does not constitute a specific limitation to SRAM array and Vector, those skilled in the art can reasonably set the above-mentioned features according to the specific software and hardware environment and use requirements when implementing the solutions of the embodiments of the present application. The protection scope of the application examples.
  • FIG. 5 is a schematic structural diagram of a circuit including a Bloom filter function according to an embodiment of the present application.
  • the bloom filter function circuit 50 can be arranged in a memory, and the memory with the bloom filter circuit 50 can be regarded as a new type of memory.
  • the bloom filter function circuit 50 may specifically include: a cell array 230 and a plurality of circuit units 400 having the same number as the plurality of bit lines BL of the cell array 230 .
  • the cell array 230 may be, for example, the above-mentioned SRAM array as shown in FIG. 4 , or an array structure including storage cells formed in other memories, including but not limited to dynamic random access memories (dynamic random access memories). random access memory, DRAM), electrically erasable programmable read-only memory (electrically-erasable programmable read-only memory, EEPROM), flash memory (flash memory), etc., which are not limited in this application.
  • each circuit unit 400 further includes a bit addressing input terminal 410, and the bit addressing input terminal 410 is used for Receives addressed data from outside the Bloom filter function circuit.
  • each circuit unit 400 further includes a filter enable signal input terminal Filter_En, a filter output terminal Filter_Done and a write enable signal input terminal WR_EN, wherein the filter enable signal input terminal Filter_En, the filter output terminal Filter_Done and the write enable signal input terminal
  • WR_EN The specific function of WR_EN will be explained in detail in the following content.
  • all circuit units 400 may share a filter enable signal input terminal Filter_En, that is, the Bloom filter function circuit includes a filter enable signal input terminal Filter_En bus, and all circuit units 400 may share a filter enable signal input terminal Filter_En.
  • the output terminal Filter_Done that is, the Bloom filter function circuit includes a filter output terminal Filter_Done bus
  • all circuit units 400 can share a write enable signal input terminal WR_EN, that is, the Bloom filter function circuit includes a write enable signal input terminal. WR_EN bus.
  • the target Vector mapped in the cell array can be mapped according to the detected element.
  • the corresponding addressing data is generated at the position of , and the addressing data may include, for example, word-addressed data and word-bit-addressed data.
  • the word addressing data is used to address the word line WL to find the word line WL where the target Vector is located;
  • the bit addressing data is used to address the bit line BL to find the detected element to map in the target Vector
  • the target bit is addressed, and operations such as writing and updating are performed on the target bit.
  • the addressed data will be input to each word line WL or each circuit cell in the form of 0 or 1 bit values.
  • the bit value input to the word line WL where the target Vector is located is 1 to activate the word line WL where the target Vector is located, and the bit value input to the word line WL where the remaining Vectors are located is 0, so that the word lines WL where the remaining Vectors are located will not be activated.
  • the bit value input to the circuit unit on the bit line BL where the target bit is located is 1, and the bit value input to other circuit units is 0 to select the target bit, so that the circuit unit performs subsequent addressing and writing to the target bit. update, etc.
  • the addressing data may initially be, for example, a Hash Value, and the low-order segment LSB of the LSB may generate a 0 or 1-bit value for input to each word line WL or each circuit unit by encoding.
  • a 0 or 1-bit value can be obtained by one-hot encoding the low-order segment LSB of the Hash Value.
  • the target Vector may include 4 groups, each group includes 32 bits, and each group has 32 bits. A target bit is included in the bits. Then, in order to address the 4 target bits, the LSB of the low-order segment of the Hash Value can obtain 4 groups of One-hot arrays after One-hot encoding, and the 4 groups of One-hot arrays correspond to the 4 groups of the target Vector one-to-one. , each One-hot array has the same length as the target Vector group, both of which are 32 bits. The One-hot value of only one bit in each One-hot array is 1, which corresponds to one target bit of the target Vector, and the remaining bits The One-hot value of 0 is 0.
  • the operation of obtaining a One-hot array by performing One-hot encoding on the LSB of the low-order segment of the Hash Value may be implemented by a processor or other external device set outside the memory, or may be implemented by a processor set outside the memory. It is realized by a computing device in the memory, for example: a main control chip of a memory, a microcontroller unit (MCU), etc., which is not limited in this embodiment of the present application.
  • MCU microcontroller unit
  • the low-order segment LSB of Hash Value can also include 4 groups of data, and each group of data is binary coded with a length of 5 bits, so the total LSB The length can be 20 bits.
  • Each group of LSB data can form 32 values through binary encoding, so each value can be encoded into a One-hot array with a length of 32 bits.
  • An exemplary One-hot encoding method is shown in Table 1.
  • the length of the high-order segment HSB is 64 bits, while in the Hash Value shown in FIG. 2 , the length of the high-order segment HSB is 44 bits. Therefore, it can be seen that in different designs, the length of the high-order segment HSB can be changed. Specifically, it can be determined according to the number of word lines WL of the SRAM array that needs word addressing. For example, the length of the high-order segment HSB can be formed. The number of binary codes is greater than or equal to the number of word lines WL of the SRAM array that needs word addressing, which is not specifically limited in this embodiment of the present application.
  • the bloom filter function circuit may also be provided with a latch 500 .
  • the input terminal of the latch 500 is used for receiving the One-hot value of each bit of the One-hot array, and latching the One-hot value of each bit of the One-hot array.
  • the latch 500 may have the same number of output terminals as the multiple circuit units 400 of the Bloom filter functional circuit provided in the embodiment of the present application, and the multiple output terminals of the latch are related to the bit search of the multiple circuit units 400 .
  • the address input terminals 410 are connected in one-to-one correspondence, so the latch 500 can input the one-hot value of each bit of the one-hot array latched into each circuit unit 400 in a one-to-one correspondence.
  • the latch 500 may further include a control signal input terminal, such as the one_hot_latch_EN terminal in FIG. 5 , the control signal input terminal is used to receive an external control signal, so as to latch the one-bit of each bit of the One-hot array according to the external control signal.
  • the -hot values are input into the respective circuit units 400 in a one-to-one correspondence.
  • each circuit unit in the Bloom filter functional circuit can perform a bitwise logical operation on the bits of the target Vector on the bit line BL where it is located according to the received One-hot value. If the One-hot value received by a certain circuit unit is 1, it means that a target bit mapped by the detected element is located on the bit line BL where the circuit unit is located.
  • the circuit unit can write 1 to the target bit to update the value of the target bit to 1.
  • each circuit unit may include two functional circuit modules, such as a filter circuit and an update circuit, in order to implement the above-mentioned bitwise logic operation.
  • the filter circuit is used to receive the One-hot value from the latch, and when receiving the One-hot value of 1, judge whether the value of the corresponding target bit is also 1, and if the value of the target bit is judged to be no If it is 1, the value of the target bit is updated to 1 by the update circuit.
  • FIG. 6 is a schematic diagram of a circuit connection between a circuit unit and a storage unit provided by an embodiment of the present application.
  • the filter circuit 420 and the update circuit 430 of the circuit unit 400 are respectively connected to the memory unit 211 through bit lines (eg, BL and BL#).
  • the read selector YSR and the sense amplifier SA are arranged on the bit line between the filter circuit 420 and the storage unit 211
  • the write selector YSW is arranged on the bit line between the update circuit 430 and the storage unit 211 .
  • the read selector YSR When the filter circuit 420 needs to read data from the storage unit 211, the read selector YSR is closed and the write selector YSW is opened, so that the filter circuit 420 reads the bit value from the storage unit 211.
  • the read selector YSR When data is updated, the read selector YSR is opened and the write selector YSW is closed, so that the update circuit 430 writes a new bit value into the storage unit 211 .
  • the storage unit 211, the filter circuit 4204 and the update circuit 430 can be connected by two bit lines.
  • the two bit lines are marked as bit line BL and bit line BL# here.
  • the bit value in the storage unit 211 can be determined according to the levels of the bit line BL and the bit line BL#. For example, when the bit line BL is at a high level and the bit line BL# is at a low level, the corresponding bit value in the storage unit 211 If it is 1, when the bit line BL is at a low level and the bit line BL# is at a high level, the bit value corresponding to the memory cell 211 is 0.
  • the filter circuit 420 includes a data input terminal Q#, the bit line BL and the bit line BL# are respectively connected with two input terminals of the sense amplifier SA, and the output of the sense amplifier SA is connected with the filter circuit 420.
  • the data input terminal Q# is connected so that the filter circuit 420 can read data from the storage unit 211 .
  • the update circuit 430 includes two output terminals Y2 and Y3, which are respectively connected to the bit line BL and the bit line BL#, so that the update circuit 430 can output different voltages through the two output terminals Y2 and Y3.
  • the storage unit 211 is updated by writing.
  • the filter circuit 420 further includes a bit-addressable input terminal Translated Hash Value, which is used for receiving the bit value of the bit-addressable data input from the outside.
  • FIG. 7 is a schematic structural diagram of a filter circuit provided by an embodiment of the present application.
  • each filter circuit may include three N-channel field-effect transistors (NFETs).
  • NFETs N-channel field-effect transistors
  • the three N-type field-effect transistors are referred to as the first N-type FETs, respectively.
  • the source S of the first N-type field effect transistor NFET1 is grounded to GND; the gate G of the first N-type field effect transistor NFET1 is used as the bit addressing input terminal of the circuit unit.
  • Translated Hash Value can be connected to the output terminal of the latch
  • the drain D of the first N-type field effect transistor NFET1 is connected with the source S of the second N-type field effect transistor NFET2; the gate G of the second N-type field effect transistor NFET2 is used as the data input terminal Q# of the filter circuit, It is connected to the output end of the sense amplifier SA; the drain D of the second N-type field effect transistor NFET2 is connected to the source S of the third N-type field effect transistor NFET3, and the gate G of the third N-type field effect transistor NFET3 is used as a filter.
  • the filter enable signal input terminal Filter_En of the circuit, and the drain D of the third N-type field effect transistor NFET3 is used as the filter output terminal Filter_Done of the filter circuit.
  • the filter circuits of all circuit units can share a filter output terminal Filter_Done bus, and the filter output terminal Filter_Done bus is also connected with a P-type field effect transistor PFET shared by the filter circuits of all circuit units,
  • the P-type field effect transistor PFET can be regarded as a part of the filter circuit.
  • the source S of the P-type field effect transistor PFET is coupled to the high potential VDD
  • the drain D of the P-type field effect transistor PFET is connected to the filter output terminal Filter_Done bus
  • the gate G of the P-type field effect transistor PFET is used as the gate of each circuit unit.
  • Pre-charge signal input terminal Pre_Ch Pre-charge signal input terminal Pre_Ch.
  • FIG. 8 is a schematic structural diagram of an update circuit provided by an embodiment of the present application. As shown in FIG. 8, each update circuit may include at least one AND gate AND unit AND1, one tri-state buffer TSB1, one inverse tri-state buffer TSB2, and two data selectors DS1 and DS2.
  • the AND gate unit AND1 includes two input terminals A1 and B1, and an output terminal Y1; the input terminal A1 of the AND gate unit AND1 is connected to the filter output terminal Filter_Done, and is used to receive the inversion signal of the filter output terminal Filter_Done; AND gate The input terminal B1 of the unit AND1 is used as the write enable signal input terminal WR_EN of the update circuit to receive the write enable signal; the output terminal Y1 of the AND gate unit AND1 is connected to the second input terminal B2 of the data selector DS1.
  • the first input terminal A2 of the data selector DS1 is connected to the write enable signal input terminal WR_EN for receiving the write enable signal;
  • the data selection terminal S1 of the data selector DS1 is connected to the operating mode selection port CIN_MODE of the circuit unit for use in Receive a working mode selection signal, wherein the working mode of the circuit unit may include a traditional mode and an in-memory operation mode;
  • the output terminal Z1 of the data selector DS1 is respectively connected with the enabling terminal E1 of the tri-state buffer TSB1 and the reverse tri-state buffer TSB2
  • the enable terminal E2 is connected.
  • the first input end A3 of the data selector DS2 is connected to the data input end D_in of the circuit unit, and is used to receive the data to be written in the storage unit in the conventional mode; the second input end B3 of the data selector DS2 is connected to a high potential or The bit addressing input terminal Translated Hash Value of the circuit unit is connected; the data selection terminal S2 of the data selector DS2 is connected with the working mode selection port CIN_MODE of the circuit unit for receiving the working mode selection signal; the output terminal Z2 of the data selector DS2 is respectively It is connected to the input terminal A4 of the tri-state buffer TSB1 and the input terminal A5 of the reverse tri-state buffer TSB2.
  • the circuit unit when the input signal of the working mode selection port CIN_MODE is low level, the circuit unit works in the traditional mode, and performs the conventional SRAM write function, that is, receives data from the data input terminal D_in, and passes through the data selector DS2 and tri-state The registers TSB1 and TSB2 are written into the storage unit.
  • the circuit unit works in the memory calculation mode and performs the function of the Bloom filter.
  • the output terminal Y2 of the tri-state buffer TSB1 is connected to the bit line BL; when the enable terminal E1 of the tri-state buffer TSB1 inputs a low signal 0, the tri-state buffer TSB1 is in a high-impedance state and cannot perform data transmission. When the high signal 1 is input to the enable terminal E1 of the buffer TSB1, its output value is equal to the input value.
  • the output terminal Y3 of the reverse three-state buffer TSB2 is connected to the bit line BL#; when the enable terminal E2 of the reverse three-state buffer TSB2 inputs a low signal 0, the reverse three-state buffer TSB2 is in a high-impedance state and cannot be For data transmission, when the enable terminal E2 of the reverse tri-state buffer TSB2 inputs a high signal 1, its output value is equal to the inversion of the input value.
  • FIG. 9 is a specific circuit diagram of the connection between the circuit unit 400 and the storage unit 211 provided by the embodiment of the present application.
  • each memory unit 211 may include two inverted tri-state buffers arranged in opposite directions, and two field effect transistor FETs arranged at both ends of the two inverted tri-state buffers.
  • the gates G of the FETs are connected to the word line WL, the drain D/source S of one FET is connected to the bit line BL, and the source S/drain D of the other FET is connected to bit line BL#.
  • the circuit structure of the storage unit 211 belongs to the prior art in the art, so the structure of the storage unit 211 shown in the figure is only an example, and does not constitute a specific limitation to the technical solutions of the embodiments of the present application.
  • an embodiment of the present application further provides a circuit control method.
  • the circuit control method can be used for the circuit unit shown in FIG. 9 , so that the circuit unit can realize the function of bloom filter.
  • FIG. 10 is a sequence diagram of a circuit control method provided by an embodiment of the present application.
  • one_hot_latch_EN represents the signal of the control signal input terminal of the latch
  • CLK represents the clock signal
  • Pre_Ch represents the signal of the pre-charge signal input terminal Pre_Ch
  • Filter_Done represents the signal of the filter output terminal Filter_Done of the circuit unit
  • Filter_En represents the signal of the circuit unit's filter output terminal
  • WR_EN represents the signal of the write enable signal input terminal WR_EN of the circuit unit.
  • Pre_Ch when Pre_Ch is low, it means that a valid precharge command is received, and the P-type field effect transistor PFET is turned on; when Pre_Ch is high, it means that no valid precharge command has been received, and the P-type The FET PFET is turned off.
  • Filter_En when Filter_En is high, it means that a valid filtering addressing command is received, and the third N-type field effect transistor NFET3 is turned on; when Filter_En is low, it means that no valid filtering addressing command has been received, at this time The third N-type field effect transistor NFET3 is turned off.
  • each circuit unit of the Bloom filter functional circuit can complete the addressing and writing update functions of the Bloom filter within one clock cycle by executing the circuit control method provided by the embodiments of the present application.
  • One clock cycle of the control method of the embodiment of the present application is exemplarily described below with reference to the timing diagram shown in FIG. 10 .
  • the input signal of the working mode selection port CIN_MODE is a high level signal.
  • the pre-charge signal input terminal Pre_Ch is high level
  • the P-type field effect transistor PFET is in the off state, so that the filter output terminal Filter_Done is low level, in addition, the filter enable signal input terminal Filter_En It is high level, and the write enable signal input terminal WR_EN is high level.
  • one_hot_latch_EN is first low level, and the One-hot array obtained by Hash Value after One-hot encoding is sent to the latch; then, one_hot_latch_EN is flipped from low level to high level, then latch The controller inputs each bit of the One-hot array it latches into the bit-addressable input terminal Translated Hash Value of each circuit unit.
  • Pre_Ch When the rising edge of the CLK signal arrives, Pre_Ch is flipped from high level to low level, and the level of Filter_Done bus is pulled up to high level, thus completing the precharging of Filter_Done bus.
  • Filter_En is changed from high level to high level.
  • WR_EN flips from high level to low level, the initialization phase ends, and the circuit unit enters the working phase.
  • the output terminal Y1 of the AND gate unit AND1 outputs a low level according to the Filter_Done signal and the WR_EN signal, and the data selector DS1 outputs a low level to the enable terminals E1 and E2 of the tri-state buffer TSB1 and the reverse tri-state buffer TSB2 level, so that the tri-state buffer TSB1 and the reverse tri-state buffer TSB2 are in a high-impedance state, and no data transmission is performed.
  • the bitwise logic operation specifically includes: when the bit value in the storage unit is 1, the bit line BL outputs a high level, the bit line BL# outputs a low level, and the sense amplifier SA outputs a low level; When the value is 0, the bit line BL outputs a low level, the bit line BL# outputs a high level, and the sense amplifier SA outputs a high level.
  • the data input terminal Q# of the filter circuit receives a high level signal from the sense amplifier SA, and the bit addressing input terminal Translated Hash Value of the filter circuit (the gate G of the first N-type field effect transistor NFET1) receives a high level signal level signal, then the three NFETs (ie the first N-type field effect transistor NFET1, the second N-type field effect transistor NFET2 and the third N-type field effect transistor NFET3) will be turned on, thereby pulling Filter_Done down to a low level level; otherwise, the three NFETs will not be turned on and Filter_Done will remain high.
  • the three NFETs ie the first N-type field effect transistor NFET1, the second N-type field effect transistor NFET2 and the third N-type field effect transistor NFET3
  • Filter_Done when Filter_Done is pulled down to a low level, it means that the bit value in the storage unit is 0, and the One-hot value input by the bit-addressable input terminal Translated Hash Value of the filter circuit is 1, indicating that this storage unit corresponds to A target bit mapped by the detected element, and the detected element is not in the target Vector, it belongs to a new element, so the bit value in the storage unit needs to be updated, at this time, the update circuit will be activated.
  • the write update operation may specifically include: on the one hand, the output terminal Y1 of the AND gate unit AND1 outputs a high level according to the Filter_Done signal and the WR_EN signal, so that the data selector DS1 sends the tri-state buffer TSB1 and the reverse tri-state buffer TSB2
  • the enable terminals E1 and E2 output high level, set the tri-state buffer TSB1 and the reverse tri-state buffer TSB2 to the data output state; on the other hand, the data selector DS2 sends the tri-state buffer TSB1 and the reverse three-state buffer
  • the input terminals A4 and A5 of the state buffer TSB2 input high level or the signal of the Translated Hash Value of the bit addressing input terminal (corresponding to the One-hot value of 1, which is also high level), so that the output terminal of the three-state buffer TSB1 Y2 outputs a high level to the bit line BL, and the output terminal Y
  • the circuit unit has completed the addressing and writing update process of the Bloom filter.
  • one_hot_latch_EN can be flipped from a high level to a low level. At this time, the latch releases the one-hot data it has already described and waits for new one-hot data to be input.
  • the bloom filter circuit provided in the embodiment of the present application can be provided in the memory, and when the processor needs to perform the bloom filter operation, the bloom filter circuit only needs to receive addressing data from the processor, The rest of the addressing and writing update processes can be completed in the memory by the Bloom filter circuit according to the addressing data, without the involvement of the processor, so there will not be too much data migration on the bus between the memory and the processor. , to avoid bus conflicts.
  • the bloom filter circuit provided by the embodiment of the present application can also realize the addressing and writing update process of the bloom filter in one instruction cycle cycle, which shortens the system response time and improves the Bloom filter efficiency.
  • FIG. 11 is a schematic structural diagram of another update circuit provided by an embodiment of the present application.
  • each update circuit may include at least one tri-state buffer TSB1, an inverse tri-state buffer TSB2, and two data selectors DS1 and DS2.
  • the difference between the update circuit shown in FIG. 11 and the update circuit shown in FIG. 8 is that the AND gate AND unit AND1 is not included.
  • the second input end B2 of the data selector DS1 is connected to the filter output end Filter_Done for directly receiving the inversion signal of the filter output end Filter_Done; the first input end A2 of the data selector DS1 is used as the write enable signal of the update circuit
  • the input terminal WR_EN is used to receive the write enable signal.
  • the rest of the implementation manners of the update circuit shown in FIG. 11 are the same as those of the update circuit shown in FIG. 8 , which will not be repeated here.
  • FIG. 12 is a specific circuit diagram of the connection between the circuit unit 400 and the storage unit 211 provided by the embodiment of the present application.
  • the connection mode shown in FIG. 12 is similar to the connection mode shown in FIG. 9 , each storage unit 211 may include two reverse tri-state buffers, and two reverse tri-state buffers arranged at both ends of the two reverse tri-state buffers Two FETs, the gate G of the two FETs is connected to the word line WL, the drain D/source S of one FET is connected to the bit line BL, and the other FET's The source S/drain D is connected to the bit line BL#.
  • the circuit structure of the storage unit 211 belongs to the prior art in the art, so the structure of the storage unit 211 shown in the figure is only an example, and does not constitute a specific limitation to the technical solutions of the embodiments of the present application.
  • an embodiment of the present application further provides a circuit control method.
  • This circuit control method can be used for the circuit unit shown in FIG. 12 , so that the circuit unit can realize the function of bloom filter.
  • FIG. 13 is a sequence diagram of a circuit control method provided by an embodiment of the present application.
  • one_hot_latch_EN represents the signal of the control signal input terminal of the latch
  • CLK represents the clock signal
  • Pre_Ch represents the signal of the precharge signal input terminal Pre_Ch
  • Filter_Done represents the signal of the filter output terminal Filter_Done of the circuit unit
  • Filter_En represents the signal of the circuit unit Filter enable signal input Filter_En signal.
  • each circuit unit of the Bloom filter functional circuit can complete the addressing and writing update functions of the Bloom filter within one clock cycle by executing the circuit control method provided by the embodiments of the present application.
  • One clock cycle of the control method of the embodiment of the present application is exemplarily described below with reference to the timing diagram shown in FIG. 13 .
  • the input signal of the working mode selection port CIN_MODE is a high level signal.
  • the pre-charge signal input terminal Pre_Ch is high level, the P-type field effect transistor PFET is in the off state, so that the filter output terminal Filter_Done is low level, in addition, the filter enable signal input terminal Filter_En to high level.
  • one_hot_latch_EN is first low level, and the One-hot array obtained by Hash Value after One-hot encoding is sent to the latch; then, one_hot_latch_EN is flipped from low level to high level, then latch The controller inputs each bit of the One-hot array it latches into the bit-addressable input terminal Translated Hash Value of each circuit unit.
  • Pre_Ch When the rising edge of the CLK signal arrives, Pre_Ch is flipped from high level to low level, and the level of Filter_Done bus is pulled up to high level, thus completing the precharging of Filter_Done bus.
  • Filter_En is changed from high level to high level. Inverted to low level, the initialization phase ends, and the circuit unit enters the working phase.
  • the data selector DS1 outputs a low level to the enable terminals E1 and E2 of the tri-state buffer TSB1 and the inverse tri-state buffer TSB2, so that the tri-state buffer TSB1 and the inverse tri-state buffer TSB2 are in high impedance status, no data transfer is performed.
  • the bitwise logic operation specifically includes: when the bit value in the storage unit is 1, the bit line BL outputs a high level, the bit line BL# outputs a low level, and the sense amplifier SA outputs a low level; When the value is 0, the bit line BL outputs a low level, the bit line BL# outputs a high level, and the sense amplifier SA outputs a high level.
  • the data input terminal Q# of the filter circuit receives a high level signal from the sense amplifier SA, and the bit addressing input terminal Translated Hash Value of the filter circuit (the gate G of the first N-type field effect transistor NFET1) receives a high level signal level signal, then the three NFETs (ie the first N-type field effect transistor NFET1, the second N-type field effect transistor NFET2 and the third N-type field effect transistor NFET3) will be turned on, thereby pulling Filter_Done down to a low level level; otherwise, the three NFETs will not be turned on and Filter_Done will remain high.
  • the three NFETs ie the first N-type field effect transistor NFET1, the second N-type field effect transistor NFET2 and the third N-type field effect transistor NFET3
  • the write update operation may specifically include: because the Filter_Done signal is at a low level, the data selector DS1 outputs a high level to the enabling terminals E1 and E2 of the tri-state buffer TSB1 and the reverse tri-state buffer TSB2, and the three The state buffer TSB1 and the reverse three-state buffer TSB2 are set to the data output state; on the other hand, the data selector DS2 inputs a high level to the input terminals A4 and A5 of the three-state buffer TSB1 and the reverse three-state buffer TSB2 Or the signal of the Translated Hash Value of the bit addressing input terminal (corresponding to the One-hot value of 1, which is also a high level), makes the output terminal Y2 of the tri-state buffer TSB1 output a high level to the bit line BL, and the tri-state buffer outputs a high level to the bit line BL.
  • the circuit unit has completed the addressing and writing update process of the Bloom filter.
  • one_hot_latch_EN can be flipped from a high level to a low level. At this time, the latch releases the one-hot data it has already described and waits for new one-hot data to be input.
  • the bloom filter circuit provided in the embodiment of the present application can be provided in the memory, and when the processor needs to perform the bloom filter operation, the bloom filter circuit only needs to receive addressing data from the processor, The rest of the addressing and writing update processes can be completed in the memory by the Bloom filter circuit according to the addressing data, without the involvement of the processor, so there will not be too much data migration on the bus between the memory and the processor. , to avoid bus conflicts.
  • the bloom filter circuit provided by the embodiment of the present application can also realize the addressing and writing update process of the bloom filter in one instruction cycle cycle, which shortens the system response time and improves the Bloom filter efficiency. Comparing the structures of FIGS. 9 and 11 , and the timing diagrams of FIGS.
  • the data selector DS1 sends the enable terminals E1 and E1 of the tri-state buffer TSB1 and the reverse tri-state buffer TSB2 to E2 outputs a low level, so that the tri-state buffer TSB1 and the reverse tri-state buffer TSB2 are in a high-impedance state, and no data transmission is performed to prevent writing and updating.
  • the addressing data is designed as Hash Value, wherein the LSB of the low-order segment of Hash Value is one-hot encoded to obtain a One-hot array, and then input to the latch, and then the latch will The One-hot values of each bit of the One-hot array are input into each circuit unit in a one-to-one correspondence, so as to implement a bitwise logical operation on the bits of the target Vector on the bit line BL where each circuit unit is located. It can be understood that it takes a certain amount of time for the processor to perform One-hot encoding on the above Hash Value, resulting in a certain delay, and at the same time, the latch and the like need to be implemented by a corresponding circuit.
  • bit-addressable data can also be implemented by other encoding forms.
  • FIG. 11 is a schematic structural diagram of another functional circuit of a bloom filter provided by an embodiment of the present application.
  • the bit-addressable data may be a binary array with the same length (bit width) as the Vector, or a binary array larger than the Vector’s length, preferably the length of the Vector is the same as the bit-addressable data. same length.
  • the length of the Vector is 32 bits
  • the length of the bit-addressable data may be 32 bits
  • the length of the bit-addressable data may be 64 bits
  • the length of the Bit-addressable data may be 64 bits
  • the length of the Vector is 128 bits
  • the length of bit-addressable data can be 128 bits; and so on.
  • the addressed data is a binary array with the same length (bit width) as the Vector
  • the addressed data (including word-addressable data and bit-addressable data) are also generated by the processor.
  • the word addressing data can be the same as the high-order segment of the Hash Value, that is, the bit value used for input to the word line WL where the target Vector is located is 1, which is used to activate the word line WL where the target Vector is located, and input to the word lines where the other Vectors are located.
  • each bit value of the bit addressing data is used to be input to the bit addressing input terminal 410 of each circuit unit 400 in a one-to-one correspondence, wherein the bit addressing
  • Each bit value of the address data can be 0 or 1, and the bit value of 1 of the bit addressing data points to the target bit of the target Vector. For example, when the detected element is mapped to 4 target bits in the target Vector, the bit addressing In the 128-bit binary array of data, correspondingly, 4 bits have the value of 1, and the rest are 0.
  • each circuit unit 400 in the Bloom filter function circuit 50 can perform a bitwise logical operation on the bits of the target Vector on the bit line BL where it is located according to the bit value it receives. If the bit value received by a certain circuit unit 400 is 1, it means that a target bit mapped by the detected element is located on the bit line BL where the circuit unit 400 is located.
  • the processor can directly generate a binary array with the same length (bit width) as the Vector as bit-addressable data, and then directly input each bit value of the bit-addressable data to each circuit in a one-to-one correspondence
  • the bit-addressable input terminal 410 of the unit 400 is used for each circuit unit 400 to perform bit-wise logical operations, so as to realize the direct bit-wise addressing of the processor, thereby eliminating the delay caused by One-hot encoding, and in addition, the bit-addressable data is not Then it needs to be sent into the latch for latching, so that the related circuit of the latch does not need to be added in the system circuit composed of the memory and the processor, which simplifies the system circuit structure and reduces the circuit area.
  • the present application also provides a computer storage medium.
  • the computer storage medium computer instructions, when executed on a computer, cause the computer to perform the methods in the above-described aspects and implementations thereof.
  • the present application also provides a computer program product comprising instructions which, when run on a computer, cause the computer to perform the methods of the above aspects and implementations thereof.

Abstract

A memory. The memory comprises: a cell array comprising multiple storage cells; and multiple circuit units respectively connected to at least one storage cell; wherein each circuit unit is used for: receiving a first bit value of externally inputted bit addressing data; reading a second bit value in a target storage cell pointed to by the bit addressing data; and updating the second bit value in the target storage cell to be the first bit value when the first bit value is different from the second bit value. When a processor needs to perform a Bloom filter operation, the memory only needs to receive addressing data from the processor, and the rest of addressing and writing update processes can be completed in the memory by the circuit units according to the addressing data, without the involvement of the processor. Therefore, excessive data migration does not occur on a bus between the memory and the processor, avoiding bus conflicts, shortening system response time, and improving the efficiency of a Bloom filter.

Description

一种存储器a memory 技术领域technical field
本申请涉及计算机技术领域,尤其涉及一种存储器。The present application relates to the field of computer technology, and in particular, to a memory.
背景技术Background technique
在计算机系统中,为了快速检测某一元素是否在一个目标集合中,人们发明了布隆过滤器(Bloom Filter)。布隆过滤器的原理是:当一个元素被加入集合时,通过K个散列值Hash Value将这个元素映射到一个位数组Vector中的K个位置,并把这K个位置的值置为1。检索时,只需要检查这K个位置的值是否都是1就可以概率性的判断目标集合中是否包含此元素,即如果这K个点位置的值有任何一个0,则被检测元素一定不存在于目标集合中;如果这K个位置的值都是1,则被检测元素很可能存在于目标集合中。In computer systems, in order to quickly detect whether an element is in a target set, people invented the Bloom filter (Bloom Filter). The principle of Bloom filter is: when an element is added to the set, the element is mapped to K positions in a bit array Vector through K hash values, and the value of these K positions is set to 1 . When retrieving, it is only necessary to check whether the values of the K positions are all 1 to determine whether the target set contains this element probabilistically, that is, if the value of the K positions has any 0, the detected element must not be Exist in the target set; if the values of these K positions are all 1, the detected element is likely to exist in the target set.
目前,基于冯诺依曼型计算机在执行布隆过滤器功能时,处理器需要对存储器进行目标Vector的寻址和目标Vector的四个目标位置的寻址,然后处理器还需要从每个目标位置读取数据进行判断,再向目标位置写入更新的数据。如此一来,布隆过滤器的每次寻址和写入更新过程都需要消耗多个指令周期cycle,导致寻址和写入更新的时延很长,并且数据也需要多次频繁地在通过总线在处理器和存储器之间搬移,导致寻址和写入更新产生的功耗很大。另外,由于处理器和存储器之间的总线的带宽通常有限,布隆过滤器的寻址和写入更新过程中的并行计算量很大,会导致总线冲突,进而增加了系统响应时长,降低布隆过滤器的效率。At present, when a von Neumann-based computer performs the Bloom filter function, the processor needs to address the memory of the target Vector and the four target locations of the target Vector, and then the processor also needs to access the memory from each target. The position reads the data for judgment, and then writes the updated data to the target position. As a result, each addressing and writing update process of the Bloom filter needs to consume multiple instruction cycles, resulting in a long delay in addressing and writing updates, and the data needs to be passed multiple times and frequently. The bus is moved between the processor and memory, resulting in significant power consumption for addressing and write updates. In addition, because the bandwidth of the bus between the processor and the memory is usually limited, the addressing and writing update process of the Bloom filter requires a large amount of parallel computation, which will lead to bus conflicts, which in turn increases the system response time and reduces the distribution time. Efficiency of the Long Filter.
发明内容SUMMARY OF THE INVENTION
为了解决传统的基于冯诺依曼型计算机的布隆过滤器方案存在的时延长、功耗大、总线冲突等问题,提高布隆过滤器的效率,本申请实施例提供了一种存储器。In order to solve the problems of time extension, high power consumption, bus conflict, etc. existing in the traditional von Neumann computer-based Bloom filter solution, and improve the efficiency of the Bloom filter, an embodiment of the present application provides a memory.
第一方面,本申请实施例提供了一种存储器,该存储器包括:单元阵列,单元阵列包括多个存储单元;多个电路单元,多个电路单元分别与至少一个存储单元连接;其中,电路单元用于:接收外部输入的位寻址数据的第一比特值;读取位寻址数据指向的目标存储单元中的第二比特值;在第一比特值与第二比特值不同时,将目标存储单元更新为第一比特值。In a first aspect, an embodiment of the present application provides a memory, the memory includes: a cell array, the cell array includes a plurality of storage cells; a plurality of circuit units, the plurality of circuit units are respectively connected with at least one storage unit; wherein, the circuit unit Used for: receiving the first bit value of the bit-addressed data input from the outside; reading the second bit value in the target storage unit pointed to by the bit-addressing data; when the first bit value is different from the second bit value, the target The memory cell is updated to the first bit value.
根据本申请实施例提供的存储器,当处理器需要执行布隆过滤器操作时,只需要向电路单元输入位寻址数据,其余的寻址和写入更新流程就都可以由电路单元根据位寻址数据在存储器内完成,不需要处理器参与,因此存储器与处理器之间的总线上不会产生过多的数据迁移,避免出现总线冲突,缩短了系统响应时长,提高了布隆过滤器的效率。According to the memory provided by the embodiment of the present application, when the processor needs to perform the Bloom filter operation, it only needs to input the bit addressing data to the circuit unit, and the rest of the addressing and writing update processes can be performed by the circuit unit according to the bit search process. The address data is completed in the memory and does not require the participation of the processor, so there will not be too much data migration on the bus between the memory and the processor, avoiding bus conflicts, shortening the system response time, and improving the bloom filter. efficiency.
在一种实现方式中,多个所述存储单元分布成多行和多列,每一行所述存储单元通过一条字线连接,每一列所述存储单元通过一条位线连接,每一行存储单元用于存储一个位数组,每一条所述位线连接有一个所述电路单元;不同所述电路单元接收的所述第一比特值对应所述位寻址数据的不同比特位。In an implementation manner, a plurality of the memory cells are distributed into multiple rows and columns, the memory cells in each row are connected by a word line, the memory cells in each column are connected by a bit line, and the memory cells in each row are connected by a word line. For storing a bit array, each of the bit lines is connected with one of the circuit units; the first bit values received by different circuit units correspond to different bits of the bit addressing data.
在一种实现方式中,所述电路单元包括过滤电路和更新电路;所述过滤电路包括位寻址输入端、数据输入端和过滤输出端;所述位寻址输入端用于接收所述第一比特值,所述数据输入端与所述存储单元连接,用于读取所述第二比特值;所述过滤电路用于在所述第一比特值与所述第二比特值不同时,在所述过滤输出端输出第一使能信号;所述更新电路包括数据 输出端,所述数据输出端与所述存储单元连接;所述更新电路用于在所述过滤电路输出所述第一使能信号时,将所述目标存储单元更新为第一比特值。In one implementation, the circuit unit includes a filter circuit and an update circuit; the filter circuit includes a bit-addressable input terminal, a data input terminal, and a filter output terminal; the bit-addressable input terminal is used to receive the first A bit value, the data input terminal is connected to the storage unit for reading the second bit value; the filter circuit is configured to, when the first bit value is different from the second bit value, A first enable signal is output at the filter output terminal; the update circuit includes a data output terminal, the data output terminal is connected to the storage unit; the update circuit is used for outputting the first enable signal at the filter circuit When the signal is enabled, the target storage unit is updated to the first bit value.
在一种实现方式中,滤电路包括第一场效应管、第二场效应管和第三场效应管;所述第一场效应管的源极接地,所述第一场效应管的栅极为所述位寻址输入端,所述第一场效应管的漏极与所述第二场效应管的源极连接;所述第二场效应管的栅极为所述数据输入端,所述第二场效应管的漏极与所述第三场效应管的源极连接;所述第三场效应管的栅极为过滤使能信号输入端,所述第三场效应管的漏极为所述过滤输出端。这样,三个场效应管串联形成了三级过滤结构,其中,第一场效应管用于接收位寻址数据的第一比特值,第二场效应管用于接收存储单元存储的第二比特值。In an implementation manner, the filter circuit includes a first field effect transistor, a second field effect transistor and a third field effect transistor; the source of the first field effect transistor is grounded, and the gate of the first field effect transistor is For the bit addressing input terminal, the drain of the first field effect transistor is connected to the source of the second field effect transistor; the gate of the second field effect transistor is the data input terminal, and the first field effect transistor is the data input terminal. The drain of the second field effect transistor is connected to the source of the third field effect transistor; the gate of the third field effect transistor is the input end of the filter enable signal, and the drain of the third field effect transistor is the filter output. In this way, three field effect transistors are connected in series to form a three-stage filtering structure, wherein the first field effect transistor is used for receiving the first bit value of the bit addressing data, and the second field effect transistor is used for receiving the second bit value stored in the memory unit.
在一种实现方式中,所述过滤电路具体用于在所述过滤使能信号输入端接收到第二使能信号,并且所述第一比特值与所述第二比特值不同时,在所述过滤输出端输出所述第一使能信号。这样,当第三场效应管的栅极接收到第二使能信号时,过滤电路能够在第一比特值与第二比特值不同时激活更新单元,实现布隆过滤器的过滤功能。In an implementation manner, the filtering circuit is specifically configured to receive a second enable signal at the filter enable signal input terminal, and when the first bit value is different from the second bit value, The filter output terminal outputs the first enable signal. In this way, when the gate of the third field effect transistor receives the second enable signal, the filter circuit can activate the update unit when the first bit value is different from the second bit value, so as to realize the filtering function of the Bloom filter.
在一种实现方式中,第一场效应管、第二场效应管和第三场效应管均为N型场效应管。In an implementation manner, the first field effect transistor, the second field effect transistor and the third field effect transistor are all N-type field effect transistors.
在一种实现方式中,所述更新电路包括三态缓存器、反向三态缓存器、第一数据选择器和第二数据选择器;所述第一数据选择器的第一输入端为写使能信号输入端,所述第一数据选择器的第二输入端用于接收所述第一使能信号的取反信号,所述第一数据选择器的输出端与所述三态缓存器的使能端和所述反向三态缓存器的使能端连接;所述第二数据选择器的第二输入端与所述位寻址输入端或者高电位连接,所述第二数据选择器的输出端与所述三态缓存器的输入端和所述反向三态缓存器的输入端连接;所述三态缓存器的输出端和所述反向三态缓存器的输出端为所述数据输出端。这样,更新电路可以通过过滤输出端的低信号使能三态缓存器和反向三态缓存器,从而向存储单元写入更新数据,实现布隆过滤器的更新功能。In an implementation manner, the update circuit includes a tri-state buffer, an inverse tri-state buffer, a first data selector and a second data selector; the first input of the first data selector is a write an enable signal input terminal, the second input terminal of the first data selector is used for receiving the inversion signal of the first enable signal, the output terminal of the first data selector is connected to the tri-state buffer The enable terminal of the second data selector is connected to the enable terminal of the inverse tri-state buffer; the second input terminal of the second data selector is connected to the bit addressing input terminal or high potential, and the second data selector The output end of the buffer is connected to the input end of the tri-state buffer and the input end of the inverse tri-state buffer; the output end of the tri-state buffer and the output end of the inverse tri-state buffer are the data output. In this way, the update circuit can enable the tri-state buffer and the inverse tri-state buffer by filtering the low signal at the output terminal, so as to write update data to the storage unit, so as to realize the update function of the Bloom filter.
在一种实现方式中,所述第一使能信号为高电平信号,所述更新电路具体用于在所述第一比特值为1,并且所述第二比特值为0时,将所述目标存储单元更新为所述第一比特值。这样,更新电路能够实现布隆过滤器的更新功能,对新元素的映射值写1。In an implementation manner, the first enable signal is a high-level signal, and the update circuit is specifically configured to, when the value of the first bit is 1 and the value of the second bit is 0, The target storage unit is updated to the first bit value. In this way, the update circuit can implement the update function of the Bloom filter and write 1 to the mapping value of the new element.
在一种实现方式中,所述更新电路包括与门单元、三态缓存器、反向三态缓存器、第一数据选择器和第二数据选择器;所述与门单元的第一输入端与所述过滤输出端连接,用于接收所述第一使能信号的取反信号;所述与门单元的第二输入端为写使能信号输入端;所述与门单元的输出端与所述第一数据选择器的第二输入端连接;所述第一数据选择器的第一输入端与所述写使能信号输入端连接,所述第一数据选择器的输出端与所述三态缓存器的使能端和所述反向三态缓存器的使能端连接;所述第二数据选择器的第二输入端与所述位寻址输入端或者高电位连接,所述第二数据选择器的输出端与所述三态缓存器的输入端和所述反向三态缓存器的输入端连接;所述三态缓存器的输出端和所述反向三态缓存器的输出端为所述数据输出端。这样,更新电路可以通过过滤输出端的低信号和写使能信号使能三态缓存器和反向三态缓存器,从而向存储单元写入更新数据,实现布隆过滤器的更新功能。In an implementation manner, the update circuit includes an AND gate unit, a tri-state buffer, an inverse tri-state buffer, a first data selector and a second data selector; the first input terminal of the AND gate unit Connected with the filter output end, used for receiving the inversion signal of the first enable signal; the second input end of the AND gate unit is the write enable signal input end; the output end of the AND gate unit is the same as the The second input end of the first data selector is connected; the first input end of the first data selector is connected to the write enable signal input end, and the output end of the first data selector is connected to the The enable terminal of the tri-state buffer is connected to the enable terminal of the inverse tri-state buffer; the second input terminal of the second data selector is connected to the bit addressing input terminal or high potential, the The output end of the second data selector is connected to the input end of the tri-state buffer and the input end of the inverse tri-state buffer; the output end of the tri-state buffer and the inverse tri-state buffer The output terminal is the data output terminal. In this way, the update circuit can enable the tri-state buffer and the reverse tri-state buffer by filtering the low signal at the output end and the write enable signal, so as to write update data to the storage unit, and realize the update function of the Bloom filter.
在一种实现方式中,所述第一使能信号为高电平信号,所述更新电路具体用于在所述写使能信号输入端输入高电平,并且所述第一比特值为1、所述第二比特值为0时,将所述目标存储单元更新为所述第一比特值。这样,更新电路能够实现布隆过滤器的更新功能,对新元素的映射值写1。In an implementation manner, the first enable signal is a high level signal, the update circuit is specifically configured to input a high level at the input end of the write enable signal, and the first bit value is 1 . When the second bit value is 0, the target storage unit is updated to the first bit value. In this way, the update circuit can implement the update function of the Bloom filter and write 1 to the mapping value of the new element.
在一种实现方式中,位线包括第一位线和第二位线,三态缓存器的输出端与第一位线连 接,反向三态缓存器的输出端与第二位线连接;当第一位线为高电平,第二位线为低电平时,存储单元中的比特值为1;当第一位线为低电平,第二位线为高电平时,存储单元中的比特值为0。这样,更新电路被激活后,可以由三态缓存器再第一位线输出高电平,由反向三态缓存器在第二位线输出低电平,实现将存储单元的比特值更新为1。In one implementation, the bit line includes a first bit line and a second bit line, the output end of the tri-state buffer is connected to the first bit line, and the output end of the inverse tri-state buffer is connected to the second bit line; When the first bit line is high and the second bit line is low, the bit value in the memory cell is 1; when the first bit line is low and the second bit line is high, the bit value in the memory cell is 1. The bit value is 0. In this way, after the update circuit is activated, the tri-state buffer can output a high level on the first bit line, and the reverse tri-state buffer can output a low level on the second bit line, so that the bit value of the storage unit can be updated to 1.
在一种实现方式中,第一数据选择器的数据选择端和第二数据选择器的数据选择端用于接收工作模式选择信号;当工作模式选择信号为低电平时,第一数据选择器的输出端和第二数据选择器的输出端均输出各自第一输入端的信号;当工作模式选择信号为高电平时,第一数据选择器的输出端和第二数据选择器的输出端均输出各自第二输入端的信号。这样,通过不同工作模式选择信号,可以实现存储器在传统读写模式和布隆过滤器模式之间切换。In an implementation manner, the data selection terminal of the first data selector and the data selection terminal of the second data selector are used to receive the working mode selection signal; when the working mode selection signal is at a low level, the first data selector The output terminal and the output terminal of the second data selector both output the signal of the respective first input terminal; when the working mode selection signal is at a high level, the output terminal of the first data selector and the output terminal of the second data selector both output the respective signals of the first input terminal. signal at the second input. In this way, the memory can be switched between the traditional read-write mode and the Bloom filter mode through different working mode selection signals.
在一种实现方式中,数据输入端通过灵敏放大器与位线连接;灵敏放大器包括两个输入端,分别与第一位线和第二位线连接;灵敏放大器还包括一个输出端,与数据输入端连接;其中,当第一位线为高电平,第二位线为低电平时,灵敏放大器输出低电平;当第一位线为低电平,第二位线为高电平时,灵敏放大器输出高电平。这样,灵敏放大器可以实现在存储单元中的比特值为0时,向过滤电路的数据输入端输入高电平,用于过滤电路激活更新电路。In an implementation manner, the data input end is connected to the bit line through a sense amplifier; the sense amplifier includes two input ends, which are respectively connected to the first bit line and the second bit line; the sense amplifier further includes an output end, which is connected to the data input end When the first bit line is high level and the second bit line is low level, the sense amplifier outputs low level; when the first bit line is low level and the second bit line is high level, The sense amplifier outputs a high level. In this way, when the bit value in the storage unit is 0, the sense amplifier can input a high level to the data input terminal of the filter circuit, so that the filter circuit can activate the update circuit.
在一种实现方式中,过滤电路还包括第四场效应管,第四场效应管的源极耦合至高电位,第四场效应管的漏极与过滤输出端连接,第四场效应管的栅极为预充电信号输入端;其中,当预充电信号输入端输入低电平时,第四场效应管导通,以将过滤输出端拉升至高电平,实现电路单元的初始化和复位。In an implementation manner, the filter circuit further includes a fourth field effect transistor, the source of the fourth field effect transistor is coupled to a high potential, the drain of the fourth field effect transistor is connected to the filter output end, and the gate of the fourth field effect transistor Extremely precharge signal input terminal; wherein, when the precharge signal input terminal is input with a low level, the fourth field effect transistor is turned on to pull the filter output terminal to a high level to realize the initialization and reset of the circuit unit.
在一种实现方式中,第四场效应管为P型场效应管。In an implementation manner, the fourth field effect transistor is a P-type field effect transistor.
在一种实现方式中,多个电路单元共用同一个过滤使能信号输入端。In an implementation manner, multiple circuit units share the same filter enable signal input terminal.
在一种实现方式中,多个电路单元共用同一个写使能信号输入端。In an implementation manner, multiple circuit units share the same write enable signal input terminal.
在一种实现方式中,多个电路单元共用同一个过滤输出端。In one implementation, multiple circuit units share the same filter output.
这样,通过多个电路单元共用过滤使能信号输入端、写使能信号输入端和过滤输出端可以简化电路结构,节省电路面积。In this way, by sharing the filter enable signal input end, the write enable signal input end and the filter output end by multiple circuit units, the circuit structure can be simplified and the circuit area can be saved.
在一种实现方式中,锁存器还包括控制信号输入端,用于接收外部控制信号,其中,当外部控制信号为低电平时,锁存器用于接收并锁存独热编码数据,当外部控制信号为高电平时,锁存器用于将独热编码数据的不同比特位的比特值一一对应地输入到各个电路单元的寻址输入端。这样,布隆过滤器可以接收散列值Hash Value格式的寻址数据,通过独热编码的形式转换成独热编码数据,再输入给各个电路单元。In an implementation manner, the latch further includes a control signal input terminal for receiving an external control signal, wherein when the external control signal is at a low level, the latch is used for receiving and latching the one-hot encoded data, and when the external control signal is at a low level When the control signal is at a high level, the latch is used to input the bit values of different bits of the one-hot encoded data to the addressing input terminals of each circuit unit in a one-to-one correspondence. In this way, the Bloom filter can receive the addressing data in the Hash Value format, convert it into one-hot encoded data in the form of one-hot encoding, and then input it to each circuit unit.
在一种实现方式中,位寻址数据为二进制数组。这样,处理器可以直接将位寻址数据的各个比特位的二进制值输入到各个电路单元中,不需要在设置锁存器,因此在存储器和处理组成的系统电路中也不需要增加锁存器的相关电路,简化了系统电路结构,减小了电路面积。In one implementation, the bit-addressable data is a binary array. In this way, the processor can directly input the binary value of each bit of the bit-addressable data into each circuit unit, and there is no need to set a latch, so there is no need to add a latch in the system circuit composed of memory and processing. The related circuit simplifies the system circuit structure and reduces the circuit area.
第二方面,本申请还提供了一种计算机存储介质。该计算机存储介质计算机指令,当计算机指令在计算机上运行时,使得计算机执行上述各方面及其实现方式中的方法。In a second aspect, the present application also provides a computer storage medium. The computer storage medium computer instructions, when executed on a computer, cause the computer to perform the methods in the above-described aspects and implementations thereof.
第三方面,本申请还提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述各方面及其实现方式中的方法。In a third aspect, the present application also provides a computer program product comprising instructions, which, when run on a computer, cause the computer to perform the methods in the above aspects and implementations thereof.
附图说明Description of drawings
图1是目前冯诺依曼型计算机的架构图;Figure 1 is the architecture diagram of the current von Neumann computer;
图2是基于冯诺依曼型计算机实现的布隆过滤器寻址和更新过程的示意图;Fig. 2 is a schematic diagram of a Bloom filter addressing and updating process based on a von Neumann-type computer;
图3是本申请实施例提供的存内计算架构的示意图;3 is a schematic diagram of an in-memory computing architecture provided by an embodiment of the present application;
图4是本申请实施例示出的SRAM的结构示意图;4 is a schematic structural diagram of an SRAM shown in an embodiment of the present application;
图5是本申请实施例示出的一种布隆过滤器功能电路的结构示意图;5 is a schematic structural diagram of a Bloom filter functional circuit shown in an embodiment of the present application;
图6是本申请实施例提供的电路单元与存储单元的电路连接示意图;6 is a schematic diagram of a circuit connection between a circuit unit and a storage unit provided by an embodiment of the present application;
图7是本申请实施例提供的filter电路的结构示意图;7 is a schematic structural diagram of a filter circuit provided by an embodiment of the present application;
图8是本申请实施例提供的一种update电路的结构示意图;8 is a schematic structural diagram of an update circuit provided by an embodiment of the present application;
图9是本申请实施例提供的一种电路单元与存储单元连接的具体电路图;9 is a specific circuit diagram of the connection between a circuit unit and a storage unit provided by an embodiment of the present application;
图10是本申请实施例提供的电路控制方法的时序图;10 is a sequence diagram of a circuit control method provided by an embodiment of the present application;
图11是本申请实施例提供的另一种update电路的结构示意图;11 is a schematic structural diagram of another update circuit provided by an embodiment of the present application;
图12是本申请实施例提供的另一种电路单元与存储单元连接的具体电路图;12 is a specific circuit diagram of another circuit unit connected to a storage unit provided by an embodiment of the present application;
图13是本申请实施例提供的另一种电路控制方法的时序图;13 is a sequence diagram of another circuit control method provided by an embodiment of the present application;
图14是本申请实施例提供的另一种布隆过滤波器功能电路的结构示意图。FIG. 14 is a schematic structural diagram of another functional circuit of a bloom filter provided by an embodiment of the present application.
具体实施方式Detailed ways
在计算机系统中,为了快速检测某一元素是否在一个目标集合中,人们发明了布隆过滤器(Bloom Filter)。布隆过滤器的原理是:当一个元素被加入集合时,通过K个散列值Hash Value将这个元素映射到一个位数组Vector中的K个位置,并把这K个位置的值置为1。检索时,只需要检查这K个位置的值是否都是1就可以概率性的判断目标集合中是否包含此元素,即如果这K个点位置的值有任何一个0,则被检测元素一定不存在于目标集合中;如果这K个位置的值都是1,则被检测元素很可能存在于目标集合中。In computer systems, in order to quickly detect whether an element is in a target set, people invented the Bloom filter (Bloom Filter). The principle of Bloom filter is: when an element is added to the set, the element is mapped to K positions in a bit array Vector through K hash values, and the value of these K positions is set to 1 . When retrieving, it is only necessary to check whether the values of the K positions are all 1 to determine whether the target set contains this element probabilistically, that is, if the value of the K positions has any 0, the detected element must not be Exist in the target set; if the values of these K positions are all 1, the detected element is likely to exist in the target set.
布隆过滤器功能在计算机系统的诸多应用(例如网络应用)中会被大量的使用。下面基于目前广泛使用的传统的冯诺依曼型计算机,对布隆过滤器的实现方案进行简要说明。图1是目前冯诺依曼型计算机的架构图,如图1所示,冯诺依曼型计算机的处理器10和存储器20分开设置,处理器10和存储器20之间可以通过总线30进行通信和数据交换,处理器10中还可以包括缓存11,可用于暂时存储从存储器20读取的数据或者即将写入到存储器20中的数据。The Bloom filter function is widely used in many applications of computer systems (eg, network applications). The following is a brief description of the implementation scheme of the Bloom filter based on the widely used traditional von Neumann computer. FIG. 1 is an architecture diagram of a current von Neumann computer. As shown in FIG. 1 , the processor 10 and the memory 20 of the von Neumann computer are set separately, and communication between the processor 10 and the memory 20 can be performed through a bus 30 For data exchange, the processor 10 may further include a cache 11 , which may be used to temporarily store data read from the memory 20 or data to be written into the memory 20 .
基于图1示出的冯诺依曼型计算机架构,为实现布隆过滤器的功能,可以通过散列值Hash Value对位于存储器20例如静态随机存取存储器(static random access memory,SRAM)中的位数组Vector进行寻址和映射。Based on the von Neumann-type computer architecture shown in FIG. 1, in order to realize the function of the Bloom filter, a hash value can be used to pair the data stored in the memory 20, such as static random access memory (SRAM), by means of a hash value. Bit array Vector for addressing and mapping.
图2是基于冯诺依曼型计算机实现的布隆过滤器寻址和更新过程的示意图。如图2所示,SRAM可以包括M级SRAM数组array,M为正整数,每一级数组array可以包括多个位数组Vector,每个Vector的长度例如为16字节bytes。散列值Hash Value可以包括高位段HSB和低位段LSB,以目前常见的长度为64比特bits的散列值Hash Value为例,高位段HSB的长度例如可以为44比特,低位段的长度例如可以为20比特。高位段HSB部分用来对SRAM array内具体的位数组Vector进行寻址;低位段LSB则可以被分成四组数组,分别用来寻址位数组Vector中四个位置。Figure 2 is a schematic diagram of a Bloom filter addressing and updating process based on a von Neumann-type computer implementation. As shown in FIG. 2 , the SRAM may include an M-level SRAM array array, where M is a positive integer, and each level of the array array may include a plurality of bit arrays Vector, and the length of each Vector is, for example, 16 bytes. The hash value Hash Value can include the high-order segment HSB and the low-order segment LSB. Taking the current common hash value Hash Value with a length of 64 bits as an example, the length of the high-order segment HSB can be, for example, 44 bits, and the length of the low-order segment can be, for example, is 20 bits. The high-order segment HSB part is used to address the specific bit array Vector in the SRAM array; the low-order segment LSB can be divided into four groups of arrays, which are respectively used to address four positions in the bit array Vector.
进一步如图2所示,布隆过滤器的寻址和写入更新功能可以通过以下四个步骤实现:Further as shown in Figure 2, the addressing and write update functions of the Bloom filter can be implemented in the following four steps:
步骤①:处理器通过散列值Hash Value的高位段HSB在SRAM array中寻址找到目标Vector。Step 1: The processor finds the target Vector by addressing the high-order segment HSB of the Hash Value in the SRAM array.
步骤②:处理器将目标Vector分为4个小组,每个小组标记为Vector’,每个Vector’的长 度4字节,即32比特。Step 2: The processor divides the target Vector into 4 groups, each group is marked as Vector', and the length of each Vector' is 4 bytes, that is, 32 bits.
步骤③:处理器将Hash Value的LSB同样分为4组,每一组LSB数据对应一个Vector’,每一组LSB数据的长度为5比特,可以形成2 5=32个值,因此每一组LSB数据刚好可以对其对应的32比特的Vector’进行按位寻址。这样,处理器可以通过Hash Value的LSB标记出目标Vector的四个目标位置。 Step 3: The processor divides the LSB of the Hash Value into 4 groups, each group of LSB data corresponds to a Vector', and the length of each group of LSB data is 5 bits, which can form 2 5 =32 values, so each group The LSB data can just be bit-wise addressed to its corresponding 32-bit Vector'. In this way, the processor can mark the four target positions of the target Vector through the LSB of the Hash Value.
步骤④:处理器分别读取目标Vector中的四个目标位置的数据,并且判断这四个目标位置的值是否均为1;如果四个目标位置的值均为1,则表示被检测元素有可能包含在目标集合内;如果四个目标位置的值至少有一个为0,则表示被检测元素为一定不存在于目标集合中,属于新的数据流,此时将值为0的目标位置更新为1。Step 4: The processor reads the data of the four target positions in the target Vector respectively, and judges whether the values of the four target positions are all 1; if the values of the four target positions are all 1, it means that the detected element has It may be included in the target set; if at least one of the values of the four target positions is 0, it means that the detected element must not exist in the target set and belongs to a new data stream. At this time, the target position with a value of 0 is updated. is 1.
通过以上步骤,即完成了一次布隆过滤器的寻址和写入更新。Through the above steps, the addressing and writing update of the Bloom filter are completed.
结合图1和图2可知,基于冯诺依曼型计算机的布隆过滤器方案在每次执行寻址和写入更新时,处理器需要对存储器进行目标Vector的寻址和目标Vector的四个目标位置的寻址,然后处理器还需要从每个目标位置读取数据进行判断,再向目标位置写入更新的数据。如此一来,布隆过滤器的每次寻址和写入更新过程都需要消耗多个指令周期cycle,导致寻址和写入更新的时延很长,并且数据也需要多次频繁地在通过总线在处理器和存储器之间搬移,导致寻址和写入更新产生的功耗很大。另外,由于处理器和存储器之间的总线的带宽通常有限,布隆过滤器的寻址和写入更新过程中的并行计算量很大,会导致总线冲突,进而增加了系统响应时长,降低布隆过滤器的效率。Combining with Fig. 1 and Fig. 2, it can be seen that the Bloom filter scheme based on von Neumann computer needs to address the memory of the target Vector and the four elements of the target Vector when performing addressing and writing update each time. The addressing of the target location, and then the processor also needs to read data from each target location for judgment, and then write updated data to the target location. As a result, each addressing and writing update process of the Bloom filter needs to consume multiple instruction cycles, resulting in a long delay in addressing and writing updates, and the data needs to be passed multiple times and frequently. The bus is moved between the processor and memory, resulting in significant power consumption for addressing and write updates. In addition, because the bandwidth of the bus between the processor and the memory is usually limited, the addressing and writing update process of the Bloom filter requires a large amount of parallel computation, which will lead to bus conflicts, which in turn increases the system response time and reduces the distribution time. Efficiency of the Long Filter.
为了解决传统的基于冯诺依曼型计算机的布隆过滤器方案存在的时延长、功耗大、总线冲突等问题,提高布隆过滤器的效率,本申请实施例提供了一种布隆过滤器功能电路。In order to solve the problems of time extension, high power consumption, bus conflict, etc. existing in the traditional von Neumann computer-based bloom filter solution, and improve the efficiency of the bloom filter, the embodiment of the present application provides a bloom filter device function circuit.
与传统的基于冯诺依曼型计算机的布隆过滤器方案不同,本申请实施例提供的布隆过滤器功能电路可以应用于非冯诺依曼型计算机架构中,具体可以应用于具有存储器内直接计算(存内计算)架构的计算机中。图3是本申请实施例提供的存内计算架构的示意图。如图3所示,该存内计算架构包括处理器100和存储器200,处理器100和存储器200之间可以通过总线300进行通信和数据交换,处理器100中还可以包括缓存110,可用于暂时存储从存储器200读取的数据或者即将写入到存储器200中的数据,存储器200除了用于存储数据(例如SRAM数组210)以外,还包括存内计算电路220,存内计算电路220可用于在存储器200内完成数据的处理。Different from the traditional von Neumann computer-based Bloom filter solution, the Bloom filter function circuit provided by the embodiment of the present application can be applied to a non-von Neumann computer architecture, and specifically can be applied to a computer with internal memory. In computers of direct computing (in-memory computing) architecture. FIG. 3 is a schematic diagram of an in-memory computing architecture provided by an embodiment of the present application. As shown in FIG. 3, the in-memory computing architecture includes a processor 100 and a memory 200. Communication and data exchange can be performed between the processor 100 and the memory 200 through a bus 300. The processor 100 can also include a cache 110, which can be used for temporary To store data read from the memory 200 or data to be written into the memory 200, the memory 200 not only stores data (for example, the SRAM array 210), but also includes an in-memory computing circuit 220, and the in-memory computing circuit 220 can be used to store data in the memory 200. The processing of the data is completed in the memory 200 .
在一种实现方式中,存内计算电路220例如可以包括本申请实施例提供的布隆过滤器功能电路,以使得本申请实施例的布隆过滤器功能电路在存储器内实现布隆过滤器功能,例如寻址和写入更新等。In an implementation manner, the in-memory computing circuit 220 may include, for example, the bloom filter function circuit provided by the embodiment of the present application, so that the bloom filter function circuit of the embodiment of the present application implements the bloom filter function in the memory , such as addressing and write updates.
为便于本领域技术人员理解本申请实施例的技术方案,在对本申请实施例提供的布隆过滤器电路的结构进行具体阐述之前,首先以SRAM为例,对存储器的一种可实现的结构进行简单说明。In order to facilitate those skilled in the art to understand the technical solutions of the embodiments of the present application, before the structure of the bloom filter circuit provided by the embodiments of the present application is described in detail, first take SRAM as an example to describe an achievable structure of the memory. Simple instructions.
图4是本申请实施例示出的SRAM的结构示意图。如图4所示,SRAM包括SRAM单元阵列(SRAM array),SRAM单元阵列可以包括多个存储单元,多个存储单元分布成多行和多列。SRAM数组的每一行存储单元可以用于存储一个Vector,并且每一行存储单元通过一条字线(word line,WL)连接。SRAM array的每一列存储单元对应不同Vector的同一个比特位,并且通过一条位线(比特line,BL)连接。其中,处理器或者其他器件可以通过字线WL对SRAM单元阵列进行字寻址,找到目标Vector,并且可以通过各个位线BL对读写用 于存储目标Vector的各个存储单元。FIG. 4 is a schematic structural diagram of an SRAM shown in an embodiment of the present application. As shown in FIG. 4 , the SRAM includes an SRAM cell array (SRAM array), and the SRAM cell array may include a plurality of memory cells, and the plurality of memory cells are distributed into multiple rows and columns. Each row of memory cells in the SRAM array can be used to store a Vector, and each row of memory cells is connected by a word line (WL). Each column of memory cells in the SRAM array corresponds to the same bit of a different Vector and is connected by a bit line (bit line, BL). Wherein, the processor or other devices can word address the SRAM cell array through the word line WL to find the target Vector, and can read and write each memory cell used to store the target Vector through each bit line BL.
进一步如图4所示,在一个示例中,SRAM array的位宽可以为16字节,即128比特,因此每一条字线WL上包括可以包括128个存储单元,每个存储单元存储Vector的1个比特位,这样SRAM array的每一条字线WL上的存储单元可以存储长度为16字节的Vector。Further as shown in FIG. 4 , in an example, the bit width of the SRAM array may be 16 bytes, that is, 128 bits, so each word line WL may include 128 memory cells, and each memory cell stores 1 of the Vector. bits, so that the memory cells on each word line WL of the SRAM array can store a Vector with a length of 16 bytes.
相应地,SRAM array共可以包括128条位线BL。为便于描述,图4根据这128条位线BL与Vector的128个比特位的对应关系,将这128条位线BL分为四组,每组32条位线BL,分别对应Vector的第0~31个比特位、第32~63个比特位、第64~95个比特位、第96~127个比特位,因此每一组位线BL对应一个4字节长度的Vector’。其中,当某一元素映射到Vector中的4个目标位置时,每一组BL上的比特位中包含一个目标位置。Correspondingly, the SRAM array may include 128 bit lines BL in total. For ease of description, FIG. 4 divides the 128 bit lines BL into four groups according to the correspondence between the 128 bit lines BL and the 128 bits of the Vector, and each group of 32 bit lines BL corresponds to the 0th bit of the Vector. ~31 bits, 32nd to 63rd bits, 64th to 95th bits, and 96th to 127th bits, so each group of bit lines BL corresponds to a Vector' with a length of 4 bytes. Among them, when an element is mapped to the four target positions in the Vector, the bits on each group of BLs include one target position.
这里需要补充说明的是,本申请实施例上述示出的SRAM array的位宽为16字节、Vector的长度为16字节、以及SRAM array共包括128条位线BL等特征均仅仅作为一种示例,不构成对SRAM array和Vector的具体限定,本领域技术人员在对本申请实施例的方案进行具体实施时,可以根据具体的软硬件环境和使用需求合理地设置上述特征,这些都没有超出本申请实施例的保护范围。It needs to be supplemented here that the above-mentioned features of the SRAM array shown in the embodiments of the present application are 16 bytes in bit width, 16 bytes in length of Vector, and 128 bit lines BL are included in the SRAM array. Example, does not constitute a specific limitation to SRAM array and Vector, those skilled in the art can reasonably set the above-mentioned features according to the specific software and hardware environment and use requirements when implementing the solutions of the embodiments of the present application. The protection scope of the application examples.
图5是本申请实施例示出的包含布隆过滤器功能电路的结构示意图。如图5所示,该布隆过滤器功能电路50可以设置于存储器内,带有布隆过滤器电路50的存储器可以视为一种新型的存储器。布隆过滤器功能电路50具体可以包括:单元阵列230、以及与单元阵列230的多条位线BL数量相同的多个电路单元400。本申请实施例中,单元阵列230例如可以是上述如图4所示的SRAM array,或者在其他存储器中形成的包含存储单元的阵列结构,上述其他存储器包括但不限于动态随机存取存储器(dynamic random access memory,DRAM)、电可擦除可编程只读存储器(electrically-erasable programmable read-only memory,EEPROM)、快闪存储器(flash memory)等,本申请对此不做限定。FIG. 5 is a schematic structural diagram of a circuit including a Bloom filter function according to an embodiment of the present application. As shown in FIG. 5 , the bloom filter function circuit 50 can be arranged in a memory, and the memory with the bloom filter circuit 50 can be regarded as a new type of memory. The bloom filter function circuit 50 may specifically include: a cell array 230 and a plurality of circuit units 400 having the same number as the plurality of bit lines BL of the cell array 230 . In this embodiment of the present application, the cell array 230 may be, for example, the above-mentioned SRAM array as shown in FIG. 4 , or an array structure including storage cells formed in other memories, including but not limited to dynamic random access memories (dynamic random access memories). random access memory, DRAM), electrically erasable programmable read-only memory (electrically-erasable programmable read-only memory, EEPROM), flash memory (flash memory), etc., which are not limited in this application.
进一步如图5所示,多个电路单元400与单元阵列230的多条位线BL一一对应连接;每个电路单元400还包括一个位寻址输入端410,位寻址输入端410用于接收来自布隆过滤器功能电路外部的寻址数据。另外,每个电路单元400还包括过滤使能信号输入端Filter_En、过滤输出端Filter_Done和写使能信号输入端WR_EN,其中过滤使能信号输入端Filter_En、过滤输出端Filter_Done和写使能信号输入端WR_EN的具体功能将在后续的内容中具体展开说明。Further as shown in FIG. 5 , a plurality of circuit units 400 are connected to a plurality of bit lines BL of the cell array 230 in one-to-one correspondence; each circuit unit 400 further includes a bit addressing input terminal 410, and the bit addressing input terminal 410 is used for Receives addressed data from outside the Bloom filter function circuit. In addition, each circuit unit 400 further includes a filter enable signal input terminal Filter_En, a filter output terminal Filter_Done and a write enable signal input terminal WR_EN, wherein the filter enable signal input terminal Filter_En, the filter output terminal Filter_Done and the write enable signal input terminal The specific function of WR_EN will be explained in detail in the following content.
在一种实现方式中,所有的电路单元400可以共用一个过滤使能信号输入端Filter_En,即布隆过滤器功能电路包括一条过滤使能信号输入端Filter_En总线,所有的电路单元400可以共用一个过滤输出端Filter_Done,即布隆过滤器功能电路包括一条过滤输出端Filter_Done总线,所有的电路单元400可以共用一个写使能信号输入端WR_EN,即布隆过滤器功能电路包括一条写使能信号输入端WR_EN总线。In an implementation manner, all circuit units 400 may share a filter enable signal input terminal Filter_En, that is, the Bloom filter function circuit includes a filter enable signal input terminal Filter_En bus, and all circuit units 400 may share a filter enable signal input terminal Filter_En. The output terminal Filter_Done, that is, the Bloom filter function circuit includes a filter output terminal Filter_Done bus, and all circuit units 400 can share a write enable signal input terminal WR_EN, that is, the Bloom filter function circuit includes a write enable signal input terminal. WR_EN bus.
基于图5示出的布隆过滤器功能电路结构,当处理器或者其他外部器件需要执行布隆过滤器的寻址和写入更新功能时,可以根据被检测元素在单元阵列中映射的目标Vector的位置产生相应的寻址数据,该寻址数据例如可以包括字寻址数据和字位寻址数据。其中,字寻址数据用于对字线WL进行寻址,以找到目标Vector所在的字线WL;位寻址数据用于对位线BL进行寻址,以找到被检测元素在目标Vector中映射的目标比特,对目标比特进行寻址和写入更新等操作。Based on the functional circuit structure of the bloom filter shown in FIG. 5, when the processor or other external device needs to perform the addressing and writing update functions of the bloom filter, the target Vector mapped in the cell array can be mapped according to the detected element. The corresponding addressing data is generated at the position of , and the addressing data may include, for example, word-addressed data and word-bit-addressed data. Among them, the word addressing data is used to address the word line WL to find the word line WL where the target Vector is located; the bit addressing data is used to address the bit line BL to find the detected element to map in the target Vector The target bit is addressed, and operations such as writing and updating are performed on the target bit.
在一种实现方式中,寻址数据将以0或1比特值的形式输入到各个字线WL或者各个电 路单元。其中,输入到目标Vector所在字线WL的比特值为1,以用于激活目标Vector所在字线WL,输入到其余Vector所在字线WL的比特值0,从而不会激活其余Vector所在字线WL;输入到位于目标比特所在位线BL上的电路单元的比特值为1,输入到其他电路单元的比特值为0,以选择目标比特,使电路单元对目标比特执行后续的寻址和写入更新等操作。In one implementation, the addressed data will be input to each word line WL or each circuit cell in the form of 0 or 1 bit values. Among them, the bit value input to the word line WL where the target Vector is located is 1 to activate the word line WL where the target Vector is located, and the bit value input to the word line WL where the remaining Vectors are located is 0, so that the word lines WL where the remaining Vectors are located will not be activated. ; The bit value input to the circuit unit on the bit line BL where the target bit is located is 1, and the bit value input to other circuit units is 0 to select the target bit, so that the circuit unit performs subsequent addressing and writing to the target bit. update, etc.
在一种实现方式中,寻址数据初始可以是例如可以是Hash Value,其低位段LSB可以通过编码的方式生成用于输入到各个字线WL或者各个电路单元的0或1比特值。In an implementation manner, the addressing data may initially be, for example, a Hash Value, and the low-order segment LSB of the LSB may generate a 0 or 1-bit value for input to each word line WL or each circuit unit by encoding.
例如,0或1比特值可以通过对Hash Value的低位段LSB进行独热One-hot编码得到。For example, a 0 or 1-bit value can be obtained by one-hot encoding the low-order segment LSB of the Hash Value.
在一个示例中,假设目标Vector的长度为128比特,被检测元素在目标Vector中映射有4个目标比特,则目标Vector可以包括4个小组,每一个小组包括32个比特,每一个小组的32个比特中包括一个目标比特。那么,为实现对4个目标比特进行寻址,Hash Value的低位段LSB经过One-hot编码之后可以得到4组One-hot数组,4组One-hot数组与目标Vector的4个小组一一对应,每个One-hot数组与目标Vector的小组的长度相同,均为32比特,每个One-hot数组中仅有一个比特的One-hot值为1,对应目标Vector的一个目标比特,其余比特的One-hot值为0。In an example, assuming that the length of the target Vector is 128 bits, and the detected element is mapped with 4 target bits in the target Vector, the target Vector may include 4 groups, each group includes 32 bits, and each group has 32 bits. A target bit is included in the bits. Then, in order to address the 4 target bits, the LSB of the low-order segment of the Hash Value can obtain 4 groups of One-hot arrays after One-hot encoding, and the 4 groups of One-hot arrays correspond to the 4 groups of the target Vector one-to-one. , each One-hot array has the same length as the target Vector group, both of which are 32 bits. The One-hot value of only one bit in each One-hot array is 1, which corresponds to one target bit of the target Vector, and the remaining bits The One-hot value of 0 is 0.
本申请实施例中,对Hash Value低位段LSB经过One-hot编码而得到One-hot数组的操作可以是由设置在存储器之外的处理器或者其他外部器件实现,也可以是由设置在存储器之内的计算器件实现,例如:存储器的主控芯片、微控制单元(microcontroller unit,MCU)等,本申请实施例对此不做限定。In the embodiment of the present application, the operation of obtaining a One-hot array by performing One-hot encoding on the LSB of the low-order segment of the Hash Value may be implemented by a processor or other external device set outside the memory, or may be implemented by a processor set outside the memory. It is realized by a computing device in the memory, for example: a main control chip of a memory, a microcontroller unit (MCU), etc., which is not limited in this embodiment of the present application.
接下来对Hash Value低位段LSB经过One-hot编码而得到One-hot数组的方法进行示例性说明。Next, a method for obtaining a One-hot array by one-hot encoding of the LSB of the low-order segment of the Hash Value is exemplarily described.
如图5所示,与Vector的4个长度为32比特的小组相对应地,Hash Value的低位段LSB也可以包括4组数据,每组数据均为长度为5比特的二进制编码,因此LSB总长度可以为20比特。LSB的每组数据通过二进制编码可以形成32个值,因此每个值都可以被编码成长度为32比特的One-hot数组。一种示例性的One-hot编码方式如表1所示。As shown in Figure 5, corresponding to the four 32-bit groups of Vector, the low-order segment LSB of Hash Value can also include 4 groups of data, and each group of data is binary coded with a length of 5 bits, so the total LSB The length can be 20 bits. Each group of LSB data can form 32 values through binary encoding, so each value can be encoded into a One-hot array with a length of 32 bits. An exemplary One-hot encoding method is shown in Table 1.
二进制binary One-hot编码One-hot encoding
0000000000 0000000000000000000000000000000100000000000000000000000000000001
0000100001 0000000000000000000000000000001000000000000000000000000000000010
0001000010 0000000000000000000000000000010000000000000000000000000000000100
0001100011 0000000000000000000000000000100000000000000000000000000000001000
0010000100 0000000000000000000000000001000000000000000000000000000000010000
0010100101 0000000000000000000000000010000000000000000000000000000000100000
0011000110 0000000000000000000000000100000000000000000000000000000001000000
0011100111 0000000000000000000000001000000000000000000000000000000010000000
表1Table 1
这里需要补充说明的是,在图5示出的Hash Value中,高位段HSB的长度为64比特,而在图2示出的Hash Value中,高位段HSB的长度为44比特。因此可以看出,在不同的设计中,高位段HSB的长度是可以变化的,具体可以根据其需要字寻址的SRAM array的字线WL的数量确定,例如高位段HSB的长度所能形成的二进制编码的数量大于或者等于其需要字寻址的SRAM array的字线WL的数量,本申请实施例对此不做具体限定。It should be supplemented here that in the Hash Value shown in FIG. 5 , the length of the high-order segment HSB is 64 bits, while in the Hash Value shown in FIG. 2 , the length of the high-order segment HSB is 44 bits. Therefore, it can be seen that in different designs, the length of the high-order segment HSB can be changed. Specifically, it can be determined according to the number of word lines WL of the SRAM array that needs word addressing. For example, the length of the high-order segment HSB can be formed. The number of binary codes is greater than or equal to the number of word lines WL of the SRAM array that needs word addressing, which is not specifically limited in this embodiment of the present application.
在一种实现方式中,如图5所示,布隆过滤器功能电路还可以设置有锁存器500。锁存器500的输入端用于接收One-hot数组的各个比特的One-hot值,并且将One-hot数组的各个比特的One-hot值锁存起来。锁存器500可以具有与本申请实施例提供的布隆过滤器功能电路的多个电路单元400数量相同的多个输出端,锁存器的多个输出端与多个电路单元400的位寻址输入端410按位一一对应连接,因此锁存器500可以将其锁存的One-hot数组的各个比特的One-hot值一一对应地输入到各个电路单元400中。锁存器500还可以包括控制信号输入端,例如图5中的one_hot_latch_EN端,控制信号输入端用于接收外部控制信号,从而根据外部控制信号将其锁存的One-hot数组的各个比特的One-hot值一一对应地输入到各个电路单元400中。In an implementation manner, as shown in FIG. 5 , the bloom filter function circuit may also be provided with a latch 500 . The input terminal of the latch 500 is used for receiving the One-hot value of each bit of the One-hot array, and latching the One-hot value of each bit of the One-hot array. The latch 500 may have the same number of output terminals as the multiple circuit units 400 of the Bloom filter functional circuit provided in the embodiment of the present application, and the multiple output terminals of the latch are related to the bit search of the multiple circuit units 400 . The address input terminals 410 are connected in one-to-one correspondence, so the latch 500 can input the one-hot value of each bit of the one-hot array latched into each circuit unit 400 in a one-to-one correspondence. The latch 500 may further include a control signal input terminal, such as the one_hot_latch_EN terminal in FIG. 5 , the control signal input terminal is used to receive an external control signal, so as to latch the one-bit of each bit of the One-hot array according to the external control signal. The -hot values are input into the respective circuit units 400 in a one-to-one correspondence.
基于上述结构,布隆过滤器功能电路中的每一个电路单元都可以根据其接收到的One-hot值,对其所在位线BL上的目标Vector的比特位进行按位逻辑操作。如果某个电路单元接收到的One-hot值为1,说明被检测元素映射的一个目标比特位于在该电路单元所在位线BL上。进一步地,如果某个电路单元接收到的One-hot值为1,并且该电路单元所在位线BL上的目标比特的值同样为1,则表示被检测元素的可能存在于目标集合中;如果电路单元接收到的One-hot值为1,并且该电路单元所在位线BL上的目标比特位的值为0,则表示被检测元素一定不存在于目标集合中,说明被检测元素是一个新的元素,这时电路单元可以对目标比特进行写1操作,将目标比特的值更新为1。上述按位逻辑操作可以在各个电路单元中同时进行,从而使得布隆过滤器功能电路同时对被检测元素在目标Vector中的四个目标比特进行检测。Based on the above structure, each circuit unit in the Bloom filter functional circuit can perform a bitwise logical operation on the bits of the target Vector on the bit line BL where it is located according to the received One-hot value. If the One-hot value received by a certain circuit unit is 1, it means that a target bit mapped by the detected element is located on the bit line BL where the circuit unit is located. Further, if the One-hot value received by a certain circuit unit is 1, and the value of the target bit on the bit line BL where the circuit unit is located is also 1, it means that the detected element may exist in the target set; if The One-hot value received by the circuit unit is 1, and the value of the target bit on the bit line BL where the circuit unit is located is 0, which means that the detected element must not exist in the target set, indicating that the detected element is a new one. , then the circuit unit can write 1 to the target bit to update the value of the target bit to 1. The above bitwise logical operations can be performed simultaneously in each circuit unit, so that the Bloom filter function circuit simultaneously detects the four target bits of the detected element in the target Vector.
在一种实现方式中,每个电路单元为实现上述按位逻辑操作,可以包括两个功能电路模块,例如过滤filter电路和更新update电路。其中,filter电路用于从锁存器接收One-hot值,以及在接收到One-hot值为1时,判断相应的目标比特位的值是否同样为1,如果判断目标比特位的值是不为1,则由update电路将该目标比特位的值更新为1。In an implementation manner, each circuit unit may include two functional circuit modules, such as a filter circuit and an update circuit, in order to implement the above-mentioned bitwise logic operation. Among them, the filter circuit is used to receive the One-hot value from the latch, and when receiving the One-hot value of 1, judge whether the value of the corresponding target bit is also 1, and if the value of the target bit is judged to be no If it is 1, the value of the target bit is updated to 1 by the update circuit.
图6是本申请实施例提供的电路单元与存储单元的电路连接示意图。如图6所示,电路单元400的过滤filter电路420和更新update电路430分别通过位线(例如BL和BL#)与存储单元211连接。其中,filter电路420与存储单元211之间的位线上设置有读选择器YSR和灵敏放大器SA,update电路430与存储单元211之间的位线上设置有写选择器YSW。当filter电路420需要从存储单元211读取数据时,读选择器YSR闭合、写选择器YSW断开,使filter电路420从存储单元211读取比特值,当update电路430需要对存储单元211进行数据更新时,读选择器YSR断开、写选择器YSW闭合,使update电路430向存储单元211中写入新的比特值。FIG. 6 is a schematic diagram of a circuit connection between a circuit unit and a storage unit provided by an embodiment of the present application. As shown in FIG. 6 , the filter circuit 420 and the update circuit 430 of the circuit unit 400 are respectively connected to the memory unit 211 through bit lines (eg, BL and BL#). The read selector YSR and the sense amplifier SA are arranged on the bit line between the filter circuit 420 and the storage unit 211 , and the write selector YSW is arranged on the bit line between the update circuit 430 and the storage unit 211 . When the filter circuit 420 needs to read data from the storage unit 211, the read selector YSR is closed and the write selector YSW is opened, so that the filter circuit 420 reads the bit value from the storage unit 211. When data is updated, the read selector YSR is opened and the write selector YSW is closed, so that the update circuit 430 writes a new bit value into the storage unit 211 .
在一种实现方式中,存储单元211与filter电路4204和update电路430均可以两条位线连接,为便于描述,这里将这两条位线标记为位线BL和位线BL#。存储单元211中的比特值可以根据位线BL和位线BL#的电平确定,例如,当位线BL为高电平、位线BL#为低电平时,对应存储单元211中的比特值为1,当位线BL为低电平、位线BL#为高电平时,对应存储单元211的比特值为0。In an implementation manner, the storage unit 211, the filter circuit 4204 and the update circuit 430 can be connected by two bit lines. For the convenience of description, the two bit lines are marked as bit line BL and bit line BL# here. The bit value in the storage unit 211 can be determined according to the levels of the bit line BL and the bit line BL#. For example, when the bit line BL is at a high level and the bit line BL# is at a low level, the corresponding bit value in the storage unit 211 If it is 1, when the bit line BL is at a low level and the bit line BL# is at a high level, the bit value corresponding to the memory cell 211 is 0.
进一步如图6所示,filter电路420包括有一个数据输入端Q#,位线BL和位线BL#分别与灵敏放大器SA的两个输入端,而灵敏放大器SA的输出则与filter电路420的数据输入端Q#连接,使得filter电路420可以从存储单元211中读取数据。update电路430包括两个输出端Y2和Y3,这两个输出端Y2和Y3分别与位线BL和位线BL#连接,使得update电路430 可以通过在两个输出端Y2和Y3输出不同的电平对存储单元211进行写入更新。Further as shown in FIG. 6 , the filter circuit 420 includes a data input terminal Q#, the bit line BL and the bit line BL# are respectively connected with two input terminals of the sense amplifier SA, and the output of the sense amplifier SA is connected with the filter circuit 420. The data input terminal Q# is connected so that the filter circuit 420 can read data from the storage unit 211 . The update circuit 430 includes two output terminals Y2 and Y3, which are respectively connected to the bit line BL and the bit line BL#, so that the update circuit 430 can output different voltages through the two output terminals Y2 and Y3. The storage unit 211 is updated by writing.
进一步如图6所示,filter电路420还包括位寻址输入端Translated Hash Value,用于接收外部输入的位寻址数据的比特值。As further shown in FIG. 6 , the filter circuit 420 further includes a bit-addressable input terminal Translated Hash Value, which is used for receiving the bit value of the bit-addressable data input from the outside.
图7是本申请实施例提供的filter电路的结构示意图。如图7所示,每个filter电路可以包括三个N型场效应管(N-channel field-effect transistor,NFET),为便于描述,这里三个N型场效应管分别称作第一N型场效应管NFET1、第二N型场效应管NFET2和第三N型场效应管NFET3。其中,第一N型场效应管NFET1的源极S接地GND;第一N型场效应管NFET1的栅极G作为电路单元的位寻址输入端Translated Hash Value可以与锁存器的输出端连接;第一N型场效应管NFET1的漏极D与第二N型场效应管NFET2的源极S连接;第二N型场效应管NFET2的栅极G作为filter电路的数据输入端Q#,与灵敏放大器SA的输出端连接;第二N型场效应管NFET2的漏极D与第三N型场效应管NFET3的源极S连接,第三N型场效应管NFET3的栅极G作为filter电路的过滤使能信号输入端Filter_En,第三N型场效应管NFET3的漏极D作为filter电路的过滤输出端Filter_Done。FIG. 7 is a schematic structural diagram of a filter circuit provided by an embodiment of the present application. As shown in FIG. 7 , each filter circuit may include three N-channel field-effect transistors (NFETs). For ease of description, the three N-type field-effect transistors are referred to as the first N-type FETs, respectively. Field effect transistor NFET1, second N-type field effect transistor NFET2 and third N-type field effect transistor NFET3. Among them, the source S of the first N-type field effect transistor NFET1 is grounded to GND; the gate G of the first N-type field effect transistor NFET1 is used as the bit addressing input terminal of the circuit unit. Translated Hash Value can be connected to the output terminal of the latch The drain D of the first N-type field effect transistor NFET1 is connected with the source S of the second N-type field effect transistor NFET2; the gate G of the second N-type field effect transistor NFET2 is used as the data input terminal Q# of the filter circuit, It is connected to the output end of the sense amplifier SA; the drain D of the second N-type field effect transistor NFET2 is connected to the source S of the third N-type field effect transistor NFET3, and the gate G of the third N-type field effect transistor NFET3 is used as a filter. The filter enable signal input terminal Filter_En of the circuit, and the drain D of the third N-type field effect transistor NFET3 is used as the filter output terminal Filter_Done of the filter circuit.
本申请实施例中,所有电路单元的filter电路可以共用一条过滤输出端Filter_Done总线,并且该过滤输出端Filter_Done总线上还连接有一个用于所有电路单元的filter电路共用的P型场效应管PFET,该P型场效应管PFET可以视作是filter电路的一部分。其中,P型场效应管PFET的源极S耦合至高电位VDD,P型场效应管PFET的漏极D连接至过滤输出端Filter_Done总线,P型场效应管PFET的栅极G作为各个电路单元的预充电信号输入端Pre_Ch。In the embodiment of the present application, the filter circuits of all circuit units can share a filter output terminal Filter_Done bus, and the filter output terminal Filter_Done bus is also connected with a P-type field effect transistor PFET shared by the filter circuits of all circuit units, The P-type field effect transistor PFET can be regarded as a part of the filter circuit. Among them, the source S of the P-type field effect transistor PFET is coupled to the high potential VDD, the drain D of the P-type field effect transistor PFET is connected to the filter output terminal Filter_Done bus, and the gate G of the P-type field effect transistor PFET is used as the gate of each circuit unit. Pre-charge signal input terminal Pre_Ch.
图8是本申请实施例提供的一种update电路的结构示意图。如图8所示,每个update电路可以包括至少一个与门AND单元AND1、一个三态缓存器TSB1、一个反向三态缓存器TSB2和两个数据选择器DS1和DS2。FIG. 8 is a schematic structural diagram of an update circuit provided by an embodiment of the present application. As shown in FIG. 8, each update circuit may include at least one AND gate AND unit AND1, one tri-state buffer TSB1, one inverse tri-state buffer TSB2, and two data selectors DS1 and DS2.
其中,与门单元AND1包括两个输入端A1和B1,以及一个输出端Y1;与门单元AND1的输入端A1与过滤输出端Filter_Done连接,用于接收过滤输出端Filter_Done的取反信号;与门单元AND1的输入端B1作为update电路的写使能信号输入端WR_EN,用于接收写使能信号;与门单元AND1的输出端Y1与数据选择器DS1的第二输入端B2连接。Among them, the AND gate unit AND1 includes two input terminals A1 and B1, and an output terminal Y1; the input terminal A1 of the AND gate unit AND1 is connected to the filter output terminal Filter_Done, and is used to receive the inversion signal of the filter output terminal Filter_Done; AND gate The input terminal B1 of the unit AND1 is used as the write enable signal input terminal WR_EN of the update circuit to receive the write enable signal; the output terminal Y1 of the AND gate unit AND1 is connected to the second input terminal B2 of the data selector DS1.
数据选择器DS1的第一输入端A2与写使能信号输入端WR_EN连接,用于接收写使能信号;数据选择器DS1的数据选择端S1与电路单元的工作模式选择端口CIN_MODE连接,用于接收工作模式选择信号,其中,电路单元的工作模式可以包括传统模式和存内运算模式;数据选择器DS1输出端Z1分别与三态缓存器TSB1的使能端E1和反向三态缓存器TSB2的使能端E2连接。The first input terminal A2 of the data selector DS1 is connected to the write enable signal input terminal WR_EN for receiving the write enable signal; the data selection terminal S1 of the data selector DS1 is connected to the operating mode selection port CIN_MODE of the circuit unit for use in Receive a working mode selection signal, wherein the working mode of the circuit unit may include a traditional mode and an in-memory operation mode; the output terminal Z1 of the data selector DS1 is respectively connected with the enabling terminal E1 of the tri-state buffer TSB1 and the reverse tri-state buffer TSB2 The enable terminal E2 is connected.
数据选择器DS2的第一输入端A3与电路单元的数据输入端D_in连接,用于在传统模式下接收待写入存储单元中的数据;数据选择器DS2的第二输入端B3与高电位或者电路单元的位寻址输入端Translated Hash Value连接;数据选择器DS2的数据选择端S2与电路单元的工作模式选择端口CIN_MODE连接,用于接收工作模式选择信号;数据选择器DS2的输出端Z2分别与三态缓存器TSB1的输入端A4和反向三态缓存器TSB2的输入端A5连接。其中,当工作模式选择端口CIN_MODE的输入信号为低电平时,该电路单元工作在传统模式,执行常规的SRAM写入功能,即从数据输入端D_in接收数据,并通过数据选择器DS2和三态缓存器TSB1、TSB2写入到存储单元中,当工作模式选择端口CIN_MODE的输入信号为高电平时,电路单元工作在存内计算模式,执行布隆过滤器的功能。The first input end A3 of the data selector DS2 is connected to the data input end D_in of the circuit unit, and is used to receive the data to be written in the storage unit in the conventional mode; the second input end B3 of the data selector DS2 is connected to a high potential or The bit addressing input terminal Translated Hash Value of the circuit unit is connected; the data selection terminal S2 of the data selector DS2 is connected with the working mode selection port CIN_MODE of the circuit unit for receiving the working mode selection signal; the output terminal Z2 of the data selector DS2 is respectively It is connected to the input terminal A4 of the tri-state buffer TSB1 and the input terminal A5 of the reverse tri-state buffer TSB2. Among them, when the input signal of the working mode selection port CIN_MODE is low level, the circuit unit works in the traditional mode, and performs the conventional SRAM write function, that is, receives data from the data input terminal D_in, and passes through the data selector DS2 and tri-state The registers TSB1 and TSB2 are written into the storage unit. When the input signal of the working mode selection port CIN_MODE is at a high level, the circuit unit works in the memory calculation mode and performs the function of the Bloom filter.
三态缓存器TSB1的输出端Y2与位线BL连接;当三态缓存器TSB1的使能端E1输入 低信号0时,三态缓存器TSB1为高阻状态,不能进行数据传输,当三态缓存器TSB1的使能端E1输入高信号1时,其输出值等于输入值。The output terminal Y2 of the tri-state buffer TSB1 is connected to the bit line BL; when the enable terminal E1 of the tri-state buffer TSB1 inputs a low signal 0, the tri-state buffer TSB1 is in a high-impedance state and cannot perform data transmission. When the high signal 1 is input to the enable terminal E1 of the buffer TSB1, its output value is equal to the input value.
反向三态缓存器TSB2的输出端Y3与位线BL#连接;当反向三态缓存器TSB2的使能端E2输入低信号0时,反向三态缓存器TSB2为高阻状态,不能进行数据传输,当反向三态缓存器TSB2的使能端E2输入高信号1时,其输出值等于输入值的取反。The output terminal Y3 of the reverse three-state buffer TSB2 is connected to the bit line BL#; when the enable terminal E2 of the reverse three-state buffer TSB2 inputs a low signal 0, the reverse three-state buffer TSB2 is in a high-impedance state and cannot be For data transmission, when the enable terminal E2 of the reverse tri-state buffer TSB2 inputs a high signal 1, its output value is equal to the inversion of the input value.
基于图7示出的filter电路结构和图8示出的update电路结构,图9是本申请实施例提供的电路单元400与存储单元211连接的具体电路图。结合图9中还可以看出,每个存储单元211可以包括两个反向设置的反向三态缓存器,以及设置在两个反向三态缓存器两端的两个场效应管FET,两个场效应管FET的栅极G连接至字线WL,其中一个场效应管FET的漏极D/源极S连接至位线BL,另一个场效应管FET的源极S/漏极D连接至位线BL#。需要补充说明的是,存储单元211的电路结构属于本领域现有技术,因此中示出的存储单元211结构仅作为一个示例,不构成对本申请实施例的技术方案的具体限定。Based on the filter circuit structure shown in FIG. 7 and the update circuit structure shown in FIG. 8 , FIG. 9 is a specific circuit diagram of the connection between the circuit unit 400 and the storage unit 211 provided by the embodiment of the present application. It can also be seen in conjunction with FIG. 9 that each memory unit 211 may include two inverted tri-state buffers arranged in opposite directions, and two field effect transistor FETs arranged at both ends of the two inverted tri-state buffers. The gates G of the FETs are connected to the word line WL, the drain D/source S of one FET is connected to the bit line BL, and the source S/drain D of the other FET is connected to bit line BL#. It should be added that the circuit structure of the storage unit 211 belongs to the prior art in the art, so the structure of the storage unit 211 shown in the figure is only an example, and does not constitute a specific limitation to the technical solutions of the embodiments of the present application.
针对图9示出的电路单元,本申请实施例还提供了一种电路控制方法。该电路控制方法可用于图9示出的电路单元,以使电路单元实现布隆过滤器功能。For the circuit unit shown in FIG. 9 , an embodiment of the present application further provides a circuit control method. The circuit control method can be used for the circuit unit shown in FIG. 9 , so that the circuit unit can realize the function of bloom filter.
图10是本申请实施例提供的电路控制方法的时序图。在图10中,one_hot_latch_EN表示锁存器的控制信号输入端的信号,CLK表示时钟信号,Pre_Ch表示预充电信号输入端Pre_Ch的信号,Filter_Done表示电路单元的过滤输出端Filter_Done的信号,Filter_En表示电路单元的过滤使能信号输入端Filter_En的信号,WR_EN表示电路单元的写使能信号输入端WR_EN的信号。FIG. 10 is a sequence diagram of a circuit control method provided by an embodiment of the present application. In Figure 10, one_hot_latch_EN represents the signal of the control signal input terminal of the latch, CLK represents the clock signal, Pre_Ch represents the signal of the pre-charge signal input terminal Pre_Ch, Filter_Done represents the signal of the filter output terminal Filter_Done of the circuit unit, Filter_En represents the signal of the circuit unit's filter output terminal The signal of the filter enable signal input terminal Filter_En, WR_EN represents the signal of the write enable signal input terminal WR_EN of the circuit unit.
其中,当Pre_Ch为低电平时,表示接收到有效的预充电命令,此时P型场效应管PFET导通;当Pre_Ch为高电平时,表示未接收到有效的预充电命令,此时P型场效应管PFET断开。当Filter_En为高电平时,表示接收到有效的过滤寻址命令,此时第三N型场效应管NFET3导通;当Filter_En为低电平时,表示未接收到有效的过滤寻址命令,此时第三N型场效应管NFET3断开。Among them, when Pre_Ch is low, it means that a valid precharge command is received, and the P-type field effect transistor PFET is turned on; when Pre_Ch is high, it means that no valid precharge command has been received, and the P-type The FET PFET is turned off. When Filter_En is high, it means that a valid filtering addressing command is received, and the third N-type field effect transistor NFET3 is turned on; when Filter_En is low, it means that no valid filtering addressing command has been received, at this time The third N-type field effect transistor NFET3 is turned off.
本申请实施例提供中,布隆过滤器功能电路的各个电路单元通过执行本申请实施例提供的电路控制方法,可以在一个时钟周期内完成布隆过滤器的寻址和写入更新功能。下面结合图10示出的时序图,对本申请实施例的控制方法的一个时钟周期进行示例性说明。其中,当电路单元执行布隆过滤器功能时,其工作模式选择端口CIN_MODE的输入信号为高电平信号。In the embodiments of the present application, each circuit unit of the Bloom filter functional circuit can complete the addressing and writing update functions of the Bloom filter within one clock cycle by executing the circuit control method provided by the embodiments of the present application. One clock cycle of the control method of the embodiment of the present application is exemplarily described below with reference to the timing diagram shown in FIG. 10 . Wherein, when the circuit unit performs the function of Bloom filter, the input signal of the working mode selection port CIN_MODE is a high level signal.
在CLK信号的上升沿到来之前,预充电信号输入端Pre_Ch为高电平,P型场效应管PFET为断开状态,使过滤输出端Filter_Done为低电平,另外,过滤使能信号输入端Filter_En为高电平,写使能信号输入端WR_EN为高电平。在此期间,one_hot_latch_EN首先为低电平,Hash Value经过One-hot编码后得到的One-hot数组被送入到锁存器中;随后,one_hot_latch_EN由低电平翻转至高电平,这时锁存器将其锁存的One-hot数组的各个比特按位输入到各个电路单元的位寻址输入端Translated Hash Value。Before the rising edge of the CLK signal comes, the pre-charge signal input terminal Pre_Ch is high level, the P-type field effect transistor PFET is in the off state, so that the filter output terminal Filter_Done is low level, in addition, the filter enable signal input terminal Filter_En It is high level, and the write enable signal input terminal WR_EN is high level. During this period, one_hot_latch_EN is first low level, and the One-hot array obtained by Hash Value after One-hot encoding is sent to the latch; then, one_hot_latch_EN is flipped from low level to high level, then latch The controller inputs each bit of the One-hot array it latches into the bit-addressable input terminal Translated Hash Value of each circuit unit.
在CLK信号的上升沿到来时,Pre_Ch由高电平翻转至低电平,将Filter_Done总线的电平拉高至高电平,从而完成对Filter_Done总线的预充电,与此同时,Filter_En由高电平翻转至低电平,WR_EN由高电平翻转至低电平,初始化阶段结束,电路单元进入工作阶段。这时,与门单元AND1的输出端Y1根据Filter_Done信号和WR_EN信号输出低电平,数据选择器DS1向三态缓存器TSB1和反向三态缓存器TSB2的使能端E1和E2输出低电平,使三态缓 存器TSB1和反向三态缓存器TSB2处于高阻状态,不进行数据传输。When the rising edge of the CLK signal arrives, Pre_Ch is flipped from high level to low level, and the level of Filter_Done bus is pulled up to high level, thus completing the precharging of Filter_Done bus. At the same time, Filter_En is changed from high level to high level. Flip to low level, WR_EN flips from high level to low level, the initialization phase ends, and the circuit unit enters the working phase. At this time, the output terminal Y1 of the AND gate unit AND1 outputs a low level according to the Filter_Done signal and the WR_EN signal, and the data selector DS1 outputs a low level to the enable terminals E1 and E2 of the tri-state buffer TSB1 and the reverse tri-state buffer TSB2 level, so that the tri-state buffer TSB1 and the reverse tri-state buffer TSB2 are in a high-impedance state, and no data transmission is performed.
在CLK信号的下降沿到来时,Pre_Ch由低电平翻转至高电平,Filter_En由低电平翻转至高电平,WR_EN由低电平翻转至高电平,此时filter电路开始进行按位逻辑操作。该按位逻辑操作具体包括:当存储单元中的比特值为1时,位线BL输出高电平,位线BL#输出低电平,灵敏放大器SA输出低电平;当存储单元中的比特值为0时,位线BL输出低电平,位线BL#输出高电平,灵敏放大器SA输出高电平。如果filter电路的数据输入端Q#从接收到灵敏放大器SA的高电平信号,并且filter电路的位寻址输入端Translated Hash Value(第一N型场效应管NFET1的栅极G)接收到高电平信号,那么三个NFET(即第一N型场效应管NFET1、第二N型场效应管NFET2和第三N型场效应管NFET3)就会导通,从而将Filter_Done拉低至低电平;否则,三个NFET不会导通,Filter_Done将继续保持在高电平。When the falling edge of the CLK signal arrives, Pre_Ch flips from low level to high level, Filter_En flips from low level to high level, and WR_EN flips from low level to high level. At this time, the filter circuit starts to perform bitwise logic operations. The bitwise logic operation specifically includes: when the bit value in the storage unit is 1, the bit line BL outputs a high level, the bit line BL# outputs a low level, and the sense amplifier SA outputs a low level; When the value is 0, the bit line BL outputs a low level, the bit line BL# outputs a high level, and the sense amplifier SA outputs a high level. If the data input terminal Q# of the filter circuit receives a high level signal from the sense amplifier SA, and the bit addressing input terminal Translated Hash Value of the filter circuit (the gate G of the first N-type field effect transistor NFET1) receives a high level signal level signal, then the three NFETs (ie the first N-type field effect transistor NFET1, the second N-type field effect transistor NFET2 and the third N-type field effect transistor NFET3) will be turned on, thereby pulling Filter_Done down to a low level level; otherwise, the three NFETs will not be turned on and Filter_Done will remain high.
基于上述配置,当Filter_Done被拉低至低电平时,意味着存储单元中的比特值为0,filter电路的位寻址输入端Translated Hash Value输入的One-hot值为1,说明这个存储单元对应被检测元素映射的一个目标比特,并且被检测元素不在目标Vector中,属于新的元素,因此需要对存储单元中的比特值进行更新,此时,update电路会被激活。Based on the above configuration, when Filter_Done is pulled down to a low level, it means that the bit value in the storage unit is 0, and the One-hot value input by the bit-addressable input terminal Translated Hash Value of the filter circuit is 1, indicating that this storage unit corresponds to A target bit mapped by the detected element, and the detected element is not in the target Vector, it belongs to a new element, so the bit value in the storage unit needs to be updated, at this time, the update circuit will be activated.
update电路被激活后,即开始执行写入更新操作。该写入更新操作具体可以包括:一方面,与门单元AND1的输出端Y1根据Filter_Done信号和WR_EN信号输出高电平,使得数据选择器DS1向三态缓存器TSB1和反向三态缓存器TSB2的使能端E1和E2输出高电平,将三态缓存器TSB1和反向三态缓存器TSB2设置为数据输出状态;另一方面,数据选择器DS2向三态缓存器TSB1和反向三态缓存器TSB2的输入端A4和A5输入高电平或者位寻址输入端Translated Hash Value的信号(对应One-hot值为1,同样为高电平),使得三态缓存器TSB1的输出端Y2向位线BL输出高电平,而三态缓存器TSB2的输出端Y3向位线BL#输出低电平(即高电平的取反信号),由此将存储单元的比特值更新为1。After the update circuit is activated, the write update operation starts. The write update operation may specifically include: on the one hand, the output terminal Y1 of the AND gate unit AND1 outputs a high level according to the Filter_Done signal and the WR_EN signal, so that the data selector DS1 sends the tri-state buffer TSB1 and the reverse tri-state buffer TSB2 The enable terminals E1 and E2 output high level, set the tri-state buffer TSB1 and the reverse tri-state buffer TSB2 to the data output state; on the other hand, the data selector DS2 sends the tri-state buffer TSB1 and the reverse three-state buffer The input terminals A4 and A5 of the state buffer TSB2 input high level or the signal of the Translated Hash Value of the bit addressing input terminal (corresponding to the One-hot value of 1, which is also high level), so that the output terminal of the three-state buffer TSB1 Y2 outputs a high level to the bit line BL, and the output terminal Y3 of the tri-state buffer TSB2 outputs a low level (ie, the inverted signal of the high level) to the bit line BL#, thereby updating the bit value of the memory cell to 1.
至此,电路单元即完成了一次布隆过滤器的寻址和写入更新流程。So far, the circuit unit has completed the addressing and writing update process of the Bloom filter.
另外,在CLK信号的下降沿到来时,one_hot_latch_EN可以由高电平翻转至低电平,此时锁存器解除其已经所述的One-hot数据,等待新的One-hot数据输入。In addition, when the falling edge of the CLK signal arrives, one_hot_latch_EN can be flipped from a high level to a low level. At this time, the latch releases the one-hot data it has already described and waits for new one-hot data to be input.
由以上技术方案可知,本申请实施例提供的布隆过滤器电路可以设置于存储器中,当处理器需要执行布隆过滤器操作时,布隆过滤器电路只需要从处理器接收寻址数据,其余的寻址和写入更新流程就都可以由布隆过滤器电路根据寻址数据在存储器内完成,不需要处理器参与,因此存储器与处理器之间的总线上不会产生过多的数据迁移,避免出现总线冲突,另外,本申请实施例提供的布隆过滤器电路还能够实现在一个指令周期cycle内完成布隆过滤器的寻址和写入更新流程,缩短了系统响应时长,提高了布隆过滤器的效率。It can be seen from the above technical solutions that the bloom filter circuit provided in the embodiment of the present application can be provided in the memory, and when the processor needs to perform the bloom filter operation, the bloom filter circuit only needs to receive addressing data from the processor, The rest of the addressing and writing update processes can be completed in the memory by the Bloom filter circuit according to the addressing data, without the involvement of the processor, so there will not be too much data migration on the bus between the memory and the processor. , to avoid bus conflicts. In addition, the bloom filter circuit provided by the embodiment of the present application can also realize the addressing and writing update process of the bloom filter in one instruction cycle cycle, which shortens the system response time and improves the Bloom filter efficiency.
图11是本申请实施例提供的另一种update电路的结构示意图。如图11所示,每个update电路可以包括至少一个三态缓存器TSB1、一个反向三态缓存器TSB2和两个数据选择器DS1和DS2。图11示出的update电路与图8示出的update电路的区别在于:不包括与门AND单元AND1。其中,数据选择器DS1的第二输入端B2与过滤输出端Filter_Done连接,用于直接接收过滤输出端Filter_Done的取反信号;数据选择器DS1的第一输入端A2作为update电路的写使能信号输入端WR_EN,用于接收写使能信号。图11示出的update电路的其余实现方式与图8示出的update电路相同,此处不再赘述。FIG. 11 is a schematic structural diagram of another update circuit provided by an embodiment of the present application. As shown in FIG. 11, each update circuit may include at least one tri-state buffer TSB1, an inverse tri-state buffer TSB2, and two data selectors DS1 and DS2. The difference between the update circuit shown in FIG. 11 and the update circuit shown in FIG. 8 is that the AND gate AND unit AND1 is not included. Wherein, the second input end B2 of the data selector DS1 is connected to the filter output end Filter_Done for directly receiving the inversion signal of the filter output end Filter_Done; the first input end A2 of the data selector DS1 is used as the write enable signal of the update circuit The input terminal WR_EN is used to receive the write enable signal. The rest of the implementation manners of the update circuit shown in FIG. 11 are the same as those of the update circuit shown in FIG. 8 , which will not be repeated here.
基于图7示出的filter电路结构和图11示出的update电路结构,图12是本申请实施例提供的电路单元400与存储单元211连接的具体电路图。图12示出的连接方式与图9示出的 连接方式类似,每个存储单元211可以包括两个反向设置的反向三态缓存器,以及设置在两个反向三态缓存器两端的两个场效应管FET,两个场效应管FET的栅极G连接至字线WL,其中一个场效应管FET的漏极D/源极S连接至位线BL,另一个场效应管FET的源极S/漏极D连接至位线BL#。需要补充说明的是,存储单元211的电路结构属于本领域现有技术,因此中示出的存储单元211结构仅作为一个示例,不构成对本申请实施例的技术方案的具体限定。Based on the filter circuit structure shown in FIG. 7 and the update circuit structure shown in FIG. 11 , FIG. 12 is a specific circuit diagram of the connection between the circuit unit 400 and the storage unit 211 provided by the embodiment of the present application. The connection mode shown in FIG. 12 is similar to the connection mode shown in FIG. 9 , each storage unit 211 may include two reverse tri-state buffers, and two reverse tri-state buffers arranged at both ends of the two reverse tri-state buffers Two FETs, the gate G of the two FETs is connected to the word line WL, the drain D/source S of one FET is connected to the bit line BL, and the other FET's The source S/drain D is connected to the bit line BL#. It should be added that the circuit structure of the storage unit 211 belongs to the prior art in the art, so the structure of the storage unit 211 shown in the figure is only an example, and does not constitute a specific limitation to the technical solutions of the embodiments of the present application.
针对图12示出的电路单元,本申请实施例还提供了一种电路控制方法。该电路控制方法可用于图12示出的电路单元,以使电路单元实现布隆过滤器功能。For the circuit unit shown in FIG. 12 , an embodiment of the present application further provides a circuit control method. This circuit control method can be used for the circuit unit shown in FIG. 12 , so that the circuit unit can realize the function of bloom filter.
图13是本申请实施例提供的电路控制方法的时序图。在图13中,one_hot_latch_EN表示锁存器的控制信号输入端的信号,CLK表示时钟信号,Pre_Ch表示预充电信号输入端Pre_Ch的信号,Filter_Done表示电路单元的过滤输出端Filter_Done的信号,Filter_En表示电路单元的过滤使能信号输入端Filter_En的信号。FIG. 13 is a sequence diagram of a circuit control method provided by an embodiment of the present application. In FIG. 13, one_hot_latch_EN represents the signal of the control signal input terminal of the latch, CLK represents the clock signal, Pre_Ch represents the signal of the precharge signal input terminal Pre_Ch, Filter_Done represents the signal of the filter output terminal Filter_Done of the circuit unit, Filter_En represents the signal of the circuit unit Filter enable signal input Filter_En signal.
本申请实施例提供中,布隆过滤器功能电路的各个电路单元通过执行本申请实施例提供的电路控制方法,可以在一个时钟周期内完成布隆过滤器的寻址和写入更新功能。下面结合图13示出的时序图,对本申请实施例的控制方法的一个时钟周期进行示例性说明。其中,当电路单元执行布隆过滤器功能时,其工作模式选择端口CIN_MODE的输入信号为高电平信号。In the embodiments of the present application, each circuit unit of the Bloom filter functional circuit can complete the addressing and writing update functions of the Bloom filter within one clock cycle by executing the circuit control method provided by the embodiments of the present application. One clock cycle of the control method of the embodiment of the present application is exemplarily described below with reference to the timing diagram shown in FIG. 13 . Wherein, when the circuit unit performs the function of Bloom filter, the input signal of the working mode selection port CIN_MODE is a high level signal.
在CLK信号的上升沿到来之前,预充电信号输入端Pre_Ch为高电平,P型场效应管PFET为断开状态,使过滤输出端Filter_Done为低电平,另外,过滤使能信号输入端Filter_En为高电平。在此期间,one_hot_latch_EN首先为低电平,Hash Value经过One-hot编码后得到的One-hot数组被送入到锁存器中;随后,one_hot_latch_EN由低电平翻转至高电平,这时锁存器将其锁存的One-hot数组的各个比特按位输入到各个电路单元的位寻址输入端Translated Hash Value。Before the rising edge of the CLK signal comes, the pre-charge signal input terminal Pre_Ch is high level, the P-type field effect transistor PFET is in the off state, so that the filter output terminal Filter_Done is low level, in addition, the filter enable signal input terminal Filter_En to high level. During this period, one_hot_latch_EN is first low level, and the One-hot array obtained by Hash Value after One-hot encoding is sent to the latch; then, one_hot_latch_EN is flipped from low level to high level, then latch The controller inputs each bit of the One-hot array it latches into the bit-addressable input terminal Translated Hash Value of each circuit unit.
在CLK信号的上升沿到来时,Pre_Ch由高电平翻转至低电平,将Filter_Done总线的电平拉高至高电平,从而完成对Filter_Done总线的预充电,与此同时,Filter_En由高电平翻转至低电平,初始化阶段结束,电路单元进入工作阶段。这时,数据选择器DS1向三态缓存器TSB1和反向三态缓存器TSB2的使能端E1和E2输出低电平,使三态缓存器TSB1和反向三态缓存器TSB2处于高阻状态,不进行数据传输。When the rising edge of the CLK signal arrives, Pre_Ch is flipped from high level to low level, and the level of Filter_Done bus is pulled up to high level, thus completing the precharging of Filter_Done bus. At the same time, Filter_En is changed from high level to high level. Inverted to low level, the initialization phase ends, and the circuit unit enters the working phase. At this time, the data selector DS1 outputs a low level to the enable terminals E1 and E2 of the tri-state buffer TSB1 and the inverse tri-state buffer TSB2, so that the tri-state buffer TSB1 and the inverse tri-state buffer TSB2 are in high impedance status, no data transfer is performed.
在CLK信号的下降沿到来时,Pre_Ch由低电平翻转至高电平,Filter_En由低电平翻转至高电平,此时filter电路开始进行按位逻辑操作。该按位逻辑操作具体包括:当存储单元中的比特值为1时,位线BL输出高电平,位线BL#输出低电平,灵敏放大器SA输出低电平;当存储单元中的比特值为0时,位线BL输出低电平,位线BL#输出高电平,灵敏放大器SA输出高电平。如果filter电路的数据输入端Q#从接收到灵敏放大器SA的高电平信号,并且filter电路的位寻址输入端Translated Hash Value(第一N型场效应管NFET1的栅极G)接收到高电平信号,那么三个NFET(即第一N型场效应管NFET1、第二N型场效应管NFET2和第三N型场效应管NFET3)就会导通,从而将Filter_Done拉低至低电平;否则,三个NFET不会导通,Filter_Done将继续保持在高电平。When the falling edge of the CLK signal arrives, Pre_Ch is flipped from low level to high level, and Filter_En is flipped from low level to high level. At this time, the filter circuit starts to perform bitwise logic operations. The bitwise logic operation specifically includes: when the bit value in the storage unit is 1, the bit line BL outputs a high level, the bit line BL# outputs a low level, and the sense amplifier SA outputs a low level; When the value is 0, the bit line BL outputs a low level, the bit line BL# outputs a high level, and the sense amplifier SA outputs a high level. If the data input terminal Q# of the filter circuit receives a high level signal from the sense amplifier SA, and the bit addressing input terminal Translated Hash Value of the filter circuit (the gate G of the first N-type field effect transistor NFET1) receives a high level signal level signal, then the three NFETs (ie the first N-type field effect transistor NFET1, the second N-type field effect transistor NFET2 and the third N-type field effect transistor NFET3) will be turned on, thereby pulling Filter_Done down to a low level level; otherwise, the three NFETs will not be turned on and Filter_Done will remain high.
基于上述配置,当Filter_Done被拉低至低电平时,意味着存储单元中的比特值为0,filter电路的位寻址输入端Translated Hash Value输入的One-hot值为1,说明这个存储单元对应被检测元素映射的一个目标比特,并且被检测元素不在目标Vector中,属于新的元素,因此需 要对存储单元中的比特值进行更新,此时,update电路会被激活。Based on the above configuration, when Filter_Done is pulled down to a low level, it means that the bit value in the storage unit is 0, and the One-hot value input by the bit-addressable input terminal Translated Hash Value of the filter circuit is 1, indicating that this storage unit corresponds to A target bit mapped by the detected element, and the detected element is not in the target Vector, but belongs to a new element. Therefore, the bit value in the storage unit needs to be updated. At this time, the update circuit will be activated.
update电路被激活后,即开始执行写入更新操作。该写入更新操作具体可以包括:由于Filter_Done信号为低电平,使得数据选择器DS1向三态缓存器TSB1和反向三态缓存器TSB2的使能端E1和E2输出高电平,将三态缓存器TSB1和反向三态缓存器TSB2设置为数据输出状态;另一方面,数据选择器DS2向三态缓存器TSB1和反向三态缓存器TSB2的输入端A4和A5输入高电平或者位寻址输入端Translated Hash Value的信号(对应One-hot值为1,同样为高电平),使得三态缓存器TSB1的输出端Y2向位线BL输出高电平,而三态缓存器TSB2的输出端Y3向位线BL#输出低电平(即高电平的取反信号),由此将存储单元的比特值更新为1。After the update circuit is activated, the write update operation starts. The write update operation may specifically include: because the Filter_Done signal is at a low level, the data selector DS1 outputs a high level to the enabling terminals E1 and E2 of the tri-state buffer TSB1 and the reverse tri-state buffer TSB2, and the three The state buffer TSB1 and the reverse three-state buffer TSB2 are set to the data output state; on the other hand, the data selector DS2 inputs a high level to the input terminals A4 and A5 of the three-state buffer TSB1 and the reverse three-state buffer TSB2 Or the signal of the Translated Hash Value of the bit addressing input terminal (corresponding to the One-hot value of 1, which is also a high level), makes the output terminal Y2 of the tri-state buffer TSB1 output a high level to the bit line BL, and the tri-state buffer outputs a high level to the bit line BL. The output terminal Y3 of the device TSB2 outputs a low level (ie, an inversion signal of a high level) to the bit line BL#, thereby updating the bit value of the memory cell to 1.
至此,电路单元即完成了一次布隆过滤器的寻址和写入更新流程。So far, the circuit unit has completed the addressing and writing update process of the Bloom filter.
另外,在CLK信号的下降沿到来时,one_hot_latch_EN可以由高电平翻转至低电平,此时锁存器解除其已经所述的One-hot数据,等待新的One-hot数据输入。In addition, when the falling edge of the CLK signal arrives, one_hot_latch_EN can be flipped from a high level to a low level. At this time, the latch releases the one-hot data it has already described and waits for new one-hot data to be input.
由以上技术方案可知,本申请实施例提供的布隆过滤器电路可以设置于存储器中,当处理器需要执行布隆过滤器操作时,布隆过滤器电路只需要从处理器接收寻址数据,其余的寻址和写入更新流程就都可以由布隆过滤器电路根据寻址数据在存储器内完成,不需要处理器参与,因此存储器与处理器之间的总线上不会产生过多的数据迁移,避免出现总线冲突,另外,本申请实施例提供的布隆过滤器电路还能够实现在一个指令周期cycle内完成布隆过滤器的寻址和写入更新流程,缩短了系统响应时长,提高了布隆过滤器的效率。对比图9和图11的结构,以及图11和图13的时序图可知,针对图9和图11的结构的结构,电路控制方法的区别在于:在针对图9的电路控制方法中,三态缓存器TSB1和反向三态缓存器TSB2的工作状态由Filter_Done信号和WR_EN信号控制,而在针对图11的电路控制方法中,三态缓存器TSB1和反向三态缓存器TSB2的工作状态仅由Filter_Done信号控制。其中,针对图9的电路控制方法由于采用了Filter_Done信号和WR_EN信号的双重控制方案,可以实现额外的阻止写入更新的功能,例如,当不希望对存储单元中的比特值进行更新时,可以将WR_EN信号保持在低电平,这样,当update电路被激活后,由于WR_EN信号为低电平,数据选择器DS1向三态缓存器TSB1和反向三态缓存器TSB2的使能端E1和E2输出低电平,使三态缓存器TSB1和反向三态缓存器TSB2处于高阻状态,不进行数据传输,实现阻止写入更新。It can be seen from the above technical solutions that the bloom filter circuit provided in the embodiment of the present application can be provided in the memory, and when the processor needs to perform the bloom filter operation, the bloom filter circuit only needs to receive addressing data from the processor, The rest of the addressing and writing update processes can be completed in the memory by the Bloom filter circuit according to the addressing data, without the involvement of the processor, so there will not be too much data migration on the bus between the memory and the processor. , to avoid bus conflicts. In addition, the bloom filter circuit provided by the embodiment of the present application can also realize the addressing and writing update process of the bloom filter in one instruction cycle cycle, which shortens the system response time and improves the Bloom filter efficiency. Comparing the structures of FIGS. 9 and 11 , and the timing diagrams of FIGS. 11 and 13 , it can be seen that for the structures of FIGS. 9 and 11 , the difference between the circuit control methods is: in the circuit control method for FIG. 9 , the three-state The working states of the buffer TSB1 and the reverse tri-state buffer TSB2 are controlled by the Filter_Done signal and the WR_EN signal, while in the circuit control method for FIG. Controlled by the Filter_Done signal. Among them, for the circuit control method of FIG. 9, due to the dual control scheme of the Filter_Done signal and the WR_EN signal, an additional function of preventing writing and updating can be realized. Keep the WR_EN signal at a low level, so that when the update circuit is activated, since the WR_EN signal is at a low level, the data selector DS1 sends the enable terminals E1 and E1 of the tri-state buffer TSB1 and the reverse tri-state buffer TSB2 to E2 outputs a low level, so that the tri-state buffer TSB1 and the reverse tri-state buffer TSB2 are in a high-impedance state, and no data transmission is performed to prevent writing and updating.
在本申请的上述实施例中,寻址数据被设计为Hash Value,其中Hash Value的低位段LSB经过One-hot编码而得到One-hot数组后,输入到锁存器,再由锁存器将One-hot数组的各个比特的One-hot值一一对应地输入到各个电路单元中,以实现对各个电路单元所在位线BL上的目标Vector的比特位进行按位逻辑操作。可以理解的是,处理器对上述Hash Value进行One-hot编码需要消耗一定的时间,产生一定的延迟,同时锁存器等需要通过相应的电路实现。In the above-mentioned embodiment of the present application, the addressing data is designed as Hash Value, wherein the LSB of the low-order segment of Hash Value is one-hot encoded to obtain a One-hot array, and then input to the latch, and then the latch will The One-hot values of each bit of the One-hot array are input into each circuit unit in a one-to-one correspondence, so as to implement a bitwise logical operation on the bits of the target Vector on the bit line BL where each circuit unit is located. It can be understood that it takes a certain amount of time for the processor to perform One-hot encoding on the above Hash Value, resulting in a certain delay, and at the same time, the latch and the like need to be implemented by a corresponding circuit.
为了进一步消除One-hot编码产生的延迟,以及简化系统电路结构,减小电路面积,位寻址数据还可以通过其他的编码形式实现。In order to further eliminate the delay caused by One-hot encoding, simplify the circuit structure of the system, and reduce the circuit area, the bit-addressable data can also be implemented by other encoding forms.
图11是本申请实施例提供的另一种布隆过滤波器功能电路的结构示意图。在一些实施例中,如图11所示,位寻址数据可以是与Vector的长度(位宽)相同的二进制数组,或者是大于Vector长度的二进制数组,优选Vector的长度与位寻址数据的长度相同。示例地,当Vector的长度为32比特时,位寻址数据的长度可以为32比特;当Vector的长度为64比特时,位寻址数据的长度可以为64比特;当Vector的长度为128比特时,位寻址数据的长度可以为128比特;以此类推。FIG. 11 is a schematic structural diagram of another functional circuit of a bloom filter provided by an embodiment of the present application. In some embodiments, as shown in FIG. 11 , the bit-addressable data may be a binary array with the same length (bit width) as the Vector, or a binary array larger than the Vector’s length, preferably the length of the Vector is the same as the bit-addressable data. same length. For example, when the length of the Vector is 32 bits, the length of the bit-addressable data may be 32 bits; when the length of the Vector is 64 bits, the length of the bit-addressable data may be 64 bits; when the length of the Vector is 128 bits , the length of bit-addressable data can be 128 bits; and so on.
当位寻址数据是与Vector的长度(位宽)相同的二进制数组时,寻址数据(包括字寻址数据和位寻址数据)同样由处理器产生。其中,字寻址数据可以与Hash Value的高位段相同,即用于输入到目标Vector所在字线WL的比特值为1,以用于激活目标Vector所在字线WL,输入到其余Vector所在字线WL的比特值0,从而不会激活其余Vector所在字线WL;位寻址数据的各个比特值则用于一一对应地输入到各个电路单元400的位寻址输入端410,其中,位寻址数据的各个比特值可以是0或者是1,位寻址数据的为1的比特值指向目标Vector的目标比特,例如当被检测元素在目标Vector中映射有4个目标比特时,位寻址数据的128比特的二进制数组中相应地有4个比特位的值为1,其余均为0。这样,布隆过滤器功能电路50中的每一个电路单元400都可以根据其接收到的比特值,对其所在位线BL上的目标Vector的比特位进行按位逻辑操作。如果某个电路单元400接收到的比特值为1,说明被检测元素映射的一个目标比特位于在该电路单元400所在位线BL上。When the bit-addressable data is a binary array with the same length (bit width) as the Vector, the addressed data (including word-addressable data and bit-addressable data) are also generated by the processor. Among them, the word addressing data can be the same as the high-order segment of the Hash Value, that is, the bit value used for input to the word line WL where the target Vector is located is 1, which is used to activate the word line WL where the target Vector is located, and input to the word lines where the other Vectors are located. The bit value of WL is 0, so that the word line WL where the rest of the Vectors are located will not be activated; each bit value of the bit addressing data is used to be input to the bit addressing input terminal 410 of each circuit unit 400 in a one-to-one correspondence, wherein the bit addressing Each bit value of the address data can be 0 or 1, and the bit value of 1 of the bit addressing data points to the target bit of the target Vector. For example, when the detected element is mapped to 4 target bits in the target Vector, the bit addressing In the 128-bit binary array of data, correspondingly, 4 bits have the value of 1, and the rest are 0. In this way, each circuit unit 400 in the Bloom filter function circuit 50 can perform a bitwise logical operation on the bits of the target Vector on the bit line BL where it is located according to the bit value it receives. If the bit value received by a certain circuit unit 400 is 1, it means that a target bit mapped by the detected element is located on the bit line BL where the circuit unit 400 is located.
基于图14示出的方案,处理器可以直接生成与Vector的长度(位宽)相同的二进制数组作为位寻址数据,然后直接将位寻址数据的各个比特值一一对应地输入到各个电路单元400的位寻址输入端410,用于各个电路单元400执行按位逻辑操作,实现处理器的直接按位寻址,由此消除One-hot编码产生的延迟,另外位寻址数据也不再需要送入锁存器锁存,由此在存储器和处理器组成的系统电路中也不需要增加锁存器的相关电路,简化了系统电路结构,减小了电路面积。Based on the scheme shown in Figure 14, the processor can directly generate a binary array with the same length (bit width) as the Vector as bit-addressable data, and then directly input each bit value of the bit-addressable data to each circuit in a one-to-one correspondence The bit-addressable input terminal 410 of the unit 400 is used for each circuit unit 400 to perform bit-wise logical operations, so as to realize the direct bit-wise addressing of the processor, thereby eliminating the delay caused by One-hot encoding, and in addition, the bit-addressable data is not Then it needs to be sent into the latch for latching, so that the related circuit of the latch does not need to be added in the system circuit composed of the memory and the processor, which simplifies the system circuit structure and reduces the circuit area.
本申请还提供了一种计算机存储介质。该计算机存储介质计算机指令,当计算机指令在计算机上运行时,使得计算机执行上述各方面及其实现方式中的方法。The present application also provides a computer storage medium. The computer storage medium computer instructions, when executed on a computer, cause the computer to perform the methods in the above-described aspects and implementations thereof.
本申请还提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述各方面及其实现方式中的方法。The present application also provides a computer program product comprising instructions which, when run on a computer, cause the computer to perform the methods of the above aspects and implementations thereof.
以上内容,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何在本申请揭露的技术范围内的变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以权利要求的保护范围为准。The above contents are only specific embodiments of the present application, but the protection scope of the present application is not limited thereto, and any changes or substitutions within the technical scope disclosed in the present application should be covered within the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (21)

  1. 一种存储器,其特征在于,包括:A memory, characterized in that, comprising:
    单元阵列,所述单元阵列包括多个存储单元;a cell array, the cell array including a plurality of memory cells;
    多个电路单元,所述多个电路单元分别与至少一个所述存储单元连接;其中,所述电路单元用于:A plurality of circuit units, the plurality of circuit units are respectively connected with at least one of the storage units; wherein, the circuit units are used for:
    接收外部输入的位寻址数据的第一比特值;Receive the first bit value of the externally input bit-addressable data;
    读取所述位寻址数据指向的目标存储单元中的第二比特值;reading the second bit value in the target storage unit pointed to by the bit-addressable data;
    在所述第一比特值与所述第二比特值不同时,将所述目标存储单元更新为所述第一比特值。When the first bit value is different from the second bit value, the target storage unit is updated to the first bit value.
  2. 根据权利要求1所述的存储器,其特征在于,The memory of claim 1, wherein
    多个所述存储单元分布成多行和多列,每一行所述存储单元通过一条字线连接,每一列所述存储单元通过一条位线连接,每一行存储单元用于存储一个位数组,每一条所述位线连接有一个所述电路单元;A plurality of the storage cells are distributed into multiple rows and columns, the storage cells in each row are connected by a word line, the storage cells in each column are connected by a bit line, and the storage cells in each row are used to store a bit array, and each row is used to store a bit array. One of the bit lines is connected with one of the circuit units;
    不同所述电路单元接收的所述第一比特值对应所述位寻址数据的不同比特位。The first bit values received by the different circuit units correspond to different bits of the bit-addressed data.
  3. 根据权利要求2所述的存储器,其特征在于,The memory of claim 2, wherein:
    所述电路单元包括过滤电路和更新电路;The circuit unit includes a filter circuit and an update circuit;
    所述过滤电路包括位寻址输入端、数据输入端和过滤输出端;The filtering circuit includes a bit addressing input terminal, a data input terminal and a filtering output terminal;
    所述位寻址输入端用于接收所述第一比特值,所述数据输入端与所述存储单元连接,用于读取所述第二比特值;The bit addressing input terminal is used for receiving the first bit value, and the data input terminal is connected to the storage unit for reading the second bit value;
    所述过滤电路用于在所述第一比特值与所述第二比特值不同时,在所述过滤输出端输出第一使能信号;The filtering circuit is configured to output a first enable signal at the filtering output end when the first bit value is different from the second bit value;
    所述更新电路包括数据输出端,所述数据输出端与所述存储单元连接;The update circuit includes a data output terminal, and the data output terminal is connected with the storage unit;
    所述更新电路用于在所述过滤电路输出所述第一使能信号时,将所述目标存储单元更新为第一比特值。The update circuit is configured to update the target storage unit to a first bit value when the filter circuit outputs the first enable signal.
  4. 根据权利要求3所述的存储器,其特征在于,The memory of claim 3, wherein:
    所述过滤电路包括第一场效应管、第二场效应管和第三场效应管;The filtering circuit includes a first field effect transistor, a second field effect transistor and a third field effect transistor;
    所述第一场效应管的源极接地,所述第一场效应管的栅极为所述位寻址输入端,所述第一场效应管的漏极与所述第二场效应管的源极连接;The source of the first field effect transistor is grounded, the gate of the first field effect transistor is the bit addressing input terminal, the drain of the first field effect transistor and the source of the second field effect transistor pole connection;
    所述第二场效应管的栅极为所述数据输入端,所述第二场效应管的漏极与所述第三场效应管的源极连接;The gate of the second field effect transistor is the data input terminal, and the drain electrode of the second field effect transistor is connected to the source electrode of the third field effect transistor;
    所述第三场效应管的栅极为过滤使能信号输入端,所述第三场效应管的漏极为所述过滤输出端。The gate of the third field effect transistor is the filter enable signal input terminal, and the drain of the third field effect transistor is the filter output terminal.
  5. 根据权利要求4所述的存储器,其特征在于,The memory of claim 4, wherein:
    所述过滤电路具体用于在所述过滤使能信号输入端接收到第二使能信号,并且所述第一比特值与所述第二比特值不同时,在所述过滤输出端输出所述第一使能信号。The filtering circuit is specifically configured to output the filtering output terminal when a second enabling signal is received at the filtering enabling signal input terminal and the first bit value is different from the second bit value. first enable signal.
  6. 根据权利要求4或5所述的存储器,其特征在于,所述第一场效应管、所述第二场效应管和所述第三场效应管均为N型场效应管。The memory according to claim 4 or 5, wherein the first field effect transistor, the second field effect transistor and the third field effect transistor are all N-type field effect transistors.
  7. 根据权利要求2-6任一项所述的存储器,其特征在于,The memory according to any one of claims 2-6, wherein,
    所述更新电路包括三态缓存器、反向三态缓存器、第一数据选择器和第二数据选择器;The update circuit includes a tri-state buffer, an inverse tri-state buffer, a first data selector and a second data selector;
    所述第一数据选择器的第一输入端为写使能信号输入端,所述第一数据选择器的第二输入端用于接收所述第一使能信号的取反信号,所述第一数据选择器的输出端与所述三态缓存器的使能端和所述反向三态缓存器的使能端连接;The first input terminal of the first data selector is a write enable signal input terminal, the second input terminal of the first data selector is used to receive the inversion signal of the first enable signal, and the first The output end of a data selector is connected with the enabling end of the tri-state buffer and the enabling end of the inverse tri-state buffer;
    所述第二数据选择器的第二输入端与所述位寻址输入端或者高电位连接,所述第二数据选择器的输出端与所述三态缓存器的输入端和所述反向三态缓存器的输入端连接;The second input terminal of the second data selector is connected to the bit addressing input terminal or a high potential, and the output terminal of the second data selector is connected to the input terminal of the tri-state buffer and the reverse The input terminal of the three-state buffer is connected;
    所述三态缓存器的输出端和所述反向三态缓存器的输出端为所述数据输出端。The output end of the tri-state buffer and the output end of the inverse tri-state buffer are the data output ends.
  8. 根据权利要求7所述的存储器,其特征在于,所述第一使能信号为高电平信号,所述更新电路具体用于在所述第一比特值为1,并且所述第二比特值为0时,将所述目标存储单元更新为所述第一比特值。The memory according to claim 7, wherein the first enable signal is a high-level signal, and the update circuit is specifically configured to set the value of the first bit to 1 and the value of the second bit to When it is 0, the target storage unit is updated to the first bit value.
  9. 根据权利要求2-6任一项所述的存储器,其特征在于The memory according to any one of claims 2-6, characterized in that
    所述更新电路包括与门单元、三态缓存器、反向三态缓存器、第一数据选择器和第二数据选择器;The update circuit includes an AND gate unit, a tri-state buffer, an inverse tri-state buffer, a first data selector and a second data selector;
    所述与门单元的第一输入端与所述过滤输出端连接,用于接收所述第一使能信号的取反信号;所述与门单元的第二输入端为写使能信号输入端;所述与门单元的输出端与所述第一数据选择器的第二输入端连接;The first input end of the AND gate unit is connected to the filter output end, and is used for receiving the inversion signal of the first enable signal; the second input end of the AND gate unit is the write enable signal input end ; The output end of the AND gate unit is connected with the second input end of the first data selector;
    所述第一数据选择器的第一输入端与所述写使能信号输入端连接,所述第一数据选择器的输出端与所述三态缓存器的使能端和所述反向三态缓存器的使能端连接;The first input terminal of the first data selector is connected to the input terminal of the write enable signal, and the output terminal of the first data selector is connected to the enable terminal of the three-state buffer and the inverse three-state buffer. enable connection of the state buffer;
    所述第二数据选择器的第二输入端与所述位寻址输入端或者高电位连接,所述第二数据选择器的输出端与所述三态缓存器的输入端和所述反向三态缓存器的输入端连接;The second input terminal of the second data selector is connected to the bit addressing input terminal or a high potential, and the output terminal of the second data selector is connected to the input terminal of the tri-state buffer and the reverse The input terminal of the three-state buffer is connected;
    所述三态缓存器的输出端和所述反向三态缓存器的输出端为所述数据输出端。The output end of the tri-state buffer and the output end of the inverse tri-state buffer are the data output ends.
  10. 根据权利要求9所述的存储器,其特征在于,所述第一使能信号为高电平信号,所述更新电路具体用于在所述写使能信号输入端输入高电平,并且所述第一比特值为1、所述第二比特值为0时,将所述目标存储单元更新为所述第一比特值。The memory according to claim 9, wherein the first enable signal is a high level signal, the update circuit is specifically configured to input a high level at the write enable signal input terminal, and the When the first bit value is 1 and the second bit value is 0, the target storage unit is updated to the first bit value.
  11. 根据权利要求7-10任一项所述的存储器,其特征在于,The memory according to any one of claims 7-10, wherein,
    所述位线包括第一位线和第二位线,所述三态缓存器的输出端与所述第一位线连接,所述反向三态缓存器的输出端与所述第二位线连接;The bit line includes a first bit line and a second bit line, the output end of the tri-state buffer is connected to the first bit line, and the output end of the inverse tri-state register is connected to the second bit line. line connection;
    当所述第一位线为高电平,所述第二位线为低电平时,所述存储单元中的比特值为1;当所述第一位线为低电平,所述第二位线为高电平时,所述存储单元中的比特值为0。When the first bit line is at a high level and the second bit line is at a low level, the bit value in the memory cell is 1; when the first bit line is at a low level, the second bit line is at a low level. When the bit line is at a high level, the bit value in the memory cell is 0.
  12. 根据权利要求7-10任一项所述的存储器,其特征在于,The memory according to any one of claims 7-10, wherein,
    所述第一数据选择器的数据选择端和所述第二数据选择器的数据选择端用于接收工作模式选择信号;当所述工作模式选择信号为低电平时,所述第一数据选择器的输出端和所述第二数据选择器的输出端均输出各自第一输入端的信号;当所述工作模式选择信号为高电平时,所述第一数据选择器的输出端和所述第二数据选择器的输出端均输出各自第二输入端的信号。The data selection terminal of the first data selector and the data selection terminal of the second data selector are used to receive a working mode selection signal; when the working mode selection signal is at a low level, the first data selector The output end of the first data selector and the output end of the second data selector both output the signal of the respective first input end; when the working mode selection signal is high level, the output end of the first data selector and the second data selector The output terminals of the data selectors all output the signals of the respective second input terminals.
  13. 根据权利要求11所述的存储器,其特征在于,The memory of claim 11, wherein:
    所述数据输入端通过灵敏放大器与所述位线连接;the data input terminal is connected to the bit line through a sense amplifier;
    所述灵敏放大器包括两个输入端,分别与所述第一位线和所述第二位线连接;The sense amplifier includes two input terminals, which are respectively connected with the first bit line and the second bit line;
    所述灵敏放大器还包括一个输出端,与所述数据输入端连接;The sense amplifier further includes an output terminal connected to the data input terminal;
    其中,当所述第一位线为高电平,所述第二位线为低电平时,所述灵敏放大器输出低电平;当所述第一位线为低电平,所述第二位线为高电平时,所述灵敏放大器输出高电平。Wherein, when the first bit line is at a high level and the second bit line is at a low level, the sense amplifier outputs a low level; when the first bit line is at a low level, the second bit line is at a low level When the bit line is at a high level, the sense amplifier outputs a high level.
  14. 根据权利要求8或10所述的存储器,其特征在于,The memory according to claim 8 or 10, characterized in that,
    所述过滤电路还包括第四场效应管,所述第四场效应管的源极耦合至高电位,所述第四场效应管的漏极与所述过滤输出端连接,所述第四场效应管的栅极为预充电信号输入端;其中,当所述预充电信号输入端输入低电平时,所述第四场效应管导通,以将所述过滤输出端拉升至高电平。The filtering circuit further includes a fourth field effect transistor, the source of the fourth field effect transistor is coupled to a high potential, the drain of the fourth field effect transistor is connected to the filtering output end, and the fourth field effect transistor is connected to the filter output. The gate of the tube is a precharge signal input terminal; wherein, when the precharge signal input terminal is input with a low level, the fourth field effect transistor is turned on to pull the filter output terminal to a high level.
  15. 根据权利要求14所述的存储器,其特征在于,所述第四场效应管为P型场效应管。The memory according to claim 14, wherein the fourth field effect transistor is a P-type field effect transistor.
  16. 根据权利要求4或5所述的存储器,其特征在于,多个所述电路单元共用同一个所述过滤使能信号输入端。The memory according to claim 4 or 5, wherein a plurality of the circuit units share the same input terminal of the filter enable signal.
  17. 根据权利要求7-15任一项所述的存储器,其特征在于,多个所述电路单元共用同一个所述写使能信号输入端。The memory according to any one of claims 7-15, wherein a plurality of the circuit units share the same input terminal of the write enable signal.
  18. 根据权利要求3-17任一项所述的存储器,其特征在于,多个所述电路单元共用同一个所述过滤输出端。The memory according to any one of claims 3-17, wherein a plurality of the circuit units share the same filter output end.
  19. 根据权利要求3-18任一项所述的存储器,其特征在于,还包括:The memory according to any one of claims 3-18, further comprising:
    锁存器;所述锁存器的输入端用于接收所述位寻址数据,所述位寻址数据为独热编码One-hot数据;所述锁存器的输出端与各个所述电路单元的寻址输入端连接,用于将所述独热编码数据的不同比特位的比特值一一对应地输入到各个所述电路单元的所述寻址输入端。a latch; an input end of the latch is used to receive the bit-addressed data, and the bit-addressed data is one-hot encoded One-hot data; an output end of the latch is connected to each of the circuits The addressing input terminals of the unit are connected, and are used for inputting the bit values of different bits of the one-hot encoded data to the addressing input terminals of each of the circuit units in a one-to-one correspondence.
  20. 根据权利要求19所述的存储器,其特征在于,所述锁存器还包括控制信号输入 端,用于接收外部控制信号,其中,当所述外部控制信号为低电平时,所述锁存器用于接收并锁存所述独热编码数据,当所述外部控制信号为高电平时,所述锁存器用于将所述独热编码数据的不同比特位的比特值一一对应地输入到各个所述电路单元的所述寻址输入端。The memory according to claim 19, wherein the latch further comprises a control signal input terminal for receiving an external control signal, wherein when the external control signal is at a low level, the latch uses For receiving and latching the one-hot encoded data, when the external control signal is at a high level, the latch is used to input the bit values of different bits of the one-hot encoded data into each of the one-hot encoded data. the addressing input of the circuit unit.
  21. 根据权利要求1-20任一项所述的存储器,其特征在于,所述位寻址数据为二进制数组。The memory according to any one of claims 1-20, wherein the bit-addressable data is a binary array.
PCT/CN2021/078446 2021-03-01 2021-03-01 Memory WO2022183314A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202180089639.XA CN116670766A (en) 2021-03-01 2021-03-01 Memory device
PCT/CN2021/078446 WO2022183314A1 (en) 2021-03-01 2021-03-01 Memory

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2021/078446 WO2022183314A1 (en) 2021-03-01 2021-03-01 Memory

Publications (1)

Publication Number Publication Date
WO2022183314A1 true WO2022183314A1 (en) 2022-09-09

Family

ID=83153692

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/078446 WO2022183314A1 (en) 2021-03-01 2021-03-01 Memory

Country Status (2)

Country Link
CN (1) CN116670766A (en)
WO (1) WO2022183314A1 (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140136762A1 (en) * 2012-11-09 2014-05-15 Sandisk Technologies Inc. Data search using bloom filters and nand based content addressable memory
CN103943138A (en) * 2014-04-18 2014-07-23 中国科学院上海高等研究院 Per unit multi-bit storage device
CN108447520A (en) * 2018-05-03 2018-08-24 睿力集成电路有限公司 Memory circuit device and memory device detecting method
CN108986858A (en) * 2017-05-30 2018-12-11 瑞萨电子株式会社 Content addressable memory

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140136762A1 (en) * 2012-11-09 2014-05-15 Sandisk Technologies Inc. Data search using bloom filters and nand based content addressable memory
CN103943138A (en) * 2014-04-18 2014-07-23 中国科学院上海高等研究院 Per unit multi-bit storage device
CN108986858A (en) * 2017-05-30 2018-12-11 瑞萨电子株式会社 Content addressable memory
CN108447520A (en) * 2018-05-03 2018-08-24 睿力集成电路有限公司 Memory circuit device and memory device detecting method

Also Published As

Publication number Publication date
CN116670766A (en) 2023-08-29

Similar Documents

Publication Publication Date Title
CN110364203B (en) Storage system supporting internal calculation of storage and calculation method
US10964358B2 (en) Apparatuses and methods for scatter and gather
US20230039948A1 (en) Methods for reading data from a storage buffer including delaying activation of a column select
TWI661310B (en) Apparatus and method for operating a memory device
TW202008160A (en) Memory system, memory device and operating method thereof
US7463501B2 (en) Semiconductor memory device
TW201633305A (en) Apparatuses and methods for storing a data value in multiple columns
JP2000011640A (en) Semiconductor storage
WO2020042868A1 (en) Static random access memory (sram) unit and related device
US8122199B2 (en) Multi port memory device with shared memory area using latch type memory cells and driving method
US10991418B2 (en) Semiconductor memory device comprising an interface conforming to JEDEC standard and control device therefor
US10585619B1 (en) Memory block erasure
CN112634969A (en) Memory device and method for reading page media stream
US20190304516A1 (en) Apparatuses and methods for coupling data lines in memory devices
US6188629B1 (en) Low power, static content addressable memory
CN111863071B (en) Circuit structure for realizing internal operation based on SRAM
US20110013467A1 (en) System and Method for Reading Memory
JPH0757469A (en) Memory circuit
US8930643B2 (en) Multi-port memory and operation
WO2022183314A1 (en) Memory
JP4854277B2 (en) Orthogonal transformation circuit
CN109427388B (en) Memory cell and static random access memory
CN115035931A (en) Circuit structure, chip and module based on 8T-SRAM unit
US10811087B2 (en) Memory circuit capable of implementing calculation operations
US10852972B2 (en) Retrieval memory and retrieval system

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21928405

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 202180089639.X

Country of ref document: CN

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21928405

Country of ref document: EP

Kind code of ref document: A1