Presentation is loading. Please wait.

Presentation is loading. Please wait.

October 10, 20001. 2 Split Transaction Budgeting Algorithm John Garney Working Group Chair: Hub Intel Corporation John Garney Working Group Chair: Hub.

Similar presentations


Presentation on theme: "October 10, 20001. 2 Split Transaction Budgeting Algorithm John Garney Working Group Chair: Hub Intel Corporation John Garney Working Group Chair: Hub."— Presentation transcript:

1 October 10, 20001

2 2 Split Transaction Budgeting Algorithm John Garney Working Group Chair: Hub Intel Corporation John Garney Working Group Chair: Hub Intel Corporation

3 October 10, 20003 Budgeting Algorithm Outline w Terms w General Algorithm Comments w Non-split Transactions w Budgeting Split Transactions – Core Spec Requirements – EHCI Requirements – Algorithm implementation tradeoffs w Information in: – Core Spec Chapters 5, 8 & 11 – EHCI Spec.

4 October 10, 20004 Budget and Schedule w Host determines when transactions run – The “Budget”: N (micro-)frames of information – Host builds description of transactions requested to run w Host Controller issues transactions – The “Schedule”: MxN (micro-)frames of transactions w Budget and schedule must match – Both are HC dependent w TT behavior must correspond – Specified by core USB spec w Mismatched budget/schedule/TT causes errors w Budgeting only applies to periodic transactions

5 October 10, 20005 Repeating Frame Patterns w Budget consists of a repeating pattern of frames – Likely a 2^N number of frames – Likely 64 or less frames for reasonable space useage – Example algorithm uses 8 frames w Schedule repeats budget pattern “endlessly” – Schedule can be same number of frames as budget Frame 0 Frame 1 Frame 3 Frame 4 Frame 5 Frame 6 Frame 7 Frame 2 Frame 0 Frame 7 … … … … BudgetBudget

6 October 10, 20006 Budgeting Algorithms w Many different algorithms possible w Any algorithm has requirements and constraints – Determined by USB core spec. and HC specification(s) w Simple budget algorithm in use for classic USB w Split transactions require new budget algorithm w This session illustrates one budget algorithm – Focus is on split transaction budget

7 October 10, 20007 Non-Split Budgeting w Classic and high-speed bus allocations easy – Count bytes for transaction in (micro-)frame – Well known for classic u 90% / 10% for periodic/non-periodic frame u Worst case (i.e. include bit-stuffing) u Transaction overheads well known (chap 5) – Similar for high-speed u 80% / 20% for microframe u Worst case (i.e. include bit-stuffing) u New transaction overheads (chap 5)

8 October 10, 20008 Transaction Overhead w Bus time requirements of a transaction includes: – Token packet (Sync + 3 bytes + EOP) u 4 bytes for split token vs. 3 for non-split token – Data packet (Sync + 3 bytes + wMaxPacketSize + EOP) u If present – Handshake packet (Sync + 1 byte + EOP) u If present – 2 Bus turnaround times – Think_time (Inter transaction gap) u HC dependent

9 October 10, 20009 Overheads Reference w Classic overheads (FS byte times, T+D+H): – FS_Isoch 9 – FS_Interrupt13 – LS_Interrupt19*8 w High-speed split overheads (HS byte times): – Token_Same_direction39 – Token_Change_direction29 – Data_Same_direction19 – Data_Change_direction 9 – Handshake_only 7

10 October 10, 200010 TTs and Split Budgeting w One or more Host Controllers per system – One High-speed budget per HS Host Controller – One classic budget per USB1.1 Host Controller w One Bus per Host Controller w One or more Hubs per bus w One or more TTs per Hub w A classic bus per TT – One split budget per TT w Split budgeter allocates HS and classic bus times

