Data distribution system, method, electronic device and storage medium with dual-port RAM
By using dual-port RAM and a dynamic control module in the data distribution system, the problem of increased downstream module area was solved, and resource utilization and data processing performance were improved.
Patent Information
- Application Number
- CN202611250664.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-18
- Publication Date
- 2026-11-17
AI Technical Summary
In existing data distribution systems, the addition of a FIFO memory to each downstream module leads to a significant increase in the area of the downstream modules and the entire system, resulting in low resource utilization.
A dual-port RAM is used to replace the FIFO memory of each downstream module. By setting up receive and transmit port control modules in the upstream module, and combining polling pointers and phase pointers, data packet storage and transmission are dynamically managed to ensure that data packets are sent when the downstream module can receive them.
Without increasing the system area, the data processing performance utilization of downstream modules was improved, achieving 1/N of the memory area utilization and avoiding resource idleness.
Smart Images

Figure CN123115019A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data transmission technology, and in particular to a data distribution system, method, electronic device, storage medium, and program product with dual-port RAM. Background Technology
[0002] During data transmission, upstream modules need to distribute data to downstream modules. When an upstream module distributes data to multiple downstream modules, each downstream module processes data at different speeds, and downstream modules with slower processing speeds may not be able to receive new data. Since the upstream module needs to distribute new data to all downstream modules simultaneously, if one downstream module is unable to receive new data, the upstream module cannot distribute the new data to other downstream modules. In this situation, the other downstream modules still have the capacity to process the new data, resulting in idle resources.
[0003] Existing technologies typically add a First-In-First-Out (FIFO) memory to each downstream module to store received data. When the data processing speed of a downstream module is slow, the FIFO memory can be used to store new data, thereby preventing other downstream modules from being idle. However, adding a FIFO memory to each downstream module significantly increases the area of the downstream modules and even the entire data distribution system, resulting in an increase in the area of the downstream modules and the entire data distribution system. Summary of the Invention
[0004] The purpose of this application is to provide a data distribution system, method, electronic device, storage medium, and program product with dual-port RAM to solve the technical problem of how to comprehensively consider the data processing speed of different downstream modules while controlling the area occupied by the data distribution system, thereby achieving the technical effect of improving the utilization rate of data processing performance of downstream modules.
[0005] In a first aspect, embodiments of the present invention provide a data distribution system with dual-port RAM, comprising: The upstream module is used to send the data packets to be sent to... N One downstream module; N A downstream module is used to receive data packets from the upstream module and process the received data packets. ; The upstream module includes a dual-port random access memory (RAM), a receive port control module, and a transmit port control module. The dual-port RAM includes a receiving port, a transmitting port, and K storage spaces. The dual-port RAM is used to store data packets to be sent. The receive port control module is used to determine whether to generate or receive a data packet to be sent in each clock cycle, and in the case of generating or receiving the first data packet, to determine that the first data packet is stored in one of K storage spaces; The transmit port control module is used to send a second data packet to no more than one downstream module in each clock cycle.
[0006] Furthermore, the receiving port control module includes: The polling pointer is used to poll the K storage spaces and store the first data packet in the first target storage space among the K storage spaces; The first target storage space includes the first blank storage space obtained through polling.
[0007] Furthermore, the receiving port control module includes: The polling pointer is used to poll the K storage spaces and store the first data packet in the first target storage space among the K storage spaces; The first target storage space includes the storage space where the stored data packets have been received by all downstream modules.
[0008] Furthermore, the transmitting port control module includes: N Each downstream module phase pointer, the N Each downstream module phase pointer corresponds to N There are K downstream modules, and each downstream module's phase pointer corresponds to K phases; Downstream module state vector, including N Bit data, N The bit data respectively indicate N The receiving status of each downstream module; Downstream module status pointer, used to poll the downstream module status vector.
[0009] Furthermore, the N-bit data of the downstream module state vector is either 0 or 1; Where 0 indicates that the corresponding downstream module cannot receive new data packets, and 1 indicates that the corresponding downstream module can receive new data packets.
[0010] Furthermore, the downstream module state vector N The value of the bit data is 0 or 1; Here, 1 indicates that the corresponding downstream module cannot receive new data packets, and 0 indicates that the corresponding downstream module can receive new data packets.
[0011] Furthermore, the capacity of the dual-port RAM is greater than or equal to 128 bytes.
[0012] In a second aspect, embodiments of the present invention provide a data distribution method with dual-port RAM, applied to the data distribution system with dual-port RAM described in the first aspect, comprising: In each clock cycle, the upstream module's receive port control module generates or receives no more than one data packet to be sent. In the case of generating or receiving the first data packet, the first data packet is stored in one of the K storage spaces. In each clock cycle, the transmit port control module in the upstream module sends a second data packet to no more than one downstream module; The upstream module is used to send the data packet to be sent to N One downstream module; N Each downstream module is used to receive data packets from the upstream module and process the received data packets. The upstream module includes a dual-port random access memory (RAM), a receive port control module, and a transmit port control module. The dual-port RAM includes a receive port, a transmit port, and K storage spaces. The dual-port RAM is used to store data packets to be transmitted.
[0013] Thirdly, embodiments of the present invention provide an electronic device, including: Memory is used to store executable instructions or computer programs. The processor, when executing computer-executable instructions or computer programs stored in the memory, implements the data distribution method with dual-port RAM as described in the second aspect.
[0014] Fourthly, a computer-readable storage medium storing a computer program product thereon, characterized in that, when the program product is executed by a processor, it implements the data distribution method with dual-port RAM as described in claim 8.
[0015] Fifthly, a computer program product comprising computer-executable instructions or a computer program, characterized in that, when the computer-executable instructions or the computer program are executed by a processor, they implement the data distribution method with dual-port RAM as described in claim 8.
[0016] This application has at least the following advantages or beneficial effects: By designing a data distribution system with dual-port RAM, this application solves the technical problem in the prior art that the area of the downstream module and even the entire data distribution system increases significantly after adding a FIFO memory to each downstream module. With the dual-port RAM and FIFO memory having the same capacity, it achieves the technical effect of using 1 / N memory area while enabling the downstream modules to achieve the same resource utilization rate. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in the specific embodiments of this application or the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0018] Figure 1 This is a schematic diagram of the structure of a data distribution system in the prior art; Figure 2 This is a schematic diagram of the data distribution system with dual-port RAM described in Embodiment 1 of this application; Figure 3 This is a schematic diagram of a dual-port RAM. Figure 4 This is a schematic diagram of the downstream module's phase pointer and dual-port RAM. Figure 5 This is a schematic diagram of the downstream module phase pointer when K=8; Figure 6A A schematic diagram of the structure of the downstream module state vector and the downstream module state pointer; Figure 6B A schematic diagram illustrating the polling of the downstream module's state vector using the downstream module's state pointer; Figure 7 This is a flowchart of a data distribution method with dual-port RAM as described in Embodiment 2 of this application. Detailed Implementation
[0019] The technical solutions of this application will be clearly and completely described below with reference to the embodiments. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0020] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.
[0021] In the description of this invention, it should be noted that the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings, or the orientation or positional relationship commonly used when the product of this invention is in use. They are only for the convenience of describing this invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of this invention. In addition, the terms "first," "second," "third," etc., are only used to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0022] Furthermore, terms such as "horizontal" and "vertical" do not imply that the component must be absolutely horizontal or suspended, but rather that it can be slightly tilted. For example, "horizontal" simply means that its direction is more horizontal than "vertical," not that the structure must be completely horizontal, but can be slightly tilted. Similarly, terms such as "front," "back," "left," and "right" do not imply that the component must be absolutely front, back, left, or right, but can be slightly tilted.
[0023] In the description of this invention, it should also be noted that, unless otherwise explicitly specified and limited, the terms "set," "install," "connect," and "link" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in this invention based on the specific circumstances.
[0024] Figure 1 This is a schematic diagram of the structure of a data distribution system in the prior art. For example... Figure 1 As shown, in order to balance the data processing speed of different downstream modules, a FIFO memory is set in each downstream module, for example, Figure 1 Downstream module 1 processes data relatively slowly. With the upstream module continuously distributing data, downstream module 1 temporarily stores unprocessed data in a FIFO memory for later processing. By setting up a FIFO memory in each downstream module, the upstream module can distribute data with little or no consideration for the differences in processing speeds between different downstream modules. However, setting up a FIFO in each downstream module significantly increases the area of the downstream modules, thus increasing the cost of the data distribution system.
[0025] Example 1 The data distribution system with dual-port RAM provided in this application can improve the utilization rate of downstream module data processing performance by comprehensively considering the data processing speed of different downstream modules without significantly increasing the area occupied by the data distribution system. Figure 2 This is a schematic diagram of the data distribution system with dual-port RAM described in Embodiment 1 of this application. Figure 2 As shown, the data distribution system with dual-port RAM described in this embodiment includes an upstream module 10 and N downstream modules 20. The upstream module 10 is used to send the data packets to be sent to... N There are 20 downstream modules. Upstream modules can be devices with data generation and processing capabilities, or they can act as relay stations to forward data from the bus or other devices to multiple downstream modules. N A downstream module 20 is used to receive data packets from the upstream module 10 and process the received data packets, wherein... In other words, in this embodiment, the upstream module 10 sends data packets to multiple downstream modules 20, and these downstream modules 20 have the same or different data processing speeds. The reason for this is... The problem of different data processing speeds among different downstream modules 20 only exists when the number of downstream modules 20 is greater than or equal to 2.
[0026] The upstream module 10 includes a dual-port random access memory (RAM) for storing data packets to be sent. This embodiment replaces the prior art's practice of using a single dual-port RAM within all downstream modules 20 by incorporating one RAM within the sending module 10. N Each module has a FIFO. Data packets to be distributed are stored in RAM. When a downstream module is capable of receiving new data, the required data packets stored in RAM are sent to that downstream module.
[0027] The dual-port RAM includes a receive port, a transmit port, and K storage spaces. Figure 3 This is a schematic diagram of a dual-port RAM, as shown below. Figure 3 As shown, the dual-port RAM includes K storage spaces (0 to K-1) for storing data packets to be sent. The dual-port RAM has two independently accessible ports, which are fixedly configured so that one is a receive port and the other a transmit port. The receive port is used to receive data packets from other devices or the bus, and the transmit port is used to send data packets to the downstream module 20. For example... Figure 3 As shown in the figure, the receiving port is located in the 0th storage space, that is, the dual-port RAM receives data packets from other devices or buses through the receiving port and stores the data packets in the 0th storage space; the sending port is located in the 2nd storage space, that is, the dual-port RAM sends data packets stored in the 2nd storage space to a downstream module through the sending port. Figure 3 This is for illustrative purposes only. In reality, the directions of the receiving port and the sending port will change depending on the actual situation, so that the data packets received by the upstream module are stored in different storage spaces, or the data packets in different storage spaces are sent to the downstream module.
[0028] The upstream module 10 further includes a receive port control module and a transmit port control module. The receive port control module is used to determine whether to generate a data packet or receive a data packet sent by other devices or buses in each clock cycle. If a first data packet is generated or a first data packet sent by other devices or buses is received, the module determines whether to store the first data packet in one of K storage spaces.
[0029] The receiving port control module includes a polling pointer, which is used to poll the K storage spaces and store the first data packet in the first target storage space among the K storage spaces. Figure 3 As shown, the arrow at the receiving port refers to the polling pointer. The address of the memory space pointed to by the polling pointer changes in a polling manner. For example, the polling pointer initially points to memory space 0. After memory space 0 receives data packets sent by other devices or the bus, the polling pointer moves to memory space 1, and so on. When the polling pointer moves to memory space K-1, one cycle of polling of the dual-port RAM is completed, and the polling pointer returns to memory space 0. Of course, the polling method is not limited to this. For example, the polling pointer can also initially point to memory space K-1, then move to memory space K-2, and so on.
[0030] The first data packet is stored in the first target storage space among the K storage spaces. This first target storage space is not any randomly polled storage space. This is because there is a possibility that if the upstream module 10 generates data packets or other devices or buses send data packets to the upstream module 10 at a rate much greater than the downstream module 20 receives data packets, then some storage spaces in the dual-port RAM may contain data packets that have not been received by the downstream module. If, in this case, new data packets are still stored in a certain storage space according to the polling results, the data packets originally stored in that storage space will be overwritten and cannot be sent to the downstream module.
[0031] Therefore, the first target storage space includes: the first empty storage space obtained through polling; or the storage space where the stored data packets have been received by all downstream modules 20. When the dual-port RAM is in its initial state, the storage space in the dual-port RAM is not completely filled. At this time, during the polling process, the polling pointer can use the first unoccupied storage space obtained through polling as the first target storage space to store the first data packet. When the dual-port RAM is not in its initial state, all storage spaces in the dual-port RAM have stored data packets. At this time, during the polling process, the polling pointer can use the storage space where the first stored data packet obtained through polling has been sent to all downstream modules as the first target storage space to store the first data packet. By selecting a suitable first target storage space, the technical problem of packet loss caused by the first data packet overwriting existing data packets that have not yet been received by all downstream modules is prevented, thus ensuring the reliability of data transmission.
[0032] The upstream module 10 further includes a transmit port control module, which controls the transmission of data packets from a storage space of the dual-port RAM to a downstream module. The transmit port control module is used to send a second data packet to no more than one downstream module 20 in each clock cycle.
[0033] Not all clock cycles do the dual-port RAM send data packets to downstream modules via the transmit port. When the upstream module generates or receives data packets from other devices or the bus at a slow rate, there may be no new data packets to send from the upstream module to the downstream module in certain clock cycles. Each clock cycle, the upstream module sends at most one data packet to one downstream module. Figure 2 As shown, within a certain clock cycle, the upstream module 10 sends a second data packet to the second downstream module. At the same time, the upstream module 10 cannot send data packets to the first downstream module or other downstream modules.
[0034] Optionally, the transmit port control module specifically includes N Each downstream module has a phase pointer, a state vector, and a state pointer. N Each downstream module phase pointer corresponds to N There are K downstream modules, and each downstream module's phase pointer corresponds to K phases. Figure 4 This is a schematic diagram of the downstream module's phase pointer and dual-port RAM. For simplicity, only the first, second, and third phase pointers are shown in the diagram. N The diagram shows the phase pointers. In reality, each downstream module corresponds to one phase pointer, therefore there are a total of... NEach downstream module has a phase pointer, where the first downstream module corresponds to the first phase pointer, the second downstream module corresponds to the second phase pointer, and so on. Each phase pointer can point to the same or different memory spaces, such as... Figure 4 As shown, the first phase pointer points to memory space 0, while the second and third phase pointers both point to memory space 1. The memory space a phase pointer points to indicates that if the downstream module corresponding to that phase pointer can receive data packets within that clock cycle, the upstream module will send the data packets from the memory space pointed to by that phase pointer to the corresponding downstream module.
[0035] Figure 5 The diagram shows the structure of the downstream module phase pointer when K=8. Figure 5 The diagram shows the first phase pointer. During the clock cycle illustrated, the first phase pointer points to memory space 0, indicating that if the upstream module sends a data packet to the first downstream module during this clock cycle, the data packet in memory space 0 of the dual-port RAM is sent to the first downstream module. When the next clock cycle arrives, and the first downstream module is able to receive the data packet, the phase of the first phase pointer increases. Figure 5 After the first phase pointer rotates clockwise, it points to the first storage space. At this time, the data packet in the first storage space of the dual-port RAM is sent to the first downstream module. By monitoring the phase pointers of each downstream module, when all phase pointers have polled a certain data packet, it indicates that the data packet has been received by all downstream modules 20.
[0036] Optionally, the capacity of the dual-port RAM is greater than or equal to 128 bytes. In the embodiments of this application, the storage space K of the dual-port RAM is its depth. The depth and bit width of the dual-port RAM together determine its capacity. Given a fixed capacity, the larger the depth value K, the smaller the bit width. Those skilled in the art can select a suitable capacity dual-port RAM according to their needs. Figure 5 For ease of illustration, we assume K=8. In practical applications, due to the significant differences in the data processing speed of each downstream module, especially when there are many downstream modules, the dual-port RAM needs to have sufficient storage space to store data packets, thereby adapting to the data processing speed requirements of different downstream modules and fully preventing resource idleness.
[0037] The transmitting port control module includes a downstream module state vector, which indicates the state of each downstream module, i.e. whether the downstream module can receive data packets in the current clock cycle. For example, if the data processing speed of downstream module 1 is slow, downstream module 1 may not be able to receive new data packets in the current clock cycle. At this time, the state of downstream module 1 is unable to receive new data packets.
[0038] Downstream module state vectors include N Bit data, N The bit data respectively indicate N The receiving status of each downstream module. Figure 6A The figure shows a schematic diagram of the downstream module state vector and downstream module state pointer. The downstream module state vector includes... N Bit data, respectively corresponding to N There are downstream modules, for example, state 1 corresponds to downstream module 1, state 2 corresponds to downstream module 2, and so on. N The status corresponds to the downstream module. N And so on.
[0039] Optionally, the downstream module state vector N The value of the bit data is either 0 or 1; where 0 indicates that the corresponding downstream module cannot receive new data packets, and 1 indicates that the corresponding downstream module can receive new data packets; or 1 indicates that the corresponding downstream module cannot receive new data packets, and 0 indicates that the corresponding downstream module can receive new data packets. In the case where 0 indicates that the corresponding downstream module cannot receive new data packets, and 1 indicates that the corresponding downstream module can receive new data packets, such as... Figure 6B As shown, when the value of state 1 is 0, it indicates that downstream module 1 cannot receive new data packets within the current clock cycle. The specific value used to characterize whether the corresponding downstream module can receive new data packets can be set according to the actual situation.
[0040] The downstream module status pointer is used to poll the downstream module status vector. Figure 6B This diagram illustrates the polling of the downstream module's state vector by the downstream module's state pointer. As shown, the downstream module's state pointer polls the downstream module's state vector from state 1 to state 2. N Poll through the states, reading from state 1 to state 2 respectively. N The state value. Since there are multiple downstream modules, and the upstream module can send data packets to at most one downstream module within a clock cycle, it is necessary to determine which downstream module the upstream module should send new data packets to within that clock cycle. For example, assuming a state value of 1 indicates that the corresponding downstream module can receive new data packets, and a state value of 0 indicates that the corresponding downstream module cannot receive new data packets, then in... Figure 6BIn the clock cycle shown, the downstream module status pointer points to a value of 0 in state 1, meaning that downstream module 1 cannot receive new data packets during this clock cycle. At this time, the downstream module status pointer polls to state 2 in this clock cycle, where the value is 1, meaning that downstream module 2 can receive new data packets during this clock cycle. The polling process of the downstream module status pointer is essentially an arbitration process; that is, when multiple downstream modules can receive new data packets, one downstream module is selected and the data packet is sent to it. By setting the downstream module status pointer to poll within the downstream module state vector, this provides... N Each downstream module has a variable priority setting, so that Figure 6B For example, initially the downstream module status pointer points to the first status value, and downstream module 1 has the highest priority. However, downstream module 1 cannot receive new data packets within this clock cycle. Therefore, the downstream module status pointer points to the second status value, and downstream module 2 can receive new data packets. Within this clock cycle, downstream module 2 receives the data packets sent by the upstream module.
[0041] This embodiment designs a data distribution system with dual-port RAM. By setting up dual-port RAM in the upstream module, it solves the technical problem in the prior art that the area of the downstream module and even the entire data distribution system increases significantly after adding a FIFO memory to each downstream module. When the dual-port RAM and FIFO memory have the same capacity, the area of a single dual-port RAM is even smaller than that of a single FIFO memory. Therefore, this embodiment achieves the technical effect of using 1 / N of the memory area to enable the downstream modules to achieve the same resource utilization.
[0042] Example 2 Figure 7 This is a flowchart of a data distribution method with dual-port RAM as described in Embodiment 2 of this application. This method can be executed by the data distribution system with dual-port RAM as described in Embodiment 1. Figure 7 As shown, a data distribution method with dual-port RAM includes: S710. In each clock cycle, the upstream module's receiving port control module generates or receives no more than one data packet to be sent. In the case of generating or receiving the first data packet, the first data packet is stored in one of the K storage spaces.
[0043] S710 specifically includes: polling pointers to poll K storage spaces to determine if there is a blank storage space and / or a storage space where the stored data packet has been received by all downstream modules 20; generating a data packet in the dual-port RAM of the upstream module 10 or receiving a data packet from other devices or buses; and storing the received data packet in the first blank storage space and / or a storage space where the stored data packet has been received by all downstream modules 20.
[0044] S720: In each clock cycle, the transmit port control module in the upstream module sends a second data packet to no more than one downstream module.
[0045] S720 specifically includes: polling the downstream module status vector using the downstream module status pointer to obtain the first downstream module that can receive new data packets; obtaining the downstream module phase pointer of the downstream module; obtaining the corresponding storage space among K storage spaces based on the downstream module phase pointer; and sending the data packet in the corresponding storage space to the downstream module.
[0046] The upstream module is used to send the data packet to be sent to N One downstream module; N Each downstream module is used to receive data packets from the upstream module and process the received data packets. The upstream module includes a dual-port random access memory (RAM), a receive port control module, and a transmit port control module. The dual-port RAM includes a receive port, a transmit port, and K storage spaces. The dual-port RAM is used to store data packets to be transmitted.
[0047] When a downstream module is able to receive a new data packet, the value corresponding to the downstream module's state in the downstream module's state vector changes, indicating that the downstream module is capable of receiving the new data packet. The phase pointer of the downstream module then points to the storage space where the new data packet to be received is located. Figure 4 and Figure 5 As shown, the downstream module phase pointer can gradually increase with the progress of data packet reception of the downstream module, starting from pointing to the 0th storage space, and after pointing to the K-1th storage space, it will point back to the 0th storage space.
[0048] like Figure 2 As shown, each downstream module reads different data packets from the dual-port RAM according to its own data processing speed, thereby achieving maximum resource utilization. Figure 4 As shown, when downstream module 1 processes data slowly, and reads the 0th storage space, the downstream module... N The third storage space has already been read. Therefore, the data distribution method with dual-port RAM designed in this embodiment achieves the technical effect of increasing the resource utilization of downstream modules by assigning an independent downstream module phase pointer to each downstream module, and different downstream modules do not affect each other.
[0049] Example 3 This application also provides an electronic device that can be used to execute the data distribution method with dual-port RAM described in Embodiment 2 above. The electronic device includes a memory and a processor, wherein the memory stores computer-executable instructions or computer programs; the processor, when executing the computer-executable instructions or computer programs stored in the memory, implements the data distribution method with dual-port RAM described in Embodiment 2 above.
[0050] The memory may include one or more of the following non-volatile and / or volatile storage media: read-only memory (ROM), random access memory (RAM), flash memory, disk storage, optical disk storage, etc.
[0051] The electronic device provided in this embodiment implements the data distribution method with dual-port RAM described in Embodiment 2 by executing computer-executable instructions or computer programs in the memory through the processor. This solves the technical problem in the prior art that the area of the downstream module and even the entire data distribution system increases significantly after each downstream module adds a FIFO memory. With the dual-port RAM and FIFO memory having the same capacity, the technical effect of achieving the same resource utilization rate of the downstream modules is achieved by using 1 / N of the memory area.
[0052] Example 4 This application also provides a computer-readable storage medium storing a computer program product. The computer-readable storage medium can be any medium capable of storing a computer program product, such as a read-only memory (ROM), random access memory (RAM), magnetic disk, optical disk, USB flash drive, portable hard drive, or solid state drive (SSD). When the program product stored in the computer-readable storage medium is executed by a processor, the data distribution method with dual-port RAM described in Embodiment 2 above is implemented.
[0053] Example 5 This application also provides a computer program product, including computer-executable instructions or a computer program. The computer program product can be implemented as software functional units and stored in the computer-readable storage medium described in Embodiment 4 above. When the computer-executable instructions or computer program are executed by a processor, the data distribution method with dual-port RAM described in Embodiment 2 above is implemented.
[0054] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.
Claims
1. A data distribution system with dual-port RAM, characterized in that, include: The upstream module is used to send the data packets to be sent to... N One downstream module; N A downstream module is used to receive data packets from the upstream module and process the received data packets. ; The upstream module includes a dual-port random access memory (RAM), a receive port control module, and a transmit port control module. The dual-port RAM includes a receiving port, a transmitting port, and K storage spaces. The dual-port RAM is used to store data packets to be sent. The receive port control module is used to determine whether to generate or receive a data packet to be sent in each clock cycle, and in the case of generating or receiving the first data packet, to determine that the first data packet is stored in one of K storage spaces; The transmit port control module is used to send a second data packet to no more than one downstream module in each clock cycle.
2. The data distribution system with dual-port RAM according to claim 1, characterized in that, The receiving port control module includes: The polling pointer is used to poll the K storage spaces and store the first data packet in the first target storage space among the K storage spaces; The first target storage space includes the first blank storage space obtained through polling.
3. The data distribution system with dual-port RAM according to claim 1, characterized in that, The receiving port control module includes: The polling pointer is used to poll the K storage spaces and store the first data packet in the first target storage space among the K storage spaces; The first target storage space includes the storage space where the stored data packets have been received by all downstream modules.
4. The data distribution system with dual-port RAM according to claim 1, characterized in that, The transmitting port control module includes: N Each downstream module phase pointer, the N Each downstream module phase pointer corresponds to N There are K downstream modules, and each downstream module's phase pointer corresponds to K phases; Downstream module state vector, including N Bit data, N The bit data respectively indicate N The receiving status of each downstream module; Downstream module status pointer, used to poll the downstream module status vector.
5. The data distribution system with dual-port RAM according to claim 4, characterized in that, The downstream module state vector N The value of the bit data is 0 or 1; Where 0 indicates that the corresponding downstream module cannot receive new data packets, and 1 indicates that the corresponding downstream module can receive new data packets.
6. The data distribution system with dual-port RAM according to claim 4, characterized in that, The downstream module state vector N The value of the bit data is 0 or 1; Here, 1 indicates that the corresponding downstream module cannot receive new data packets, and 0 indicates that the corresponding downstream module can receive new data packets.
7. The data distribution system with dual-port RAM according to claim 1, characterized in that, The capacity of the dual-port RAM is greater than or equal to 128 bytes.
8. A data distribution method with dual-port RAM, characterized in that, The data distribution system with dual-port RAM as described in any one of claims 1-7 includes: In each clock cycle, the upstream module's receive port control module generates or receives no more than one data packet to be sent. In the case of generating or receiving the first data packet, the first data packet is stored in one of the K storage spaces. In each clock cycle, the transmit port control module in the upstream module sends a second data packet to no more than one downstream module; The upstream module is used to send the data packet to be sent to N One downstream module; N Each downstream module is used to receive data packets from the upstream module and process the received data packets. The upstream module includes a dual-port random access memory (RAM), a receive port control module, and a transmit port control module. The dual-port RAM includes a receive port, a transmit port, and K storage spaces. The dual-port RAM is used to store data packets to be transmitted.
9. An electronic device, characterized in that, include: Memory is used to store executable instructions or computer programs. A processor, when executing computer-executable instructions or computer programs stored in the memory, implements the data distribution method with dual-port RAM as described in claim 8.
10. A computer-readable storage medium storing a computer program product thereon, characterized in that, When the program product is executed by the processor, it implements the data distribution method with dual-port RAM as described in claim 8.
11. A computer program product comprising computer-executable instructions or a computer program, characterized in that, When the computer-executable instructions or computer program are executed by the processor, the data distribution method with dual-port RAM as described in claim 8 is implemented.
