SoC chip, flow control method and device
By introducing the flow control module and the load acquisition module into the SoC chip, combined with the bandwidth limiter and target flow control strategy, the flow of VC is accurately controlled, which solves the data flow transmission blocking problem caused by insufficient bandwidth of the slave IP core and improves the transmission efficiency. and resource utilization.
Patent Information
- Application Number
- CN202310347776.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-28
- Publication Date
- 2024-10-01
Smart Images

Figure CN118740734A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of integrated circuit technology, and in particular to a SoC chip, a flow control method and a device. Background Art
[0002] The system on chip (SoC) includes a master side intellectual property (IP) core and a slave side IP core. The master side IP core communicates with the slave side IP core through an on-chip network (NOC). Usually, the sum of the bandwidth resources required by the master side IP core is greater than the sum of the bandwidth resources that can be provided by the slave side IP core. When multiple master side IP cores use the bandwidth resources provided by the slave side IP core to perform services, due to the limited bandwidth resources provided by the slave side IP core, when the available bandwidth resources provided by the slave side IP core are insufficient for one or some master side IP cores to perform services, the transmission of the data stream of the one or some master side IP cores will be blocked.
[0003] To this end, a flow control method based on a virtual channel (VC) mechanism is proposed. Different VCs can reuse the same physical link. For a physical link, when the data flow of a VC reused on the physical link is blocked, other data flows can still be transmitted on the physical link through other VCs reused on the physical link. Therefore, by limiting the flow of some VCs, the data flows on other VCs can be unblocked.
[0004] Currently, traffic control is mostly performed by actively limiting the traffic of some VCs to leave more available resources for other VCs. Even if other VCs do not require resources, the traffic of the VCs will continue to be limited, which will reduce the transmission rate of the data flow of the VCs and increase the transmission delay of the data flow. Summary of the invention
[0005] The embodiments of the present application provide a SoC chip, a flow control method and a device, which can more accurately control the flow of a VC and reduce the transmission delay of a data stream passing through the VC.
[0006] In a first aspect, an embodiment of the present application provides a SoC chip, which may include a flow control module and a first IP core, wherein the flow control module is used to: receive a flow control request, and use a target flow control strategy to perform flow control on a first VC. The flow control request is used to request flow control on the first VC, and the first VC includes one or more VCs established by the first IP core.
[0007] In the ScC chip involved in the embodiment of the present application, a flow control module can be set. When the first IP core has a need to control the flow of the first VC established, a flow control request can be generated. The flow control module performs flow control on the first VC under the triggering of the flow control request. Compared with actively limiting the flow of the VC, the SoC chip provided in the embodiment of the present application, when the first VC established by the first IP core has a flow control demand, performs flow control on the first VC, which can better meet the actual demand of the first IP core for flow, thereby more accurately controlling the flow of the first VC.
[0008] In a possible design, the SoC chip also includes a bandwidth limiter, which can be used to limit the bandwidth of the VC established by the first IP core; wherein the bandwidth limiter is set on the VC established by the first IP core, and the bandwidth occupied by the VC established by the first IP core remains unchanged before and after passing through the bandwidth limiter.
[0009] The bandwidth limiter can limit the bandwidth of the VC established by the first IP core, and then control the flow of the VC established by the first IP core, leaving more available bandwidth for other IP cores. In the SoC chip designed in the embodiment of the present application, the bandwidth occupied by the VC established by the first IP core remains unchanged before and after passing through the bandwidth limiter, which is equivalent to the function of the bandwidth limiter being invalid. Even if a bandwidth limiter is set in the SoC chip, the bandwidth limiter can be enabled to be invalid. This design can avoid the problem of low resource utilization caused by actively limiting the bandwidth of the first IP core.
[0010] In a possible design, the first IP core is one or more of the following: a central processing unit (CPU), an application processor (AP), a graphics processing unit (GPU), a wireless access module, a camera subsystem, a display subsystem, a multimedia subsystem, a system cache, or an external memory.
[0011] In a possible design, the SoC chip further includes a load acquisition module, wherein the load acquisition module is used to determine the load rate of the first IP core, and when the load rate is greater than or equal to a first threshold, send a flow control request to the flow control module, and the first IP core is a system cache or an external memory. The flow control module is used to receive the flow control request in the following manner: the flow control module receives the flow control request from the load acquisition module.
[0012] When the first IP core is a system cache or an external memory, the load rate of the first IP core can be obtained. When the load rate is high, it can be considered that the storage space of the first IP core is insufficient. In this case, the load acquisition module can generate a flow control request to trigger the flow control module to control the first VC, thereby alleviating the flow pressure of the first IP core.
[0013] In a possible design, the load rate of the first IP core is the resource occupancy rate of the first IP core, and the resource occupancy rate is the ratio of the occupied resources to the maximum resources that can be used. For example, the resource is the command queue of the first IP core, and the load rate of the first IP core is the occupancy rate of the command queue of the first IP core, and the command queue is used to store the commands to be processed by the first IP core. Among them, the resource occupancy rate is the ratio of the number of commands stored in the command queue to the upper limit of the number of commands that the command queue can store. For another example, the resource is a data cache for storing data, and the resource occupancy rate of the first IP core is the ratio of the data size stored in the data cache of the first IP core to the upper limit of the data size that the data cache can store. For another example, the resource is bandwidth, and the resource occupancy rate of the first IP core is the ratio of the bandwidth actually used by the first IP core to the bandwidth that can be used by the first IP core.
[0014] In a possible design, the load acquisition module is a counter.
[0015] In a possible design, the target flow control strategy is a flow control strategy having a mapping relationship with the occupancy rate. Different flow control strategies corresponding to different resource occupancy rates are also different, thereby achieving flexible control of the flow of the first VC and achieving precise control of flow control.
[0016] In a possible design, the mapping relationship includes one or more of the following:
[0017] The resource utilization rate is within the first range, and the target flow control strategy is not to limit the flow of the first VC; the resource utilization rate is within the second range, and the target flow control strategy is to send an enable signal corresponding to the first VC at a first rate, and the enable signal enables sending data packets on the first VC; or, the resource utilization rate is within the third range, and the target flow control strategy is to stop sending the enable signal corresponding to the first VC, and the enable signal enables sending data packets on the first VC.
[0018] The first range, the second range and the third range may be predefined or (pre) configured. The first range, the second range and the third range may be considered as the threshold range of flow control. Different threshold ranges correspond to different flow control strategies. The embodiment of the present application can control the flow more flexibly and accurately by setting multiple threshold ranges of flow control.
[0019] In a possible design, the first IP core is a CPU, an AP, a GPU, a wireless access module, a camera subsystem, a display subsystem, or a multimedia subsystem, and the target flow control strategy is associated with one or more of the following: a bandwidth associated with the first VC, or a resource availability rate of the first VC, where the resource availability rate is a ratio of available resources to a maximum available resource. A matching flow control strategy can be set according to the bandwidth associated with the first VC and the resources required by the first VC to more accurately control the flow of the first VC.
[0020] In a possible design, the target flow control strategy is to reduce the average flow rate of at least one VC other than the first VC during the second time period, and the at least one VC is not a VC established by the first IP core. The flow rate of the first VC can be increased by reducing the flow rate of at least one VC other than the first VC.
[0021] In a second aspect, an embodiment of the present application provides a terminal device, comprising a SOC chip according to any possible design of the first aspect; further, the terminal device may also include at least one external memory.
[0022] In a third aspect, an embodiment of the present application provides a flow control method, which is applied to a system on chip (SoC) chip, wherein the SoC chip includes a flow control module and a first IP core, and the method includes:
[0023] Receiving a flow control request through a flow control module, the flow control request is used to request flow control of a first VC, the first VC including one or more VCs established by the first IP core;
[0024] The flow control module adopts a target flow control strategy to control the flow of the first VC.
[0025] In a possible design, the SoC chip further includes a bandwidth limiter, and the method further includes:
[0026] The bandwidth used by the VC established by the first IP core is limited by a bandwidth limiter; wherein the bandwidth limiter is set on the VC established by the first IP core, and the bandwidth occupied by the VC established by the first IP core remains unchanged before and after passing through the bandwidth limiter.
[0027] In a possible design, the first IP core is one or more of the following: CPU, AP, GPU, wireless access module, camera subsystem, display subsystem, multimedia subsystem, system cache or external memory.
[0028] In a possible design, the first IP core is a system cache or an external memory, the SoC chip further includes a load acquisition module, and the method further includes:
[0029] Determine the load of the first IP core through the load acquisition module, and generate a flow control request when the load is greater than or equal to a first threshold;
[0030] The flow control module receives the flow control request, including: the flow control module receives the flow control request from the load acquisition module.
[0031] In a possible design, the load rate of the first IP core is the resource occupancy rate of the first IP core, and the resource occupancy rate is the ratio of the occupied resources to the maximum resources that can be used. For example, the resource is the command queue of the first IP core, and the load rate of the first IP core is the occupancy rate of the command queue of the first IP core, and the command queue is used to store the commands to be processed by the first IP core. Among them, the resource occupancy rate is the ratio of the number of commands stored in the command queue to the upper limit of the number of commands that the command queue can store. For another example, the resource is a data cache for storing data, and the resource occupancy rate of the first IP core is the ratio of the data size stored in the data cache of the first IP core to the upper limit of the data size that the data cache can store. For another example, the resource is bandwidth, and the resource occupancy rate of the first IP core is the ratio of the bandwidth actually used by the first IP core to the bandwidth that can be used by the first IP core.
[0032] In a possible design, the load acquisition module is a counter.
[0033] In a possible design, the target flow control strategy is a flow control strategy that has a mapping relationship with the resource occupancy rate.
[0034] In a possible design, the mapping relationship includes one or more of the following: the resource occupancy rate is within a first range, and the target flow control strategy is not to limit the flow of the first VC; the resource occupancy rate is within a second range, and the target flow control strategy is to send an enable signal corresponding to the first VC at a first rate, and the enable signal enables sending data packets on the first VC; or, the resource occupancy rate is within a third range, and the target flow control strategy is to stop sending the enable signal corresponding to the first VC, and the enable signal enables sending data packets on the first VC.
[0035] In a possible design, the first IP core is a CPU, an AP, a GPU, a wireless access module, a camera subsystem, a display subsystem, or a multimedia subsystem, and the target traffic control strategy is associated with one or more of the following: a bandwidth associated with the first VC, or a resource availability rate of the first VC, where the resource availability rate is a ratio of available resources to the maximum available resources.
[0036] In a possible design, the target traffic control strategy is to reduce the average traffic rate of at least one VC other than the first VC within the second time period, and the at least one VC is not a VC established by the first IP core.
[0037] Regarding the third aspect and the beneficial effects of possible designs of the third aspect, reference may be made to the description of the beneficial effects of the first aspect and each possible design of the first aspect, which will not be repeated here.
[0038] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, comprising instructions, which, when executed on a computer, enables the computer to execute a method as described in any possible design of the third aspect above.
[0039] In a fifth aspect, an embodiment of the present application provides a computer program product, which, when executed on a computer, enables the computer to execute a method as described in any possible design of the third aspect above. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 is a schematic diagram of the structure of an exemplary SoC chip;
[0041] Figure 2 It is a structural diagram of the VC mechanism;
[0042] Figure 3 A schematic diagram of flow control for VC;
[0043] Figure 4 A schematic diagram of the structure of a SoC chip provided in an embodiment of the present application;
[0044] Figure 5 Another structural schematic diagram of the SoC chip provided in the embodiment of the present application;
[0045] Figure 6 A schematic diagram of the structure of a terminal device provided in an embodiment of the present application;
[0046] Figure 7 A flow chart of a flow control method according to an embodiment of the present application. DETAILED DESCRIPTION
[0047] In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the embodiments of the present application will be further described in detail below with reference to the accompanying drawings.
[0048] The various digital numbers such as the first and second involved in the embodiments of the present application are only for the convenience of description, and are not used to limit the scope of the embodiments of the present application, nor do they represent the order of precedence. "And / or" describes the association relationship of the associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. "At least one" refers to one or more. At least two refers to two or more. "At least one", "any one" or similar expressions refer to any combination of these items, including any combination of single items (individuals) or plural items (individuals). For example, at least one item (individual, kind) of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple.
[0049] The terms "component", "module", "system", etc. used in the embodiments of the present application are used to represent computer-related entities, hardware, firmware, a combination of hardware and software, software, or software in execution. For example, a component can be, but is not limited to, a process, a processor, an object, an executable file, an execution thread, a program and / or a computer running on a processor. By way of illustration, both the application running on a computing device and the computing device can be components. One or more components can reside in a process and / or an execution thread, and a component can be located on a computer and / or be distributed between 2 or more computers. In addition, these components can be executed from various computer-readable media having various data structures stored thereon. Components can, for example, communicate by local and / or remote processes according to signals with one or more data packets (for example, data from two components interacting with another component between a local system, a distributed system and / or a network, for example, the Internet interacting with other systems by signals).
[0050] SoC chips are integrated circuits that integrate multiple electronic systems on the same chip. They are widely used in a variety of devices, such as mobile phones and handheld computers. SoC chips are usually composed of multiple IP cores, which are connected to external memory through a bus to interact with programs and data. Each IP core can be regarded as a pre-designed circuit function module for implementing corresponding functions. Among them, IP cores can be CPU, AP, GPU, multimedia subsystem (video subsystem), camera subsystem (camera subsystem), wireless access module (modem), display subsystem (display subsystem), storage system, etc. Compared with the storage system, CPU, multimedia subsystem, camera subsystem, display subsystem, GPU and wireless access module belong to the master side IP core, and the storage system belongs to the slave side IP core. The master side IP core can be connected / communicated with the slave side IP core through NOC. It is not difficult to understand that the master side IP core and the slave side IP core are to distinguish between the two types of IP cores. From this perspective, the master side IP core can be called the first type of IP core, and the slave side IP core can be called the second type of IP core.
[0051] The storage system may include a system cache (SC) and an external memory. The external memory, for example, includes but is not limited to a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDR SDRAM), a disk memory, etc. The external memory can be controlled by a memory controller. The SC is the last level cache (LLC) of the system. The SC can be accessed by all IP cores and is the system shareable cache of the SOC chip. The SC can be implemented using a static random access memory (SRAM). The external memory can be regarded as an off-chip system, and the part before the external memory can be regarded as an on-chip SoC chip.
[0052] For example, the structure of a SoC chip can be as follows: Figure 1 As shown. Figure 1In the present invention, the CPU, multimedia subsystem, camera subsystem, display subsystem, GPU and wireless access module are connected to the external memory through the network on chip (NOC).
[0053] Specifically, when the master-side IP core (taking the CPU as an example) runs a software program of an application, it can find the corresponding software program from the external memory and then run the software program. Usually, the sum of the bandwidth / resources required by the master-side IP core is greater than the sum of the bandwidth / resources that the slave-side IP core can provide. For example, the resources that DRAM can provide are the first resources, and the resources required by the CPU, GPU, camera subsystem, and wireless access module are the second resources, and the size of the second resource is greater than the size of the first resource. For multiple IP cores on the master side, the requirements of the service requests of different IP cores may be different. Since the size of the second resource is greater than the size of the first resource, the size of the resources required by multiple IP cores may also be different. When multiple master-side IP cores use the bandwidth resources provided by the slave-side IP core to perform services, since the bandwidth resources provided by the slave-side IP core are limited, when the available bandwidth resources provided by the slave-side IP core are insufficient for one or some master-side IP cores to perform services, the transmission of the data stream of the one or some master-side IP cores will be blocked, affecting the overall performance of the SoC chip.
[0054] For example, the CPU has high latency requirements for service data, and hopes that the slave IP core can respond to the transmission of service data more quickly. The GPU usually requires more resources, but has lower latency requirements for service data, and hopes that the slave IP core can provide more resources. The wireless access module also has high latency requirements for service data, and hopes that the slave IP core can respond to the transmission of service data more quickly. The camera subsystem also has high latency requirements for service data, and hopes that the slave IP core can respond to the transmission of service data more quickly. If a resource provided by the slave DRAM can be used by both the GPU and the wireless access module, that is, the GPU and the wireless access module reuse the same resource provided by the DRAM. In this case, when the GPU and the wireless access module are each performing their own services, it may happen that a resource being used by the wireless access module happens to be a resource being used by the GPU, causing mutual blocking of service data transmission between the wireless access module and the GPU, and interruption of the transmission of any service data.
[0055] Therefore, a flow control method based on VC mechanism is proposed. Different VCs can reuse the same physical link, and different data streams can be transmitted without blocking each other through different VCs. For a physical link, when the data packets occupying a VC reused by the physical link are blocked, other data packets can still be transmitted on the physical link through other VCs reused by the physical link. Therefore, by limiting the flow of some VCs, the data streams on other VCs can be unblocked.
[0056] The flow of flow control based on the VC mechanism is: when the next-level node has idle / available resources, it feeds back the credit signal of the corresponding VC to the next-level node; after receiving the credit signal, the previous-level node sends the data packet of the VC corresponding to the credit signal. If the previous-level node does not receive the credit signal corresponding to a certain VC from the next-level node, the data packet of the VC corresponding to the credit signal is not sent. The credit signal is a signal used to enable the sending of the data packet of the corresponding VC. In the embodiment of the present application, the credit signal is also called an enable signal. The enable signal corresponding to the VC can be used to enable the sending of data packets on the VC.
[0057] For example, see Figure 2 , which is a structural diagram of the VC mechanism. Figure 2 Take two levels of nodes as an example, and take VC0 and VC1 as an example. The two levels of nodes are called first-level nodes and second-level nodes, and the first-level node is the upstream node of the second-level node. The data stream of the first-level node can be distributed to VC0 and / or VC1 through a demultiplexer (DMUX). The data packets of VC0 and / or VC1 of the first-level node can be transmitted to the second-level node through a multiplexer (MUX). Figure 2 As shown, when the second-level node has idle resources, it can feed back / send the enable signal of VC1 to the first-level node ( Figure 2 The first-level node receives the VC1 enable signal from the second-level node and sends the VC1 data packet of the first-level node. Similarly, when the second-level node has idle resources, it can feedback / send the VC0 enable signal to the first-level node ( Figure 2 The first-level node receives the VC0 enable signal from the second-level node and sends the VC0 data packet of the first-level node. Figure 2 It can be seen that even if a data packet is blocked, other data packets can still be transmitted through the VC based on the flow control mechanism of the VC mechanism, that is, different data packets can be transmitted alternately on the same physical channel, thereby improving the network throughput.
[0058] Furthermore, for any VC, flow control can be further performed in consideration of different business requirements. For example, GPUs usually require more resources and have lower latency requirements for business data. The wireless access module also has higher latency requirements for business data and hopes to respond to the transmission of business data more quickly. If the resources reused by the GPU and the wireless access module are limited, the flow of the GPU can be adaptively controlled to reduce the flow of the GPU and leave more available resources for the wireless access module. For example, flow control can be performed on the VC corresponding to the GPU business.
[0059] For easier understanding, see Figure 3 , which is a schematic diagram of flow control for VC. Figure 3 and Figure 2 The difference is that Figure 3 A flow control / limiting module, such as a bandwidth controller, is added to VC0 and VC1 in the network. Figure 3 The structure shown requires the configuration of a flow control / limitation module in advance. For example, the service flow of the GPU is transmitted through VC0, and the service flow of the wireless access module is transmitted through VC1. In order to reduce the impact of GPU resource usage on the wireless access module, the resources available to VC0 can be configured as partial resources through the flow control / limitation module corresponding to VC0, that is, the resources used by VC0 can be limited. Figure 3 The structure shown can be considered as actively controlling the flow of VC. Or, even if there is no flow control requirement for a certain VC, the flow of the VC will be limited. This will reduce resource utilization, affect the transmission of certain service flows, and increase the latency of the service flow. Using the previous example, if the wireless access module has no service, it will affect the transmission of the GPU's service flow and reduce resource utilization.
[0060] In order to solve the above technical problems, the embodiments of the present application propose to control the flow of the corresponding VC according to the actual load of the system, so as to reduce the delay of service flow transmission on the basis of improving resource utilization.
[0061] The embodiments of the present application can be applicable to a variety of possible scenarios, and can be particularly applicable to the design stage of a SoC chip. Specifically, during the design process of the SoC chip, the SoC chip can be improved, such as adding a flow control module to the SoC chip (and, a load acquisition module can also be added), and then by executing the method described in the embodiments of the present application, it can be determined whether the flow needs to be controlled; subsequently, the flow control of the VC can be performed through a flow control strategy adapted to the VC, thereby achieving precise control of the flow.
[0062] See also Figure 4 , is a structural diagram of a SoC chip provided in an embodiment of the present application. Figure 4Take the master-side IP cores included in the SoC chip as IP core 0 to IP core 3 as an example. Figure 4 compared to Figure 1 The structure shown in FIG. 1 adds a flow control module and a load acquisition module. The load acquisition module is not a necessary module. In other words, Figure 4 The structure shown may not include a load acquisition module, so in Figure 4 In the figure, a dotted line is used to indicate the difference. Figure 4 The SoC chip shown may also include a bandwidth limiter, which can limit the bandwidth used by a certain IP core. Taking the first IP core as an example, the bandwidth limiter can limit the bandwidth used by the first IP core. Setting the bandwidth limiter is equivalent to actively limiting the VC established by the first IP core through the bandwidth limiter. However, in an embodiment of the present application, even if the bandwidth limiter is set, the bandwidth limiter can be enabled to fail. For example, before passing through the bandwidth limiter and after passing through the bandwidth limiter, the bandwidth occupied by the VC established by the first IP core remains unchanged. Alternatively, the bandwidth used by the first IP core before passing through the bandwidth limiter is the first bandwidth, and the bandwidth used by the first IP core after passing through the bandwidth limiter is the second bandwidth, and the first bandwidth and the second bandwidth are the same.
[0063] The flow control module can respond to the flow control request of one or more IP cores, and adaptively perform flow control on at least one VC according to the received flow control request. For example, taking the first IP core on the master side as an example, when the first IP core has a flow control requirement for one or some VCs, a signal can be sent to the flow control module, and the signal is used to trigger the flow control module to perform flow control. For the convenience of description, the signal is referred to as a flow control request in the embodiment of the present application. The flow control module receives the flow control request, determines the flow control strategy to be used, and performs flow control on the corresponding VC. For the convenience of description, the embodiment of the present application refers to the flow control strategy to be determined by the flow control module as the target flow strategy, and the VC to be flow controlled is taken as the first VC as an example.
[0064] Among them, the flow control module can be a hardware description language program with specific circuit functions, which can be transplanted to different semiconductor processes to produce integrated circuit chips. For example, the flow control module is a hardware circuit designed with the hardware description language program and is integrated into the SoC chip. Alternatively, the flow control module can also be a software description language program with specific functions, which can be integrated into the SoC chip. The embodiment of the present application does not limit the location where the flow control module is integrated in the SoC chip. For example, the flow control module can be integrated on the NOC of the SoC chip.
[0065] The load acquisition module can count / acquire the load rate of one or more IP cores. When the load rate exceeds a certain threshold, a flow control request can be generated to trigger the flow control module to perform flow control on at least one VC. Taking the first IP core as an example, when the load rate of the first IP core exceeds a certain threshold, the load acquisition module can generate a flow control request. The flow control module receives the flow control request sent by the load acquisition module, determines the target flow control strategy to be used, and performs flow control on the first VC.
[0066] Among them, the load acquisition module can be a hardware description language program with specific circuit functions, which can be transplanted to different semiconductor processes to produce integrated circuit chips. For example, the load acquisition module is a hardware circuit designed with the hardware description language program and is integrated in the SOC chip. For example, the load acquisition module can be a counter. Alternatively, the load acquisition module can also be a software description language program with specific functions, which can be integrated in the SoC chip. The embodiment of the present application does not limit the location where the load acquisition module is integrated in the SoC chip. For example, the load acquisition module can be integrated on the NOC of the SoC chip. For another example, the load acquisition module can be integrated in the IP core.
[0067] Since the flow control module performs flow control only when triggered by a flow control request, compared to Figure 3 The structure shown in the figure actively limits the flow of VC, which can reduce the impact on the transmission of business flow. Figure 4 , the technical solution provided in the embodiment of the present application is introduced in detail for the two situations where the first IP core is a master side IP core or a slave side IP core.
[0068] In the first case, the first IP core is a slave IP core, for example, the first IP core is a system cache or an external memory. For example, the first IP core is IP core 4. The fewer resources the first IP core can use, the higher the load rate of the first IP core can be considered. To this end, the embodiment of the present application can obtain the load rate of the first IP core, and determine whether to generate a flow control request based on the obtained load rate. If the load rate is low, it can be considered that there is no need to control the flow of the first IP core, and there is no need to generate a flow control request. When the load rate is greater than or equal to a certain threshold, it can be considered that the flow of the first IP core needs to be controlled, and a flow control request is generated.
[0069] The load rate of the first IP core may be a resource occupancy rate, where the resource occupancy rate is a ratio of occupied resources to a maximum usable resource.
[0070] As an example, the resource of the first IP core is the command queue of the first IP core. It is understandable that when the main side IP core performs business, the commands required for executing the business can be first stored in the first IP core, and then the commands can be taken out from the first IP core for execution. The first IP core can store commands from one or more main side IP cores. When the first IP core stores a large number of commands, it may cause normal transmission of business data. In this case, it is expected that the flow of the first IP core can be controlled so that the first IP core can leave more space to store subsequent commands to reduce the normal transmission of business data.
[0071] The load rate of the first IP core may be the occupancy rate of the command queue of the first IP core. The command queue is used to store the commands to be processed by the first IP core, and the occupancy rate is the ratio of the number of commands stored in the command queue to the upper limit of the number of commands that the command queue can store. The upper limit of the number of commands that the command queue can store may be the total length / total depth of the command queue. Specifically, the load rate of the first IP core may be acquired through a load acquisition module. For example, if the command queue receives a command, the number of commands stored in the command queue is increased by 1, and if a command in the command queue is read away, the number of commands stored in the command queue is decreased by 1. The load acquisition module may determine the occupancy rate of the command queue by counting the commands stored in the command queue. When the occupancy rate of the command queue of the first IP core exceeds a certain threshold, a flow control request is generated to trigger the flow control module to perform flow control on the first VC.
[0072] As an example, the resource of the first IP core is a data cache for storing data, and the resource occupancy rate of the first IP core is the ratio of the size of data stored in the data cache of the first IP core to the upper limit of the size of data that can be stored in the data cache.
[0073] It is understandable that when the master-side IP core performs a service, in addition to sending commands to the first IP core, it may also temporarily store data in the first IP core and then read data from the first IP core. The first IP core can store data from one or more master-side IP cores. When the first IP core stores a lot of data, it may cause normal transmission of service data. In this case, it is expected to control the flow of the first IP core so that the first IP core can leave more space to store subsequent data to reduce the normal transmission of service data.
[0074] The resource occupancy rate of the first IP core may be a ratio of the data size stored in the data cache of the first IP core to the upper limit of the data size that the data cache can store. When the resource occupancy rate of the first IP core exceeds a certain threshold, a flow control request is generated to trigger the flow control module to perform flow control on the first VC.
[0075] As an example, the resource is bandwidth, and the resource occupancy rate of the first IP core is the ratio of the bandwidth actually used by the first IP core to the bandwidth that can be used by the first IP core.
[0076] The bandwidth actually used by the first IP core may be less than the bandwidth allocated to the first IP core. For example, the bandwidth allocated to the first IP is 4 GB / s, the bandwidth actually used by the first IP core is 2 GB / s, and the remaining 2 GB / s of bandwidth may have been used. In this case, it is expected to control the traffic of the first IP core so that the first IP core can have more available bandwidth to reduce the normal transmission of business data.
[0077] The load rate of the first IP core may be a ratio of the bandwidth actually used by the first IP core to the bandwidth available for use by the first IP core. When the occupancy rate of the command queue of the first IP core exceeds a certain threshold, a flow control request is generated to trigger the flow control module to perform flow control on the first VC.
[0078] The flow control module receives the flow control request and uses the target flow control strategy to perform flow control on the first VC. The target flow control strategy is related to the resource occupancy rate of the first IP core. Alternatively, the target flow control strategy has a mapping relationship with the occupancy rate of the command queue of the first IP core.
[0079] In a possible implementation, multiple flow control threshold ranges or thresholds may be set, and different threshold ranges / thresholds may correspond to different flow control strategies. For example, a first range, a second range, and a third range may be predefined or (pre) configured. Among them, the maximum value in the first range is less than or equal to the minimum value in the second range, and the maximum value in the second range is less than or equal to the minimum value in the third range. For example, the first range is 0% to 30%, the second range is 31% to 70%, and the third range is 71% to 100%. The resource occupancy rate of the first IP core is in different ranges, and the target flow control strategy is also different.
[0080] For example, when the resource occupancy rate of the first IP core is within the first range, the target flow control strategy is not to restrict the flow of the first VC. That is to say, when the resource occupancy rate of the first IP core is low, there is no need to adjust the flow of the first VC. When the resource occupancy rate of the first IP core is within the second range, the target flow control strategy is to feed back the enable signal corresponding to the first VC at the first rate. When the resource occupancy rate of the first IP core is within the second range, the data packet can be sent on the first VC at a lower rate. The first rate can be predefined or agreed, or the first rate is determined by the flow control module. For example, the flow control module can obtain the first rate by subtracting a preset step from a preset rate upper limit value. When the resource occupancy rate of the first IP core is within the third range, the target flow control strategy is to stop sending the enable signal corresponding to the first VC. When the occupancy rate of the command queue of the first IP core is high, the sending of data packets on the first VC can be stopped to avoid blocking.
[0081] By setting multiple flow control threshold ranges or thresholds, the target flow control measurement can be adaptively adjusted to more flexibly and accurately adjust the flow of the first VC, and on the basis of improving resource utilization, the delay of service data can be minimized. For example, see Figure 5 , showing a SoC chip structure with multiple flow control threshold ranges. When the resource occupancy rate of the first IP core exceeds the maximum value of a certain threshold range, a flow control request is generated. Figure 5 Take the case where three threshold ranges are included and the resource occupancy rate of the first IP core exceeds the maximum value of the second threshold range as an example.
[0082] In the second case, the first IP core is a main IP core, for example, the first IP core is one or more of a CPU, a GPU, an AP, a camera subsystem, a wireless access module, a display subsystem, or a multimedia subsystem. For example, the first IP core is IP core 1.
[0083] The first IP core may generate a flow control request according to the flow demand for the established first VC. For example, if the first VC requires a larger flow, a flow control request may be generated to trigger the flow control module to perform flow control on the first VC. Figure 4Take IP core 1 as an example. The traffic demand of the first VC can be characterized by one or more of the following: the bandwidth associated with the first VC, the average traffic rate of the first VC in the first time period, the resource availability of the first VC, the resource availability is the ratio of the available resources to the maximum available resources, the delay of the first VC, etc. The bandwidth associated with the first VC is replaceable with the bandwidth associated with the first IP core; the average traffic rate of the first VC in the first time period is replaceable with the average traffic rate of the first IP core in the first time period; the resource availability of the first VC is replaceable with the resource availability of the first IP core; the delay of the first VC is replaceable with the delay of the first IP core.
[0084] As an example, the bandwidth associated with the first VC can represent the bandwidth required by the first VC. If the bandwidth currently actually available to the first VC is less than the bandwidth associated with the first VC, then a request can be made to control the traffic of the first VC so that the first VC can actually use more bandwidth. Controlling the traffic of the first VC includes controlling the traffic of one or more VCs other than the first VC so that the first VC can actually use more bandwidth. The resource availability of the first VC can represent the resources required by the first VC. If the resources currently actually available to the first VC are relatively small, then a request can be made to control the traffic of the first VC so that the first VC can use more resources. If the average traffic rate of the first VC in the first time period is relatively small, a request can be made to control the traffic of the first VC so as to increase the average traffic rate of the first VC. If the delay of the first VC is relatively high, it means that the first VC is easily blocked. A request can be made to control the traffic of the first VC so as to increase the traffic of the first VC and reduce the delay of the first VC.
[0085] Taking the bandwidth associated with the first VC as an example, multiple bandwidth thresholds can be set. When the bandwidth associated with the first VC is lower than a certain threshold, the first IP core can generate a flow control request. For example, the second threshold, the third threshold, and the fourth threshold can be predefined or (pre) configured, wherein the second threshold is greater than or equal to the third threshold, and the third threshold is greater than or equal to the fourth threshold. For example, the first threshold is 4GB / s, the second threshold is 8GB / s, and the third threshold is 16GB / s. Different thresholds correspond to different flow control strategies.
[0086] For example, when the bandwidth associated with the first VC is lower than the first threshold, the target flow control strategy is to limit the flow of at least one VC other than the first VC. The at least one VC is not a VC established by the first IP core or is not a VC to be used by the first IP core. For example, the target flow control strategy is to limit the flow of at least one VC other than the first VC to 1GB / s. When the bandwidth associated with the first IP core is lower than the second threshold, the target flow control strategy is to feed back the enable signal corresponding to the first VC at the first rate. The first rate can be predefined or agreed, or the first rate is determined by the flow control module. When the bandwidth associated with the first IP core is lower than the third threshold, the target flow control strategy is to stop sending the enable signal corresponding to the first VC.
[0087] Alternatively, the first threshold is 1GB / s, the second threshold is 2GB / s, and the third threshold is 4GB / s. When the average flow rate of the first VC in the first time period is lower than the first threshold, the target flow control strategy is to limit the average flow rate of at least one VC other than the first VC in the second time period to 1GB / s. When the average flow rate of the first VC in the first time period is lower than the second threshold, the target flow control strategy is to limit the average flow rate of at least one VC other than the first VC in the second time period to 1.5GB / s. When the average flow rate of the first VC in the first time period is lower than the third threshold, the target flow control strategy is to limit the average flow rate of at least one VC other than the first VC in the second time period to 2GB / s.
[0088] Similarly, for the average flow rate of the first VC in the first time period, multiple flow rate thresholds can be set, and different flow rate thresholds correspond to different target flow control strategies. For the resource availability of the first VC, multiple thresholds can be set, and different thresholds correspond to different target flow control strategies. For the delay of the first VC, multiple delay thresholds can be set, and different delays correspond to different target flow control strategies. When the resource occupancy rate of the first IP core exceeds a certain threshold, a flow control request is generated, such as Figure 5 shown. Figure 5 A flow control request is generated when the resource occupancy rate of the first IP core exceeds a third threshold.
[0089] By setting multiple flow control thresholds, the target flow control measurement can be adaptively adjusted to more flexibly and accurately adjust the flow of the first VC, and on the basis of improving resource utilization, the delay of business data can be minimized.
[0090] See also Figure 6 , is a schematic diagram of the structure of a device provided in an embodiment of the present application. The device includes Figure 4 Optionally, the device may also include at least one external memory. Figure 6In the terminal device shown in the figure, the external memory can be regarded as an off-chip system, and the parts other than the external memory can be regarded as Figure 4 The SoC chip in it.
[0091] In one example, the device may be a terminal device, which may be deployed on land, including indoors or outdoors, handheld or vehicle-mounted; it may also be deployed on the water (such as a ship, etc.); it may also be deployed in the air (such as an airplane, a balloon, and a satellite, etc.). The terminal device may be a mobile phone, a tablet computer (pad), a computer with wireless transceiver function, a virtual reality (VR) terminal, an augmented reality (AR) terminal, a wireless terminal in industrial control, a wireless terminal in self-driving, a wireless terminal in remote medical, a wireless terminal in smart grid, a wireless terminal in transportation safety, a wireless terminal in smart city, a wireless terminal in smart home, etc. In another example, the device may also be a test machine for testing chips.
[0092] based on Figure 6 The terminal device shown in the figure may include one or more IP cores ( Figure 6 Only one IP core, i.e., CPU, NOC, flow control module, SC and at least one external memory are shown. One or more IP cores are connected to the external memory and SC through NOC, and SC is connected to the external memory. The external memory may be DRAM. Optionally, the terminal device may further include a load acquisition module.
[0093] The flow control module and the load acquisition module can be deployed in hardware circuits or software functional modules on the NOC. The flow control module can read commands (such as flow control requests) from the IP core or the load acquisition module, decode the commands, and then complete the execution of the commands. Specifically, when the first IP core has a flow control requirement for the first VC, it can send a flow control request to the flow control module. The flow control module receives the flow control request, determines the target flow control strategy, and performs flow control on the first VC. The load acquisition module determines that the load rate of the DRAM exceeds a certain threshold and sends a flow control request to the flow control module. The flow control module receives the flow control request, determines the target flow control strategy, and performs flow control on the first VC.
[0094] Based on the same inventive concept, an embodiment of the present application provides a flow control method. The method can be applied to a SOC chip, the SOC chip includes at least one IP core and a flow control module, the at least one IP core includes a first IP core. Figure 7 , the method comprises the following steps:
[0095] Step 701: Receive a flow control request, where the flow control request is used to request flow control on a first VC.
[0096] Step 702: Use the target flow control strategy to control the flow of the first VC.
[0097] S701 and S702 may be executed by a flow control module. For details, please refer to the relevant contents of the aforementioned embodiment, which will not be described in detail here.
[0098] In one possible design, the SoC chip further includes a bandwidth limiter, and the method further includes:
[0099] The bandwidth used by the VC established by the first IP core is limited by a bandwidth limiter; wherein the bandwidth limiter is set on the VC established by the first IP core; wherein the bandwidth occupied by the VC established by the first IP core remains unchanged before and after passing through the bandwidth limiter.
[0100] In a possible design, the first IP core is one or more of the following: CPU, AP, GPU, wireless access module, camera subsystem, display subsystem, multimedia subsystem, system cache, or external memory.
[0101] In a possible design, the first IP core is a system cache or an external memory, the SoC chip further includes a load acquisition module, and the method further includes:
[0102] Determine the load of the first IP core by a load acquisition module, and when the load rate is greater than or equal to a first threshold, the flow control request;
[0103] The flow control module receives the flow control request, including: the flow control module receives the flow control request from the load acquisition module.
[0104] In one possible design, the load rate of the first IP core is the resource occupancy rate of the first IP core, and the resource occupancy rate is the ratio of the occupied resources to the maximum resources that can be used. For example, the resource is the command queue of the first IP core, and the load rate of the first IP core is the occupancy rate of the command queue of the first IP core, and the command queue is used to store the commands to be processed by the first IP core. Among them, the resource occupancy rate is the ratio of the number of commands stored in the command queue to the upper limit of the number of commands that the command queue can store. For another example, the resource is a data cache for storing data, and the resource occupancy rate of the first IP core is the ratio of the data size stored in the data cache of the first IP core to the upper limit of the data size that the data cache can store. For another example, the resource is bandwidth, and the resource occupancy rate of the first IP core is the ratio of the bandwidth actually used by the first IP core to the bandwidth that can be used by the first IP core.
[0105] In one possible design, the load acquisition module is a counter.
[0106] In one possible design, the target flow control strategy is a flow control strategy that has a mapping relationship with the resource occupancy rate. In one possible design, the mapping relationship is one or more of the following: when the resource occupancy rate is within a first range, the target flow control strategy is not to limit the flow of the first VC; when the resource occupancy rate is within a second range, the target flow control strategy is to send an enable signal corresponding to the first VC at a first rate, and the enable signal enables sending data packets on the first VC; or, when the resource occupancy rate is within a third range, the target flow control strategy is to stop sending the enable signal corresponding to the first VC, and the enable signal enables sending data packets on the first VC.
[0107] In one possible design, the first IP core is a CPU, an AP, a GPU, a wireless access module, a camera subsystem, a display subsystem, or a multimedia subsystem, and the target flow control measurement is associated with one or more of the following: a bandwidth associated with the first VC, or a resource availability rate of the first VC, where the resource availability rate is a ratio of available resources to the maximum available resources.
[0108] In one possible design, the target traffic control strategy is to reduce the average traffic rate of at least one VC other than the first VC within the second time period, and the at least one VC is not a VC established / used by the first IP core.
[0109] also, Figure 7 Other implementations of the method shown can also be found in the above Figures 4 to 6 The relevant description in will not be repeated here.
[0110] The steps of the method or algorithm described in the embodiments of the present application can be directly embedded in the hardware, the software unit executed by the processor, or the combination of the two. The software unit can be stored in a RAM memory, a flash memory, a ROM memory, an EPROM memory, an EEPROM memory, a register, a hard disk, a removable disk, a CD-ROM or other storage media of any form in the art. Exemplarily, the storage medium can be connected to the processor so that the processor can read information from the storage medium and can write information to the storage medium. Optionally, the storage medium can also be integrated into the processor. The processor and the storage medium can be arranged in an ASIC, and the ASIC can be arranged in a terminal device. Optionally, the processor and the storage medium can also be arranged in different components in the terminal device.
[0111] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0112] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A system-on-chip (SoC) chip, It is characterized in that The invention comprises a flow control module and a first intellectual property IP core, wherein the flow control module is used for: receiving a flow control request, the flow control request being used to request flow control of a first virtual channel VC, the first VC including one or more VCs established by the first IP core; The target flow control strategy is used to control the flow of the first VC.
2. The SoC chip according to claim 1, It is characterized in that The SoC chip also includes a bandwidth limiter, which is used to limit the bandwidth of the VC established by the first IP, and the bandwidth limiter is set on the VC established by the first IP core; wherein, before and after passing through the bandwidth limiter, the bandwidth occupied by the VC established by the first IP core remains unchanged.
3. The SoC chip according to claim 1 or 2, It is characterized in that The first IP core is one or more of the following: a central processing unit CPU, an application processor AP, a graphics processor GPU, a wireless access module, a camera subsystem, a display subsystem, a multimedia subsystem, a system cache or an external memory.
4. The SoC chip as claimed in claim 3, It is characterized in that The SoC chip also includes a load acquisition module; wherein, The load acquisition module is used to determine the load rate of the first IP core, and send the flow control request to the flow control module when the load rate is greater than or equal to a first threshold, wherein the first IP core is a system cache or an external memory; The flow control module is used to receive the flow control request in the following manner: the flow control module receives the flow control request from the load acquisition module.
5. The SoC chip as claimed in claim 4, It is characterized in that The load rate of the first IP core is the resource occupancy rate of the first IP core, and the resource occupancy rate is the ratio of occupied resources to the maximum available resources.
6. The SoC chip according to claim 4 or 5, It is characterized in that The load acquisition module is a counter.
7. The SoC chip according to claim 5 or 6, It is characterized in that The target flow control strategy is a flow control strategy having a mapping relationship with the resource occupancy rate.
8. The SoC chip as claimed in claim 7, It is characterized in that The mapping relationship includes one or more of the following: The resource occupancy rate is within a first range, and the target flow control strategy is not to limit the flow of the first VC; The resource occupancy rate is within a second range, the target flow control strategy is to send an enable signal corresponding to the first VC at a first rate, and the enable signal enables sending data packets on the first VC; or, The resource occupancy rate is within a third range, and the target flow control strategy is to stop sending an enable signal corresponding to the first VC, wherein the enable signal enables sending data packets on the first VC.
9. The SoC chip as claimed in claim 3, It is characterized in that The first IP core is a CPU, an AP, a GPU, a wireless access module, a camera subsystem, a display subsystem, or a multimedia subsystem, and the target traffic control strategy is associated with one or more of the following: The bandwidth associated with the first VC, or the resource availability of the first VC, where the resource availability is a ratio of available resources to maximum available resources.
10. The SoC chip as claimed in claim 9, It is characterized in that The target traffic control strategy is to reduce the average traffic rate of at least one VC other than the first VC within a second time period, and the at least one VC is not a VC established by the first IP core.
11. A terminal device, It is characterized in that Comprising the SoC chip as claimed in any one of claims 1 to 10.
12. A flow control method, It is characterized in that Applied to a system on chip (SoC) chip, the SoC chip includes a flow control module and a first intellectual property IP core, the method includes: Receiving a flow control request through the flow control module, the flow control request is used to request flow control of a first virtual channel VC, the first VC being one or more VCs established by the first IP core; The flow control module adopts a target flow control strategy to control the flow of the first VC.
13. The method according to claim 12, It is characterized in that The SoC chip further includes a bandwidth limiter, and the method further includes: The bandwidth used by the VC established by the first IP core is limited by the bandwidth limiter; wherein the bandwidth limiter is set on the VC established by the first IP core; wherein the bandwidth occupied by the VC established by the first IP core remains unchanged before and after passing through the bandwidth limiter.
14. The method according to claim 12 or 13, It is characterized in that The first IP core is one or more of the following: a central processing unit CPU, an application processor AP, a graphics processor GPU, a wireless access module, a camera subsystem, a display subsystem, a multimedia subsystem, a system cache or an external memory.
15. The method of claim 14, It is characterized in that The first IP core is a system cache or an external memory, the SoC chip further includes a load acquisition module, and the method further includes: Determine the load rate of the first IP core through the load acquisition module, and generate the flow control request when the load rate is greater than or equal to a first threshold; The receiving the flow control request through the flow control module includes: receiving the flow control request from the load acquisition module through the flow control module.
16. The method of claim 15, It is characterized in that The load rate of the first IP core is the resource occupancy rate of the first IP core, and the resource occupancy rate is the ratio of occupied resources to the maximum available resources.
17. The method according to claim 15 or 16, It is characterized in that The load acquisition module is a counter.
18. The method according to claim 16 or 17, It is characterized in that The target flow control strategy is a flow control strategy having a mapping relationship with the resource occupancy rate.
19. The method of claim 18, It is characterized in that The mapping relationship includes one or more of the following: The resource occupancy rate is within a first range, and the target flow control strategy is not to limit the flow of the first VC; The resource occupancy rate is within a second range, the target flow control strategy is to send an enable signal corresponding to the first VC at a first rate, and the enable signal enables sending data packets on the first VC; or, The resource occupancy rate is within a third range, and the target flow control strategy is to stop sending an enable signal corresponding to the first VC, wherein the enable signal enables sending data packets on the first VC.
20. The method of claim 14, It is characterized in that The first IP core is a CPU, an AP, a GPU, a wireless access module, a camera subsystem, a display subsystem, or a multimedia subsystem, and the target traffic control strategy is associated with one or more of the following: The bandwidth associated with the first VC, or the resource availability of the first VC, where the resource availability is a ratio of available resources to maximum available resources.
21. The method of claim 20, It is characterized in that The target traffic control strategy is to reduce the average traffic rate of at least one VC other than the first VC within a second time period, and the at least one VC is not a VC established by the first IP core.
22. A computer-readable storage medium, It is characterized in that The method comprises instructions which, when executed on a computer, cause the computer to perform the method according to any one of claims 12 to 21.
