WO2024001332A1 - Multi-port memory, and reading and writing method and apparatus for multi-port memory - Google Patents

Multi-port memory, and reading and writing method and apparatus for multi-port memory Download PDF

Info

Publication number
WO2024001332A1
WO2024001332A1 PCT/CN2023/083179 CN2023083179W WO2024001332A1 WO 2024001332 A1 WO2024001332 A1 WO 2024001332A1 CN 2023083179 W CN2023083179 W CN 2023083179W WO 2024001332 A1 WO2024001332 A1 WO 2024001332A1
Authority
WO
WIPO (PCT)
Prior art keywords
read
write
buffer
command
read command
Prior art date
Application number
PCT/CN2023/083179
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 深圳市中兴微电子技术有限公司
Publication of WO2024001332A1 publication Critical patent/WO2024001332A1/en

Links

Classifications

    • GPHYSICS
    • G11INFORMATION STORAGE
    • G11CSTATIC STORES
    • G11C11/00Digital stores characterised by the use of particular electric or magnetic storage elements; Storage elements therefor
    • G11C11/21Digital stores characterised by the use of particular electric or magnetic storage elements; Storage elements therefor using electric elements
    • G11C11/34Digital stores characterised by the use of particular electric or magnetic storage elements; Storage elements therefor using electric elements using semiconductor devices
    • G11C11/40Digital stores characterised by the use of particular electric or magnetic storage elements; Storage elements therefor using electric elements using semiconductor devices using transistors
    • G11C11/41Digital stores characterised by the use of particular electric or magnetic storage elements; Storage elements therefor using electric elements using semiconductor devices using transistors forming static cells with positive feedback, i.e. cells not needing refreshing or charge regeneration, e.g. bistable multivibrator or Schmitt trigger
    • G11C11/413Auxiliary circuits, e.g. for addressing, decoding, driving, writing, sensing, timing or power reduction
    • GPHYSICS
    • G11INFORMATION STORAGE
    • G11CSTATIC STORES
    • G11C7/00Arrangements for writing information into, or reading information out from, a digital store
    • G11C7/10Input/output [I/O] data interface arrangements, e.g. I/O data control circuits, I/O data buffers
    • GPHYSICS
    • G11INFORMATION STORAGE
    • G11CSTATIC STORES
    • G11C7/00Arrangements for writing information into, or reading information out from, a digital store
    • G11C7/10Input/output [I/O] data interface arrangements, e.g. I/O data control circuits, I/O data buffers
    • G11C7/1051Data output circuits, e.g. read-out amplifiers, data output buffers, data output registers, data output level conversion circuits
    • G11C7/1057Data output buffers, e.g. comprising level conversion circuits, circuits for adapting load
    • GPHYSICS
    • G11INFORMATION STORAGE
    • G11CSTATIC STORES
    • G11C7/00Arrangements for writing information into, or reading information out from, a digital store
    • G11C7/10Input/output [I/O] data interface arrangements, e.g. I/O data control circuits, I/O data buffers
    • G11C7/1051Data output circuits, e.g. read-out amplifiers, data output buffers, data output registers, data output level conversion circuits
    • G11C7/1063Control signal output circuits, e.g. status or busy flags, feedback command signals
    • GPHYSICS
    • G11INFORMATION STORAGE
    • G11CSTATIC STORES
    • G11C7/00Arrangements for writing information into, or reading information out from, a digital store
    • G11C7/10Input/output [I/O] data interface arrangements, e.g. I/O data control circuits, I/O data buffers
    • G11C7/1051Data output circuits, e.g. read-out amplifiers, data output buffers, data output registers, data output level conversion circuits
    • G11C7/1069I/O lines read out arrangements
    • GPHYSICS
    • G11INFORMATION STORAGE
    • G11CSTATIC STORES
    • G11C7/00Arrangements for writing information into, or reading information out from, a digital store
    • G11C7/10Input/output [I/O] data interface arrangements, e.g. I/O data control circuits, I/O data buffers
    • G11C7/1078Data input circuits, e.g. write amplifiers, data input buffers, data input registers, data input level conversion circuits
    • G11C7/1084Data input buffers, e.g. comprising level conversion circuits, circuits for adapting load
    • GPHYSICS
    • G11INFORMATION STORAGE
    • G11CSTATIC STORES
    • G11C7/00Arrangements for writing information into, or reading information out from, a digital store
    • G11C7/10Input/output [I/O] data interface arrangements, e.g. I/O data control circuits, I/O data buffers
    • G11C7/1078Data input circuits, e.g. write amplifiers, data input buffers, data input registers, data input level conversion circuits
    • G11C7/109Control signal input circuits
    • GPHYSICS
    • G11INFORMATION STORAGE
    • G11CSTATIC STORES
    • G11C7/00Arrangements for writing information into, or reading information out from, a digital store
    • G11C7/10Input/output [I/O] data interface arrangements, e.g. I/O data control circuits, I/O data buffers
    • G11C7/1078Data input circuits, e.g. write amplifiers, data input buffers, data input registers, data input level conversion circuits
    • G11C7/1096Write circuits, e.g. I/O line write drivers
    • 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

  • Embodiments of the present application relate to the field of network communications, and specifically, to a multi-port memory, a method and device for reading and writing a multi-port memory.
  • Memory is a component used to store programs and data. It is widely used in the fields of computers, communications, and artificial intelligence. Almost all high-tech chips or devices are equipped with dedicated internal or external memory. The performance of the memory is often one of the key factors that determines the performance of the entire chip or device. Among various memories, SRAM is currently the most common on-chip memory in the field of large-scale integrated circuits. Compared with memory forms such as latch arrays and registers, the storage cost of SRAM is minimal, so existing caches are mainly SRAM.
  • the original SRAM IP basically consists of a single read or write port, while chips related to the fields of computers, communications, and artificial intelligence often require more ports of memory to ensure high parallel processing performance and high-bandwidth interface performance.
  • the existing multi-port cache mainly has the following design solutions: the first is time-sharing reading through an arbitration mechanism, but the cache speed of this type is often limited by the interface rate of the memory and cannot provide parallel access; the second The storage area is divided into multiple granularities, but this solution does not provide a solution to access conflicts. When access conflicts occur, you can only wait, and the access rate cannot be guaranteed.
  • the third method is to copy storage resources and copy storage content. , to achieve parallel read and write port expansion, but the memory overhead required by this solution will increase exponentially as the number of ports increases, and the area and power consumption overhead are too large.
  • Embodiments of the present application provide a multi-port memory, a method and a device for reading and writing a multi-port memory, so as to at least solve the problem of excessive multi-port parallel read and write cache overhead in related technologies.
  • a multi-port memory including: N write ports, a write controller, K write buffers and a storage block group, wherein the above storage block group includes K storage blocks. block, where K is greater than N; the above-mentioned write port is used to receive externally input write commands and write data, and output to the above-mentioned write controller; the above-mentioned write controller is used to schedule the above-mentioned write commands and write data to the corresponding Write buffer; the above-mentioned write buffer is used to cache the write data to be written into the storage block, where one write buffer corresponds to one storage block.
  • a method for reading and writing a multi-port memory including: when receiving a write command through multiple write ports, determining the storage block corresponding to each write command; in the above storage block When there is free cache space in the write buffer, the write command is scheduled to the corresponding write buffer, so that the write data indicated by the write command is written into the storage block through the write buffer.
  • a multi-port memory reading and writing device including: a write controller, configured to determine the corresponding address of each write command when a write command is received through multiple write ports. storage block, and when there is free cache space in the write buffer of the storage block, schedule the above-mentioned write command to the corresponding above-mentioned write buffer to write the write data indicated by the above-mentioned write command through the above-mentioned write buffer. into the above memory block.
  • a computer-readable storage medium is also provided.
  • a computer program is stored in the computer-readable storage medium, wherein the computer program is configured to execute any of the above methods when running. Steps in Examples.
  • an electronic device including a memory and a processor.
  • a computer program is stored in the memory, and the processor is configured to run the computer program to perform any of the above. Steps in method embodiments.
  • the multi-port memory is divided into K memories and a separate write buffer is configured for each memory block, an order-preserving multi-port cache design is realized and the storage problems caused by the increase of access ports are solved.
  • the problem of exponential increase in overhead is achieved by reducing the overhead of storage resources required for multi-port memory cache.
  • Figure 1 is a hardware structure block diagram of a reading and writing method for running a multi-port memory according to an embodiment of the present application
  • Figure 2 is an application system diagram of a multi-port memory according to an embodiment of the present application
  • Figure 3 is a structural block diagram of a multi-port memory according to an embodiment of the present application.
  • Figure 4 is a schematic flowchart of a method for reading and writing a multi-port memory according to an embodiment of the present application
  • Figure 5 is a schematic diagram of the operation of a write controller of a multi-port memory according to an embodiment of the present application
  • Figure 6 is a schematic diagram of the operation of a read controller of a multi-port memory according to an embodiment of the present application
  • Figure 7 is a schematic diagram of the operation of the buffer level of a multi-port memory according to an embodiment of the present application.
  • Figure 8 is a structural block diagram of a multi-port memory reading and writing device according to an embodiment of the present application.
  • FIG. 1 is a hardware structure block diagram of a mobile terminal using a multi-port memory reading and writing method according to an embodiment of the present application.
  • the mobile terminal may include one or more (only one is shown in Figure 1) processors 102 (the processor 102 may include but is not limited to a microprocessor (Micro Control Unit, MCU) or a programmable logic device (Field Programmable Gate Array, FPGA) and other processing devices) and a memory 104 for storing data, wherein the above-mentioned mobile terminal may also include a transmission device 106 for communication functions and an input and output device 108.
  • MCU Micro Control Unit
  • FPGA Field Programmable Gate Array
  • the mobile terminal may also include a transmission device 106 for communication functions and an input and output device 108.
  • the structure shown in Figure 1 is only illustrative, and it does not limit the structure of the above-mentioned mobile terminal.
  • the mobile terminal may also include more or fewer components than shown in FIG. 1 , or have a different configuration than shown in FIG. 1 .
  • the memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as computer programs corresponding to the multi-port memory reading and writing methods in the embodiments of the present application.
  • the processor 102 stores them in the memory 104 by running
  • the computer program in the computer is used to perform various functional applications and data processing, that is, to implement the above method.
  • Memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory.
  • the memory 104 may further include memory located remotely relative to the processor 102, and these remote memories may be connected to the mobile terminal through a network. Examples of the above-mentioned networks include but are not limited to the Internet, intranets, local area networks, mobile communication networks and combinations thereof.
  • the transmission device 106 is used to receive or send data via a network.
  • Specific examples of the above-mentioned network may include a wireless network provided by a communication provider of the mobile terminal.
  • the transmission device 106 includes a network adapter (Network Interface Controller, NIC for short), which can be connected to other network devices through a base station to communicate with the Internet.
  • the transmission device 106 may be a radio frequency (Radio Frequency, RF for short) module, which is used to communicate with the Internet wirelessly.
  • NIC Network Interface Controller
  • a multi-port memory includes: N write ports, a write controller, K write buffers and a storage block group, where the storage block group includes K storage blocks. block, where K is greater than N; the write port is used to receive externally input write commands and write data, and output them to the write controller; the write controller is used to schedule write commands and write data to the corresponding write buffer; The write buffer is used to cache the write data to be written into the storage block, where one write buffer corresponds to one storage block.
  • Multi-port memory is not limited to large-scale integrated circuits for data caching and storage. It is necessary to implement the functions of each module in the chip design stage and embed it as an overall IP into various large-scale chips to provide multi-port read and write cache functions. .
  • multi-port memory When multi-port memory is used to provide multi-port read and write cache functions, the applied system is not limited to the system shown in Figure 2.
  • the multi-port memory (multi-port cache) is connected to n processors (or n-core processors) to provide n processors (or n-core processors) for read and write access and data caching.
  • the entire address space of the cache can be shared among n processors (or n-core processors), and reads and writes can be performed simultaneously.
  • the multi-port cache provides two independent access ports for each processor, one read and one write.
  • Multi-port memory is not limited to the application system shown in Figure 2 above, but can also be used in other devices and systems with multi-port access requirements. This is only one possible application implementation environment.
  • the multi-port memory given in this embodiment The memory is not limited to any system requiring multi-port caching.
  • the above-mentioned multi-port memory also includes N read ports, a read controller, K read command buffers and N read data buffers, wherein the read port is used to receive externally input read commands, And output to the read controller; the read controller is used to schedule the read command to the corresponding read command buffer; the read command buffer is used to cache the read command of the corresponding storage block, where one read command buffer corresponds to A storage block; a read data buffer, used to cache data read from the storage block to be output to the corresponding read port, where one read data buffer corresponds to one read port.
  • the structure of the multi-port memory is not limited to that shown in Figure 3.
  • the write port group mainly provides N write ports on the write side, receives external input write data and write commands, and sends write data and write commands to the write controller.
  • the write controller determines and schedules the write command, then sends the write command and write data to the write buffer of the corresponding storage block, and then the write buffer writes the corresponding storage block one by one.
  • the storage block group contains N storage blocks and is the main cache carrier.
  • the read port group mainly provides N read ports on the read side, receives externally input read commands, and sends them to the read command buffer via the read controller. According to the read command in the read command buffer, read operations are performed on the memory block in sequence. The read data is delayed in the read data buffer and sent to the read port group. The read port group receives the read data returned by the read data buffer. Finally, Returned to the initiator of the read command.
  • Figure 4 is a flow chart according to the embodiment of the present application. As shown in Figure 4, the process includes the following steps:
  • Step S402 when receiving write commands through multiple write ports, determine the storage blocks corresponding to each write command
  • Step S404 If there is free cache space in the write buffer of the storage block, schedule the write command to the corresponding write buffer to write the write data indicated by the write command into the storage block through the write buffer.
  • the multi-port memory Before writing data to the multi-port memory, it is not limited to dividing it into K memory blocks according to the cache capacity of the multi-port, and configures a write buffer and a read command buffer for each memory block, and configures a write buffer and a read command buffer for each memory block.
  • Each read port is configured with a read data buffer.
  • the device that performs the reading method of the multi-port memory is not limited to a write controller of the multi-port memory.
  • the relationship between the write controller, the write port, and the memory block is not limited to that shown in Figure 5.
  • the two write ports are connected to the write controller, and the write controller distributes the write commands and write data schedule of the two write ports to the write data of the four memory blocks.
  • each write data buffer is directly connected to the corresponding memory block.
  • the write controller determines the storage block corresponding to the access address indicated by the write command, and determines whether there is a conflict between the write commands currently received by multiple write ports. Whether there is a conflict between the write commands received by multiple write ports is not limited to indicating whether the storage blocks corresponding to the access addresses indicated by the write commands received by the multiple write ports are the same. In the case where at least two write commands indicate the same storage block, multiple write commands are not limited to being queued in the write buffer corresponding to the storage block to write the write data into the indicated storage block in sequence.
  • the write controller After determining the storage block indicated by each write command, the write controller is not limited to determining whether the storage space in the write data buffer of the corresponding storage block is all occupied. When there is still unoccupied buffer space in the write data buffer, the write data corresponding to the write command is sequentially scheduled to the corresponding write data buffer.
  • the storage block corresponding to each write command after determining the storage block corresponding to each write command, it also includes: when all cache spaces in the write buffer of the storage block are occupied, blocking the write port that receives the write command, and in the next cycle Initiate the write command again.
  • the write command fails because the current cache space of the storage block's write data buffer is occupied, block the write port that receives the write command and wait until the next cycle to initiate the write command again. If the write data is successfully written into the write data buffer, it is queued in sequence and waits to be written into the storage block.
  • the storage block corresponding to each read command is determined; when there is free cache space in the read command buffer of the storage block, the read command is Schedule to the corresponding read command buffer, and mark the buffer level for the read command, so that the read data buffer feeds back the read data indicated by the read command to the corresponding read port according to the buffer level, where the buffer level indicates the read The number of beats the data is delayed in the read data buffer.
  • the device that performs the reading method of the multi-port memory is not limited to a read controller of the multi-port memory. After the read command reaches the read port, the read controller determines the memory block corresponding to the access address indicated by the read command, and determines whether there is a conflict between the read commands currently received by the multiple read ports. Whether there is a conflict between read commands received by multiple read ports is not limited to whether the storage blocks corresponding to the access addresses indicated by the read commands received by multiple read ports are the same. In the case where at least two read commands indicate the same storage block, multiple read commands are not limited to being queued in the read command buffer corresponding to the storage block to sequentially read data from the indicated storage blocks.
  • the read controller determines the memory block indicated by each read command, it is not limited to determining the read command buffer of the corresponding memory block. Whether all storage space is occupied. When there is still unoccupied buffer space in the read command buffer, the read commands are sequentially scheduled to the corresponding read command buffer. Read commands are queued one after another during the read command buffer period to wait for execution to read the storage block.
  • the storage block corresponding to each read command after determining the storage block corresponding to each read command, it also includes: when all the cache space in the read command buffer of the storage block is occupied, blocking the read port that receives the read command, and in the next Periodically initiate a read command again.
  • the read port that receives the read command is blocked and waits for the next cycle to initiate the read command again. If the read command is successfully written into the read command buffer, the buffer level is marked for the read command, which is used to control the number of delayed beats of the read data in the read data buffer.
  • scheduling the read command to the corresponding read command buffer and marking the buffer level for the read command includes: when at least two read commands correspond to the same storage block, sequentially assign the at least two read commands according to priority.
  • Each read command is cached into the read command buffer corresponding to the storage block, and each read command is marked with a buffering level according to the cache order, where the buffering level of each read command is different.
  • Each read command written into the same read command buffer has a different buffering level, thereby controlling the delay level of the read data in the read data buffer through the buffering level to ensure that the output sequence of the read data is consistent with the read port reception The order of read commands is consistent.
  • the relationship between the read controller, the read port, and the memory block is not limited to that shown in Figure 6.
  • the two read ports are connected to the read controller, and the read controller schedules and distributes the two read port commands to the corresponding read command buffers of the four memory blocks.
  • the read commands in each read command buffer are waiting to be executed in sequence, and the data read from the storage block are interleaved and stored in the read data buffers of the two read ports.
  • the delay levels of different read data outputs can be controlled in the read data buffer to ensure that the output sequence of read data is consistent with the order in which the read port receives read commands.
  • marking the buffering level for each read command in sequence according to the cache order includes: determining the cache position of the read command in the read command buffer according to the cache order of the read command cache in the read command buffer; marking the read command The buffering level corresponding to the cache location in the read command buffer, where the total number of buffering levels is consistent with the number of cache locations in the read command buffer, and the number of buffering levels is positively correlated with the ordering of the cache locations.
  • the buffering level marking method is to mark the buffering level corresponding to the read command based on the expected waiting time of the read command in the read command buffer.
  • the buffering level mark will arrive at the read data buffer along with the corresponding read data, and will be marked according to the buffer level. Different levels are stored in registers with different delay levels in the read data buffer.
  • the buffer level is equal to the number of cache locations in the read command buffer. Then there are 3 storage locations in the read command buffer. indivual. Taking the two ports each receiving a read command at the same time as an example, as shown in Figure 7, the read command 1 received through the read port 1 and the read command 2 received through the read port 2 at the same time indicate the same memory block. After reading control After the processor determines the conflict, it queues the two read commands according to priority. It is assumed that command 1 is queued before command 2. Before command 1 and command 2 are stored in the read command buffer corresponding to the storage block, the read command buffer is empty.
  • command 1 does not need to wait and can directly perform data reading
  • command 2 needs to wait for 1 cycle before performing data reading.
  • the number of cycles in which the read command is queued is recorded as the buffering level. Then the buffering level of command 1 is 0 and the buffering level of command 2 is 1. If there are other read commands scheduled to the read command buffer at this time, they will be queued behind command 2, and the buffering level will be 2.
  • the data read by command 1 data 1, read from the storage block, and put into the buffer level 0 according to the buffer level within the register. Thereafter, the data is transferred to the registers of the next buffer level every cycle.
  • data 1 arrives at the register with buffer level 1.
  • data read by command 2 data 2, after being read from the storage block, is directly stored in the register with buffer level 1 according to its buffer level mark.
  • data 1 and data 2 are respectively transferred to the register with buffer level 2, and will be sent to port 1 and port 2 at the same time in the next cycle.
  • the registers in the buffer level receive data from the previous buffer level, or receive storage block reads.
  • the data corresponding to the buffer level will not arrive at the same time. Since the same port can only receive at most one read command at the same time, through the multi-port memory in this embodiment, as long as the read command can correctly enter the read command buffer, it will be marked with a buffer level, and the corresponding read data There will be no conflicts in the read data buffer.
  • the computer software product is stored in a storage medium (such as read-only memory/random access memory).
  • the memory Read-Only Memory/Random Access Memory, ROM/RAM), magnetic disk, optical disk
  • ROM/RAM Read-Only Memory/Random Access Memory
  • magnetic disk magnetic disk
  • optical disk includes several instructions to cause a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute this application Methods described in various embodiments.
  • module may be a combination of software and/or hardware that implements a predetermined function.
  • apparatus described in the following embodiments is preferably implemented in software, implementation in hardware, or a combination of software and hardware, is also possible and contemplated.
  • Figure 8 is a structural block diagram of a multi-port memory read and write device according to an embodiment of the present application.
  • the device includes: a write controller 82 for receiving a write command through multiple write ports. , determine the storage block corresponding to each write command, and when there is free cache space in the write buffer of the storage block, schedule the write command to the corresponding write buffer, so that the write command indicated by the write buffer is Write data is written to the memory block.
  • the above-mentioned controller 82 is also configured to block the write port that receives the write command after determining the storage block corresponding to each write command, and when the cache space in the write buffer of the storage block is all occupied. , and initiate the write command again in the next cycle.
  • the above-mentioned multi-port memory reading and writing device further includes: a read controller, configured to determine the storage block corresponding to each read command when a read command is received through multiple read ports.
  • a read controller configured to determine the storage block corresponding to each read command when a read command is received through multiple read ports.
  • the read command is scheduled to the corresponding read command buffer, and the buffer level is marked for the read command, so that the read data buffer receives the read data.
  • the read data is fed back to the corresponding read port, where each storage block is equipped with a corresponding read command buffer, and the buffer level indicates the number of beats of delay in the read data buffer for the read data indicated by the read command.
  • the above-mentioned read controller is also used to block the read port that receives the read command after determining the storage block corresponding to each read command, and when the buffer space in the read command buffer of the storage block is all occupied. , and initiate the read command again in the next cycle.
  • the above-mentioned read controller schedules the read command to the corresponding read command buffer, and marks the read command Buffering level, including: when at least two read commands correspond to the same storage block, cache at least two read commands to the read command buffer corresponding to the storage block in sequence according to priority, and cache each read command in sequence according to the cache order.
  • Command tag buffering level where the buffering level is different for each read command.
  • the above-mentioned read controller marks the buffering level for each read command in sequence according to the cache order, including: determining the cache position of the read command in the read command buffer according to the cache order in the read command buffer; is the buffering level corresponding to the read command mark and the cache location in the read command buffer, where the total number of buffering levels is consistent with the number of cache locations in the read command buffer, and the number of buffering levels is positive with the ordering of the cache locations.
  • each of the above modules can be implemented through software or hardware.
  • it can be implemented in the following ways, but is not limited to this: the above modules are all located in the same processor; or the above modules can be implemented in any combination.
  • the forms are located in different processors.
  • Embodiments of the present application also provide a computer-readable storage medium that stores a computer program, wherein the computer program is configured to execute the steps in any of the above method embodiments when running.
  • the computer-readable storage medium may include but is not limited to: U disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM) , mobile hard disk, magnetic disk or optical disk and other media that can store computer programs.
  • ROM read-only memory
  • RAM random access memory
  • mobile hard disk magnetic disk or optical disk and other media that can store computer programs.
  • An embodiment of the present application also provides an electronic device, including a memory and a processor.
  • a computer program is stored in the memory, and the processor is configured to run the computer program to perform the steps in any of the above method embodiments.
  • the above-mentioned electronic device may further include a transmission device and an input-output device, wherein the transmission device is connected to the above-mentioned processor, and the input-output device is connected to the above-mentioned processor.
  • modules or steps of the present application can be implemented using general-purpose computing devices, and they can be concentrated on a single computing device, or distributed across a network composed of multiple computing devices. They may be implemented in program code executable by a computing device, such that they may be stored in a storage device for execution by the computing device, and in some cases may be executed in a sequence different from that shown herein. Or the described steps can be implemented by making them into individual integrated circuit modules respectively, or by making multiple modules or steps among them into a single integrated circuit module. As such, the application is not limited to any specific combination of hardware and software.