11 October 10, 200011 HC/TT/Device_endpoint w New configured EP allocates 2 bus times: – Classic from split_budget of “parent” TT u To determine in what microframes classic transaction can run – High-speed from HC HS budget, per microframe u For split transactions on HS bus HCHC HubHub TTTTSplitBudgetSplitBudgetHSBudgetHSBudgetTTTTSplitBudgetSplitBudget DevDev EPEPEPEP

12 October 10, 200012 Budget/Schedule Example w Two isoch OUT endpoints: A, B (spans uframe) w Does A/B split-start order matter? HS Schedule: HS Schedule: S S SSA O O D D Periodic Xacts TIME A A B B S S SSB1 O O D D S S SSB2 O O D D Classic Schedule: Budget:: Periodic Xacts A A B B Microframe

13 October 10, 200013 Budget/Schedule Example (Error) w Does A/B split-start order matter? – YES!! – TT sees classic B and HS SSB2 as errors S S SSB1 O O D D Periodic Xacts TIME A A S S SSA O O D D S S SSB2 O O D D B B Budget:: Periodic Xacts A A B B HS Schedule: HS Schedule: Classic Schedule: B B Microframe

14 October 10, 200014 Core Spec Requirements w Allocate bus times – HS split transactions with bit-stuffing, 80% x 7500 bytes max – Classic without bit-stuffing, 90% x 6/7 x 1500 bytes max w Only 2^N periods allowed, (new) periodic isochronous w Split Processing: – Determine start- & complete- split patterns u Fewer CSs at end of frame (chap 11 for details) – At most 16 SS per microframe w Split Ordering – CSs for all endpoints in each microframe matches SS order – SSs & CSs scheduled in budget order for microframe

15 October 10, 200015 EHCI Requirements w Schedule “large” isoch first in frame – Large is > 1157 x ½, i.e. 579 bytes – Not only wMaxPacketSize,… – Must include transaction overhead also w Interrupt in decreasing period order – Dictated by Qhead endpoint “tree”

16 October 10, 200016 Endpoint Trees w One struct per allocated endpoint w Linked into correct period frame list(s) Frame 0 Endpt Frame 1 Frame 3 Frame 4 Frame 5 Frame 6 Frame 7 Frame 2 Endpt Per = 8 Per = 4 Per = 2 Per = 1

17 October 10, 200017 Algorithm Tradeoffs w Minimize changes to current budget/schedule – Adding new endpoint should avoid change to others w Desirable to balance allocation in all frames – Find least allocated frame(s) for new allocation u First fully allocated frame precludes more period 1 endpoints w What order for endpoints with same period? – Choose “oldest to newest” order toward end of frame w All isochronous endpoints, then all interrupt – Other sequences are possible to implement

18 October 10, 200018 Split Endpoint Order in Frame w Only one large isoch allowed in any frame LargeLarge Frame 0 Per =1 Per =N Per =2 Per =1 Split Isoch. endpoints Split Interrupt endpoints … … Frame 1 Frame 2 … … … Decreasing period same period old new same period old new same period old new same period old new

19 October 10, 200019 Algorithm Comments w Preserve old to new order within same period – Least impact on other allocated endpoints – Most isoch. will be period = 1 – Most isoch. allocations at end of isoch. Portion of frame w Isoch. order in frame is preferred – Allows compact budget, no budget “holes” – But, EHCI dictates opposite order for interrupts

20 October 10, 200020 Budget Data Structure w Budget uses endpoint tree to track split isoch & interrupt Frame 0 EndptEndpt EndptEndpt EndptEndpt Frame 1 Frame 3 Frame 4 Frame 5 Frame 6 Frame 7 Frame 2 EndptEndpt EndptEndpt EndptEndpt EndptEndpt EndptEndpt EndptEndpt EndptEndpt EndptEndpt EndptEndpt EndptEndpt EndptEndpt EndptEndpt EndptEndpt EndptEndpt EndptEndpt EndptEndpt EndptEndpt Endpt Endpt EndptEndpt Isochronous Endpoints Interrupt Endpoints

