Multi-port and multi-priority router data packet cache management scheduling system
By designing a multi-port and multi-priority packet cache management and scheduling system in the router, using static random memory and lightweight linked list management strategies, the problems of low cache space utilization and high scheduling cost in traditional routers are solved, and efficient bandwidth is achieved Scheduling and system performance improvements.
Patent Information
- Application Number
- CN202411071787.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-06
- Publication Date
- 2024-11-19
AI Technical Summary
Traditional routers have low cache space utilization and high scheduling costs, resulting in limited bandwidth improvement, and complex scheduling strategies make speed a bottleneck.
Design a multi-port and multi-priority router packet cache management and scheduling system, using static random memory, separately process scheduling units and data units, adopt a lightweight linked list management strategy, supports absolute priority and weight polling, and minimize dynamic scheduling The unit is 64 bytes, and the scheduling speed is improved.
It realizes efficient utilization of cache space, greatly improves scheduling speed, adaptive bandwidth adjustment, reduces the scheduling cost of dynamic cache, and improves system performance and stability.
Smart Images

Figure CN118984301A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of integrated circuits, and in particular relates to a multi-port and multi-priority router data packet cache management and scheduling system. Background Art
[0002] With the rapid development of information technology and the deepening of the information society, the amount of information on the Internet has exploded, and the requirements of each network terminal for network bandwidth are increasing day by day, so higher requirements are put forward for the data storage and forwarding capabilities of network devices such as routers. In the processing of data packets by network devices, storage management and scheduling take up most of the time, so the low-speed cache capacity of most memories has become a bottleneck restricting the further improvement of network processors.
[0003] Traditional static caching technology allocates a fixed cache space for each priority queue, so that the read and write bandwidth of each port can be fully utilized. However, in actual applications, data packets of different priorities are generally uneven, so there will be a situation where the cache space of some priority queues is full, while the cache space of other priority queues is still empty, which will result in a large waste of cache space.
[0004] In order to make full use of the cache space, dynamic cache technology has been widely used, that is, queues of different priorities share a cache space; however, there is a problem with this cache space. In actual applications, the length of the data packet is not fixed and can vary within a certain range, so the data packet unit cannot be well determined: if it is too large, there will still be a large waste of cache space, and dynamic scheduling will lose its meaning; if it is too small, the scheduling cost of the dynamic cache space will be very high, seriously restricting the power consumption and bandwidth of the entire system; and the current complex scheduling strategy makes the scheduling speed a bottleneck for further bandwidth improvement. Summary of the invention
[0005] In view of the above-mentioned problems or deficiencies, in order to solve the problem that the bandwidth of the traditional router cache space cannot be increased due to low utilization and high scheduling cost, the present invention provides a multi-port and multi-priority router data packet cache management and scheduling system, which is a special integrated circuit, uses static random access memory as a storage medium, has m input ports and n output ports, and data packets can be output from any input port to any output port; its data packet has p priorities, and the length is between 64 bytes and 1024 bytes; a lightweight linked list design is used to schedule address resources, and the minimum unit s for dynamic scheduling of address resources is 64 bytes, and the bit width w of each data frame is 32 bits. The present invention processes the scheduling unit and the data unit separately, and uses a more lightweight linked list management strategy, which greatly improves the scheduling speed under the premise of ensuring complete dynamic scheduling.
[0006] A multi-port and multi-priority router data packet cache management and scheduling system includes an input buffer module, a control frame conversion module, an address recovery instruction generation module, an address resource allocation / recovery module, an input port routing table module, an output port routing table module, an output docking module and a dynamic data cache module.
[0007] The input buffer module has m input ports, which are the input ports of the entire system, and are used to receive and buffer external input data. Because the allocation of address resources requires a certain amount of time, a FIFO (first-in, first-out queue) of a certain depth is required to temporarily store data. If the bandwidth of each port is required to reach 1Gbps when the clock frequency is 250MHz, then the depth of this FIFO is at least 4m and the width is 32 bits. Its output terminal is connected to the dynamic data cache module, which has a total of m output ports. When the input port routing table module generates a valid address, data is read from the input buffer module and written into the dynamic data cache module together with the valid address. In addition, the full signal of the FIFO is connected to the external data provider to realize the flow control of the input data.
[0008] One end of the control frame conversion module is connected to the input data from the outside world, and has m input ports and a group of registers corresponding to each port, and the group of registers includes level 0 and level 1 registers; its output port is connected to the address resource allocation / recycling module, which obtains all control frames in the input data by listening to the input data from the outside world, and then performs priority polling arbitration according to the data packet information of the control frame. Among the control frames that arrive, one of the control frames with the highest priority succeeds in arbitration, and the remaining control frames fail in arbitration. The control frames that fail in arbitration will wait for the next round of arbitration.
[0009] Furthermore, the control frame that has been successfully arbitrated is the control frame with the highest port number among the control frames with the highest priority, so as to ensure the serialization of address resource allocation.
[0010] Furthermore, the arbitration mechanism of the control frame conversion module is as follows: (1) firstly, the control frame data is written into the corresponding position in the m groups of the current level registers (level 0), and its valid bit is pulled high, indicating that the control frame is valid; (2) when the control frame in the current level registers (level 0) is valid, and the corresponding position in the next level registers (level 1) is invalid, and the priority of the control frame is the same as the alternative priority, then the control frame is written from the level 0 register to the level 1 register, that is, the valid bit of the corresponding position of the level 0 register is pulled low, and the valid bit of the level 1 register is pulled high; (3) when the allocation instruction register to be executed When the highest bit of the valid control frame in the level 1 register is empty, the highest bit of the valid control frame in the level 1 register is converted into an address allocation instruction, and the control frame is invalidated in the register at this level until there is no control frame in the level 1 register; (4) When the address resource allocation / recycling module allows the reception of allocation instructions, and the allocation instruction register to be executed is not empty, the allocation instruction is sent to the address resource allocation / recycling module; (5) When and only when there is a control frame in the level 0 register and there is no control frame in the level 1 register, the alternative priority is set to 0, and in other cases it is increased by 1. The alternative priority counts cyclically between 0 and p-1, where p is the number of priorities.
[0011] The address recovery instruction generation module includes n output ports and n groups of recovery instruction status registers corresponding to each other, which are initialized to 0; and is used to generate address recovery instructions. In order to correctly generate address recovery instructions, the module monitors the empty and full conditions of the queue in the pointer register stack of the address resource allocation / recovery module and the data actually output in the output docking module, and determines the generation of the address recovery instruction of a certain output port in a certain clock cycle through polling, and sends the address recovery instruction when the address resource allocation / recovery module allows receiving the address recovery instruction.
[0012] Furthermore, the address recovery instruction generation module generates two types of address recovery instructions:
[0013] One is the starting address resource recovery instruction. First, there are n groups of recovery instruction status registers in the module, corresponding to n output ports, initialized to 0. The module will first poll the information of the recovery instruction status registers corresponding to different output ports. If it is idle (that is, 0), it will select the data packet queue with a certain priority of the data packet corresponding to the output port according to the absolute priority arbitration or the weighted polling priority arbitration, and then it will generate a fixed recovery instruction for recovering a single address resource (that is, 64 bytes), and at the same time set the recovery instruction status register of this output port to busy.
[0014] The other is a supplementary address resource recovery instruction. According to the actual data output of the output docking module intercepted, when the control frame output of a data packet is intercepted, a recovery instruction for recovering its actual length minus one address resource is formed according to its length information. If the length of this data packet is an address resource, that is, the starting address resource recovery instruction has completely recovered the space occupied by the data packet, then no supplementary address resource recovery instruction will be generated; and when the data output by the output docking module is intercepted as the end frame, the recovery instruction status register of the corresponding output port will be reset to idle. The address recovery instruction generated above will be sent to the address resource allocation / recovery module when the address resource allocation / recovery module allows receiving the recovery instruction.
[0015] The address resource allocation / recycling module is used for the allocation and recycling of address resources, and is connected to the control frame conversion module and the address recycling instruction generation module, receives the allocation and recycling instructions of the above two modules, stores them in an instruction FIFO, and allocates or recycles address resources in turn; because the allocation and recycling instructions may arrive at the same time, there is a priority for which of the two instructions enters the instruction FIFO first, and this priority is switched in turn in this module. The allocation instruction has a higher priority during initialization, and the recycling instruction priority becomes higher after storing an allocation instruction, and the allocation instruction priority becomes higher after storing a recycling instruction, so that the allocation and recycling instructions are executed as evenly as possible. When the instruction FIFO is full, neither the allocation nor the recycling instructions are allowed to be received; the address resource allocation / recycling module is also connected to the input port routing table module and the output port routing table module, and is responsible for receiving the allocated address resources and the recycled address resources, wherein the address resources allocated by the address allocation event are written into the input port routing table module, and the address resources recovered by the address recycling event are written into the output port routing table module.
[0016] Furthermore, the address resource allocation / recycling module has a memory for storing the address resource linked list, and a pointer register stack for reading and writing (dxry represents a read pointer, dxwy represents a write pointer, where x represents an output port, y represents a priority, for example, the pointer registers representing output port 0 and priority 1 are d0w1 and d0r1), an empty linked list head pointer pems and a tail pointer peme. The depth of the address resource linked list memory is 2 K (2 K= storage space of dynamic data cache module / 64 bytes), the bit width is K, the data stored in each address in the address resource list is the address of the next node, and the value of the address plus one is written to the current address during initialization. The pointer register stack is divided into n groups based on the destination output port, and each destination port has p sets of priority read and write pointers corresponding to its p priorities (for example, the read and write pointer registers of priority 0 of destination port 0 are d0r0 and d0w0 respectively), that is, there are a total of n*p queues, n*p*2+2 groups of registers, when the read and write pointers point to the same address, it means that the queue is empty, for example, when d0r0 is equal to d0w0, it means that the destination port is 0, and the data packet with priority 0 does not currently exist; when the head pointer and tail pointer of the empty list point to the same address, the list is full, that is, the address resources have been allocated. These pointer registers point to the address resource linked list, and the bit width is K. During initialization, a continuous linked list address is assigned to the read and write pointers of different queues in turn. The read and write pointers of the same queue are the same, and the head pointer and tail pointer of the empty linked list are assigned to the head address and tail address of the remaining addresses of the linked list, respectively. For example, 0 is assigned to d0r0 and d0w0, 1 is assigned to d0r1 and d0w1, (n*p-1) is assigned to d(n-1)r(p-1) and d(n-1)w(p-1), n*p is assigned to pems, 2 K -1 is assigned to peme.
[0017] Take an example to illustrate the address allocation event and address recovery event. Assume that the destination port of the written data packet is 0, the priority is 1, the length is 1 address resource, and the source input port is 2. The specific address allocation process is:
[0018] (1) The value of the d0w1 register is allocated and written into the FIFO corresponding to the input port routing table module (i.e., the address resource FIFO corresponding to input port 2 in the input port routing table) as the allocated address resource; (2) The value of the pems register is written into the d0w1 register and the address previously pointed to by the d0w1 register, that is, the value stored in the address 1 originally pointed to by d0w1 will change from 2 to n*p, and the value of the d0w1 register will change from 1 to n*p; (3) The value in the address pointed to by the pems register is read out and written into the pems register, that is, n*p+1 is read out from the address n*p pointed to by pems, and then n*p+1 is written into the pems register; at this time, the address allocation event is completed.
[0019] After the address allocation event is completed, the address recovery instruction generation module detects that there are registers with different read and write pointers in the p-group read and write pointer registers with the destination port 0, that is, there is data to be sent, so it can generate an address recovery instruction, initiate address recovery, and read out data. The specific process is as follows:
[0020] (1) Read the value of the d0r1 register (address 1) as the read address of the subsequent module (that is, send it to the FIFO of output port 0 corresponding to the output port routing table module), and write this value to the address pointed to by the peme register, as well as the peme register itself. In other words, write the address pointed to by peme to 2 K -1 changes the value in register PEME from 0 to 1, and then changes the value in register PEME from 2 K -1 becomes 1; (2) the value of the address pointed to by the d0r1 register is read out and written into the d0r1 register, that is, n*p is read out, and then the value of d0r1 changes from 1 to n*p, and the address recycling event is completed; allocating or recycling an address resource only takes 2 clock cycles.
[0021] The length of the address resource allocation and recovery instruction is 5+log2(mnp) bits, bit 4+log2(mnp) indicates address resource allocation or recovery, bits 3+log2(mnp) to 4+log2(np) indicate the source port, bits 3+log2(np) to log2(np) indicate the length, bits log2(np)-1 to log2(n) indicate the priority, and bits log2(n)-1 to 0 indicate the destination port.
[0022] The input port routing table module has m address resource FIFOs with a depth of 16, which are responsible for receiving the allocated address resources and listening to the empty and full signals of the data FIFO of the corresponding port in the input buffer module; if the data FIFO of the corresponding port is not empty, it attempts to obtain a valid address resource from the address resource FIFO of the corresponding port of this module, and then splices this valid address resource with the address offset (if the data frame is 32 bits and the address resource is 64 bytes, at a clock frequency of 250MHz and a port bandwidth of 1Gbps, the address offset has log2(128 / m) bits) to become a valid address, and then continuously takes out m / 8 data from the corresponding data FIFO in the input buffer module, and then a valid address data pair is formed. If the end frame is taken without taking enough m / 8 data, it is considered that enough data has been taken. This module may have up to m valid address data pairs at the same time, and a circular priority arbitrator is used for arbitration at this time. The valid address data pairs that succeed in arbitration are written into the dynamic data cache module, and the valid address data pairs that fail in arbitration wait for the next arbitration. After the valid address data pair that has successfully arbitrated is written into the dynamic data cache module, the address offset is increased by one, and the data is retrieved again to form a new address data pair until the address offset is completed, that is, the address offset bits shift from all 0 to all 1. At this time, the address resource is invalid, and an attempt is made to retrieve the address resource from the corresponding address resource FIFO to repeat the above process.
[0023] The output port routing table module has n address resource FIFOs with a depth of 16, which are responsible for receiving recycled address resources, generating valid recycled addresses, and retrieving data from the dynamic data cache module. The output port routing table module has a read-write protection lock. If the status of the corresponding port in the listening output docking module is idle, it attempts to obtain address resources from the address resource FIFO of the corresponding port in this module as a valid address resource, and then compares this address resource with the valid address resource in the input port routing table module. If the same address resource exists, it waits until the same valid address resource does not exist in the input port routing table module, and then splices the address offset into a valid address (if the data frame is 32 bits and the address resource is 64 bytes, at a clock frequency of 250MHz and a port bandwidth requirement of 1Gbps, then The address offset has log2(128 / n) bits); at this time, there may be up to n valid addresses, and these valid addresses are arbitrated in a circular priority manner. The valid address that has successfully been arbitrated is used to read the corresponding data from the dynamic data cache module, put it into the corresponding port of the output docking module, and the state of the port is changed to busy until the data is read out by the outside world. The state of the port is changed back to idle, and the offset is made in sequence until the address resource is offset. That is, the address offset bit is offset from all 0 to all 1. At this time, the address resource is invalid, and the state of the corresponding port in the output docking module is monitored. Try to take out the address resource from the corresponding address resource FIFO and repeat the above process.
[0024] The output docking module has n registers for data caching, which are responsible for temporarily storing the data of each output port read from the dynamic data caching module and outputting the data according to the external state.
[0025] The dynamic data cache module is composed of a static random access memory, and is connected with the input buffer module, the input port routing table module, the output docking module, and the output port routing table module to serve as a unified data cache space.
[0026] In summary, the present invention relates to a dedicated integrated circuit, which uses a static random access memory as a storage medium, and processes scheduling units and data units separately; its data packets have p priorities, and the length is between 64 bytes and 1024 bytes. The first frame (control frame) of each data packet contains the length, priority and destination port information of the data packet, and the last frame (end frame) contains the information of the end of the data packet, and the intermediate data frames have no special information; data packet scheduling supports absolute priority and weighted polling priority, and the scheduling speed can reach s / 2 bytes per clock cycle. At a clock frequency of 250MHz, the bandwidth of each port can be adaptively adjusted, and it only needs to meet the total bandwidth of less than sGbps; a lightweight linked list design is used to schedule address resources, and the addition, deletion and traversal functions of traditional linked lists are abandoned, and only the connection function of the linked list is retained. The read and write of the queue are separated and managed by two sets of linked lists, and the remaining space is managed by a separate set of linked lists, so that the effect of multiple queues sharing a cache space is achieved with a relatively small logic complexity, while ensuring a higher scheduling speed. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 is a system block diagram of the present invention;
[0028] Figure 2 It is a diagram illustrating the allocation instructions of the control frames of each port in the control frame conversion module;
[0029] Figure 3 Instruction structure for address resource allocation / reclaim module processing;
[0030] Figure 4 The status of the address resource list and the read and write pointers of each queue when they are initialized;
[0031] Figure 5 The state of the address resource linked table of the embodiment after an address resource allocation is performed;
[0032] Figure 6 This is the state of the address resource linked list in the embodiment after an address resource recovery is performed. DETAILED DESCRIPTION
[0033] In order to make the purpose, technical solution and advantages of the present invention clearer, the working process of the present invention will be further described in detail below with reference to examples.
[0034] First, the read-write pointers of the linked list and each queue and the head and tail pointers of the empty linked list need to be specially initialized. All others can be initialized to 0. The initialization of the linked list requires adding a value to the address and writing it to the address. The largest address can be initialized to 0, and the read-write pointers of each queue are assigned values in sequence starting from 0. The head pointer and tail pointer of the empty linked list are respectively assigned to the head address and tail address of the remaining addresses of the linked list, that is, 0 is assigned to d0r0 and d0w0, 1 is assigned to d0r1 and d0w1, n*p is assigned to d(n-1)r(p-1) and d(n-1)w(p-1), n*p is assigned to pems, 2 K -1 is assigned to peme, such as Figure 4 shown.
[0035] A data packet enters the input port 0. The length of the data packet is 1, the priority is 1, the destination is port 0, and the source input port is 2. The control frame of the data packet is intercepted and enters the control frame conversion module, becomes an allocation instruction and enters the address resource allocation / recycling module to start address resource allocation.
[0036] (1) Assign the value of the d0w1 register (i.e., address 1) and write it into the FIFO corresponding to the input port routing table module (i.e., the FIFO corresponding to port 2) as the assigned address; (2) Write the value of the pems register into the d0w1 register and the address previously pointed to by the d0w1 register, that is, the value stored in the address 1 originally pointed to by d0w1 will change from 2 to n*p, and the value of the d0w1 register will change from 1 to n*p; (3) Read the value in the address pointed to by the pems register and write it into the pems register, that is, read n*p+1 from the address n*p pointed to by pems, and then write n*p+1 into the pems register, as shown in Figure 5 shown.
[0037] At this time, an address resource enters the address resource FIFO of port 0 in the input port router module. At the same time, the values of registers d0w1 and d0r1 are no longer the same. The address recovery instruction module detects that there is a data packet in the queue and the recovery instruction status register corresponding to output port 0 is idle, so a start address recovery instruction is generated and sent to the address resource allocation / recovery module. At the same time, the recovery instruction status register corresponding to output port 0 becomes busy, and the address resource allocation / recovery module starts address recovery.
[0038] (1) Read the value of the d0r1 register (address 1) as the read address of the subsequent module (that is, send it to the FIFO of output port 0 corresponding to the output port routing table module), and write this value to the address pointed to by the peme register, as well as the peme register itself. In other words, write the address pointed to by peme to 2 K -1 changes the value in register PEME from 0 to 1, and then changes the value in register PEME from 2K -1 becomes 1; (2) the value of the address pointed to by the d0r1 register is read out and written into the d0r1 register, that is, n*p is read out, and then the value of d0r1 changes from 1 to n*p. At this point, the address recycling event is completed, and the values of registers d0w1 and d0r1 are the same again, such as Figure 6 shown.
[0039] The above is the process of scheduling addresses. The specific data packet first enters the data FIFO corresponding to port 0 of the input buffer module, and then waits for the address resource of the port corresponding to the input port routing table module to be valid (that is, address 1 in the address resource FIFO corresponding to input port 2), splices the offset to form a valid address, and writes it together with the data into the dynamic data storage module. After the address resource recovery instruction is executed, the address resource FIFO of port 0 of the output port routing table module obtains an address resource (that is, address 1), takes out the address resource, and then port 0 will check whether there is the same address resource in the input port routing table module through the read-write lock. The valid address resources will not be valid until there are no identical valid address resources. The address resources of port 0 in the output port routing table module will be valid and allowed to be spliced with the offset into a valid address. Data is read from the dynamic data storage module and placed in the output docking module to wait for output. The address recovery instruction module listens to the data output by the output docking module. When a control frame is detected, it determines whether to generate a supplementary address recovery instruction. In this example, the data packet length is 1, so no supplementary address recovery instruction is generated. When the end frame is detected, the corresponding port in the address recovery instruction module, that is, the recovery instruction status register of port 0 is turned idle again.
[0040] Compared with the router design using static cache, the present invention adopts the design of dynamic cache to solve the problem of low cache space utilization. Compared with the traditional dynamic cache router design, the present invention measures the design of dynamic cache and realizes a lightweight linked list management mechanism with low address allocation and recovery cost. While effectively improving the scheduling speed, it achieves strong flexibility. The length of the message can be any length between 64 bytes and 1024 bytes. The bandwidth of different ports can be adaptively allocated under a large total scheduling bandwidth (that is, if the clock frequency is 250MHz, it only needs to meet the total bandwidth of less than 64Gbps), and as long as the initialization is completed, there is no need to do any maintenance on the linked list, thereby improving the stability and performance of the system.
[0041] In summary, the present invention processes the scheduling unit and the data unit separately, and performs fully dynamic address management based on the linked list for the entire cache space with the address resource allocation and recovery module as the core, thereby solving the problem of low cache space utilization: its data packet scheduling supports absolute priority and weighted polling priority, and the scheduling speed can reach s / 2 bytes per clock cycle. At a clock frequency of 250MHz, the bandwidth of each port can be adaptively adjusted, as long as the total bandwidth is less than sGbps; combined with the use of a lightweight linked list design to schedule address resources, the traditional linked list's add, delete and traversal functions are abandoned, and only the linked list's connection function is retained. The read and write of the queue are separated and managed by two sets of linked lists, and the remaining space is managed by a separate set of linked lists. The effect of multiple queues sharing one cache space is achieved with a relatively small logic complexity, while ensuring a relatively high scheduling speed, reducing a lot of complex logic controls, and improving the performance and reliability of the overall system design.
Claims
1. A multi-port multi-priority router data packet cache management and scheduling system, characterized in that: It includes an input buffer module, a control frame conversion module, an address recovery instruction generation module, an address resource allocation / recovery module, an input port routing table module, an output port routing table module, an output docking module and a dynamic data cache module; The input buffer module has m input ports, which are the input ports of the entire system and are used to receive and buffer external input data; Its output end is connected to the dynamic data cache module, which has a total of m output ports. When the input port routing table module generates a valid address, it reads data from the input buffer module and writes it into the dynamic data cache module together with the valid address. In addition, the full signal of the FIFO is connected to the external data provider to realize the flow control of the input data. One end of the control frame conversion module is connected to the input data from the outside, and has m input ports and a group of registers corresponding to each port, and the group of registers includes level 0 and level 1 registers; its output port is connected to the address resource allocation / recycling module, which obtains all the control frames in the input data by listening to the input data from the outside, and then performs priority polling arbitration according to the data packet information of the control frame. Among the control frames that arrive, one of the control frames with the highest priority succeeds in arbitration, and the remaining control frames fail in arbitration. The control frames that fail in arbitration will wait for the next round of arbitration; The address recovery instruction generation module includes n output ports and n sets of recovery instruction status registers corresponding to each other, which are initialized to 0; It monitors the fullness and emptyness of the queue in the pointer register stack of the address resource allocation / recycling module and the actual output data in the output docking module, determines to generate an address recycling instruction of a certain output port in a certain clock cycle by polling, and issues the address recycling instruction when the address resource allocation / recycling module allows receiving the address recycling instruction; The address resource allocation / recycling module is used for the allocation and recycling of address resources, is connected with the control frame conversion module and the address recycling instruction generation module, receives the allocation and recycling instructions of the above two modules, stores them in an instruction FIFO, and sequentially allocates or recycles address resources; the allocation and recycling instructions are switched in turn as to which enters the instruction FIFO first, the allocation instruction has a higher priority during initialization, after storing an allocation instruction, the recycling instruction priority becomes higher, and after storing a recycling instruction, the allocation instruction priority becomes higher, when the instruction FIFO is full, neither the allocation nor the recycling instructions are allowed to be received; the address resource allocation / recycling module is also connected with the input port routing table module and the output port routing table module, and is responsible for receiving the allocated address resources and the recycled address resources, wherein the address resources allocated by the address allocation event are written into the input port routing table module, and the address resources recycled by the address recycling event are written into the output port routing table module; The input port routing table module has m address resource FIFOs with a depth of 16, which are responsible for receiving the allocated address resources and listening to the empty and full signals of the data FIFO of the corresponding port in the input buffer module; if the data FIFO of the corresponding port is not empty, it tries to obtain a valid address resource from the address resource FIFO of the corresponding port of this module, and then splices the address offset of this valid address resource into a valid address, and then continuously takes out m / 8 data from the corresponding data FIFO in the input buffer module, at which time a valid address data pair is formed. If the end frame is taken before taking m / 8 data, it is considered that enough data has been taken; the input port routing table module may have at most m valid address data pairs at the same time, and a circular priority arbitrator is used for arbitration at this time. The valid address data pairs that succeed in arbitration are written into the dynamic data cache module, and the valid address data pairs that fail in arbitration wait for the next arbitration; After the valid address data pair that has been successfully arbitrated is written into the dynamic data cache module, the address offset is increased by one, and the data is taken out again to form a new address data pair until the address offset is completed, that is, the address offset bit shifts from all 0 to all 1. At this time, this address resource is invalid, and an attempt is made to take out the address resource from the corresponding address resource FIFO to repeat the above process; The output port routing table module has n address resource FIFOs with a depth of 16, which are responsible for receiving recycled address resources, generating valid recycled addresses, and taking data out of the dynamic data cache module; the output port routing table module has a read-write protection lock. If the state of the corresponding port in the listening output docking module is idle, it attempts to obtain address resources from the address resource FIFO of the corresponding port in this module as a valid address resource, and then compares this address resource with the valid address resource in the input port routing table module. If the same address resource exists, it waits until the same valid address resource does not exist in the input port routing table module , and then splice the address offset to become a valid address; at this time, there may be up to n valid addresses, and these valid addresses are arbitrated in a circular priority manner. The valid address that succeeds in arbitration is used to read the corresponding data from the dynamic data cache module, put it into the corresponding port of the output docking module, and change the state of the port to busy until the data is read out by the outside world. The state of the port changes back to idle, and the offset is shifted in sequence until the address resource is offset. That is, the address offset bit shifts from all 0 to all 1. At this time, the address resource is invalid, and the state of the corresponding port in the output docking module is monitored. Try to take out the address resource from the corresponding address resource FIFO and repeat the above process; The output docking module has n registers for data caching, which are responsible for temporarily storing the data of each output port read from the dynamic data caching module and outputting the data according to the external state; The dynamic data cache module is composed of a static random access memory, and is connected with the input buffer module, the input port routing table module, the output docking module, and the output port routing table module to serve as a unified data cache space.
2. The multi-port multi-priority router data packet buffer management and scheduling system as claimed in claim 1, characterized in that: The control frame that successfully arbitrates is the control frame with the highest port number among the control frames with the highest priority, so as to ensure the serialization of address resource allocation.
3. The multi-port multi-priority router data packet buffer management and scheduling system as claimed in claim 1, characterized in that: The arbitration mechanism of the control frame conversion module is as follows: (1) firstly, the control frame data is written into the corresponding position in the m groups of the current level register level 0, and its valid bit is pulled high, indicating that the control frame is valid; (2) when the control frame in the current level register level 0 is valid, and the corresponding position in the next level register level 1 is invalid, and the priority of the control frame is the same as the alternative priority, then the control frame is written from the level 0 register to the level 1 register, that is, the valid bit of the corresponding position of the level 0 register is pulled low, and the valid bit of the level 1 register is pulled high; (3) when the allocation instruction register to be executed is empty, The valid control frame with the highest bit in the level 1 register becomes the address allocation instruction, and the control frame is invalidated in the register of this level until there is no control frame in the level 1 register; (4) When the address resource allocation / recycling module allows the allocation instruction to be received, and the allocation instruction register to be executed is not empty, the allocation instruction is sent to the address resource allocation / recycling module; (5) If and only if there is a control frame in the level 0 register and there is no control frame in the level 1 register, the alternative priority is set to 0, and in other cases it is increased by 1. The alternative priority counts cyclically between 0 and p-1, where p is the number of priorities.
4. The multi-port multi-priority router data packet buffer management and scheduling system as claimed in claim 1, characterized in that: There are two types of address recovery instructions generated by the address recovery instruction generation module: One is the starting address resource recovery instruction. First, there are n groups of recovery instruction status registers in the address recovery instruction generation module, corresponding to n output ports, which are initialized to 0. The module first polls the information of the recovery instruction status registers corresponding to different output ports. If the idle is 0, the data packet queue with a certain priority of the data packet corresponding to the output port will be selected according to the absolute priority arbitration or the weighted polling priority arbitration, and then a recovery instruction for recovering a single address resource is fixedly generated, and the recovery instruction status register of this output port is set to busy at the same time; The other is a supplementary address resource recovery instruction. According to the actual data output of the output docking module intercepted by the device, when a control frame output of a data packet is intercepted, a recovery instruction for recovering the actual length minus one address resource is generated according to its length information. If the length of the data packet is one address resource, that is, the starting address resource recovery instruction has completely recovered the space occupied by the data packet, then no supplementary address resource recovery instruction will be generated. When the data output by the output docking module is intercepted as the end frame, the recovery instruction status register of the corresponding output port is reset to idle. The address reclaiming instruction generated above will be sent to the address resource allocation / reclaiming module when the address resource allocation / reclaiming module allows receiving the reclaiming instruction.
5. The multi-port multi-priority router data packet buffer management and scheduling system as claimed in claim 1, characterized in that: The address resource allocation / recycling module has a memory for storing the address resource linked list, and a pointer register stack representing n output ports with p priorities, a total of n*p groups of different queues for reading and writing, an empty linked list head pointer pems and a tail pointer peme; the depth of the address resource linked list memory is 2 K , 2 K = Storage space of dynamic data cache module / 64 bytes, bit width is K, the data stored in each address in the address resource list is the address of the next node, and the value of the address plus one is written into the current address during initialization; The pointer register stack is divided into n groups based on the destination output port. Each destination port has p sets of priority read and write pointers corresponding to its p priorities. There are a total of n*p queues and n*p*2+2 groups of registers. The pointer register stack uses dxry to represent the read pointer, dxwy to represent the write pointer, x to represent the output port, and y to represent the priority. When the read and write pointers point to the same address, it means that the queue is empty and the data packet with priority 0 does not exist at present. When the head pointer and tail pointer of the empty linked list point to the same address, the linked list is full, that is, the address resources have been allocated. These pointer registers point to the address resource linked list, and the bit width is K. During initialization, a continuous linked list address is assigned to the read and write pointers of different queues in turn. The read and write pointers of the same queue are the same, and the empty linked list head pointer and tail pointer are assigned to the head address and tail address of the remaining addresses of the linked list respectively.
Citation Information
Cited By
Data caching device
CN121967361A
Pointer distribution device of linked list, linked list structure and chip
CN121996429A
A pointer allocation device for a linked list, a linked list structure product and a chip
CN121996429B
