Logical circuit design
ArchiTek home page
Arbitration

Regarding appropriate arbitration

Sample RTL of arbitration determined method

Routing
  • Propagate Valid to particular pipelike at branch. Simultaneously, to propagate selected variable sSel to another pipeline. Branch example is detour type.(sSel to increment for each negotiation.)。
  • Select Valid for a particular pipeline at combination. Selection to be according to selection variable sSel
  • Omit data code.
Latency(CLK)0
    
    module split(sVld, sStall, sSel, iVld, iStall, oVld, oStall, reset, clk);
            output          sVld;
            input           sStall;
            output  [R-1:0] sSel;
            input           iVld;
            output          iStall;
            output  [N-1:0] oVld;
            input   [N-1:0] oStall;
            input           reset;
            input           clk;
    
            wire            nasc    = iVld & !iStall;
    
            reg     [R-1:0] sSel;
            wire    [N-1:0] vldVec   = 1'b1 << sSel;
    
            always @(posedge clk)
                    if (reset)
                            sSel    <= #1 {R{1'b0}};
                    else if (!iStall)
                            sSel    <= #1 sSel + 1'b1;

            assign iStall   = oStall[sSel] | sStall;
            assign sVld     = nasc;
            assign oVld     = {N{nasc}} & vldVec;
    endmodule
    
            
iVld → oVldPropagate
iVld → iStallTruncate
iStall ← oStallPropagate
Separate Circuit
Latency(CLK)1
    
    module unite(sVld, sStall, sSel, iVld, iStall, oVld, oStall);
            input           sVld;
            output          sStall;
            input   [R-1:0] sSel;
            input   [N-1:0] iVld;
            output  [N-1:0] iStall;
            output          oVld;
            input           oStall;
    
            wire    [N-1:0] StallVec   = 1'b1 << sSel;
    
            assign sStall   = !iVld[sSel] | oStall;
            assign iStall   = {N{!sVld | oStall}} | ~StallVec;
            assign oVld     = iVld[sSel] & sVld;
    endmodule
    
            
iVld → oVldPropagate
iVld → iStallPropagate
iStall ← oStallPropagate
Unite Circuit

Sample RTL arbitration non-determined method

Round-Robin Arbiter
  • From N Validsround robin method[5] is used to select 1
  • Omit data code(oArb signal used to select 1 from N data)
  • Round robin method pointer is arbitrated result close to detoured ascending order.
  • Characteristics differ according to pointer detour method.
    • When pointer is incremented each cycle, then approximately random arbitration is obtained.(Valid is equally processed.)
    • When pointer is replaced by arbitration result + 1, then update type arbitration(Valid is equally processed.)
    • When pointer is replaced by arbitration rsult, then parking type arbitration(Same Valid is continuously high priority)
Latency(CLK)0
    
    module rrArbiter(iVld, iStall, oVld, oStall, oArb, reset, clk);
            parameter       R       = 3;
            parameter       N       = 1<<R;

            input   [N-1:0] iVld;
            output  [N-1:0] iStall;
            output          oVld;
            input           oStall;
            output  [R-1:0] oArb;
            input           reset;
            input           clk;
    
            reg     [R-1:0] oPtr;   // Round-Robin Pointer
            wire    [N-1:0] oVec    = 1'b1 << rrArb;

            // 0: Park, 1: Not Park
            wire            oInc    = 1'b1;
    
            always @(posedge clk)
                    if (reset)
                            oPtr    <= #1 {R{1'b0}};
                    else if (oVld & !oStall)
                            oPtr    <= #1 oArb + oInc;
    
    
            assign iStall   = {N{oStall}} & ~oVec;

            assign oVld     = |iVld;
            assign oArb     = arbFunc(iVld, oPtr);
    
    function [R-1:0] arbFunc;
            input   [N-1:0] vld;
            input   [R-1:0] ptr;
            reg     [R-1:0] idx;
            reg     [R-1:0] num[N-1:0];
            integer         i, j;
            begin
                    for (i=0; i<N; i=i+1) begin
                            num[i]  = {R{1'bx}};
                            for (j=0; j<N; j=j+1) begin
                                    idx     = i[R-1:0] + ~j[R-1:0];
                                    if (vld[idx])
                                            num[i]  = idx;
                            end
                    end
                    arbFunc = num[ptr];
            end
    endfunction
    
    endmodule
    
            
iVld → oVldPropagate
iVld → iStallPropagate
iStall ← oStallPropagate
Round-Robin Arbiter Circuit

Logical Design Circuit > Pipeline > Arbitration    Next Page(Synchronizatin)   TOP of this page ▲

[1]
Carefully examining the RTL, depending on each arbitration methodBasic typeor to useBuffer type differs. In buffer type, FF which can be buffered are limited and hence cannot accomodate multiple versus 1.
[2]
When directly connecting split and unite in sample code, Valid and Stall loop occurs. Needless to say, during this time, arbitrary stage must exist.
[3]
Within a system LSI, the purpose of a pipeline is well defined and so can envision that ordering is not as well defined as it is done through communication from undefined multiple services.
[4]
Bandwidth control is not almighty. Image is of setting the limit of obtained bandwidth in a micro way. Further, in order to find the best solution for the system combining priority control and bandwidth control, need more research.
[5]
Round-Robin Arbiter which uses the arbFunc() is coded for speed priority (large scale circuit). Beforehand result which can be obtained from all the pointers is checked, finally result from specified pointer is selected. Normally the specified pointer is barrel shifted, and selected by priority circuit. For the former 10% to 20% speed up is determined.

Selection after arbitration is used mostly as latched, but in low latency systems, the selection is sometimes used directly and such an example is provided.