Switching policy decides when a router forwards. Store-and-forward waits for the whole packet; virtual cut-through forwards after the header when the full packet fits downstream; wormhole forwards flit by flit.
Policy | Forwards when | Buffer per hop | Failure mode |
|---|---|---|---|
Store-and-forward | Whole packet buffered | One full packet | Highest latency, simplest reasoning |
Virtual cut-through | Header arrived and room fits the packet | One full packet | Blocked header still holds a full buffer |
Wormhole | Header arrived and one flit fits | Few flits | Blocked header chains across routers |
A credit counts a free downstream buffer slot. The sender transmits only with credit in hand, and the receiver returns one credit per drained flit after the round-trip delay.
Depth follows Little's law: at 1 flit per cycle with a 6-cycle round trip, depth 6 sustains full rate. The sender below also reuses a credit that arrives in the same cycle, matching real bypass behavior.
A blocked wormhole header parks its flits across several routers. Every packet queued behind it waits, even when its own path is free; that is head-of-line blocking.
Partitioning buffers into virtual channels lets one class pass around another. The signature of credit starvation is local queue growth with delayed credit returns while neighboring links sit idle.
The model below runs two credit lanes for 60 cycles against a 6-cycle return pipeline: depth 6 must never stall, depth 2 must deliver exactly 2 flits per round trip, and each credit count must stay inside its depth.
module credit_sender #(parameter int DEPTH = 6) (
input logic clk,
input logic rst_n,
input logic want,
input logic ret_credit,
output logic send,
output logic [31:0] credit_o
);
logic [31:0] credit;
assign send = want && ((credit > 0) || ret_credit);
assign credit_o = credit;
always_ff @(posedge clk or negedge rst_n) begin
if (!rst_n) credit <= DEPTH;
else if (send && !ret_credit) credit <= credit - 1;
else if (!send && ret_credit) credit <= credit + 1;
end
endmodule
Two thirds: 6 over 9 flits per cycle. Depth is fixed, so throughput follows depth over round trip until depth is resized to 9.
Credit starvation is the suspect. Check credit return latency: slow returns with stable offered load name credits, while fast returns with a shared hot link name path choice.