|
@@ -39,14 +39,19 @@ module mrdimm_snapshot_mux #(
|
|
|
wire [9:0] bmc_relative=index-`MR_SNAPSHOT_BMC_RAW_OFFSET;
|
|
wire [9:0] bmc_relative=index-`MR_SNAPSHOT_BMC_RAW_OFFSET;
|
|
|
wire [9:0] ct_relative=index-`MR_SNAPSHOT_CT_RAW_OFFSET;
|
|
wire [9:0] ct_relative=index-`MR_SNAPSHOT_CT_RAW_OFFSET;
|
|
|
wire [9:0] axis_relative=index-`MR_SNAPSHOT_AXIS_OFFSET;
|
|
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;
|
|
|
wire copying_axes=index>=`MR_SNAPSHOT_AXIS_OFFSET;
|
|
wire copying_axes=index>=`MR_SNAPSHOT_AXIS_OFFSET;
|
|
|
assign bmc_rd_index=in_bmc ? bmc_relative[5:1] : 5'd0;
|
|
assign bmc_rd_index=in_bmc ? bmc_relative[5:1] : 5'd0;
|
|
|
assign ct_rd_index=in_ct ? ct_relative[5:1] : 5'd0;
|
|
assign ct_rd_index=in_ct ? ct_relative[5:1] : 5'd0;
|
|
|
wire [7:0] copy_data=in_bmc ? (bmc_relative[0] ? bmc_rd_raw[15:8] : bmc_rd_raw[7:0]) :
|
|
wire [7:0] copy_data=in_bmc ? (bmc_relative[0] ? bmc_rd_raw[15:8] : bmc_rd_raw[7:0]) :
|
|
|
in_ct ? (ct_relative[0] ? ct_rd_raw[15:8] : ct_rd_raw[7:0]) :
|
|
in_ct ? (ct_relative[0] ? ct_rd_raw[15:8] : ct_rd_raw[7:0]) :
|
|
|
- index>=`MR_SNAPSHOT_AXIS_OFFSET ? axis_data[axis_relative*8 +:8] : header_shadow[index*8 +:8];
|
|
|
|
|
|
|
+ header_shadow[{index[7:0],3'b000} +:8];
|
|
|
wire memory_write=locked && (copying_axes || (phase==2 && index[0]));
|
|
wire memory_write=locked && (copying_axes || (phase==2 && index[0]));
|
|
|
- wire [15:0] memory_write_data=copying_axes ? axis_data[axis_relative*8 +:16] : {copy_data,header_low_byte};
|
|
|
|
|
|
|
+ // 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};
|
|
|
ef2_bram_dp #(.DATA_WIDTH(16),.ADDR_WIDTH(SNAPSHOT_ADDR_WIDTH),.DATA_DEPTH(SNAPSHOT_LENGTH/2)) u_snapshot_memory (
|
|
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),
|
|
.clk(clk),.a_en(memory_write),.a_we(memory_write),
|
|
|
.a_addr(index[SNAPSHOT_ADDR_WIDTH:1]),.a_wdata(memory_write_data),.a_rdata(),
|
|
.a_addr(index[SNAPSHOT_ADDR_WIDTH:1]),.a_wdata(memory_write_data),.a_rdata(),
|