Dynamic self-adaptive virtual channel mapping method, device and storage medium

文档序号:406037 发布日期:2021-12-17 浏览:40次 中文

阅读说明:本技术 一种动态自适应的虚拟通道映射方法、装置及存储介质 (Dynamic self-adaptive virtual channel mapping method, device and storage medium ) 是由 孙旭 周玉龙 刘刚 李拓 于 2021-11-16 设计创作,主要内容包括:本申请涉及一种动态自适应的虚拟通道映射方法、装置及存储介质。所述方法包括:监测不同传输等级的事务层数据包的等效数据流量,获取所有传输等级的等效数据流量总和,所述等效数据流量为事务层数据包的数据长度与系数的乘积;基于所述传输等级的等效数据流量总和,获取每个传输等级对应的虚拟通道的数量的预计算值;根据所述预计算值调整传输等级到虚拟通道的映射,得到传输等级到虚拟通道的映射关系表。本方法提高了PCIe系统的总线利用率,进而提高整个SOC芯片的性能。(The application relates to a dynamic self-adaptive virtual channel mapping method, a dynamic self-adaptive virtual channel mapping device and a storage medium. The method comprises the following steps: monitoring equivalent data flow of transaction layer data packets of different transmission levels, and acquiring the sum of the equivalent data flow of all the transmission levels, wherein the equivalent data flow is the product of the data length and the coefficient of the transaction layer data packets; acquiring a pre-calculated value of the number of virtual channels corresponding to each transmission grade based on the sum of equivalent data flow of the transmission grade; and adjusting the mapping from the transmission grade to the virtual channel according to the pre-calculated value to obtain a mapping relation table from the transmission grade to the virtual channel. The method improves the bus utilization rate of the PCIe system, and further improves the performance of the whole SOC chip.)

1. A dynamic adaptive virtual channel mapping method, the method comprising:

monitoring equivalent data flow of transaction layer data packets of different transmission levels, and acquiring the sum of the equivalent data flow of all the transmission levels, wherein the equivalent data flow is the product of the data length and the coefficient of the transaction layer data packets;

acquiring a pre-calculated value of the number of virtual channels corresponding to each transmission grade based on the sum of equivalent data flow of the transmission grade;

and adjusting the mapping from the transmission grade to the virtual channel according to the pre-calculated value to obtain a mapping relation table from the transmission grade to the virtual channel.

2. The method of claim 1, wherein monitoring equivalent data traffic of transaction layer packets of different transmission classes comprises:

generating a time interval of each monitoring according to a system clock, performing statistical analysis once every preset time, generating an enabling signal for monitoring every preset time in a system clock counting mode, and monitoring equivalent data flow of transaction layer data packets with different transmission levels.

3. The method of claim 2, wherein monitoring equivalent data traffic of transaction layer packets of different transmission classes comprises:

calculating equivalent data flow of a single transmission grade according to the sum of equivalent data flow accumulation of instructions in the same monitoring period, and registering the equivalent data flow of the single transmission grade to obtain a register value of the equivalent data flow of the single transmission grade;

and accumulating the equivalent data flow register values of the single transmission grade of all the transmission grades to obtain the equivalent data flow sum of all the transmission grades.

4. The method of claim 3, wherein the commanded equivalent data flow during the monitoring period is calculated by:

Flow_N_x=(TLP_coe x Length)

TLP_coe= type_coe*fmt_coe

wherein, Flow _ N _ x is the equivalent data Flow of a single instruction of the nth transmission level, Length is the data Length of the transaction layer packet operated by the current instruction, and both type _ coe and fmt _ coe are calculation coefficients.

5. The method of claim 4, wherein the obtaining a pre-computed value of the number of virtual channels corresponding to each transmission class comprises:

obtaining a pre-calculated value of the number of virtual channels corresponding to each transmission class according to the following formula:

VC_weight_N_PRE = 8* Flow_sum_N_reg/ wr_Flow_sum;