Landscapes

  • Engineering & Computer Science (AREA)
  • Microelectronics & Electronic Packaging (AREA)
  • Computer Hardware Design (AREA)
  • Memory System Of A Hierarchy Structure (AREA)
  • Static Random-Access Memory (AREA)

Abstract

Provided in the present application are a multi-port memory, and a reading and writing method and apparatus for a multi-port memory. The multi-port memory comprises N write ports, one write controller, K write buffers and one memory block group, wherein the memory block group comprises K memory blocks, K being greater than N; the write ports are used for receiving write commands and write data, which are externally inputted, and outputting same to the write controller; the write controller is used for scheduling the write commands and the write data to the corresponding write buffers; and the write buffers are used for buffering write data to be written into the memory blocks, wherein one write buffer corresponds to one memory block.

Description

多端口存储器、多端口存储器的读写方法及装置Multi-port memory, multi-port memory reading and writing methods and devices
相关申请Related applications
本申请要求于2022年6月30日申请的、申请号为202210765522.5的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims priority to the Chinese patent application with application number 202210765522.5 filed on June 30, 2022, the entire content of which is incorporated into this application by reference.
技术领域Technical field
本申请实施例涉及网络通讯领域,具体而言,涉及一种多端口存储器、多端口存储器的读写方法及装置。Embodiments of the present application relate to the field of network communications, and specifically, to a multi-port memory, a method and device for reading and writing a multi-port memory.
背景技术Background technique
存储器是用来存储程序和数据的部件,在计算机领域、通讯领域、人工智能领域等均有极为广泛的应用。几乎所有具备高科技含量的芯片或设备都配备专用的内部或外部存储器,存储器的性能往往是决定整个芯片或设备性能的关键因素之一。在各种存储器中,SRAM是目前大规模集成电路领域最常见的片内存储器。相比较于锁存器阵列和寄存器等存储器形式,SRAM的存储代价是最小的,因此现有缓存主要以SRAM为主。原始的SRAM IP基本由单个读或写端口形式构成,而计算机、通讯、人工智能领域相关芯片往往需要更多端口的存储器,以保证高并行度处理性能和高带宽接口性能。Memory is a component used to store programs and data. It is widely used in the fields of computers, communications, and artificial intelligence. Almost all high-tech chips or devices are equipped with dedicated internal or external memory. The performance of the memory is often one of the key factors that determines the performance of the entire chip or device. Among various memories, SRAM is currently the most common on-chip memory in the field of large-scale integrated circuits. Compared with memory forms such as latch arrays and registers, the storage cost of SRAM is minimal, so existing caches are mainly SRAM. The original SRAM IP basically consists of a single read or write port, while chips related to the fields of computers, communications, and artificial intelligence often require more ports of memory to ensure high parallel processing performance and high-bandwidth interface performance.
现有的多端口缓存主要有以下几种设计方案:第一种是通过仲裁机制分时读取,但这种类型的缓存速度往往受限于存储器的接口速率,无法提供并行访问;第二种是将存储区进行多粒度划分,但这种方案并没有提供访问冲突的解决办法,在访问冲突时只能等待,访问速率无法得到保障;第三种是采用复制存储资源和复制存储内容的方式,实现并行读写端口扩展,但是这种方案所需的存储器开销会随着端口数量的增加以指数形式增长,面积和功耗的开销过大。The existing multi-port cache mainly has the following design solutions: the first is time-sharing reading through an arbitration mechanism, but the cache speed of this type is often limited by the interface rate of the memory and cannot provide parallel access; the second The storage area is divided into multiple granularities, but this solution does not provide a solution to access conflicts. When access conflicts occur, you can only wait, and the access rate cannot be guaranteed. The third method is to copy storage resources and copy storage content. , to achieve parallel read and write port expansion, but the memory overhead required by this solution will increase exponentially as the number of ports increases, and the area and power consumption overhead are too large.
发明内容Contents of the invention
本申请实施例提供了一种多端口存储器、多端口存储器的读写方法及装置,以至少解决相关技术中多端口并行读写缓存开销过大的问题。Embodiments of the present application provide a multi-port memory, a method and a device for reading and writing a multi-port memory, so as to at least solve the problem of excessive multi-port parallel read and write cache overhead in related technologies.
根据本申请的一个实施例,提供了一种多端口存储器,包括:N个写端口、一个写控制器、K个写缓冲器和一个存储块组,其中,上述存储块组,包括K个存储块,其中,K大于N;上述写端口,用于接收外部输入的写命令和写数据,并输出至上述写控制器;上述写控制器,用于将上述写命令和写数据调度至对应的写缓冲器;上述写缓冲器,用于缓存待写入存储块的写数据,其中,一个写缓冲器对应一个存储块。According to an embodiment of the present application, a multi-port memory is provided, including: N write ports, a write controller, K write buffers and a storage block group, wherein the above storage block group includes K storage blocks. block, where K is greater than N; the above-mentioned write port is used to receive externally input write commands and write data, and output to the above-mentioned write controller; the above-mentioned write controller is used to schedule the above-mentioned write commands and write data to the corresponding Write buffer; the above-mentioned write buffer is used to cache the write data to be written into the storage block, where one write buffer corresponds to one storage block.
根据本申请的一个实施例,提供了一种多端口存储器的读写方法,包括:在通过多个写端口接收到写命令的情况下,确定各个写命令各自对应的存储块;在上述存储块的写缓冲器中存在空闲缓存空间的情况下,将上述写命令调度至对应的上述写缓冲器中,以通过上述写缓冲器将上述写命令指示的写数据写入上述存储块。 According to an embodiment of the present application, a method for reading and writing a multi-port memory is provided, including: when receiving a write command through multiple write ports, determining the storage block corresponding to each write command; in the above storage block When there is free cache space in the write buffer, the write command is scheduled to the corresponding write buffer, so that the write data indicated by the write command is written into the storage block through the write buffer.
根据本申请的另一个实施例,提供了一种多端口存储器的读写装置,包括:写控制器,用于在通过多个写端口接收到写命令的情况下,确定各个写命令各自对应的存储块,并在上述存储块的写缓冲器中存在空闲缓存空间的情况下,将上述写命令调度至对应的上述写缓冲器中,以通过上述写缓冲器将上述写命令指示的写数据写入上述存储块。According to another embodiment of the present application, a multi-port memory reading and writing device is provided, including: a write controller, configured to determine the corresponding address of each write command when a write command is received through multiple write ports. storage block, and when there is free cache space in the write buffer of the storage block, schedule the above-mentioned write command to the corresponding above-mentioned write buffer to write the write data indicated by the above-mentioned write command through the above-mentioned write buffer. into the above memory block.
根据本申请的又一个实施例,还提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机程序,其中,所述计算机程序被设置为运行时执行上述任一项方法实施例中的步骤。According to yet another embodiment of the present application, a computer-readable storage medium is also provided. A computer program is stored in the computer-readable storage medium, wherein the computer program is configured to execute any of the above methods when running. Steps in Examples.
根据本申请的又一个实施例,还提供了一种电子装置,包括存储器和处理器,所述存储器中存储有计算机程序,所述处理器被设置为运行所述计算机程序以执行上述任一项方法实施例中的步骤。According to yet another embodiment of the present application, an electronic device is also provided, including a memory and a processor. A computer program is stored in the memory, and the processor is configured to run the computer program to perform any of the above. Steps in method embodiments.
通过本申请,由于将多端口存储器划分为K个存储器,并为每个存储快配置单独的写缓冲器,实现了保序的多端口缓存设计,解决了随着访问端口增加而带来的存储开销指数级增大的问题,达到减少了多端口存储器缓存所需存储资源的开销效果。Through this application, since the multi-port memory is divided into K memories and a separate write buffer is configured for each memory block, an order-preserving multi-port cache design is realized and the storage problems caused by the increase of access ports are solved. The problem of exponential increase in overhead is achieved by reducing the overhead of storage resources required for multi-port memory cache.
附图说明Description of drawings
图1是根据本申请实施例的运行多端口存储器的读写方法的硬件结构框图;Figure 1 is a hardware structure block diagram of a reading and writing method for running a multi-port memory according to an embodiment of the present application;
图2是根据本申请实施例的多端口存储器的应用系统图;Figure 2 is an application system diagram of a multi-port memory according to an embodiment of the present application;
图3是根据本申请实施例的多端口存储器的结构框图;Figure 3 is a structural block diagram of a multi-port memory according to an embodiment of the present application;
图4是根据本申请实施例的多端口存储器的读写方法的流程示意图;Figure 4 is a schematic flowchart of a method for reading and writing a multi-port memory according to an embodiment of the present application;
图5是根据本申请实施例的多端口存储器的写控制器的运行示意图;Figure 5 is a schematic diagram of the operation of a write controller of a multi-port memory according to an embodiment of the present application;
图6是根据本申请实施例的多端口存储器的读控制器的运行示意图;Figure 6 is a schematic diagram of the operation of a read controller of a multi-port memory according to an embodiment of the present application;
图7是根据本申请实施例的多端口存储器的缓冲等级的运行示意图;Figure 7 is a schematic diagram of the operation of the buffer level of a multi-port memory according to an embodiment of the present application;
图8是根据本申请实施例的多端口存储器的读写装置的结构框图。Figure 8 is a structural block diagram of a multi-port memory reading and writing device according to an embodiment of the present application.
具体实施方式Detailed ways
下文中将参考附图并结合实施例来详细说明本申请的实施例。The embodiments of the present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
需要说明的是,本申请的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。It should be noted that the terms "first", "second", etc. in the description and claims of this application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.
本申请实施例中所提供的方法实施例可以在移动终端、计算机终端或者类似的运算装置中执行。以运行在移动终端上为例,图1是本申请实施例的一种多端口存储器的读写方法的移动终端的硬件结构框图。如图1所示,移动终端可以包括一个或多个(图1中仅示出一个)处理器102(处理器102可以包括但不限于微处理器(Micro Control Unit,MCU)或可编程逻辑器件(Field Programmable Gate Array,FPGA)等的处理装置)和用于存储数据的存储器104,其中,上述移动终端还可以包括用于通信功能的传输设备106以及输入输出设备108。本领域普通技术人员可以理解,图1所示的结构仅为示意,其并不对上述移动终端的结构造成限定。例如,移动终端还可包括比图1中所示更多或者更少的组件,或者具有与图1所示不同的配置。The method embodiments provided in the embodiments of this application can be executed in a mobile terminal, a computer terminal, or a similar computing device. Taking running on a mobile terminal as an example, FIG. 1 is a hardware structure block diagram of a mobile terminal using a multi-port memory reading and writing method according to an embodiment of the present application. As shown in Figure 1, the mobile terminal may include one or more (only one is shown in Figure 1) processors 102 (the processor 102 may include but is not limited to a microprocessor (Micro Control Unit, MCU) or a programmable logic device (Field Programmable Gate Array, FPGA) and other processing devices) and a memory 104 for storing data, wherein the above-mentioned mobile terminal may also include a transmission device 106 for communication functions and an input and output device 108. Persons of ordinary skill in the art can understand that the structure shown in Figure 1 is only illustrative, and it does not limit the structure of the above-mentioned mobile terminal. For example, the mobile terminal may also include more or fewer components than shown in FIG. 1 , or have a different configuration than shown in FIG. 1 .
存储器104可用于存储计算机程序,例如,应用软件的软件程序以及模块,如本申请实施例中的多端口存储器的读写方法对应的计算机程序,处理器102通过运行存储在存储器104 内的计算机程序,从而执行各种功能应用以及数据处理,即实现上述的方法。存储器104可包括高速随机存储器,还可包括非易失性存储器,如一个或者多个磁性存储装置、闪存、或者其他非易失性固态存储器。在一些实例中,存储器104可进一步包括相对于处理器102远程设置的存储器,这些远程存储器可以通过网络连接至移动终端。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as computer programs corresponding to the multi-port memory reading and writing methods in the embodiments of the present application. The processor 102 stores them in the memory 104 by running The computer program in the computer is used to perform various functional applications and data processing, that is, to implement the above method. Memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include memory located remotely relative to the processor 102, and these remote memories may be connected to the mobile terminal through a network. Examples of the above-mentioned networks include but are not limited to the Internet, intranets, local area networks, mobile communication networks and combinations thereof.
传输装置106用于经由一个网络接收或者发送数据。上述的网络具体实例可包括移动终端的通信供应商提供的无线网络。在一个实例中,传输装置106包括一个网络适配器(Network Interface Controller,简称为NIC),其可通过基站与其他网络设备相连从而可与互联网进行通讯。在一个实例中,传输装置106可以为射频(Radio Frequency,简称为RF)模块,其用于通过无线方式与互联网进行通讯。The transmission device 106 is used to receive or send data via a network. Specific examples of the above-mentioned network may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, NIC for short), which can be connected to other network devices through a base station to communicate with the Internet. In one example, the transmission device 106 may be a radio frequency (Radio Frequency, RF for short) module, which is used to communicate with the Internet wirelessly.
在本实施例中提供了一种多端口存储器,该多端口存储器包括:N个写端口、一个写控制器、K个写缓冲器和一个存储块组,其中,存储块组,包括K个存储块,其中,K大于N;写端口,用于接收外部输入的写命令和写数据,并输出至写控制器;写控制器,用于将写命令和写数据调度至对应的写缓冲器;写缓冲器,用于缓存待写入存储块的写数据,其中,一个写缓冲器对应一个存储块。In this embodiment, a multi-port memory is provided. The multi-port memory includes: N write ports, a write controller, K write buffers and a storage block group, where the storage block group includes K storage blocks. block, where K is greater than N; the write port is used to receive externally input write commands and write data, and output them to the write controller; the write controller is used to schedule write commands and write data to the corresponding write buffer; The write buffer is used to cache the write data to be written into the storage block, where one write buffer corresponds to one storage block.
多端口存储器不限于应用于在大规模集成电路,用于数据的缓存、存储,需要在芯片设计阶段将各模块功能进行实现,作为整体IP嵌入各类大型芯片中,提供多端口读写缓存功能。Multi-port memory is not limited to large-scale integrated circuits for data caching and storage. It is necessary to implement the functions of each module in the chip design stage and embed it as an overall IP into various large-scale chips to provide multi-port read and write cache functions. .
多端口存储器用于提供多端口读写缓存功能时,所应用的系统不限于如图2所示,多端口存储器(多端口缓存)连接了n个处理器(或n核处理器),供n个处理器(或n核处理器)进行读写访问和数据缓存。n个处理器(或n核处理器)之间可以共享缓存的全部地址空间,并且同时执行读写。多端口缓存为每个处理器提供1读1写两个独立的访问端口。When multi-port memory is used to provide multi-port read and write cache functions, the applied system is not limited to the system shown in Figure 2. The multi-port memory (multi-port cache) is connected to n processors (or n-core processors) to provide n processors (or n-core processors) for read and write access and data caching. The entire address space of the cache can be shared among n processors (or n-core processors), and reads and writes can be performed simultaneously. The multi-port cache provides two independent access ports for each processor, one read and one write.
多端口存储器不限于应用在上述图2所示的应用系统中,还可用于其它具有多端口访问需求的装置和系统,这里仅为一种可能的应用实施环境,本实施例给出的多端口存储器不限用于任意需求多端口缓存的系统内。Multi-port memory is not limited to the application system shown in Figure 2 above, but can also be used in other devices and systems with multi-port access requirements. This is only one possible application implementation environment. The multi-port memory given in this embodiment The memory is not limited to any system requiring multi-port caching.
作为一种实施方式,上述多端口存储器还包括N个读端口、一个读控制器、K个读命令缓冲器和N个读数据缓冲器,其中,读端口,用于接收外部输入的读命令,并输出至读控制器;读控制器,用于将读命令调度至对应的读命令缓冲器;读命令缓冲器,用于缓存读对应的存储块的读命令,其中,一个读命令缓冲器对应一个存储块;读数据缓冲器,用于缓存从存储块读出的待输出至对应读端口的数据,其中,一个读数据缓冲器对应一个读端口。As an implementation manner, the above-mentioned multi-port memory also includes N read ports, a read controller, K read command buffers and N read data buffers, wherein the read port is used to receive externally input read commands, And output to the read controller; the read controller is used to schedule the read command to the corresponding read command buffer; the read command buffer is used to cache the read command of the corresponding storage block, where one read command buffer corresponds to A storage block; a read data buffer, used to cache data read from the storage block to be output to the corresponding read port, where one read data buffer corresponds to one read port.
多端口存储器的结构不限于如图3所示。写端口群主要提供写入侧的N个写端口,接收外部输入的写数据和写命令,并将写数据和写命令发给写控制器。写控制器对写命令进行判断和调度,然后将写命令和写数据送入对应存储块的写缓冲器,再由写缓冲器逐一写入对应存储块。The structure of the multi-port memory is not limited to that shown in Figure 3. The write port group mainly provides N write ports on the write side, receives external input write data and write commands, and sends write data and write commands to the write controller. The write controller determines and schedules the write command, then sends the write command and write data to the write buffer of the corresponding storage block, and then the write buffer writes the corresponding storage block one by one.
存储块组包含了N个存储块,是主要的缓存载体。The storage block group contains N storage blocks and is the main cache carrier.
读端口群主要提供读出侧的N个读端口,接收外部输入的读命令,经由读控制器发送给读命令缓冲器。根据读命令缓冲器内的读命令,依次对存储块执行读操作,读出数据在读数据缓冲器内延时并发送给读端口群,读端口群接收读数据缓冲器返回的读出数据,最终返回给读命令发起方。 The read port group mainly provides N read ports on the read side, receives externally input read commands, and sends them to the read command buffer via the read controller. According to the read command in the read command buffer, read operations are performed on the memory block in sequence. The read data is delayed in the read data buffer and sent to the read port group. The read port group receives the read data returned by the read data buffer. Finally, Returned to the initiator of the read command.
在本实施例中提供了一种用于上述多端口存储器的读写方法,图4是根据本申请实施例的的流程图,如图4所示,该流程包括如下步骤:In this embodiment, a reading and writing method for the above-mentioned multi-port memory is provided. Figure 4 is a flow chart according to the embodiment of the present application. As shown in Figure 4, the process includes the following steps:
步骤S402,在通过多个写端口接收到写命令的情况下,确定各个写命令各自对应的存储块;Step S402, when receiving write commands through multiple write ports, determine the storage blocks corresponding to each write command;
步骤S404,在存储块的写缓冲器中存在空闲缓存空间的情况下,将写命令调度至对应的写缓冲器中,以通过写缓冲器将写命令指示的写数据写入存储块。Step S404: If there is free cache space in the write buffer of the storage block, schedule the write command to the corresponding write buffer to write the write data indicated by the write command into the storage block through the write buffer.
在往多端口存储器中写入数据之前,不限于按照多端口的缓存容量,将其平均分为K个存储块,并为每个存储快配置一个写缓冲器和一个读命令缓冲器,并为每个读端口配置一个读数据缓冲器。Before writing data to the multi-port memory, it is not limited to dividing it into K memory blocks according to the cache capacity of the multi-port, and configures a write buffer and a read command buffer for each memory block, and configures a write buffer and a read command buffer for each memory block. Each read port is configured with a read data buffer.
执行上述多端口存储器的读方法的不限于为多端口存储器的写控制器。写控制器与写端口、存储块之间的关系不限于如图5所示。以端口数N=2,存储块数K=4为例,两个写端口连接写控制器,写控制器间将两个写端口的写命令和写数据调度分发至四个存储块的写数据缓冲器中,每个写数据缓冲器均与对应的存储块直接连接。The device that performs the reading method of the multi-port memory is not limited to a write controller of the multi-port memory. The relationship between the write controller, the write port, and the memory block is not limited to that shown in Figure 5. Taking the number of ports N = 2 and the number of memory blocks K = 4 as an example, the two write ports are connected to the write controller, and the write controller distributes the write commands and write data schedule of the two write ports to the write data of the four memory blocks. In the buffer, each write data buffer is directly connected to the corresponding memory block.
当写命令和写数据到达写端口之后,由写控制器确定写命令所指示的访问地址所对应的存储块,并判断当前多个写端口接收到的写命令之间是否存在冲突。多个写端口接收到的写命令之间是否存在冲突不限于指示多个写端口接收到的写命令所指示的访问地址对应的存储块是否一样。在至少两个写命令指示的存储块一样的情况下,不限于对多个写命令在存储块对应的写缓冲器中进行排队,以将写数据依次写入指示的存储块中。When the write command and write data arrive at the write port, the write controller determines the storage block corresponding to the access address indicated by the write command, and determines whether there is a conflict between the write commands currently received by multiple write ports. Whether there is a conflict between the write commands received by multiple write ports is not limited to indicating whether the storage blocks corresponding to the access addresses indicated by the write commands received by the multiple write ports are the same. In the case where at least two write commands indicate the same storage block, multiple write commands are not limited to being queued in the write buffer corresponding to the storage block to write the write data into the indicated storage block in sequence.
写控制器在确定各个写命令指示的存储块后,不限于确定对应存储块的写数据缓冲器中的存储空间是否均被占用。在写数据缓冲器中还存在未被占用的缓冲空间时,将写命令对应的写数据依次调度至对应的写数据缓冲器内。After determining the storage block indicated by each write command, the write controller is not limited to determining whether the storage space in the write data buffer of the corresponding storage block is all occupied. When there is still unoccupied buffer space in the write data buffer, the write data corresponding to the write command is sequentially scheduled to the corresponding write data buffer.
作为一种实施方式,在确定各个写命令各自对应的存储块之后,还包括:在存储块的写缓冲器中缓存空间均被占用的情况下,阻塞接收写命令的写端口,并在下一周期再次发起写命令。As an implementation manner, after determining the storage block corresponding to each write command, it also includes: when all cache spaces in the write buffer of the storage block are occupied, blocking the write port that receives the write command, and in the next cycle Initiate the write command again.
如果因存储块的写数据缓冲器当前缓存空间均被占用导致写命令失败时,阻塞接收写命令的写端口,并等待至下一个周期再次发起该写命令。如果写数据成功写入了写数据缓冲器,则依次排队等待写入存储块。If the write command fails because the current cache space of the storage block's write data buffer is occupied, block the write port that receives the write command and wait until the next cycle to initiate the write command again. If the write data is successfully written into the write data buffer, it is queued in sequence and waits to be written into the storage block.
作为一种实施方式,在通过多个读端口接收到读命令的情况下,确定各个读命令各自对应的存储块;在存储块的读命令缓冲器中存在空闲缓存空间的情况下,将读命令调度至对应的读命令缓冲器中,并为读命令标记缓冲等级,以使读数据缓冲器按照缓冲等级,将读命令指示的读出数据反馈给对应的读端口,其中,缓冲等级指示读出数据在读数据缓冲器中的延时拍数。As an implementation manner, when a read command is received through multiple read ports, the storage block corresponding to each read command is determined; when there is free cache space in the read command buffer of the storage block, the read command is Schedule to the corresponding read command buffer, and mark the buffer level for the read command, so that the read data buffer feeds back the read data indicated by the read command to the corresponding read port according to the buffer level, where the buffer level indicates the read The number of beats the data is delayed in the read data buffer.
执行上述多端口存储器的读方法的不限于为多端口存储器的读控制器。当读命令到达读端口之后,由读控制器确定读命令所指示的访问地址所对应的存储块,并判断当前多个读端口接收到的读命令之间是否存在冲突。多个读端口接收到的读命令之间是否存在冲突不限于为多个读端口接收到的读命令所指示的访问地址对应的存储块是否一样。在至少两个读命令指示的存储块一样的情况下,不限于对多个读命令在存储块对应的读命令缓冲器中进行排队,以依次从指示的存储块中读取数据。The device that performs the reading method of the multi-port memory is not limited to a read controller of the multi-port memory. After the read command reaches the read port, the read controller determines the memory block corresponding to the access address indicated by the read command, and determines whether there is a conflict between the read commands currently received by the multiple read ports. Whether there is a conflict between read commands received by multiple read ports is not limited to whether the storage blocks corresponding to the access addresses indicated by the read commands received by multiple read ports are the same. In the case where at least two read commands indicate the same storage block, multiple read commands are not limited to being queued in the read command buffer corresponding to the storage block to sequentially read data from the indicated storage blocks.
读控制器在确定各个读命令指示的存储块后,不限于确定对应存储块的读命令缓冲器的 存储空间是否均被占用。在读命令缓冲器中还存在未被占用的缓冲空间时,将读命令依次调度至对应的读命令缓冲器中。读命令在读命令缓冲期内依次排队等待执行读取存储块。After the read controller determines the memory block indicated by each read command, it is not limited to determining the read command buffer of the corresponding memory block. Whether all storage space is occupied. When there is still unoccupied buffer space in the read command buffer, the read commands are sequentially scheduled to the corresponding read command buffer. Read commands are queued one after another during the read command buffer period to wait for execution to read the storage block.
作为一种实施方式,在确定各个读命令各自对应的存储块之后,还包括:在存储块的读命令缓冲器中缓存空间均被占用的情况下,阻塞接收读命令的读端口,并在下一周期再次发起读命令。As an implementation manner, after determining the storage block corresponding to each read command, it also includes: when all the cache space in the read command buffer of the storage block is occupied, blocking the read port that receives the read command, and in the next Periodically initiate a read command again.
如果因存储块的读命令缓冲器当前缓存空间均被占用时,阻塞接收读命令的读端口,等待下一个周期再次发起该读命令。如果读命令成功写入读命令缓冲器,则为读命令标记缓冲等级,用于控制读出数据在读数据缓冲器内的延时拍数。If the current buffer space of the storage block's read command buffer is occupied, the read port that receives the read command is blocked and waits for the next cycle to initiate the read command again. If the read command is successfully written into the read command buffer, the buffer level is marked for the read command, which is used to control the number of delayed beats of the read data in the read data buffer.
作为一种实施方式,将读命令调度至对应的读命令缓冲器中,并为读命令标记缓冲等级,包括:在至少两个读命令对应同一存储块的情况下,按照优先级依次将至少两个读命令缓存至存储块对应的读命令缓冲器中,并按照缓存顺序依次为每个读命令标记缓冲等级,其中,每个读命令的缓冲等级均不相同。As an implementation manner, scheduling the read command to the corresponding read command buffer and marking the buffer level for the read command includes: when at least two read commands correspond to the same storage block, sequentially assign the at least two read commands according to priority. Each read command is cached into the read command buffer corresponding to the storage block, and each read command is marked with a buffering level according to the cache order, where the buffering level of each read command is different.
写入同一读命令缓冲器中的每个读命令的缓冲等级均不相同,从而通过缓冲等级控制读出数据在读数据缓冲器中的延时等级,以保证读出数据的输出顺序与读端口接收读命令的顺序是一致的。Each read command written into the same read command buffer has a different buffering level, thereby controlling the delay level of the read data in the read data buffer through the buffering level to ensure that the output sequence of the read data is consistent with the read port reception The order of read commands is consistent.
读控制器与读端口、存储块之间的关系不限于如图6所示。以端口数N=2,存储块数K=4为例,两个读端口连接读控制器,读控制器将两个读端口命令调度分发至四个存储块各自对应的读命令缓冲器内。每个读命令缓冲器内的读命令按排队顺序依次等待被执行,由存储块读出的数据交织后分别存入两个读端口的读数据缓冲器中。通过被标记的不同缓冲等级,可以在读数据缓冲器内控制不同读数据输出的延时等级,以保证读出数据的输出顺序与读端口接收读命令的顺序是一致的。The relationship between the read controller, the read port, and the memory block is not limited to that shown in Figure 6. Taking the number of ports N = 2 and the number of memory blocks K = 4 as an example, the two read ports are connected to the read controller, and the read controller schedules and distributes the two read port commands to the corresponding read command buffers of the four memory blocks. The read commands in each read command buffer are waiting to be executed in sequence, and the data read from the storage block are interleaved and stored in the read data buffers of the two read ports. Through different marked buffer levels, the delay levels of different read data outputs can be controlled in the read data buffer to ensure that the output sequence of read data is consistent with the order in which the read port receives read commands.
作为一种实施方式,按照缓存顺序依次为每个读命令标记缓冲等级,包括:按照读命令缓存读命令缓冲器中的缓存顺序,确定读命令在读命令缓冲器中的缓存位置;为读命令标记与读命令缓冲器中的缓存位置对应的缓冲等级,其中,缓冲等级的总级数与读命令缓冲器中的缓存位置的数量一致,缓冲等级的级数与缓存位置的排序呈正相关。As an implementation manner, marking the buffering level for each read command in sequence according to the cache order includes: determining the cache position of the read command in the read command buffer according to the cache order of the read command cache in the read command buffer; marking the read command The buffering level corresponding to the cache location in the read command buffer, where the total number of buffering levels is consistent with the number of cache locations in the read command buffer, and the number of buffering levels is positively correlated with the ordering of the cache locations.
缓冲等级的标记方法是根据读命令在读命令缓冲器内的预计等待时间,标记该读命令对应的缓冲等级,缓冲等级标记会随着对应的读出数据的一起到达读数据缓冲器,并根据缓冲等级的不同,存入读数据缓冲器中不同延时等级的寄存器中。The buffering level marking method is to mark the buffering level corresponding to the read command based on the expected waiting time of the read command in the read command buffer. The buffering level mark will arrive at the read data buffer along with the corresponding read data, and will be marked according to the buffer level. Different levels are stored in registers with different delay levels in the read data buffer.
以缓冲等级共3级为例,进行缓冲等级标记以及读命令、读出数据处理方法的示意、缓冲等级与读命令缓冲器中的缓存位置数量相等,则读命令缓冲器中的存储位置共有3个。以两个端口同时各自接收到一个读命令为例,如图7所示,通过读端口1接收到的读命令1和同时通过读端口2接收到的读命令2指示同一存储块,经读控制器判断其冲突后,按优先级将两个读命令进行排队,假设命令1排在命令2之前。在命令1和命令2存入存储块对应的读命令缓冲器之前,读命令缓冲器为空。这意味着命令1不需要等待,可以直接执行数据读取,命令2在执行数据读取之前需要等待1个周期。将读命令排队等待的周期数记为缓冲等级,那么命令1的缓冲等级为0,命令2的缓冲等级为1。如果此时有其他读命令调度至该读命令缓冲器,则排在命令2后面,缓冲等级为2。Taking the buffer level as a total of 3 levels as an example, the buffer level mark, the read command, and the read data processing method are shown. The buffer level is equal to the number of cache locations in the read command buffer. Then there are 3 storage locations in the read command buffer. indivual. Taking the two ports each receiving a read command at the same time as an example, as shown in Figure 7, the read command 1 received through the read port 1 and the read command 2 received through the read port 2 at the same time indicate the same memory block. After reading control After the processor determines the conflict, it queues the two read commands according to priority. It is assumed that command 1 is queued before command 2. Before command 1 and command 2 are stored in the read command buffer corresponding to the storage block, the read command buffer is empty. This means that command 1 does not need to wait and can directly perform data reading, and command 2 needs to wait for 1 cycle before performing data reading. The number of cycles in which the read command is queued is recorded as the buffering level. Then the buffering level of command 1 is 0 and the buffering level of command 2 is 1. If there are other read commands scheduled to the read command buffer at this time, they will be queued behind command 2, and the buffering level will be 2.
对应的在读数据缓冲器中,对应的连续3个周期内的各个寄存器变化如图7所示。The corresponding changes in each register in the read data buffer in three consecutive cycles are shown in Figure 7.
时刻0时,命令1读出的数据:数据1,由存储块读出,根据缓冲等级放入缓冲等级为0 的寄存器内。此后,每个周期该数据都会向下一级缓冲等级的寄存器传送。At time 0, the data read by command 1: data 1, read from the storage block, and put into the buffer level 0 according to the buffer level within the register. Thereafter, the data is transferred to the registers of the next buffer level every cycle.
时刻1时,数据1到达缓冲等级为1的寄存器。此时命令2读出的数据:数据2,由存储块读出后,根据其缓冲等级标记直接存储至缓冲等级为1的寄存器。At time 1, data 1 arrives at the register with buffer level 1. At this time, the data read by command 2: data 2, after being read from the storage block, is directly stored in the register with buffer level 1 according to its buffer level mark.
时刻2时,数据1和数据2分别传送至缓冲等级为2的寄存器,并且将在下一个周期同时送出至端口1和端口2。At time 2, data 1 and data 2 are respectively transferred to the register with buffer level 2, and will be sent to port 1 and port 2 at the same time in the next cycle.
可以明确的是,通过缓冲等级的标记,多个读端口指示读取的读出数据在读数据缓冲器内并不存在冲突,缓冲等级内的寄存器接收上一缓冲等级的数据,或者接收存储块读出的对应缓冲等级的数据,二者不会同时到达。由于同一端口在同一时刻内只会收到至多一条读命令,因此通过本实施例中的多端口存储器,只要读命令可以正确进入到读命令缓冲器,被标记上缓冲等级,对应的读出数据就不会在读数据缓冲器内发生冲突。What is clear is that through the marking of the buffer level, multiple read ports indicate that the read data does not conflict in the read data buffer. The registers in the buffer level receive data from the previous buffer level, or receive storage block reads. The data corresponding to the buffer level will not arrive at the same time. Since the same port can only receive at most one read command at the same time, through the multi-port memory in this embodiment, as long as the read command can correctly enter the read command buffer, it will be marked with a buffer level, and the corresponding read data There will be no conflicts in the read data buffer.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到根据上述实施例的方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如只读存储器/随机存取存储器(Read-Only Memory/Random Access Memory,ROM/RAM)、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本申请各个实施例所述的方法。Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by means of software plus the necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases the former is Better implementation. Based on this understanding, the technical solution of the present application can be embodied in the form of a software product in essence or that contributes to the existing technology. The computer software product is stored in a storage medium (such as read-only memory/random access memory). The memory (Read-Only Memory/Random Access Memory, ROM/RAM), magnetic disk, optical disk) includes several instructions to cause a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute this application Methods described in various embodiments.
在本实施例中还提供了一种多端口存储器的读写装置,该装置用于实现上述实施例及优选实施方式,已经进行过说明的不再赘述。如以下所使用的,术语“模块”可以实现预定功能的软件和/或硬件的组合。尽管以下实施例所描述的装置较佳地以软件来实现,但是硬件,或者软件和硬件的组合的实现也是可能并被构想的。This embodiment also provides a multi-port memory reading and writing device, which is used to implement the above-mentioned embodiments and preferred implementations. What has already been described will not be described again. As used below, the term "module" may be a combination of software and/or hardware that implements a predetermined function. Although the apparatus described in the following embodiments is preferably implemented in software, implementation in hardware, or a combination of software and hardware, is also possible and contemplated.
图8是根据本申请实施例的多端口存储器的读写装置的结构框图,如图8所示,该装置包括:写控制器82,用于在通过多个写端口接收到写命令的情况下,确定各个写命令各自对应的存储块,并在存储块的写缓冲器中存在空闲缓存空间的情况下,将写命令调度至对应的写缓冲器中,以通过写缓冲器将写命令指示的写数据写入存储块。Figure 8 is a structural block diagram of a multi-port memory read and write device according to an embodiment of the present application. As shown in Figure 8, the device includes: a write controller 82 for receiving a write command through multiple write ports. , determine the storage block corresponding to each write command, and when there is free cache space in the write buffer of the storage block, schedule the write command to the corresponding write buffer, so that the write command indicated by the write buffer is Write data is written to the memory block.
在一实施例中,上述可控制器82还用于在确定各个写命令各自对应的存储块之后,在存储块的写缓冲器中缓存空间均被占用的情况下,阻塞接收写命令的写端口,并在下一周期再次发起写命令。In one embodiment, the above-mentioned controller 82 is also configured to block the write port that receives the write command after determining the storage block corresponding to each write command, and when the cache space in the write buffer of the storage block is all occupied. , and initiate the write command again in the next cycle.
在一实施例中,上述多端口存储器的读写装置还包括:读控制器,用于在通过多个读端口接收到读命令的情况下,确定各个读命令各自对应的存储块,在存储块的读命令缓冲器中存在空闲缓存空间的情况下,将读命令调度至对应的读命令缓冲器中,并为读命令标记缓冲等级,以使读数据缓冲器在接收到读出数据的情况下,将读出数据反馈给对应的读端口其中,其中,每个存储块均配备有对应的读命令缓冲器,缓冲等级指示读命令指示的读出数据在读数据缓冲器中的延时拍数。In one embodiment, the above-mentioned multi-port memory reading and writing device further includes: a read controller, configured to determine the storage block corresponding to each read command when a read command is received through multiple read ports. In the storage block When there is free cache space in the read command buffer, the read command is scheduled to the corresponding read command buffer, and the buffer level is marked for the read command, so that the read data buffer receives the read data. , the read data is fed back to the corresponding read port, where each storage block is equipped with a corresponding read command buffer, and the buffer level indicates the number of beats of delay in the read data buffer for the read data indicated by the read command.
在一实施例中,上述读控制器还用于在确定各个读命令各自对应的存储块之后,在存储块的读命令缓冲器中缓存空间均被占用的情况下,阻塞接收读命令的读端口,并在下一周期再次发起读命令。In one embodiment, the above-mentioned read controller is also used to block the read port that receives the read command after determining the storage block corresponding to each read command, and when the buffer space in the read command buffer of the storage block is all occupied. , and initiate the read command again in the next cycle.
在一实施例中,上述读控制器将读命令调度至对应的读命令缓冲器中,并为读命令标记 缓冲等级,包括:在至少两个读命令对应同一存储块的情况下,按照优先级依次将至少两个读命令缓存至存储块对应的读命令缓冲器中,并按照缓存顺序依次为每个读命令标记缓冲等级,其中,每个读命令的缓冲等级均不相同。In one embodiment, the above-mentioned read controller schedules the read command to the corresponding read command buffer, and marks the read command Buffering level, including: when at least two read commands correspond to the same storage block, cache at least two read commands to the read command buffer corresponding to the storage block in sequence according to priority, and cache each read command in sequence according to the cache order. Command tag buffering level, where the buffering level is different for each read command.
在一实施例中,上述读控制器按照缓存顺序依次为每个读命令标记缓冲等级,包括:按照读命令缓存读命令缓冲器中的缓存顺序,确定读命令在读命令缓冲器中的缓存位置;为读命令标记与读命令缓冲器中的缓存位置对应的缓冲等级,其中,缓冲等级的总级数与读命令缓冲器中的缓存位置的数量一致,缓冲等级的级数与缓存位置的排序呈正相关。In one embodiment, the above-mentioned read controller marks the buffering level for each read command in sequence according to the cache order, including: determining the cache position of the read command in the read command buffer according to the cache order in the read command buffer; is the buffering level corresponding to the read command mark and the cache location in the read command buffer, where the total number of buffering levels is consistent with the number of cache locations in the read command buffer, and the number of buffering levels is positive with the ordering of the cache locations. Related.
需要说明的是,上述各个模块是可以通过软件或硬件来实现的,对于后者,可以通过以下方式实现,但不限于此:上述模块均位于同一处理器中;或者,上述各个模块以任意组合的形式分别位于不同的处理器中。It should be noted that each of the above modules can be implemented through software or hardware. For the latter, it can be implemented in the following ways, but is not limited to this: the above modules are all located in the same processor; or the above modules can be implemented in any combination. The forms are located in different processors.
为便于对本申请所提供的技术方案的理解,下面将结合具体场景的实施例进行详细的阐述。In order to facilitate the understanding of the technical solutions provided in this application, detailed description will be given below with reference to embodiments of specific scenarios.
本申请的实施例还提供了一种计算机可读存储介质,该计算机可读存储介质中存储有计算机程序,其中,该计算机程序被设置为运行时执行上述任一项方法实施例中的步骤。Embodiments of the present application also provide a computer-readable storage medium that stores a computer program, wherein the computer program is configured to execute the steps in any of the above method embodiments when running.
在一个示例性实施例中,上述计算机可读存储介质可以包括但不限于:U盘、只读存储器(Read-Only Memory,简称为ROM)、随机存取存储器(Random Access Memory,简称为RAM)、移动硬盘、磁碟或者光盘等各种可以存储计算机程序的介质。In an exemplary embodiment, the computer-readable storage medium may include but is not limited to: U disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM) , mobile hard disk, magnetic disk or optical disk and other media that can store computer programs.
本申请的实施例还提供了一种电子装置,包括存储器和处理器,该存储器中存储有计算机程序,该处理器被设置为运行计算机程序以执行上述任一项方法实施例中的步骤。An embodiment of the present application also provides an electronic device, including a memory and a processor. A computer program is stored in the memory, and the processor is configured to run the computer program to perform the steps in any of the above method embodiments.
在一个示例性实施例中,上述电子装置还可以包括传输设备以及输入输出设备,其中,该传输设备和上述处理器连接,该输入输出设备和上述处理器连接。In an exemplary embodiment, the above-mentioned electronic device may further include a transmission device and an input-output device, wherein the transmission device is connected to the above-mentioned processor, and the input-output device is connected to the above-mentioned processor.
本实施例中的具体示例可以参考上述实施例及示例性实施方式中所描述的示例,本实施例在此不再赘述。For specific examples in this embodiment, reference may be made to the examples described in the above-mentioned embodiments and exemplary implementations, and details will not be described again in this embodiment.
显然,本领域的技术人员应该明白,上述的本申请的各模块或各步骤可以用通用的计算装置来实现,它们可以集中在单个的计算装置上,或者分布在多个计算装置所组成的网络上,它们可以用计算装置可执行的程序代码来实现,从而,可以将它们存储在存储装置中由计算装置来执行,并且在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤,或者将它们分别制作成各个集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。这样,本申请不限制于任何特定的硬件和软件结合。Obviously, those skilled in the art should understand that the above-mentioned modules or steps of the present application can be implemented using general-purpose computing devices, and they can be concentrated on a single computing device, or distributed across a network composed of multiple computing devices. They may be implemented in program code executable by a computing device, such that they may be stored in a storage device for execution by the computing device, and in some cases may be executed in a sequence different from that shown herein. Or the described steps can be implemented by making them into individual integrated circuit modules respectively, or by making multiple modules or steps among them into a single integrated circuit module. As such, the application is not limited to any specific combination of hardware and software.
以上所述仅为本申请的优选实施例而已,并不用于限制本申请,对于本领域的技术人员来说,本申请可以有各种更改和变化。凡在本申请的原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。 The above descriptions are only preferred embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various modifications and changes. Any modifications, equivalent replacements, improvements, etc. made within the principles of this application shall be included in the protection scope of this application.

