Fix: indent to 4 spaces (3 spaces is pure evil)
This commit is contained in:
@ -6,8 +6,8 @@ module mem_hub (input logic rst,
|
||||
input logic [3:0][7:0] rx_byte,
|
||||
input logic [3:0] rx_valid,
|
||||
input logic [3:0][1:0] rx2tx_dest, // rx byte's destination
|
||||
input logic [3:0] tx_read, // if tx_byte was read
|
||||
output logic [3:0] rx_read, // if rx_byte was read
|
||||
input logic [3:0] tx_ready, // if tx_byte was read
|
||||
output logic [3:0] rx_ready, // if rx_byte was read
|
||||
output logic [3:0][1:0] tx_src, // tell the tx where the stream is comming from
|
||||
output logic [3:0][7:0] tx_byte,
|
||||
output logic [3:0] tx_valid,
|
||||
@ -17,34 +17,27 @@ module mem_hub (input logic rst,
|
||||
|
||||
// TBD: pre-agree on packet size
|
||||
|
||||
// [index][rx_src]
|
||||
logic [3:0][1:0] service_queue;
|
||||
logic [3:0] in_queue;
|
||||
// use the round-robin strat to poll since the routing is much faster
|
||||
// NOTE: To expand to more connected_devices, use a hierarchical design
|
||||
logic [1:0] curr_service = 0;
|
||||
|
||||
// [rx_src][tx_dest], might not be useful
|
||||
logic [1:0][1:0] rx2tx_map;
|
||||
|
||||
logic [2:0] i;
|
||||
// src dest byte
|
||||
logic [1:0][1:0][7:0] service_buffer;
|
||||
logic [3:0] in_buffer;
|
||||
|
||||
// Core service logic
|
||||
always_ff @ (posedge sys_clk) begin
|
||||
if (rst) begin
|
||||
rx_read <= '0;
|
||||
rx_ready <= '1;
|
||||
tx_src <= '0;
|
||||
tx_valid <= '0;
|
||||
packet_size <= '0;
|
||||
service_queue <= '0;
|
||||
in_queue <= '0;
|
||||
rx2tx_map <= '0;
|
||||
i <= 0;
|
||||
service_buffer <= '0;
|
||||
curr_service <= '0;
|
||||
end else if (rx_valid[curr_service]) begin
|
||||
|
||||
end
|
||||
|
||||
if (in_queue == 4'd0) begin // no one is in the queue yet
|
||||
if (tx_valid != 4'd0) begin
|
||||
for (i = 0; i < 3'd4; i++) begin
|
||||
// TODO: write the logic for enqueuing
|
||||
end
|
||||
end
|
||||
end else begin
|
||||
end
|
||||
curr_service <= curr_service + 1;
|
||||
end
|
||||
endmodule // mem_hub
|
||||
|
Reference in New Issue
Block a user