21 October 10, 200021 Schedule Data Structure w Schedule uses interrupt Tree, but replicates isoch. TDs w HS nonsplit TDs are unordered and can be “anywhere” Frame 0 EndptEndpt EndptEndpt EndptEndpt Frame 1 Frame 3 Frame 4 Frame 5 Frame 6 Frame 7 Frame 2 EndptEndpt EndptEndpt EndptEndpt EndptEndpt EndptEndpt EndptEndpt EndptEndpt EndptEndpt EndptEndpt EndptEndpt EndptEndpt EndptEndpt EndptEndpt EndptEndpt EndptEndpt EndptEndpt EndptEndpt EndptEndpt EndptEndpt EndptEndpt Endpt Endpt EndptEndpt Endpt EndptEndpt Endpt EndptEndpt EndptEndpt EndptEndpt EndptEndpt Ordered Isochronous siTDS Ordered Isochronous siTDS Ordered Interrupt Qheads/qTDs

22 October 10, 200022 Example Budget - 1 w A:Isoch out, wMaxPacketSize=19, Period=1 Frame 0 Frame 1 Frame 2 Frame 3 Frame 4 Frame 5 Frame 6 Frame 7 A

23 October 10, 200023 Example Budget - 2 w B:Inter out, wMaxPacketSize=64, Period= 1 Frame 0 Frame 1 Frame 2 Frame 3 Frame 4 Frame 5 Frame 6 Frame 7 A B

24 October 10, 200024 Example Budget - 3 w C: Inter in, wMaxPacketSize=45, Period= 4 Frame 0 Frame 1 Frame 2 Frame 3 Frame 4 Frame 5 Frame 6 Frame 7 A B C

25 October 10, 200025 Example Budget - 4 w D: Inter in, wMaxPacketSize=36, Period= 2 Frame 0 Frame 1 Frame 2 Frame 3 Frame 4 Frame 5 Frame 6 Frame 7 A B C D

26 October 10, 200026 Example Budget - 5 w E: Isocin, wMaxPacketSize=110, Period= 1 Frame 0 Frame 1 Frame 2 Frame 3 Frame 4 Frame 5 Frame 6 Frame 7 A B C D E

27 October 10, 200027 Example Budget - 6 w F:Isoch in, wMaxPacketSize=580, Period= 8 Frame 0 Frame 1 Frame 2 Frame 3 Frame 4 Frame 5 Frame 6 Frame 7 A B C D E F

28 October 10, 200028 Example Budget - 7 w G:Interin, wMaxPacketSize=32, Period= 2 Frame 0 Frame 1 Frame 2 Frame 3 Frame 4 Frame 5 Frame 6 Frame 7 A B C D E F G

29 October 10, 200029 Example Budget Deallocation w Deallocate D: B & G “compacted” Frame 0 Frame 1 Frame 2 Frame 3 Frame 4 Frame 5 Frame 6 Frame 7 A B C E F G

30 October 10, 200030 Calculated Budget Parameters IDMicroframeStartSplits CompleteSplits w A 21 0 w B 31 3 w C 31 3 w E 21 4 w F-11 6 w G 31 3

31 October 10, 200031 Example Periodic Isoch w Creates “hole” that can be reclaimed by bulk/control – Or other large periodic isoch allocations Frame 0 Frame 1 Frame 2 Frame 3 Frame 4 Frame 5 Frame 6 Frame 7 A B C E F G

32 October 10, 200032 Budgeting Summary w Classic budgeting is well understood w High-speed budgeting is a derivative of classic w Split transaction budgeting is new and complex w Split budgeting must be done correctly w A split budgeting algorithm exists and works w Contact: techsup@usb.org


Download ppt "October 10, 20001. 2 Split Transaction Budgeting Algorithm John Garney Working Group Chair: Hub Intel Corporation John Garney Working Group Chair: Hub."

Similar presentations


Ads by Google