Claims (12)

  1. 一种多端口存储器,包括:N个写端口、一个写控制器、K个写缓冲器和一个存储块组,其中,A multi-port memory includes: N write ports, a write controller, K write buffers and a memory block group, wherein,
    所述存储块组,包括K个存储块,其中,K大于N;The storage block group includes K storage blocks, where K is greater than N;
    所述写端口,用于接收外部输入的写命令和写数据,并输出至所述写控制器;The write port is used to receive externally input write commands and write data, and output them to the write controller;
    所述写控制器,用于将所述写命令和写数据调度至对应的写缓冲器;The write controller is used to schedule the write command and write data to the corresponding write buffer;
    所述写缓冲器,用于缓存待写入存储块的写数据,其中,一个写缓冲器对应一个存储块。The write buffer is used to cache write data to be written into the storage block, where one write buffer corresponds to one storage block.
  2. 根据权利要求1所述的多端口存储器,还包括N个读端口、一个读控制器、K个读命令缓冲器和N个读数据缓冲器,其中,The multi-port memory according to claim 1, further comprising N read ports, a read controller, K read command buffers and N read data buffers, wherein,
    所述读端口,用于接收外部输入的读命令,并输出至所述读控制器;The read port is used to receive externally input read commands and output them to the read controller;
    所述读控制器,用于将所述读命令调度至对应的读命令缓冲器;The read controller is used to schedule the read command to the corresponding read command buffer;
    读命令缓冲器,用于缓存读对应的存储块的读命令,其中,一个读命令缓冲器对应一个存储块;The read command buffer is used to cache read commands for reading corresponding storage blocks, where one read command buffer corresponds to one storage block;
    所述读数据缓冲器,用于缓存从存储块读出的待输出至对应读端口的数据,其中,一个读数据缓冲器对应一个读端口。The read data buffer is used to cache data read from the storage block to be output to the corresponding read port, where one read data buffer corresponds to one read port.
  3. 一种多端口存储器的读写方法,应用于权利要求1-2任一项所述的多端口存储器,所述方法包括:A method of reading and writing a multi-port memory, applied to the multi-port memory according to any one of claims 1-2, the method includes:
    在通过多个写端口接收到写命令的情况下,确定各个写命令各自对应的存储块;When a write command is received through multiple write ports, determine the storage block corresponding to each write command;
    在所述存储块的写缓冲器中存在空闲缓存空间的情况下,将所述写命令调度至对应的所述写缓冲器中,以通过所述写缓冲器将所述写命令指示的写数据写入所述存储块。When there is free cache space in the write buffer of the storage block, the write command is scheduled to the corresponding write buffer to write the write data indicated by the write command through the write buffer. Write to the memory block.
  4. 根据权利要求3所述的方法,其中,在确定各个写命令各自对应的存储块之后,还包括:The method according to claim 3, wherein after determining the storage blocks corresponding to each write command, it further includes:
    在所述存储块的写缓冲器中缓存空间均被占用的情况下,阻塞接收所述写命令的写端口,并在下一周期再次发起所述写命令。When all the cache space in the write buffer of the storage block is occupied, the write port that receives the write command is blocked, and the write command is initiated again in the next cycle.
  5. 根据权利要求3所述的方法,所述方法还包括:The method of claim 3, further comprising:
    在通过多个读端口接收到读命令的情况下,确定各个读命令各自对应的存储块;When a read command is received through multiple read ports, determine the memory block corresponding to each read command;
    在所述存储块的读命令缓冲器中存在空闲缓存空间的情况下,将所述读命令调度至对应的所述读命令缓冲器中,并为所述读命令标记缓冲等级,以使读数据缓冲器按照所述缓冲等级,将所述读命令指示的读出数据反馈给对应的读端口,其中,所述缓冲等级指示所述读出数据在所述读数据缓冲器中的延时拍数。When there is free cache space in the read command buffer of the storage block, the read command is scheduled to the corresponding read command buffer, and the buffer level is marked for the read command so that the read data The buffer feeds back the read data indicated by the read command to the corresponding read port according to the buffer level, wherein the buffer level indicates the number of beats of the delay of the read data in the read data buffer. .
  6. 根据权利要求5所述的方法,其中,在确定各个读命令各自对应的存储块之后,还包括:The method according to claim 5, wherein after determining the storage block corresponding to each read command, it further includes:
    在所述存储块的读命令缓冲器中缓存空间均被占用的情况下,阻塞接收所述读命令的读端口,并在下一周期再次发起所述读命令。When all cache spaces in the read command buffer of the storage block are occupied, the read port that receives the read command is blocked, and the read command is initiated again in the next cycle.
  7. 根据权利要求5所述的方法,其中,将所述读命令调度至对应的所述读命令缓冲器中,并为所述读命令标记缓冲等级,包括:The method according to claim 5, wherein scheduling the read command to the corresponding read command buffer and marking the buffer level for the read command includes:
    在至少两个所述读命令对应同一存储块的情况下,按照优先级依次将至少两个所述读命令缓存至所述存储块对应的读命令缓冲器中,并按照缓存顺序依次为每个读命令标记缓冲等 级,其中,每个读命令的缓冲等级均不相同。In the case where at least two of the read commands correspond to the same storage block, cache at least two of the read commands into the read command buffer corresponding to the storage block in sequence according to the priority, and sequentially cache each read command in the cache order. Read command tag buffer, etc. levels, where each read command has a different buffering level.
  8. 根据权利要求7所述的方法,其中,按照缓存顺序依次为每个读命令标记缓冲等级,包括:The method according to claim 7, wherein marking the buffering level for each read command in sequence according to the cache order includes:
    按照所述读命令缓存所述读命令缓冲器中的缓存顺序,确定所述读命令在所述读命令缓冲器中的缓存位置;Determine the cache location of the read command in the read command buffer according to the cache order of the read command cache in the read command buffer;
    为所述读命令标记与所述读命令缓冲器中的缓存位置对应的缓冲等级,其中,所述缓冲等级的总级数与所述读命令缓冲器中的缓存位置的数量一致,所述缓冲等级的级数与所述缓存位置的排序呈正相关。Mark the read command with a buffering level corresponding to a cache location in the read command buffer, wherein the total number of buffering levels is consistent with the number of cache locations in the read command buffer, and the buffer The number of levels is positively correlated with the ordering of the cache locations.
  9. 一种多端口存储器的读写装置,包括:A multi-port memory reading and writing device, including:
    写控制器,用于在通过多个写端口接收到写命令的情况下,确定各个写命令各自对应的存储块,并在所述存储块的写缓冲器中存在空闲缓存空间的情况下,将所述写命令调度至对应的所述写缓冲器中,以通过所述写缓冲器将所述写命令指示的写数据写入所述存储块。A write controller, configured to determine the storage block corresponding to each write command when a write command is received through multiple write ports, and when there is free cache space in the write buffer of the storage block, write the The write command is scheduled to the corresponding write buffer, so that the write data indicated by the write command is written into the storage block through the write buffer.
  10. 根据权利要求9所述的装置,还包括:The device of claim 9, further comprising:
    读控制器,用于在通过多个读端口接收到读命令的情况下,确定各个读命令各自对应的存储块,在所述存储块的读命令缓冲器中存在空闲缓存空间的情况下,将所述读命令调度至对应的所述读命令缓冲器中,并为所述读命令标记缓冲等级,以使读数据缓冲器在接收到读出数据的情况下,将读出数据反馈给对应的所述读端口其中,其中,每个所述存储块均配备有对应的读命令缓冲器,所述缓冲等级指示所述读命令指示的所述读出数据在所述读数据缓冲器中的延时拍数。A read controller, configured to determine the storage block corresponding to each read command when a read command is received through multiple read ports, and when there is free cache space in the read command buffer of the storage block, the read controller will The read command is scheduled to the corresponding read command buffer, and the buffer level is marked for the read command, so that when the read data buffer receives the read data, the read data is fed back to the corresponding In the read port, each of the storage blocks is equipped with a corresponding read command buffer, and the buffer level indicates the delay of the read data indicated by the read command in the read data buffer. Number of beats per hour.
  11. 一种计算机可读存储介质,其中,所述计算机可读存储介质中存储有计算机程序,其中,所述计算机程序被处理器执行时实现所述权利要求3至8任一项中所述的方法的步骤。A computer-readable storage medium, wherein a computer program is stored in the computer-readable storage medium, wherein when the computer program is executed by a processor, the method described in any one of claims 3 to 8 is implemented. A step of.
  12. 一种电子装置,包括存储器、处理器以及存储在所述存储器上并可在所述处理器上运行的计算机程序,其中,所述处理器执行所述计算机程序时实现所述权利要求3至8任一项中所述的方法的步骤。 An electronic device including a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements claims 3 to 8 when executing the computer program. The steps of the method described in any one.
