Skip to content

Commit b27232c

Browse files
committed
Add description for round-robin distributor
1 parent 5221fb9 commit b27232c

File tree

1 file changed

+18
-10
lines changed

1 file changed

+18
-10
lines changed

src/rr_distributor.sv

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,27 @@
1212
// Date: 12.01.2021
1313
// Description: round robin distributor
1414

15+
/// The rr_distributor forwards requests to individual outputs in a round robin fashion.
1516
module rr_distributor # (
16-
parameter int unsigned NumOut = 1,
17-
parameter int unsigned Width = 1,
18-
parameter type payload_t = logic [Width-1:0],
19-
parameter int unsigned IdxWidth = (NumOut > 32'd1) ? unsigned'($clog2(NumOut)) : 32'd1,
20-
parameter type idx_t = logic [IdxWidth-1:0]
17+
/// Number of outputs to distribute to.
18+
parameter int unsigned NumOut = 1,
19+
/// Data width of the payload in bits. Not needed if `payload_t` is overwritten.
20+
parameter int unsigned Width = 1,
21+
/// Data type of the payload, can be overwritten with a custom type. Only use of `Width`.
22+
parameter type payload_t = logic [Width-1:0],
23+
/// Dependent parameter, do **not** overwrite.
24+
/// Width of the selected index
25+
parameter int unsigned IdxWidth = (NumOut > 32'd1) ? unsigned'($clog2(NumOut)) : 32'd1,
26+
/// Dependent parameter, do **not** overwrite.
27+
/// type of the selected index
28+
parameter type idx_t = logic [IdxWidth-1:0]
2129
) (
30+
input logic clk_i,
31+
input logic rst_ni,
2232
// input stream
23-
input logic clk_i,
24-
input logic rst_ni,
25-
input logic valid_i,
26-
output logic ready_o,
27-
input payload_t payload_i,
33+
input logic valid_i,
34+
output logic ready_o,
35+
input payload_t payload_i,
2836
// output stream
2937
output logic [NumOut-1:0] valid_o,
3038
input logic [NumOut-1:0] ready_i,

0 commit comments

Comments
 (0)