VC _ weight _ N _ PRE is a PRE-calculated value of the number of virtual channels corresponding to the transmission grade, Flow _ sum _ N _ reg is an equivalent data Flow register value of the transmission grade, wr _ Flow _ sum is the sum of equivalent data flows of all the transmission grades, and N and the transmission grade are integers between 0 and 7.

6. The method of claim 5, wherein the obtaining a mapping table of transmission classes to virtual channels comprises:

according to the pre-calculated value of the number of the virtual channels corresponding to each transmission grade, the number of the corresponding virtual channels and the channel number when the transmission grade value is 0 are firstly determined, then the rest transmission grade values are sequenced from large to small, the number of the corresponding virtual channels and the channel number are sequentially determined, and a mapping relation table from the transmission grade to the virtual channels is obtained.

7. The method of claim 6, wherein the method comprises:

dynamically adjusting the arbitration priority of the virtual channel according to the mapping relation table from the transmission grade to the virtual channel;

and updating the mapping relation table when one monitoring and adjusting period is finished.

8. A dynamically adaptive virtual channel mapping apparatus, the apparatus comprising:

the monitoring module is used for monitoring equivalent data flow of the transaction layer data packets of different transmission levels and acquiring the sum of the equivalent data flow of all the transmission levels, wherein the equivalent data flow is the product of the data length and the coefficient of the transaction layer data packets;

the calculation module is used for acquiring a pre-calculation value of the number of the virtual channels corresponding to each transmission grade based on the sum of the equivalent data flow of the transmission grade;

and the adjusting module is used for adjusting the mapping from the transmission grade to the virtual channel according to the pre-calculated value to obtain a mapping table from the transmission grade to the virtual channel.

9. The apparatus of claim 8, wherein the monitoring module is to:

generating a time interval of each monitoring according to a system clock, performing statistical analysis once every preset time, generating an enabling signal for monitoring every preset time in a system clock counting mode, and monitoring equivalent data flow of transaction layer data packets with different transmission levels.

10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 6.

Technical Field

The present application relates to the field of chip design, and in particular, to a dynamic adaptive virtual channel mapping method, apparatus, and storage medium.

Background

The pcie (peripheral Component Interconnect express) bus is a high-speed serial computer expansion bus standard, a high-performance, general-purpose I/O Interconnect bus defined for computing and communication platforms, and is particularly suitable for high-speed real-time communication. PCIe buses are currently in wide use, including personal computers, servers, storage, System On Chip (SOC), and the like.

From a specific technical point of view, PCIe is an encapsulation layered protocol, and mainly includes a Transaction layer (Transaction layer), a Data link layer (Data link layer), and a Physical layer (Physical layer). In the PCIe architecture, a Data packet is first generated in a Core Layer (Device Core) of a Device, then passes through a Transaction Layer (Transaction Layer), a Data Link Layer (Data Link Layer), and a Physical Layer (Physical Layer) of the Device in sequence, and is finally sent out. The data at the receiving end also needs to pass through the physical layer, the data link and the transaction layer in sequence, and finally reach the Device Core.

The PCIe Transaction Layer is divided into a sending part and a receiving part, and is responsible for generating an outward TLP (Transaction Layer Packet) to the data link Layer and receiving the inward TLP. Among them, the virtual channel vc (virtual channel) and the Flow control (Flow control) are key technologies and also technical difficulties. From the physical link, all TLPs of the same type sent or received by the same device pass through the same physical path, and when the VC is not used, the TLPs can be received or sent only in chronological order, which may cause a problem of low transmission efficiency. For example, one PCIe device continuously sends two functionally unrelated commands to two PCIe devices, and when there is no virtual channel, the latter command must wait for the former group of commands to be sent to the corresponding device, and wait for the device to perform a specific operation before executing the specific operation. This waiting process can be long when the bus is idle but must wait, thereby severely reducing bus efficiency. When the virtual channel is used, the latter instruction can be sent to the corresponding equipment without waiting for the completion of the operation of the latter instruction after the former instruction is sent to the corresponding equipment. However, when two instructions have a dependency, the two instructions cannot be sent to two virtual channels. Therefore, the mapping of different commands to VCs is a key technology affecting the correctness and transmission efficiency of PCIe systems.

