|
|
@@ -41,6 +41,15 @@ module mrdimm_snapshot_mux #(
|
|
|
wire [9:0] axis_relative=index-`MR_SNAPSHOT_AXIS_OFFSET;
|
|
|
localparam integer AXIS_WORD_ADDR_WIDTH=$clog2(AXIS_COUNT*`MR_AXIS_RECORD_BYTES/2);
|
|
|
wire [AXIS_WORD_ADDR_WIDTH-1:0] axis_word_index=axis_relative>>1;
|
|
|
+ reg [15:0] selected_axis_word;
|
|
|
+ integer axis_word;
|
|
|
+ always @* begin
|
|
|
+ selected_axis_word=0;
|
|
|
+ // Decode once per word and share that enable across all16 bits.
|
|
|
+ // This avoids independent deep bit-select trees in the TD mapper.
|
|
|
+ for(axis_word=0;axis_word<AXIS_COUNT*`MR_AXIS_RECORD_BYTES/2;axis_word=axis_word+1)
|
|
|
+ selected_axis_word=selected_axis_word | (axis_data[axis_word*16+:16] & {16{axis_word_index==axis_word}});
|
|
|
+ end
|
|
|
wire copying_axes=index>=`MR_SNAPSHOT_AXIS_OFFSET;
|
|
|
assign bmc_rd_index=in_bmc ? bmc_relative[5:1] : 5'd0;
|
|
|
assign ct_rd_index=in_ct ? ct_relative[5:1] : 5'd0;
|
|
|
@@ -51,7 +60,7 @@ module mrdimm_snapshot_mux #(
|
|
|
// AXIS_OFFSET and every record are even; select only aligned words.
|
|
|
// Keeping this separate from the header-byte mux avoids duplicate wide
|
|
|
// byte/word selectors and makes the legal address width explicit to TD.
|
|
|
- wire [15:0] memory_write_data=copying_axes ? axis_data[{axis_word_index,4'b0000} +:16] : {copy_data,header_low_byte};
|
|
|
+ wire [15:0] memory_write_data=copying_axes ? selected_axis_word : {copy_data,header_low_byte};
|
|
|
ef2_bram_dp #(.DATA_WIDTH(16),.ADDR_WIDTH(SNAPSHOT_ADDR_WIDTH),.DATA_DEPTH(SNAPSHOT_LENGTH/2)) u_snapshot_memory (
|
|
|
.clk(clk),.a_en(memory_write),.a_we(memory_write),
|
|
|
.a_addr(index[SNAPSHOT_ADDR_WIDTH:1]),.a_wdata(memory_write_data),.a_rdata(),
|