Arbitration scheduling system and method for multi-port USB host chip
By adopting an arbitration scheduling system in a multi-port USB host chip, and dynamically adjusting transmission priority in combination with transmission methods and device types, the problem of low bandwidth utilization when multiple devices are transmitted simultaneously is solved, and more efficient data transmission and performance improvement is achieved.
Patent Information
- Application Number
- CN202411133497.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-19
- Publication Date
- 2024-11-19
- Estimated Expiration
- 2044-08-19
AI Technical Summary
In a multi-port USB host chip, when multiple devices request data transmission at the same time, the bus bandwidth utilization rate is low, resulting in some port devices waiting for a long time, and the data transmission efficiency is low. The fixed priority or polling mechanism of the existing technology cannot be used. Effectively resolve this problem.
The arbitration scheduling system is adopted, and the transmission priority is dynamically adjusted based on factors such as transmission method, device type and transmission length. The current data transmission priority of each port is calculated through the arbitration module, and the bus management module reasonably allocates the bus bandwidth resources. The transmission scheduling module is transmitted. Adjust the transmission policy according to priority and bandwidth resources.
It effectively improves the utilization rate of bus bandwidth, avoids long-term waiting of equipment, improves data transmission rate and performance, adapts to changes in different scenarios and demands, and has stronger flexibility and comprehensiveness.
Smart Images

