1332615 九、發明說明: 【發明所屬之技術領域】 本發明係有關一種仲裁器,特別係關於一種精細頻寬 調控的仲裁器及其仲裁方法。 【先前技術】 在共用匯流排系統(shared bus system)中,包括多個主 控裝置(master)以及附屬裝置(slave),這些主控裝置及附屬 • 裝置之間的資料傳輸,例如控制訊號與資料等,皆透過一 共用匯流排傳輸。當系統中有多個主控裝置發出匯流排使 用要求,同時爭奪匯流排使用.權,發生匯流排衝突(bus contention)時,便由一仲裁器根據主控裝置的即時需求或 頻寬需求做出適當的仲裁以決定該共用匯流排的使用 權。主控裝置的即時需求表示所提出的傳輸要求必須在一 個限定的時間内完成,頻寬需求則表示需要一個定額以上 之資料傳輸量,仲裁時如果違反了任一個主控裝置的即時 或頻寬需求,此一系統便無法正常工作。 在共用匯流排系統中,習知的仲裁方法包括: 1. 先來先服務(First-Come-First-Service) 先送來的資料傳收需求將優先被服務,由於未考慮每 個主控裝置的頻寬需求,容易造成系統頻寬分配不均的情 形。 2. 固定權數(Fixed Priority) 在發生爭奪匯流排使用權時有較高優先權的主控裝 5 1332615 置將優先被服務,導致較低優先權的主控裝置發生餓斃 (starvation)的情況,仍有系統頻寬分配不均的問題。 3. 動態權數(Dynamic Priority) 動態改變每個主控裝置的權數以改善共用資源的使 用情形,改變主控裝置權數的做法有很多種,但是仍難完 全避免低優先權的主控裝置發生餓斃。 4. 動態優先權(Earliest Deadline First) 優先完成執行期限(deadline)最靠近的資料傳收需 • 求,雖然可以滿足每個資料傳收的即時需求,但也容易造 成系統資源分配不均。 5. 輪流(Round-Robin) 將系統頻寬公平地分配給每個主控裝置,限制每個共 用資源的主控裝置只能使用相同比例的頻寬,但容易造成 即時性資料傳收需求被延遲的情形。 6·多時分工(time-division multiplexing) 依據事先分配的時槽(time slots)決定共用匯流排的使 用權,雖然可以依主控裝置的需求公平地分配系統頻寬, 但是在系統過於複雜時,時槽的設計很難同時滿足每個主 控裝置的即時與頻寬需求。 7·亂數(Random) 依據系統上預設的票數(tickets)分配以及主控裝置提 出匯流排使用的情形,亂數動態地決定共用匯流排的使用 權,能公平的分配每個主控裝置頻寬使用權,但是卻無法 處理即時資料傳收。 6 1332615 中華民國專利申請案號93136895,發明名摇「 仲裁器、匯流排裝置、與匯流排仲裁方法」中揭4 =1332615 IX. DESCRIPTION OF THE INVENTION: TECHNICAL FIELD The present invention relates to an arbiter, and more particularly to an arbiter for fine frequency bandwidth regulation and an arbitration method thereof. [Prior Art] In a shared bus system, including a plurality of masters and slaves, data transmission between the master devices and the attached devices, such as control signals and Data, etc., are transmitted through a common bus. When there are multiple master devices in the system to issue bus bar usage requirements, and at the same time vying for bus bar usage rights, when bus contention occurs, an arbiter is used according to the immediate demand or bandwidth requirement of the master device. Appropriate arbitration is used to determine the right to use the shared bus. The immediate demand of the master device indicates that the proposed transmission request must be completed within a limited time. The bandwidth requirement indicates that a fixed amount of data transmission is required. If the arbitration is violated, the instantaneous or bandwidth of any master device is violated. Demand, this system will not work properly. In the shared bus system, the conventional arbitration methods include: 1. First-Come-First-Service The data transmission demand sent first will be preferentially served, since each master device is not considered. The bandwidth requirement is likely to cause uneven distribution of system bandwidth. 2. Fixed Priority In the event of a dispute over the use of the bus, the higher priority of the main control 5 1332615 will be preferentially serviced, resulting in starvation of the lower priority master device. There is still a problem of uneven distribution of system bandwidth. 3. Dynamic Priority Dynamically change the weight of each master device to improve the use of shared resources. There are many ways to change the weight of the master device, but it is still difficult to completely avoid the hungry of the low priority master device. shoot. 4. Earliest Deadline First Prioritizes the deadline for data transmission and demand. Although it can meet the immediate needs of each data transmission, it is easy to cause uneven distribution of system resources. 5. Round-Robin distributes the system bandwidth fairly to each master device. The master device that limits each shared resource can only use the same proportion of bandwidth, but it is easy to cause immediate data transmission needs. Delayed situation. 6. Time-division multiplexing Determines the usage rights of the shared bus according to the time slots allocated in advance. Although the system bandwidth can be fairly distributed according to the requirements of the master device, when the system is too complicated The design of the time slot is difficult to meet the real-time and bandwidth requirements of each master device at the same time. 7. Random number (Random) According to the preset number of votes on the system and the use of the bus by the master device, the random number dynamically determines the usage rights of the shared bus, and can distribute each master fairly. Device bandwidth usage rights, but can not handle real-time data transmission. 6 1332615 Republic of China Patent Application No. 93136895, the name of the invention is shaken in the "arbitrator, busbar device, and busbar arbitration method" 4 =
1流排^統,包括複數個計數器與—個控制電路二Z 頻寬使用量,用來記錄每個二 主控制電路則依計數器的值動態改變 控裝置的優先權,依據事先設計的頻寬使用量來決定丘 =匯,的使用權。這種仲裁方式雖然能滿足主控裝置: 頻寬需要,但卻未考慮主控裝置的即時需求。而 號1257551的「匯流排仲裁系統及方法」中,則揭露/ 先順序分配裝置與-個仲裁電路的仲 系、=丈地減少了擁有高優先權的主控裝置的 動祕改變主控裝置的優先權,因此能避免在固定 ^權的仲裁方式中可能面臨的主控褒置賊的情況,作 種方法亦無法有效因應主控裝置的即時需求。又如 =國專利第^25嶋號的「匯流排控制權仲裁方法與 :」’其揭露一種包括複數個時間累積器的仲裁系 虽系統中任意—個主控裝置提出匯流排使用要求時, 二戶 斤對應的時間累積器便開始累計,當時間累積器的值大 2設的門檻值時,該主控袭置將得到最高的匯流排使用 優先權,這種仲裁方式雖滿足了各主控裝置的即時需求, 旦部未考慮到頻寬需求’無法適當地分配系統頻寬。中華 國專利第1220500號中,提出了一種包括設備輪流次序 傳收要求表及没備使用記錄表的系統,動態地檢查設 備輪流次序表與傳收要求表,決定好主控裝置的匯流排使 7 ⑸ 2615 用次序,並且將使用的情形記錄在設備使用記錄表中。藉 由大量的記憶體記錄系統上主控裝置的匯流排使用情 ^用以動態5周整仲裁方法,滿足每個主控裝置的即時與 頻寬需求,然而,此發明_很重要的設備輪流次序表在目 前複雜的系統中仍難以設計。另外,美國專利第6,633,939 號揭露了-種動態權數的仲裁方式,其係依據主控裝置的 订為,動態改變其對應的權數,由於每次都是由擁有高優 鲁*權的主控裝置得到匯流排使用權,因此仍難以避免較低 優先權的主控裝置發生餓斃的情況。美國專利第6,694,488 號亦是-種動態權數的仲裁方法,其系統中每個主控裝置 都包括一個 communication architecture 她灯(cat)電路, 用以在發生匯流排衝突時適當地決定主控裝置的匯流排 使用權,雖然該CAT電路能幫助仲裁器滿足主控裝置的即 時需求’但卻無法滿足頻寬需求。美國專利案號第 6,877,053號則提出了 一種亂數的仲裁方法,每個主控裝置 鲁都有預先設計的票數,當發生匯流排衝突時,仲裁器會依 主控裝置的票數以加權的方式任意同意一個主控裝置的 匯流排使用權,這樣雖然能較公平的分配 ; 慮到主控裝置的即時需求。 一 P禾考 因此,-種同時滿足系統上主控裝置的即 求的仲裁器與仲裁方法,乃為所冀。 【發明内容】 本發明的目的之-,在於提供一種三階的仲裁器。 8 1332615 在於提供一種三階的匯流排控制 本發明的目的之一 權仲裁方法。 根據本發明’-種仲裁器包括一即時處理器、一頻寬 調節器以及一加權隨機仲裁管理器,在複數個主控褒置提 出匯机排使用要求時,決定一共用匯流排的使用權。該些 控裝置具有即時及/或頻寬需求,並分別被預設一票數, ,即時處理器檢查該些主控裝置發出的匯流排使用要求 疋否包括即時需求’判斷該些匯流排使用要求是否緊急, =意緊急的匯流排使用要m統中沒有緊急的Ϊ流 求’該即時處理器不動作。該頻寬調節器偵測該 二、控裝置的頻寬需求是否已滿心並限制該些頻寬需求 置發出匯流排使用要求’該加權隨機仲裁 二=根據4些主控裝置的票數及提出匯流排使用要求 的㈣’加權隨機地同意其中―匯流排使用要求。 【實施方式】 主^ j係根據本發明之共賴流排系統ig的示意圖’ 乃:、⑴、112、113、114以及附屬裝置121、122透 傳輸r資料傳輸,仲裁請與各: ^ '生匯流排衝突時根據主控裝置的#數、 即時及/或頻寬需求做出適當的仲裁。褒置的-數、 ®係根據本發明之仲裁器的方 括即時處理器20卜頻口哉益2〇0包 理器203以接供即裔2〇2以及加權隨機仲裁管 以扶供一三階匯流排控制權仲裁方法。 9 钱即:處:T01包括了複數個即時計數器2。“⑽ ===分別對應—主控裝置,__ 距用要求的時間與當前時間的差 即該主控裝置的料相, =表解決系統中匯流排爭奪的最短時間 ==❹要求時,即時處理器-將先檢查= :=:ΐΓ 需求’發出包含即時需求的匯 ζ ί要求的主控裝置所對應的㈣計數器綱開始計 數直到忒主控裝置獲得匯流排fΡ 數器204達到該μ戒值,声一=用核才停止。若即時計 :表不该主控裝置的匯流排使用要 ^疋緊急的’即時處理器2〇1將優先同意該匯流排使用要 求’將區流排使用權給該主控裝置。若系統上沒有緊急的 匯流排使用要求,即時處理器2〇1 +動作。在本實施例中, =計數器204為下數計數器,當有主控裝置提出包含即 時需求的匯流排使用要求時,對應該主控裝置的即時計數 器撕便從-預設值開始下數,當即時計數器2〇4的計數 值下數到小於-警戒值時,即時處理器2〇ι將該匯流排使 用要求視為緊急’並優先同意該匯流排使用要求。若系統 中存在多個緊急的主控裝置’即時處理器2〇1會將計數值 最小的即㈣數器2〇4對應的匯流排使用要求視為最緊 急’並同意該最緊急的匯流排使用要求。若所有即時計數 器204的計數值都大於警戒值,則表示沒有緊急的匯流排 使用要求,即時處理器2〇1不會動作。 頻寬調節器202檢查每個主控裝置的匯流排頻寬,頻 1332615 寬調節器202中包括複數個頻寬暫存器2〇5,分別纪錄每 個主控裝置傳輸的匯流排使用量。每一頻寬暫存器2〇5、在 對應的主控裝置取得匯流排使用權後開始計數,直到咳主 控裝置釋出匯流排使用權,頻寬調節器202檢查每一主控 裝置的匯流排使用量,在一定時間内,若一主控裝置的頻 寬使用量超過該主控裝置的頻寬需求,即該主控裝置的頻 寬需求已經被滿足,頻寬調節器2〇2將暫時限制該主控裝 置發出匯流排使用要求,讓匯流排使用權能讓給系統^ 他頻寬需求未滿足的主控褒置。 加權隨機仲裁管理器203中包括亂數控制器裏,亂 數控制器206中存有每個主控裝置的票數,這可以由軟體 進行系統模擬’或是依設計者的經驗決定,在發生匯流排 衝突且即時處理器2〇1不動作時,亂數控制器裏依據每 個主控裝置的票數與提出匯流排使用要求的情形,加權隨 機(weighted random)地同意其中一個主控裝置的 用要求。 文 為提ί、别述之訊息給即時處理器2(H、頻寬調節器 以及加權隨機仲裁管理器2〇3’共用匯流排系統中每一主 控裝置亦包括一即時計數器,用來反應該主控裝置的即時 f求的緊急性,例如一下數計數器。每一主控農置還具有 =寬暫存器,分別紀錄其匯流排使用量,提供給頻寬調 卽器202’此外,仲裁器2〇〇在同一時間中,最多只同意 :個匯流排使用要求,即一次只有一個主控裝置能取得匯 流排使用權。 1J32615 圖3係根據本發明之仲裁器實施例,匯流排仲裁系統 匕括主控裝置M1、M2、M3及M4’分別提出包含即 時與頻寬需求的匯流排使用要求Rb R2、R3及以,即時 處理斋321檢查匯流排使用要求R1〜R4是否包含即時需 长並判斷疋否緊急,據以將共用匯流排的使用權優先給 予有緊急即時需求的主控裝置。頻寬調節器331記錄每個 日控裝置的頻見使用量,並根據該些主控裝置的頻寬需求 是否滿足而產生限制信號S1〜S4。若系統中沒有緊急的主 控,置:即時處理H321不動作,匯流排使用權由隨機仲 裁笞理器341决疋,限制信號si〜S4藉由及閘〜限 制匯机排使用要求R1〜R4進入加權隨機仲裁管理器 的It t將頻I需纟已滿足的主控裝置的匯流排使用要求 限^住’加權隨機仲裁管理器341再依據主控装置M1〜M4 的票數W1〜W4 ’以及被限制信號S1〜S4限制後的匯流排 使用要求,加權隨機地同意其中一個主控裝置的匯流排使 用要求。 【圖式簡單說明】 圖1係共用匯流排系統的示意圖; 圖2係根據本發明一實施例的方塊圖;以及 圖3係根據本發明一實施例的示意圖。 【主要元件符號說明】 100共用匯流排系統 12 13326151 stream line system, including a plurality of counters and a control circuit 2 Z bandwidth usage amount, used to record each of the two main control circuits to dynamically change the priority of the control device according to the value of the counter, according to the pre-designed bandwidth The amount of use determines the right to use Qiu = Hui. Although this arbitration method can satisfy the main control device: the bandwidth needs, but does not consider the immediate needs of the master device. In the "Bus Arbitration System and Method" of No. 1257551, the system of the first-order distribution device and the arbitration circuit is disclosed, and the master control device of the master device with high priority is reduced. The priority, therefore, can avoid the situation of the master thief that may be faced in the fixed arbitration method, and the seeding method cannot effectively respond to the immediate needs of the master device. Another example is the "Bus Control Arbitration Arbitration Method and:" of the National Patent No. 25 No. 25, which discloses an arbitration system that includes a plurality of time accumulators, although any one of the main control devices in the system requests the use of the bus, The time accumulator corresponding to the two households begins to accumulate. When the value of the time accumulator is greater than the threshold value set by 2, the master control will get the highest bus use priority. This arbitration method satisfies the mains. The immediate needs of the control unit, the Department did not consider the bandwidth requirement 'the system bandwidth could not be properly allocated. In Chinese Patent No. 1220500, a system including a device rotation order transmission request table and an unused usage record table is proposed, which dynamically checks the equipment rotation order table and the transmission request table, and determines the bus arrangement of the main control device. 7 (5) 2615 The order is used, and the situation to be used is recorded in the device usage record table. The busbar usage of the master device on a large number of memory recording systems is used to dynamically and continuously arbitrate the five-week arbitration method to meet the instantaneous and bandwidth requirements of each master device. However, this invention _ very important device rotation The sequence table is still difficult to design in today's complex systems. In addition, U.S. Patent No. 6,633,939 discloses a method of arbitration for dynamic weights, which dynamically changes its corresponding weight according to the order of the master device, since each time it is controlled by a master device having a high-quality right Get the right to use the bus, so it is still difficult to avoid the hungry situation of the lower priority master. U.S. Patent No. 6,694,488 is also a method of arbitration for dynamic weights. Each of the master devices in the system includes a communication architecture (cat) circuit for appropriately determining the master device in the event of a busbar collision. Bus usage rights, although the CAT circuit can help the arbiter meet the immediate needs of the master device, but can not meet the bandwidth requirements. U.S. Patent No. 6,877,053 proposes a random number arbitration method. Each master device has a pre-designed number of votes. When a busbar conflict occurs, the arbiter will weight the number of votes of the master device. The way to arbitrarily agree to the right to use a bus of a master device, so that it can be more fairly distributed; taking into account the immediate needs of the master device. A P-test is therefore a kind of arbitrator and arbitration method that simultaneously satisfies the requirements of the master device on the system. SUMMARY OF THE INVENTION It is an object of the present invention to provide a third-order arbiter. 8 1332615 is to provide a third-order bus control. One of the objects of the present invention is a method of arbitration. According to the present invention, the arbitrator includes an instant processor, a bandwidth adjuster, and a weighted random arbitration manager, and determines the usage rights of a shared bus when a plurality of master devices propose the use of the hub row. . The control devices have immediate and/or bandwidth requirements, and are respectively preset to a number of votes. The instant processor checks the bus bar usage requirements issued by the master devices, and includes whether the instant demand is used to determine the bus bars. Whether the request is urgent, = the emergency bus is used, there is no urgent turbulence in the system, and the instant processor does not operate. The bandwidth adjuster detects whether the bandwidth requirement of the second control device is full and limits the bandwidth requirement to issue a bus bar usage requirement. The weighted random arbitration 2 is based on the number of votes of the four master devices. The busbar uses the required (4) 'weighted random consent to the bus bar usage requirements. [Embodiment] The main diagram of the common system ig according to the present invention is: (1), 112, 113, 114 and the auxiliary devices 121, 122 transmit the r data transmission, and the arbitration and each: ^ ' Appropriate arbitration is based on the #number, immediate and/or bandwidth requirements of the master device when the bus is in conflict. The number of the device is based on the arbitrator of the present invention, and the instant processor 20 is used to receive the 2 〇 2 and the weighted random arbitration tube. Third-order bus control arbitration method. 9 Money is: Department: T01 includes a number of instant counters 2. "(10) === respectively correspond to - the master device, __ the difference between the required time and the current time is the phase of the master device, = table to solve the shortest time in the bus bar in the system == ❹ request, instant Processor - will check first = :=: 需求 demand 'issues the sink containing the immediate demand ί the corresponding master device corresponds to the (4) counter class starts counting until the 忒 master device obtains the bus bar f 204 204 reaches the μ ring Value, sound one = stop with the core. If the meter is used: the bus is not used by the master device. The emergency 'immediate processor 2〇1 will give priority to the bus usage requirement'. Right to the master device. If there is no emergency bus usage requirement on the system, the immediate processor 2〇1 + action. In this embodiment, the =counter 204 is the next counter, when the master device proposes to include the immediate demand When the bus is used, the instant counter corresponding to the master device is torn down from the preset value. When the count value of the instant counter 2〇4 is less than the - alert value, the instant processor 2〇 Use the bus Seek to be considered urgent" and give priority to the use of the bus. If there are multiple emergency masters in the system, the immediate processor 2〇1 will use the bus with the lowest count value (4) The request is considered to be the most urgent and agrees to the most urgent bus usage requirement. If all the counters 204 have a count value greater than the alert value, it means that there is no emergency bus usage requirement, and the immediate processor 2〇1 will not operate. The bandwidth adjuster 202 checks the busbar bandwidth of each master device, and the frequency 1332615 wide adjuster 202 includes a plurality of bandwidth registers 2〇5, respectively recording the busbar usage used by each master device. Each bandwidth register 2〇5 starts counting after the corresponding master device obtains the bus usage right until the cough master releases the bus usage right, and the bandwidth adjuster 202 checks each master device. The usage of the bus bar, if the bandwidth usage of a main control device exceeds the bandwidth requirement of the main control device within a certain period of time, that is, the bandwidth requirement of the main control device has been satisfied, the bandwidth adjuster 2〇2 Temporary limit The master control device issues a bus bar usage requirement, so that the bus bar usage right can be given to the system for the main control device whose bandwidth requirement is not satisfied. The weighted random arbitration manager 203 includes the random number controller, and the random number control The number of votes of each master device is stored in the device 206, which can be simulated by the software system or determined according to the designer's experience. When the bus bar conflict occurs and the instant processor 2〇1 does not operate, the random number control According to the number of votes of each master device and the request for the use of the bus, weighted randomly agrees to the requirements of one of the master devices. The message is for the instant processor. 2 (H, bandwidth regulator and weighted random arbitration manager 2〇3' each master device in the shared bus system also includes an instant counter, which is used to reflect the urgency of the immediate control of the master device, for example Count down counters. Each master farm has a = wide register, which records its bus usage, and provides it to the bandwidth adjuster 202'. In addition, the arbitrator 2 〇〇 at the same time, at most only agree: one bus The requirement is that only one master device can obtain the right to use the bus at a time. 1J32615 FIG. 3 is an embodiment of an arbiter according to the present invention. The bus arbitration system includes main control devices M1, M2, M3, and M4' respectively requesting bus usage requirements Rb R2, R3, and The instant processing 321 checks the bus usage requirements whether the R1 to R4 include the immediate demand and judges whether the emergency is urgent, so that the usage right of the shared bus is preferentially given to the main control device having the urgent immediate demand. The bandwidth adjuster 331 records the frequency usage of each of the day-controlled devices, and generates the limit signals S1 to S4 according to whether or not the bandwidth requirements of the master devices are satisfied. If there is no emergency master in the system, the immediate processing H321 does not work, the bus usage right is determined by the random arbitration processor 341, and the limit signals si~S4 are used by the gates to limit the use of the routers to the requirements R1~R4. The Itt that enters the weighted random arbitration manager needs to limit the bus usage requirements of the satisfied master device to the 'weighted random arbitration manager 341 and then according to the number of votes W1~W4 of the master device M1~M4' And the use of the busbars restricted by the restricted signals S1 to S4, the weighting randomly agrees to the busbar usage requirements of one of the master devices. BRIEF DESCRIPTION OF THE DRAWINGS FIG. 1 is a schematic diagram of a shared busbar system; FIG. 2 is a block diagram of an embodiment of the present invention; and FIG. 3 is a schematic diagram of an embodiment of the present invention. [Main component symbol description] 100 shared bus system 12 1332615
101 共用匯流排 102 仲裁器 111 主控裝置 112 主控裝置 113 主控裝置 114 主控裝置 121 附屬裝置 122 附屬裝置 200 仲裁器 201 即時處理器 202 頻寬調節器 203 加權隨機仲裁管理器 204 即時計數器 205 頻寬記錄器 206 亂數控制器 300 匯流排仲裁系統 321 即時處理器 331 頻寬調節器 332 及閘 333 及閘 334 及閘 335 及閘 341 加權隨機管理器101 shared bus 102 arbiter 111 master device 112 master device 113 master device 114 master device 121 accessory device 122 accessory device 200 arbiter 201 instant processor 202 bandwidth adjuster 203 weighted random arbitration manager 204 instant counter 205 bandwidth recorder 206 random number controller 300 bus arbitration system 321 instant processor 331 bandwidth regulator 332 and gate 333 and gate 334 and gate 335 and gate 341 weighted random manager