In header information of the TLP, PCIe defines TC (Transmit Class) attribute parameters, and defines 8 classes of Transmit classes in total. How TLPs of different TCs are mapped into VCs is a mapping method of virtual channels, and a PCIe protocol specifies that TLPs of the same TC must be mapped into the same VC, and different TCs may also be mapped into the same VC.

In the prior art, the following mapping method is generally used: the TC values and the VC values are in one-to-one correspondence, namely, a channel with TC of 0 is mapped to VC0, a channel with TC of 1 is mapped to VC10, and the like. 2. And presetting a fixed TC and VC mapping relation, namely determining the TC and VC mapping relation in advance according to actual requirements before project development, wherein the TC and VC mapping relation cannot be changed any more in the system operation process.

In the prior art, the mapping relationship between the TC and the VC cannot be dynamically adjusted, the requested bandwidth is not matched with the virtual channel cache space, and the bus utilization rate of the PCIe system is low, thereby affecting the performance of the SOC chip.

Disclosure of Invention

Therefore, it is necessary to provide a dynamic adaptive virtual channel mapping method, device and storage medium for solving the above technical problems, so as to improve the bus utilization rate of the PCIe system and further improve the performance of the entire SOC chip.

In one aspect, a dynamic adaptive virtual channel mapping method is provided, where the method includes:

monitoring equivalent data flow of transaction layer data packets of different transmission levels, and acquiring the sum of the equivalent data flow of all the transmission levels, wherein the equivalent data flow is the product of the data length and the coefficient of the transaction layer data packets;

acquiring a pre-calculated value of the number of virtual channels corresponding to each transmission grade based on the sum of equivalent data flow of the transmission grade;

and adjusting the mapping from the transmission grade to the virtual channel according to the pre-calculated value to obtain a mapping relation table from the transmission grade to the virtual channel.

In one embodiment, the monitoring equivalent data traffic of transaction layer packets of different transmission levels includes:

generating a time interval of each monitoring according to a system clock, performing statistical analysis once every preset time, generating an enabling signal for monitoring every preset time in a system clock counting mode, and monitoring equivalent data flow of transaction layer data packets with different transmission levels.

In one embodiment, the monitoring equivalent data traffic of transaction layer packets of different transmission levels includes:

calculating equivalent data flow of a single transmission grade according to the sum of equivalent data flow accumulation of instructions in the same monitoring period, and registering the equivalent data flow of the single transmission grade to obtain a register value of the equivalent data flow of the single transmission grade;

and accumulating the equivalent data flow register values of the single transmission grade of all the transmission grades to obtain the equivalent data flow sum of all the transmission grades.

In one embodiment, the equivalent data flow instructed in the monitoring period is calculated by:

