2015-04-24 17:29:05 -04:00
|
|
|
module etx_remap (/*AUTOARG*/
|
|
|
|
// Outputs
|
|
|
|
emesh_access_out, emesh_packet_out,
|
|
|
|
// Inputs
|
|
|
|
clk, reset, emesh_access_in, emesh_packet_in, remap_en,
|
2015-05-04 17:09:50 -04:00
|
|
|
remap_bypass, etx_rd_wait, etx_wr_wait
|
2015-04-24 17:29:05 -04:00
|
|
|
);
|
|
|
|
|
|
|
|
parameter AW = 32;
|
|
|
|
parameter DW = 32;
|
|
|
|
parameter PW = 104;
|
|
|
|
parameter ID = 12'h808;
|
|
|
|
|
|
|
|
//Clock/reset
|
|
|
|
input clk;
|
|
|
|
input reset;
|
|
|
|
|
|
|
|
//Input from arbiter
|
|
|
|
input emesh_access_in;
|
|
|
|
input [PW-1:0] emesh_packet_in;
|
|
|
|
input remap_en; //enable tx remap (static)
|
|
|
|
input remap_bypass; //dynamic control (read request)
|
|
|
|
|
|
|
|
//Output to TX IO
|
|
|
|
output emesh_access_out;
|
|
|
|
output [PW-1:0] emesh_packet_out;
|
2015-05-04 17:09:50 -04:00
|
|
|
|
|
|
|
//Wait signals from protocol block
|
|
|
|
input etx_rd_wait;
|
|
|
|
input etx_wr_wait;
|
2015-04-24 17:29:05 -04:00
|
|
|
|
|
|
|
wire [31:0] addr_in;
|
|
|
|
wire [31:0] addr_remap;
|
|
|
|
wire [31:0] addr_out;
|
2015-05-04 17:09:50 -04:00
|
|
|
wire write_in;
|
|
|
|
|
2015-04-24 17:29:05 -04:00
|
|
|
reg emesh_access_out;
|
|
|
|
reg [PW-1:0] emesh_packet_out;
|
2015-05-04 17:09:50 -04:00
|
|
|
|
2015-04-24 17:29:05 -04:00
|
|
|
|
|
|
|
assign addr_in[31:0] = emesh_packet_in[39:8];
|
2015-05-04 17:09:50 -04:00
|
|
|
assign write_in = emesh_packet_in[1];
|
|
|
|
|
2015-04-28 16:56:31 -04:00
|
|
|
assign addr_remap[31:0] = {addr_in[29:18],//ID
|
|
|
|
addr_in[17:16],//SPECIAL GROUP
|
|
|
|
{(2){(|addr_in[17:16])}},//ZERO IF NOT SPECIAL
|
2015-04-24 17:29:05 -04:00
|
|
|
addr_in[15:0]
|
|
|
|
};
|
|
|
|
|
|
|
|
assign addr_out[31:0] = (remap_en & ~remap_bypass) ? addr_remap[31:0] :
|
|
|
|
addr_in[31:0];
|
|
|
|
|
2015-05-04 17:09:50 -04:00
|
|
|
|
|
|
|
//stall read/write access appropriately
|
2015-04-24 17:29:05 -04:00
|
|
|
always @ (posedge clk)
|
2015-05-04 17:09:50 -04:00
|
|
|
if((write_in & ~etx_wr_wait) | (~write_in & ~etx_rd_wait))
|
2015-04-24 17:29:05 -04:00
|
|
|
begin
|
|
|
|
emesh_access_out <= emesh_access_in;
|
|
|
|
emesh_packet_out[PW-1:0] <= {emesh_packet_in[PW-1:40],
|
|
|
|
addr_out[31:0],
|
|
|
|
emesh_packet_in[7:0]
|
|
|
|
};
|
|
|
|
end
|
|
|
|
|
|
|
|
endmodule // etx_mux
|
|
|
|
|