PCT/CN2023/083179 2022-06-30 2023-03-22 Multi-port memory, and reading and writing method and apparatus for multi-port memory WO2024001332A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210765522.5 2022-06-30
CN202210765522.5A CN117373508A (en) 2022-06-30 2022-06-30 Multiport memory, read-write method and device of multiport memory

Publications (1)

Publication Number Publication Date
WO2024001332A1 true WO2024001332A1 (en) 2024-01-04

Family

ID=89382671

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/083179 WO2024001332A1 (en) 2022-06-30 2023-03-22 Multi-port memory, and reading and writing method and apparatus for multi-port memory

Country Status (2)

Country Link
CN (1) CN117373508A (en)
WO (1) WO2024001332A1 (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040246807A1 (en) * 2003-06-03 2004-12-09 Seung-Hoon Lee Multi-port memory device with stacked banks
US20140052914A1 (en) * 2012-08-16 2014-02-20 Broadcom Corporation Multi-ported memory with multiple access support
CN106126112A (en) * 2015-05-07 2016-11-16 马维尔以色列(M.I.S.L.)有限公司 Each cycle has multiple read port and a plurality of memorizer of multiple write port
CN108206034A (en) * 2016-12-20 2018-06-26 豪威科技股份有限公司 For providing the method and system of multiport memory
CN112052206A (en) * 2020-08-31 2020-12-08 浙江双成电气有限公司 Multi-port data storage system based on arbitration

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040246807A1 (en) * 2003-06-03 2004-12-09 Seung-Hoon Lee Multi-port memory device with stacked banks
US20140052914A1 (en) * 2012-08-16 2014-02-20 Broadcom Corporation Multi-ported memory with multiple access support
CN106126112A (en) * 2015-05-07 2016-11-16 马维尔以色列(M.I.S.L.)有限公司 Each cycle has multiple read port and a plurality of memorizer of multiple write port
CN108206034A (en) * 2016-12-20 2018-06-26 豪威科技股份有限公司 For providing the method and system of multiport memory
CN112052206A (en) * 2020-08-31 2020-12-08 浙江双成电气有限公司 Multi-port data storage system based on arbitration

Also Published As

Publication number Publication date
CN117373508A (en) 2024-01-09

Similar Documents

Publication Publication Date Title
US6667920B2 (en) Scratchpad memory
KR100962769B1 (en) Supercharge message exchanger
US8874810B2 (en) System and method for read data buffering wherein analyzing policy determines whether to decrement or increment the count of internal or external buffers
US20060031643A1 (en) Implementing FIFOs in shared memory using linked lists and interleaved linked lists
KR20110089321A (en) Method and system for improving serial port memory communication latency and reliability
US7447872B2 (en) Inter-chip processor control plane communication
US9690713B1 (en) Systems and methods for effectively interacting with a flash memory
CN116414767B (en) Reordering method and system for AXI protocol-based out-of-order response
US20240086200A1 (en) Self-scheduling threads in a programmable atomic unit
US20200393991A1 (en) Efficient data movement method for in storage computation
CN116547644A (en) Detecting infinite loops in programmable atomic transactions
CN111538694B (en) Data caching method for network interface to support multiple links and retransmission
CN114827048A (en) Dynamic configurable high-performance queue scheduling method, system, processor and protocol
US20170024146A1 (en) Memory controller, information processing device, and control method
US12086638B2 (en) Topology of accelerators
WO2024001332A1 (en) Multi-port memory, and reading and writing method and apparatus for multi-port memory
KR20170117326A (en) Direct memory access control device for at least one processing unit having a random access memory
CN111190840A (en) Multi-party central processing unit communication architecture based on field programmable gate array control
CN115955441A (en) Management scheduling method and device based on TSN queue
CN103853692A (en) Multiprocessor data communication method based on interrupt judgment mechanism
US12045190B2 (en) Packet control apparatus and packet control method
EP0923032B1 (en) Method for transferring data in a multiprocessor computer system with crossbar interconnecting unit
CN103401812B (en) Message processing method and device based on 2 groups of Message processing engines

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: 23829523

Country of ref document: EP

Kind code of ref document: A1