Flow_N_x=(TLP_coe x Length

TLP_coe= type_coe*fmt_coe

wherein, Flow _ N _ x is the equivalent data Flow of a single instruction of the nth transmission level, Length is the data Length of the transaction layer packet operated by the current instruction, and both type _ coe and fmt _ coe are calculation coefficients.

In one embodiment, the obtaining a pre-calculated value of the number of virtual channels corresponding to each transmission class includes:

obtaining a pre-calculated value of the number of virtual channels corresponding to each transmission class according to the following formula:

VC_weight_N_PRE = 8* Flow_sum_N_reg/ wr_Flow_sum;

VC _ weight _ N _ PRE is a PRE-calculated value of the number of virtual channels corresponding to the transmission grade, Flow _ sum _ N _ reg is an equivalent data Flow register value of the transmission grade, wr _ Flow _ sum is the sum of equivalent data flows of all the transmission grades, and N and the transmission grade are integers between 0 and 7.

In one embodiment, the obtaining the mapping relationship table from the transmission level to the virtual channel includes:

according to the pre-calculated value of the number of the virtual channels corresponding to each transmission grade, the number of the corresponding virtual channels and the channel number when the transmission grade value is 0 are firstly determined, then the rest transmission grade values are sequenced from large to small, the number of the corresponding virtual channels and the channel number are sequentially determined, and a mapping relation table from the transmission grade to the virtual channels is obtained.

In one embodiment, the method comprises:

dynamically adjusting the arbitration priority of the virtual channel according to the mapping relation table from the transmission grade to the virtual channel;

and updating the mapping relation table when one monitoring and adjusting period is finished.

In another aspect, a dynamically adaptive virtual channel mapping apparatus is provided, the apparatus including:

the monitoring module is used for monitoring equivalent data flow of the transaction layer data packets of different transmission levels and acquiring the sum of the equivalent data flow of all the transmission levels, wherein the equivalent data flow is the product of the data length and the coefficient of the transaction layer data packets;

the calculation module is used for acquiring a pre-calculation value of the number of the virtual channels corresponding to each transmission grade based on the sum of the equivalent data flow of the transmission grade;

and the adjusting module is used for adjusting the mapping from the transmission grade to the virtual channel according to the pre-calculated value to obtain a mapping table from the transmission grade to the virtual channel.

In one embodiment, the monitoring module is configured to:

generating a time interval of each monitoring according to a system clock, performing statistical analysis once every preset time, generating an enabling signal for monitoring every preset time in a system clock counting mode, and monitoring equivalent data flow of transaction layer data packets with different transmission levels.

In yet another aspect, a computer-readable storage medium is provided, having stored thereon a computer program which, when executed by a processor, performs the steps of:

monitoring equivalent data flow of transaction layer data packets of different transmission levels, and acquiring the sum of the equivalent data flow of all the transmission levels, wherein the equivalent data flow is the product of the data length and the coefficient of the transaction layer data packets;

acquiring a pre-calculated value of the number of virtual channels corresponding to each transmission grade based on the sum of equivalent data flow of the transmission grade;

and adjusting the mapping from the transmission grade to the virtual channel according to the pre-calculated value to obtain a mapping relation table from the transmission grade to the virtual channel.

The dynamic self-adaptive virtual channel mapping method, device and storage medium can monitor the equivalent data traffic of the TLPs with different transmission level values in real time, and can adjust the mapping from the transmission level to the virtual channel in real time in the actual operation process of the PCIe system through analyzing each path of traffic data, so that the TLP with a high bandwidth request obtains a correspondingly large virtual channel cache space, the TLP with a low speed and a low bandwidth request obtains a correspondingly small virtual channel cache space, and meanwhile, the arbitration priority of the virtual channel can be dynamically adjusted, the bus utilization rate of the PCIe system is improved, and the performance of the whole SOC chip is improved.

Drawings

FIG. 1 is a flowchart illustrating a dynamic adaptive virtual channel mapping method according to an embodiment;

FIG. 2 is a schematic diagram of a PCIe system in one embodiment;

fig. 3 is a block diagram of a dynamic adaptive virtual channel mapping apparatus according to an embodiment.

Detailed Description

In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.

In one embodiment, as shown in fig. 1, there is provided a dynamic adaptive virtual channel mapping method, the method comprising:

s1: and monitoring equivalent data flow of the transaction layer data packets of different transmission levels, and acquiring the sum of the equivalent data flow of all the transmission levels, wherein the equivalent data flow is the product of the data length and the coefficient of the transaction layer data packets.

Specifically, a monitoring period may be configured, and in each monitoring period, the equivalent data traffic of the TLC corresponding to each transmission level is monitored, for example, the value of the transmission level may be an integer between 0 and 7, that is, TC0, TC1, and … … TC 7. And then adding the equivalent data traffic corresponding to all transmission levels to obtain the sum of the equivalent data traffic of all transmission levels.

S2: and acquiring a pre-calculated value of the number of the virtual channels corresponding to each transmission grade based on the sum of the equivalent data flow of the transmission grade.

In this step, according to the sum of the equivalent data traffic of the transmission classes obtained in step 1, a pre-calculated value of the number of virtual channels corresponding to each transmission class is calculated for adjustment of a mapping relationship table in the subsequent step.

S3: and adjusting the mapping from the transmission grade to the virtual channel according to the pre-calculated value to obtain a mapping relation table from the transmission grade to the virtual channel.

Specifically, the number of virtual channels and the channel number corresponding to the TCO-TC7 are calculated according to the pre-calculated value to form a mapping table, and the mapping table may be updated.

The dynamic self-adaptive virtual channel mapping method can monitor equivalent data traffic of TLPs with different transmission level values in real time, and can adjust the mapping from the transmission level to the virtual channel in real time in the actual operation process of the PCIe system through analyzing each path of traffic data, so that the TLP with a high bandwidth request obtains a correspondingly large virtual channel cache space, the TLP with a low speed and a low bandwidth request obtains a correspondingly small virtual channel cache space, and meanwhile, the arbitration priority of the virtual channel can be dynamically adjusted, the bus utilization rate of the PCIe system is improved, and the performance of the whole SOC chip is improved.

In one embodiment, the monitoring equivalent data traffic of transaction layer packets of different transmission levels includes:

generating a time interval of each monitoring according to a system clock, performing statistical analysis once every preset time, generating an enabling signal for monitoring every preset time in a system clock counting mode, and monitoring equivalent data flow of transaction layer data packets with different transmission levels.

As shown in fig. 2, this embodiment mainly includes 8 sets of RAM memories as carriers of virtual channels, 8 sets of dual-port random access memories RAM having the same size, where the data bit width is denoted as width and the Depth is Depth, and the size can be freely configured according to an actual use environment. For ram write operation, only the wr _ addr write address and the wr _ data write data are needed to be written to the port, and the write enable is pulled high, so that the data are written to the corresponding address position. For ram read operation, data is read from the RD _ data port only by giving the read address RD _ addr to the corresponding port and pulling the read enable signal high.

When the system is initialized, a default one-to-one mapping mode of the transmission grade value and the virtual channel value is used.

Generating a time interval of each monitoring according to a system clock, wherein each time T isQTime is analyzed once, and every T is generated in a mode of counting by a system clockQAn enable signal for monitoring.

TQ=K* T

Wherein, TQIs a monitored clock period; t is the system clock period, T =1/fsys,fsysIs the system clock frequency; and K is a monitoring clock coefficient and is configured through a register.

In one embodiment, the monitoring equivalent data traffic of transaction layer packets of different transmission levels includes:

calculating equivalent data flow of a single transmission grade according to the sum of equivalent data flow accumulation of instructions in the same monitoring period, and registering the equivalent data flow of the single transmission grade to obtain a register value of the equivalent data flow of the single transmission grade;

and accumulating the equivalent data flow register values of the single transmission grade of all the transmission grades to obtain the equivalent data flow sum of all the transmission grades.

Specifically, the traffic of each transmission level is calculated in the same manner, and is classified according to the transmission level value in the header information of the TLP packet, and is synchronously and parallelly calculated.

In one embodiment, the equivalent data flow instructed in the monitoring period is calculated by:

Flow_N_x=(TLP_coe x Length

TLP_coe= type_coe*fmt_coe

wherein, Flow _ N _ x is the equivalent data Flow of a single instruction of the nth transmission level, Length is the data Length of the transaction layer packet operated by the current instruction, and both type _ coe and fmt _ coe are calculation coefficients.

Specifically, taking the data flow calculation of TC0 as an example, the method includes:

(1) first, the equivalent data flow of a single instruction is calculated

Flow _0_ x = (TLP _ coe x Length), Flow _0_ x is a single-instruction equivalent data Flow with TC of 0; TLP _ coe is an instruction weight coefficient; length is the actual data Length of the current instruction operation, and is represented by DW (double word), and is obtained from header information of a TLP packet.

TLP_coe= type_coe*fmt_coe

Wherein, Type _ coe is Type calculation coefficient (Type is parameter in TLP header information)

Where x represents that it may be any value.

fmt _ coe is a fmt calculation coefficient (fmt is a parameter in TLP header information), and the corresponding relationship is as follows:

the reason why different calculation coefficients are set is that paths of different TLPs for transferring routes in the system are different, and the correlation between the paths and the system configuration is different, so that the time for occupying buses is different.

(2) Calculating the sum of the command equivalent data flow accumulation in the same monitoring period

Flow_sum_0 =Flow_0_1+Flow_0_2+Flow_0_3 +……+Flow_0_N

Flow _ sum _0 is the sum of all equivalent data flows with TC of 0 in the same cycle

(3) Registering the monitored time point when it arrives

Flow_sum_0_reg =Flow_sum_0,

Flow _ sum _0_ reg is a register value of an equivalent data Flow sum with the current cycle TC being 0, and is cleared in the next clock cycle: flow _ sum _0= 0.

(4) Summation of all TC data flows

When the monitoring time is reached, the equivalent quantity flows of the respective transmission level values are summed

wr_Flow_sum=Flow_sum_0_reg+Flow_sum_1_reg+Flow_sum_3_reg+……+Flow_sum_7_reg

Wherein wr _ Flow _ sum is the sum of equivalent data flows of all TC values in the same cycle.

In one embodiment, the obtaining a pre-calculated value of the number of virtual channels corresponding to each transmission class includes:

obtaining a pre-calculated value of the number of virtual channels corresponding to each transmission class according to the following formula:

VC_weight_N_PRE = 8* Flow_sum_N_reg/ wr_Flow_sum;

VC _ weight _ N _ PRE is a PRE-calculated value of the number of virtual channels corresponding to the transmission grade, Flow _ sum _ N _ reg is an equivalent data Flow register value of the transmission grade, wr _ Flow _ sum is the sum of equivalent data flows of all the transmission grades, and N and the transmission grade are integers between 0 and 7.

In one embodiment, the obtaining the mapping relationship table from the transmission level to the virtual channel includes:

according to the pre-calculated value of the number of the virtual channels corresponding to each transmission grade, the number of the corresponding virtual channels and the channel number when the transmission grade value is 0 are firstly determined, then the rest transmission grade values are sequenced from large to small, the number of the corresponding virtual channels and the channel number are sequentially determined, and a mapping relation table from the transmission grade to the virtual channels is obtained.

Specifically, the number of VC rams is pre-calculated when the transmission level is 0,

if VC _ weight _0_ PRE < = 1: VC _ weight _0=1, VC _ num = 0;

if VC _ weight _0_ PRE > 1: VC _ weight _0= VC _ weight _0_ PRE _ up, VC _ num = 0;

VC _ weight _0 is the number of VC rams corresponding to a transmission level of 0, VC _ num is the corresponding VC channel number, and VC _ weight _0_ PRE _ up is a value rounded up by VC _ weight _0_ PRE.

Secondly, sorting the remaining transmission grade values, arranging the transmission grade values from large to small, and processing the transmission grade values from large to small in sequence, wherein the processing method comprises the following steps:

the maximum value is generally greater than 1, and it is determined that:

if VC _ weight _ or _ PRE _1> VC _ weight _ or _ PRE _1_ up-0.5:

VC_weight_0=VC_weight_0_PRE_up,VC_num = 2;

if VC _ weight _ or _ PRE _1_ up < VC _ weight _ or _ PRE _1< = VC _ weight _ or _ PRE _1_ up-0.5:

VC_weight_0=VC_weight_0_PRE_up-1,VC_num = 1;

and then judging the next largest value by the same method as the above, wherein the largest value occupies the independent VC ram, and VC _ num is sequentially added with 1.

And when the subsequent value is less than 1, writing the subsequent value into the subsequent VC ram, adding 1 to VC _ num on the previous basis, continuously judging a smaller value downwards, adding the smaller value to the previous value which is less than 1, mapping the smaller value to the same space as the previous space if the sum of the smaller value and the previous value is less than 1.5, mapping the smaller value to the next VC ram if the sum of the smaller value and the previous value is more than 1.5, and adding 1 to VC _ num on the previous basis.

If the last array is judged, no VC ram is left, and the array is mapped into TC 0.

For example, the mapping relationship table is as follows:

in one embodiment, the method comprises:

dynamically adjusting the arbitration priority of the virtual channel according to the mapping relation table from the transmission grade to the virtual channel;

and updating the mapping relation table when one monitoring and adjusting period is finished.

Specifically, as shown in the following table:

the number of ram actually used by different virtual channels in the above table is the reference value for virtual channel arbitration. Considering that the arbitration method is different under different usage environments, only the reference value is provided here. The arbiter parameters can be adjusted according to the reference value, for example, when using the fixed priority method, the channel with the largest VC ram can be given the highest arbitration authority and arranged in sequence; when using the time-sliced arbitration method, the scale of VC ram can be used as the reference for time-slicing.

At the end of a supervision adjustment period, the new mapping and arbitration reference values are updated.

It should be understood that, although the steps in the flowchart of fig. 1 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least a portion of the steps in fig. 1 may include multiple sub-steps or multiple stages that are not necessarily performed at the same time, but may be performed at different times, and the order of performance of the sub-steps or stages is not necessarily sequential, but may be performed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.

In one embodiment, as shown in fig. 3, there is provided a dynamically adaptive virtual channel mapping apparatus, the apparatus comprising:

the monitoring module 301 is configured to monitor equivalent data flows of transaction layer data packets of different transmission levels, and obtain a sum of the equivalent data flows of all the transmission levels, where the equivalent data flow is a product of a data length and a coefficient of a transaction layer data packet;

a calculating module 302, configured to obtain a pre-calculated value of the number of virtual channels corresponding to each transmission class based on a sum of equivalent data flows of the transmission classes;

and an adjusting module 303, configured to adjust the mapping from the transmission level to the virtual channel according to the pre-calculated value, so as to obtain a mapping table from the transmission level to the virtual channel.

In one embodiment, the monitoring module 301 is configured to:

generating a time interval of each monitoring according to a system clock, performing statistical analysis once every preset time, generating an enabling signal for monitoring every preset time in a system clock counting mode, and monitoring equivalent data flow of transaction layer data packets with different transmission levels.

In one embodiment, the monitoring module 301 is configured to:

calculating equivalent data flow of a single transmission grade according to the sum of equivalent data flow accumulation of instructions in the same monitoring period, and registering the equivalent data flow of the single transmission grade to obtain a register value of the equivalent data flow of the single transmission grade;

and accumulating the equivalent data flow register values of the single transmission grade of all the transmission grades to obtain the equivalent data flow sum of all the transmission grades.

In one embodiment, the monitoring module 301 is configured to calculate the equivalent data traffic instructed in the monitoring period by:

Flow_N_x=(TLP_coe x Length

TLP_coe= type_coe*fmt_coe

wherein, Flow _ N _ x is the equivalent data Flow of a single instruction of the nth transmission level, Length is the data Length of the transaction layer packet operated by the current instruction, and both type _ coe and fmt _ coe are calculation coefficients.

In one embodiment, the calculation module 302 is configured to:

obtaining a pre-calculated value of the number of virtual channels corresponding to each transmission class according to the following formula:

VC_weight_N_PRE = 8* Flow_sum_N_reg/ wr_Flow_sum;

VC _ weight _ N _ PRE is a PRE-calculated value of the number of virtual channels corresponding to the transmission grade, Flow _ sum _ N _ reg is an equivalent data Flow register value of the transmission grade, wr _ Flow _ sum is the sum of equivalent data flows of all the transmission grades, and N and the transmission grade are integers between 0 and 7.

In one embodiment, the adjusting module 303 is configured to:

according to the pre-calculated value of the number of the virtual channels corresponding to each transmission grade, the number of the corresponding virtual channels and the channel number when the transmission grade value is 0 are firstly determined, then the rest transmission grade values are sequenced from large to small, the number of the corresponding virtual channels and the channel number are sequentially determined, and a mapping relation table from the transmission grade to the virtual channels is obtained.

In one embodiment, the adjusting module 303 is configured to:

dynamically adjusting the arbitration priority of the virtual channel according to the mapping relation table from the transmission grade to the virtual channel;

and updating the mapping relation table when one monitoring and adjusting period is finished.

For specific limitations of the dynamically adaptive virtual channel mapping apparatus, refer to the above limitations of the dynamically adaptive virtual channel mapping method, which are not described herein again. The modules in the above dynamic adaptive virtual channel mapping apparatus may be implemented in whole or in part by software, hardware, and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.

In one embodiment, a computer-readable storage medium is provided, having stored thereon a computer program which, when executed by a processor, performs the steps of:

monitoring equivalent data flow of transaction layer data packets of different transmission levels, and acquiring the sum of the equivalent data flow of all the transmission levels, wherein the equivalent data flow is the product of the data length and the coefficient of the transaction layer data packets;

acquiring a pre-calculated value of the number of virtual channels corresponding to each transmission grade based on the sum of equivalent data flow of the transmission grade;

and adjusting the mapping from the transmission grade to the virtual channel according to the pre-calculated value to obtain a mapping relation table from the transmission grade to the virtual channel.

In one embodiment, the computer program when executed by the processor further performs the steps of:

generating a time interval of each monitoring according to a system clock, performing statistical analysis once every preset time, generating an enabling signal for monitoring every preset time in a system clock counting mode, and monitoring equivalent data flow of transaction layer data packets with different transmission levels.

In one embodiment, the computer program when executed by the processor further performs the steps of:

calculating equivalent data flow of a single transmission grade according to the sum of equivalent data flow accumulation of instructions in the same monitoring period, and registering the equivalent data flow of the single transmission grade to obtain a register value of the equivalent data flow of the single transmission grade;

and accumulating the equivalent data flow register values of the single transmission grade of all the transmission grades to obtain the equivalent data flow sum of all the transmission grades.

In one embodiment, the computer program when executed by the processor further performs the steps of:

calculating an equivalent data flow of the instructions in the monitoring period by:

Flow_N_x=(TLP_coe x Length

TLP_coe= type_coe*fmt_coe

wherein, Flow _ N _ x is the equivalent data Flow of a single instruction of the nth transmission level, Length is the data Length of the transaction layer packet operated by the current instruction, and both type _ coe and fmt _ coe are calculation coefficients.

In one embodiment, the computer program when executed by the processor further performs the steps of:

obtaining a pre-calculated value of the number of virtual channels corresponding to each transmission class according to the following formula:

VC_weight_N_PRE = 8* Flow_sum_N_reg/ wr_Flow_sum;

VC _ weight _ N _ PRE is a PRE-calculated value of the number of virtual channels corresponding to the transmission grade, Flow _ sum _ N _ reg is an equivalent data Flow register value of the transmission grade, wr _ Flow _ sum is the sum of equivalent data flows of all the transmission grades, and N and the transmission grade are integers between 0 and 7.

In one embodiment, the computer program when executed by the processor further performs the steps of:

according to the pre-calculated value of the number of the virtual channels corresponding to each transmission grade, the number of the corresponding virtual channels and the channel number when the transmission grade value is 0 are firstly determined, then the rest transmission grade values are sequenced from large to small, the number of the corresponding virtual channels and the channel number are sequentially determined, and a mapping relation table from the transmission grade to the virtual channels is obtained.

In one embodiment, the computer program when executed by the processor further performs the steps of:

dynamically adjusting the arbitration priority of the virtual channel according to the mapping relation table from the transmission grade to the virtual channel;

and updating the mapping relation table when one monitoring and adjusting period is finished.

It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.

The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

14页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:模拟专用通讯端口的方法、装置及微控制器

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!