Figure CN118642985B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of chip technology, and in particular to an arbitration scheduling system and method for a multi-port USB host chip. Background Art
[0002] USB (Universal Serial Bus) is a universal serial bus technology and one of the main interfaces for data transmission between devices. Currently, the most widely used is USB3.2 Gen1 / Gen2, with a maximum rate of 20Gb / s. Multi-port USB host chips, each port supports USB3.2 Gen1 / Gen2 and is backward compatible with USB2.0 / 1.1. Multiple USB devices can be connected at the same time to achieve efficient data transmission.
[0003] In a multi-port USB host chip, it is very common for multiple devices to request data transfer at the same time. However, the USB bus is a shared bus structure, and multiple different devices communicate with the host through the same physical bus. Therefore, an arbitration mechanism is needed to manage data transmission and access between multiple devices. Arbitration for a multi-port host USB chip involves managing data transmission priorities and access rights between multiple USB interfaces to ensure that multiple devices can effectively share USB bus resources when connected at the same time.
[0004] There are four USB data transmission modes. Different USB transmission modes have different bandwidth requirements, which mainly depend on their application scenarios, data transmission characteristics and USB standard limitations. The bandwidth requirements of various transmission modes are as follows:
[0005] Control transmission usually has lower bandwidth requirements because it is mainly used to send management and control commands for devices rather than large amounts of data transmission. The packet size of control transmission is usually small and requires less bandwidth. Bulk transmission is suitable for the transmission of large amounts of data, such as reading and writing large files. Although bulk transmission does not require high latency for data transmission, it can occupy a large bandwidth to ensure efficient data transmission. Interrupt transmission is used to periodically transmit small amounts of data, such as data transmission for input devices such as mice and keyboards. Although the amount of data transmitted is not large, interrupt transmission requires low latency, so the bandwidth requirements are more flexible and usually do not occupy too much bandwidth. Isochronous transmission is used for real-time data transmission, such as audio and video streaming. It is very sensitive to the time interval and bandwidth requirements of transmission to ensure that data can be transmitted on time, but synchronous transmission does not guarantee the reliability of data. Therefore, the bandwidth requirements are high to support stable real-time data transmission.
[0006] When a single device is connected to the USB host chip for data transmission, the read and write speeds can basically reach the USB standard (excluding bus loss). However, when multiple devices are connected at the same time and initiate the same data transmission, the data transmission rate of some ports will be very slow, or even drop to 0. Or, when processing data of different transmission methods of multiple devices at the same time, such as interrupt transmission and batch transmission, batch transmission requires more bandwidth, while interrupt transmission only requires a small amount of bus bandwidth resources. However, in fact, according to the fixed priority or polling mechanism, the device that initiates the interrupt transmission may occupy a lot of bus bandwidth resources for a period of time. The device performing batch transmission needs to wait for the interrupt transmission to complete, or can only use part of the bus bandwidth for transmission. The utilization rate of the bus bandwidth is low, resulting in a slow rate and poor read and write performance. Summary of the invention
[0007] In view of the problems existing in the prior art, an arbitration scheduling system and method for a multi-port USB host chip are provided. The transmission priority is arbitrated by combining factors such as transmission mode, device type, and transmission length, and bus bandwidth resources are reasonably allocated to improve the bus bandwidth utilization, thereby increasing the data transmission rate. The priority and order of access to different ports can be dynamically adjusted to adapt to different scenarios and changes in demand.
[0008] The first aspect of the present invention provides an arbitration scheduling system for a multi-port USB host chip, wherein the multi-port USB host chip is interconnected with a USB host and a plurality of USB devices respectively, and the multi-port USB host chip comprises:
[0009] The host controller module includes multiple links formed by multiple ports, which is responsible for data transmission between the USB host and each USB device;
[0010] An arbitration module, used to calculate the current data transmission priority of each port according to the information carried in the transmission request; wherein the arbitration module recalculates the current data transmission priority of each port at regular intervals;
[0011] A bus management module is used to allocate bus bandwidth resources to each port according to the current data transmission priority;
[0012] The transmission scheduling module is used to dynamically adjust the transmission strategy according to the current data transmission priority of each port and the allocated bus bandwidth resources, and control the host controller module to complete the data transmission.
[0013] As a preferred solution, the arbitration scheduling system also includes a command parsing unit, which is used to obtain a transmission request from the host controller module, and parse to obtain USB device information and transmission information, and provide information for the arbitration module; the command parsing unit re-obtains the current transmission information from the host controller module at regular intervals.
[0014] As a preferred solution, the arbitration scheduling system further includes a cache module, which is used to cache transmission information and data provided by the command parsing unit for use by the arbitration module.
[0015] As a preferred solution, the arbitration module determines whether only a single port is performing data transmission. If so, the default transmission priority is the highest; if not, the transmission priority is obtained by comprehensive calculation based on the USB device information and the transmission information.
[0016] As a preferred solution, in the arbitration module, the process of comprehensively calculating the transmission priority according to the USB device information and the transmission information includes:
[0017] The initial priority of all ports defaults to level one. The transmission priority of each port is calculated comprehensively based on the transmission direction, device rate, remaining data volume and transmission mode of each port. Among them, the priority of the input direction is increased by one level, and the priority of the output direction remains unchanged; the priority remains unchanged when the device rate is the lowest rate, and the priority increases by one level for each higher device rate; the priority increases by one level when the remaining data volume exceeds the preset threshold, otherwise the priority remains unchanged; the priority increases by one level when the transmission mode is synchronous transmission or batch transmission, and the priority remains unchanged when the interrupt transmission or control transmission is the control transmission.
[0018] As a preferred solution, if only a single port is transmitting data, the bus management module does not work and by default releases all bus bandwidth resources for use by the USB device of this port; otherwise, the bus management module allocates idle bus bandwidth resources to each port in real time according to the transmission priority ratio of each port.
[0019] As a preferred solution, after the transmission scheduling module obtains the transmission priority of each port and the allocated bus bandwidth resources, it controls the host controller module to transmit data; at the same time, if there is currently bus bandwidth resources transmitting data, it determines whether the bus bandwidth resources need to be released for reallocation by the bus management module based on the transmission priority and transmission protocol of the port transmitting data.
[0020] As a preferred solution, in the transmission scheduling module, if the transmission mode of the port is interrupt transmission, regardless of the transmission priority, transmission must be performed at a fixed time according to the protocol; if the transmission mode of the port is synchronous transmission, regardless of the transmission priority, data transmission of a fixed length must be completed at a fixed time according to the protocol; if multiple ports perform interrupt transmission or synchronous transmission at the same time, transmission is performed according to the transmission priority.
[0021] A second aspect of the present invention provides an arbitration scheduling method for a multi-port USB host chip, wherein the multi-port USB host chip is interconnected with a plurality of USB devices, and the arbitration scheduling method comprises:
[0022] Receive USB device transfer requests and allocate bus bandwidth resources for data transmission;
[0023] Parsing the USB device information and transfer information contained in the transfer request;
[0024] The transmission priority of each port is arbitrated at regular intervals. If only a single port transmits data, the default transmission priority is the highest.
[0025] Allocate idle bus bandwidth resources to corresponding ports according to the transmission priority of each port;
[0026] The transmission strategy of each port is adjusted according to the transmission priority of each port and the allocated bus bandwidth resources; among them, if there is a port currently transmitting data and its priority is lower than the priority of the port to transmit data, part of the bus bandwidth resources will be released and reallocated under the condition that the protocol is met.
[0027] As a preferred solution, the arbitrating of the transmission priority of each port specifically includes:
[0028] The initial priority of all ports defaults to level one. The transmission priority of each port is calculated comprehensively based on the transmission direction, device rate, remaining data volume and transmission mode of each port. Among them, the priority of the input direction is increased by one level, and the priority of the output direction remains unchanged; the priority remains unchanged when the device rate is the lowest rate, and the priority increases by one level for each higher device rate; the priority increases by one level when the remaining data volume exceeds the preset threshold, otherwise the priority remains unchanged; the priority increases by one level when the transmission mode is synchronous transmission or batch transmission, and the priority remains unchanged when the interrupt transmission or control transmission is the control transmission.
[0029] Compared with the prior art, the beneficial effects of adopting the above technical solution are:
[0030] 1. Applicable to multi-port host chips. When multiple USB devices are connected at the same time, arbitration is performed based on the characteristics of the USB transmission method, device rate (USB2.0, USB3.2 Gen1 / Gen2, etc.), transmission direction, transmission length and other factors to reasonably allocate bus bandwidth resources, which can effectively improve bus utilization.
[0031] 2. The arbitration scheduling method and system of the present invention can avoid the problem that when multiple devices are interacting with each other at the same time, a device at a certain port is in a long waiting period, resulting in low data interaction efficiency.
[0032] 3. The arbitration scheduling method and system of the present invention can dynamically adjust the priority and order of access to different ports according to the current data transmission situation to adapt to different scenarios and demand changes, which is more flexible and comprehensive.
[0033] 4. The cache module proposed in the present invention can cache transmission-related information and data for arbitration, without disrupting the current data transmission process, and avoiding waste of bus resources caused by additional overhead brought by arbitration calculation. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Figure 1 This is a schematic diagram of an arbitration scheduling system for a multi-port USB host chip proposed by the present invention.
[0035] Figure 2 The present invention provides a flowchart of an arbitration scheduling method for a multi-port USB host chip. DETAILED DESCRIPTION
[0036] Embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar modules or modules with the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present application, and cannot be construed as limitations on the present application. On the contrary, the embodiments of the present application include all changes, modifications and equivalents that fall within the spirit and connotation of the appended claims.
[0037] The existing arbitration method is usually based on a fixed priority or polling mechanism, which may lead to low data transmission efficiency or long waiting time for a device at a certain port and inflexible priority setting in practical applications. The embodiment of the present invention proposes an arbitration scheduling system for a multi-port USB host chip, which is mainly used in a multi-port USB host chip. The multi-port USB host chip provides multiple ports for interconnection with USB devices; at the same time, the multi-port USB host chip is also interconnected with a host computer, namely a USB host, to realize data transmission scheduling between the USB host and various USB device components.
[0038] Please refer to Figure 1 , the arbitration and scheduling system of the multi-port USB host chip mainly includes a host controller module, an arbitration module, a bus management module and a transmission scheduling module. The host controller module includes multiple links formed by multiple ports, which are responsible for data transmission between the USB host and each USB device; the arbitration module is used to calculate the current data transmission priority of each port according to the information carried by the transmission request; the bus management module is used to allocate bus bandwidth resources to each port according to the current data transmission priority; the transmission scheduling module is used to dynamically adjust the transmission strategy according to the current data transmission priority of each port and the allocated bus bandwidth resources. The transmission priority arbitration and bus bandwidth resource allocation of each port are completed through the arbitration module, the bus management module and the transmission scheduling, and the transmission strategy of the host controller module is dynamically adjusted, which can effectively improve the bus utilization rate. It should be noted that each USB device corresponds to each port in the USB host chip. The subsequent description mostly uses ports for explanation, but it is not difficult to understand that when arbitrating the transmission priority of a port, the transmission priority of the USB device corresponding to the port is also arbitrated. The following is a further explanation of each module, specifically:
[0039] The USB host controller module mainly implements the hardware functions of the USB link layer according to the USB protocol specification, and is used to manage the data flow of the USB host and USB devices. Since multiple ports are provided, it includes multiple links to support the data of multiple ports. Please continue to refer to Figure 1 , a USB physical layer module is also included between the host controller module and the USB device. The USB physical layer module provides multiple USB physical interfaces and supports multi-port serial data reception and transmission. The USB host loads a USB driver to drive the communication between the USB host chip and the device.
[0040] In actual applications, the USB host controller module receives and parses data from the USB physical layer module and then sends it to the USB host, or sends the data sent by the USB host to the USB physical layer module in the USB packet format and then to the USB device.
[0041] The arbitration module is the core part of the arbitration scheduling system. The allocation of bus bandwidth resources and the transmission order all depend on the arbitration results of the arbitration module. In this embodiment, the arbitration module mainly calculates the transmission priority of each port (USB device) based on the information contained in the transmission request in the host controller module, such as transmission direction, device rate, transmission mode, data length, etc. Specifically, after the arbitration module obtains the information provided by the transmission request, it updates the record status of all current ports and then calculates the current data transmission priority of the corresponding port of each USB device. Before arbitrating the transmission priority of each port, it is necessary to determine the number of device ports currently performing data transmission. If only a single port performs data transmission, the default transmission priority is the highest; if there are multiple ports for data transmission, it is necessary to calculate the transmission priority based on factors such as the port's transmission direction, data length, transmission mode, device rate, etc.
[0042] When judging the transmission priority, for the transmission direction, the input direction has a higher priority than the output direction; for the remaining transmission data volume, the larger the remaining transmission data volume, the higher the priority; for the transmission mode, synchronous transmission and bulk transmission have a higher priority than interrupt transmission and control transmission; for the device rate, the higher the device rate, the higher the priority.
[0043] Accordingly, this embodiment provides a specific multi-port transmission priority arbitration method, which specifically includes:
[0044] (1) The initial priority of all ports defaults to level 1;
[0045] (2) Determine the transmission direction of the port. If the transmission direction is the input direction, the priority is increased by one level, and the priority of the output direction remains unchanged;
[0046] (3) Determine the device speed. If the device speed is the lowest, the priority remains unchanged. The priority increases by one level for each higher speed (for example, USB2.0, USB3.2 Gen1 / Gen2, etc.);
[0047] (4) Determine the transmission mode. If the transmission mode is synchronous transmission or batch transmission, the priority is increased by one level. If the transmission mode is interrupt transmission or control transmission, the priority remains unchanged.
[0048] (5) Determine the remaining transmission data volume. If the remaining transmission data volume exceeds the preset threshold, the priority is increased by one level; otherwise, the priority remains unchanged;
[0049] (6) Finally, the transmission priority of each port can be obtained by comprehensive calculation.
[0050] In other embodiments, the arbitration factor of the transmission priority may be reduced or increased according to demand.
[0051] It should be noted that when judging the remaining transmission data volume, the preset threshold is related to the device speed and transmission mode. The threshold settings are different for different speeds and transmission modes, and are adjusted according to actual needs.
[0052] In order to prevent a certain port from occupying too much bus bandwidth resources for a long time, in this embodiment, as long as the data transmission of multiple ports is not completed, the arbitration module will update the transmission priority of each port at regular intervals to dynamically adjust the transmission strategy. For example, a certain transmission of a certain port has the highest transmission priority in the first arbitration. By the second arbitration, even if the transmission of the device has not been completed, the arbitration result of the transmission priority may be lowered. At this time, it can effectively prevent a certain port from occupying more bus bandwidth resources for a long time while other ports are in a long-term waiting state.
[0053] The bus management module is mainly responsible for the management and allocation of the USB upstream port bus resources, and its allocation depends on the transmission priority of each port provided by the arbitration module. In a preferred embodiment, in order to reduce the power consumption of the USB host chip, if only a single port is performing data transmission, the bus management module does not work, and all bus bandwidth resources are released by default for use by the port. If multiple ports are performing data transmission, bus bandwidth resources need to be allocated according to the transmission priority of each port.
[0054] In this embodiment, when allocating bus bandwidth resources, the bus management module allocates idle bus bandwidth resources to each port in real time in proportion to the transmission priority ratio of each port. For example, assuming that the bus bandwidth is currently idle, the bus bandwidth resource is 100%. Assuming that there are 4 ports, the arbitration result is the same transmission priority, then the bus bandwidth resources are evenly allocated, and the bus bandwidth resources that can be used by each port are 25%; if the transmission priority ratio of the 4 ports is 1:1:1:2, the bus bandwidth resources that can be used by each port are: 20%, 20%, 20%, 40% respectively.
[0055] After receiving the transmission priority and allocated bus bandwidth resources of each port, the transmission scheduling module dynamically adjusts the current transmission strategy and cooperates with the host controller module to complete the data transmission. It should be noted that the transmission scheduling module needs to comply with the USB protocol specification requirements when adjusting the transmission strategy. For example, if the transmission mode of the port is interrupt transmission, regardless of the transmission priority, it is necessary to transmit at a fixed time according to the protocol; if the transmission mode of the port is synchronous transmission, regardless of the transmission priority, it is necessary to complete the fixed-length data transmission at a fixed time according to the protocol; if each multi-port performs interrupt transmission or synchronous transmission at the same time, the transmission is carried out according to the transmission priority.
[0056] Furthermore, after receiving the bus bandwidth resources allocated by the bus management module, if there are currently bus bandwidth resources transmitting data, the transmission scheduling module determines whether the bus bandwidth resources need to be released for redistribution by the bus management module based on the transmission priority and transmission protocol of the port that is transmitting data. For example, if the current bus bandwidth resources have been transmitted, 60% of the bus bandwidth resources have been used, and the arbitration priorities of the ports are different, the bus management module first allocates 40% of the remaining bus bandwidth resources according to the transmission priority ratio, and informs the transmission scheduling module; the transmission scheduling module transmits according to the allocation of the remaining 40% bus bandwidth resources, and at the same time releases part of the currently used 60% bus bandwidth resources according to the transmission strategy. Assuming that 20% is released, the bus management module will reallocate the 20% bus bandwidth resources according to the arbitration priority. At this time, the transmission scheduling module can dynamically adjust the transmission strategy according to the newly allocated bus bandwidth resources.
[0057] In one embodiment, the transmission scheduling module determines that there is a port currently transmitting data and its transmission priority is lower than the transmission priority of the port to be transmitted data, then releases part of the bus bandwidth resources under the condition of satisfying the protocol and reallocates them. For example, if the bus bandwidth resources are currently occupied by bulk transmission, which transmits 1024 bytes, if the transmission priority of the bulk transmission is lower than other transmissions, then part of the bus bandwidth resources are released for other transmissions, and when releasing the bus bandwidth resources, the protocol conditions must be met so as not to disrupt the currently ongoing bulk transmission.
[0058] Through the cooperation of the arbitration module, bus management module and transmission scheduling module, the priority and order of access to different ports can be dynamically adjusted according to the current data transmission situation to adapt to different scenarios and changes in demand, which is more flexible and comprehensive.
[0059] Please continue to refer to Figure 1 In one embodiment, the arbitration scheduling system further includes a command parsing unit, which is mainly used to obtain a transmission request from the host controller module, and parse the USB device information and transmission information, including the device address, transmission rate, transmission type, data length, direction, etc., to provide information for the arbitration module. Specifically, the command parsing unit first determines which transmission endpoint initiates the transmission request according to the type of the doorbell register, thereby knowing the transmission type of this transmission, and parses the data request packet of the transmission command received by the host controller module to obtain the data transmission direction, data length, device rate, data storage location and other control information, and then provides it to the arbitration module.
[0060] It should be noted that, in order to dynamically adjust the transmission strategy, the command parsing unit will obtain the current transmission information of the host controller module in real time at regular intervals, provide the arbitration module with the latest information, and implement the update of the transmission priority.
[0061] The command parsing module may have parsed the relevant information of the port transmission, but the arbitration module is still performing the previous transmission priority calculation and is not ready to receive new data. At this time, the data will be sent directly to the arbitration module, which will affect the previous transmission priority arbitration process.
[0062] In one embodiment, the arbitration scheduling system further includes a cache module for caching the transmission information and data provided by the command parsing unit, and sending the data information to the arbitration module after the arbitration module is ready. By caching the transmission information by the cache module, the transmission time delay caused by the scheduling can be reduced, and when the transmission information is dynamically refreshed, the arbitration process that has not yet been executed will not be overwritten.
[0063] Please refer to Figure 2 , which shows an arbitration scheduling method for a multi-port USB host chip disclosed in an embodiment of the present invention, comprising:
[0064] Step 101: Receive a USB device transmission request and allocate bus bandwidth resources for data transmission.
[0065] When multiple devices are connected to the USB host chip and initiate transmission at the same time, after the host controller module receives the transmission requests from multiple devices, it controls the physical layer to start data transmission through the transmission endpoint. In this embodiment, the default transmission strategy is fixed polling of each device to evenly distribute bus resources.
[0066] Step 102: parse the USB device information and transmission information included in the transmission request.
[0067] In this step, the transmission endpoint that initiated the transmission request is determined based on the type of the doorbell register, so as to know the transmission type of this transmission, parse the data request packet of the transmission command received by the host controller module, and obtain the data transmission direction, data length, device rate, data storage location and other control information for subsequent transmission priority arbitration.
[0068] It should be noted that, in order to dynamically adjust the transmission strategy, it is necessary to re-acquire the current transmission information of the host controller module at regular intervals to refresh the data.
[0069] Step 103: arbitrate the transmission priority of each port at regular intervals.
[0070] In this step, before performing transmission priority arbitration, it is necessary to determine the number of device ports currently performing data transmission. If only a single port is performing data transmission, the default transmission priority is the highest; if there are multiple ports performing data transmission, it is necessary to calculate the transmission priority based on factors such as the port's transmission direction, data length, transmission mode, and device rate.
[0071] In this embodiment, a specific transmission priority arbitration method is proposed, specifically: the initial priority of all ports defaults to level one, the transmission direction is the input direction, the priority is increased by one level, and the output direction priority remains unchanged; the device rate is the lowest rate, the priority remains unchanged, and the priority is increased by one level for each higher device rate; the priority is increased by one level when the remaining data volume exceeds a preset threshold, otherwise the priority remains unchanged; the transmission mode is synchronous transmission or batch transmission, the priority is increased by one level, and the priority of interrupt transmission or control transmission remains unchanged. The transmission priority of each port is comprehensively calculated based on the transmission direction, device rate, remaining data volume and transmission mode of each port.
[0072] Step 104: Allocate idle bus bandwidth resources to corresponding ports according to the transmission priority of each port.
[0073] In this step, idle bus bandwidth resources are allocated to each port in real time in proportion to the transmission priority ratio of each port.
[0074] Step 105: Adjust the transmission strategy of each port according to the transmission priority of each port and the allocated bus bandwidth resources.
[0075] In this step, the transmission strategy needs to meet the USB transmission protocol specification requirements. At the same time, if there is a port currently transmitting data and its priority is lower than the priority of the port to be transmitted, part of the bus bandwidth resources will be released and redistributed under the condition of meeting the protocol.
[0076] The arbitration scheduling system and method of a multi-port USB host chip proposed by the present invention have the following advantages:
[0077] 1. Applicable to multi-port host chips. When multiple devices are connected at the same time, arbitration is performed based on the characteristics of the USB transmission method, device rate (USB2.0, USB3.2 Gen1 / Gen2), transmission direction, transmission length and other factors to reasonably allocate bus bandwidth resources, which can effectively improve bus utilization;
[0078] 2. The arbitration scheduling method and system of the present invention can avoid the problem that when multiple devices are interacting with each other at the same time, a device at a certain port is in a long waiting period, resulting in low data interaction efficiency.
[0079] 3. The arbitration scheduling method and system of the present invention can dynamically adjust the priority and order of access to different ports according to the current data transmission situation to adapt to different scenarios and demand changes, which is more flexible and comprehensive.
[0080] 4. The cache module in the arbitration scheduling system can cache transmission-related information and data for arbitration, without disrupting the current data transmission process and avoiding the waste of bus resources caused by the additional overhead brought by arbitration calculations.
[0081] For those skilled in the art, the specific meanings of the above terms in the present invention can be understood in specific situations; the drawings in the embodiments are used to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings herein can be arranged and designed in various different configurations.
[0082] Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limitations on the present application. Ordinary technicians in this field can change, modify, replace and modify the above embodiments within the scope of the present application.
Claims
1. An arbitration scheduling system for a multi-port USB host chip, characterized in that: The multi-port USB host chip is interconnected with a USB host and multiple USB devices respectively, and the arbitration scheduling system includes: The host controller module includes multiple links formed by multiple ports, which is responsible for data transmission between the USB host and each USB device; The arbitration module is used to recalculate the current data transmission priority of each port at regular intervals. If only a single port is currently transmitting data, the default transmission priority is the highest. Otherwise, the transmission priority is calculated based on the USB device information and transmission information, including: the initial priority of all ports is level one by default, and the transmission priority of each port is calculated based on the transmission direction, device rate, remaining data volume and transmission mode of each port; among which, the priority of the input direction is increased by one level, and the priority of the output direction remains unchanged; the priority remains unchanged when the device rate is the lowest rate, and the priority increases by one level for each higher device rate; the priority increases by one level when the remaining data volume exceeds the preset threshold, otherwise the priority remains unchanged; the priority increases by one level when the transmission mode is synchronous transmission or batch transmission, and the priority remains unchanged when the interrupt transmission or control transmission is unchanged; A bus management module is used to allocate bus bandwidth resources to each port according to the current data transmission priority; The transmission scheduling module is used to control the host controller module to transmit data after obtaining the transmission priority and allocated bus bandwidth resources of each port; at the same time, if there is currently bus bandwidth resources transmitting data, it is determined whether the bus bandwidth resources need to be released for reallocation by the bus management module based on the transmission priority and transmission protocol of the port currently transmitting data.
2. The arbitration scheduling system for a multi-port USB host chip according to claim 1, characterized in that: It also includes a command parsing unit, which is used to obtain a transmission request from the host controller module, and parse to obtain USB device information and transmission information, and provide information for the arbitration module; the command parsing unit re-acquires the current transmission information from the host controller module at regular intervals.
3. The arbitration scheduling system for a multi-port USB host chip according to claim 2, characterized in that: It also includes a cache module, which is used to cache transmission information and data provided by the command parsing unit for use by the arbitration module.
4. The arbitration scheduling system for a multi-port USB host chip according to any one of claims 1 to 3, characterized in that: If only a single port is transmitting data, the bus management module does not work and releases all bus bandwidth resources by default for use by the USB device of this port; otherwise, the bus management module allocates idle bus bandwidth resources to each port in real time according to the transmission priority ratio of each port.
5. The arbitration scheduling system for a multi-port USB host chip according to claim 1, characterized in that: In the transmission scheduling module, if the transmission mode of the port is interrupt transmission, regardless of the transmission priority, transmission must be performed at a fixed time according to the protocol; if the transmission mode of the port is synchronous transmission, regardless of the transmission priority, data transmission of a fixed length must be completed at a fixed time according to the protocol; if each multi-port performs interrupt transmission or synchronous transmission at the same time, transmission is performed according to the transmission priority.
6. An arbitration scheduling method for a multi-port USB host chip, characterized in that: The multi-port USB host chip is interconnected with a plurality of USB devices, and the arbitration scheduling method comprises: Receive USB device transfer requests and allocate bus bandwidth resources for data transmission; Parsing the USB device information and transfer information contained in the transfer request; The transmission priority of each port is arbitrated at regular intervals. The arbitration process includes: the initial priority of all ports is set to level 1 by default, and the transmission priority of each port is calculated comprehensively based on the transmission direction, device rate, remaining data volume and transmission mode of each port; among which, the priority of the input direction is increased by one level, and the priority of the output direction remains unchanged; the priority of the device rate remains unchanged at the lowest rate, and the priority is increased by one level for each higher device rate; the priority is increased by one level when the remaining data volume exceeds the preset threshold, otherwise the priority remains unchanged; the priority is increased by one level when the transmission mode is synchronous transmission or batch transmission, and the priority of interrupt transmission or control transmission remains unchanged; among which, the default transmission priority is the highest if only a single port transmits data; Allocate idle bus bandwidth resources to corresponding ports according to the transmission priority of each port; The transmission strategy of each port is adjusted according to the transmission priority of each port and the allocated bus bandwidth resources; among them, if there is a port currently transmitting data and its priority is lower than the priority of the port to transmit data, part of the bus bandwidth resources will be released and reallocated under the condition that the protocol is met.
