Przeglądaj źródła

fix: flatten MRDIMM payload register bank

codex 3 miesięcy temu
rodzic
commit
c80b586eba
1 zmienionych plików z 7 dodań i 4 usunięć
  1. 7 4
      src/common/payload_ram.v

+ 7 - 4
src/common/payload_ram.v

@@ -26,12 +26,15 @@ module payload_ram #(
 
     generate
         if (REGISTERED_RAM != 0) begin : g_registered_ram
-            (* syn_ramstyle = "registers", ram_style = "registers" *)
-            reg [7:0] memory [0:DEPTH-1];
+            // Keep this as a flat vector rather than an unpacked array so
+            // vendor inference cannot turn the tiny p4 mailbox into a RAM
+            // macro again.  The variable part-select is still a plain
+            // flip-flop write/read bank and has identical cycle semantics.
+            reg [(DEPTH*8)-1:0] flat_memory;
             always @(posedge clk) begin
-                if (wr_en && wr_in_range) memory[wr_addr[INDEX_BITS-1:0]] <= wr_data;
+                if (wr_en && wr_in_range) flat_memory[wr_addr[INDEX_BITS-1:0] * 8 +: 8] <= wr_data;
             end
-            assign rd_data = rd_in_range ? memory[rd_addr[INDEX_BITS-1:0]] : 8'hFF;
+            assign rd_data = rd_in_range ? flat_memory[rd_addr[INDEX_BITS-1:0] * 8 +: 8] : 8'hFF;
         end else begin : g_inferred_ram
             reg [7:0] memory [0:DEPTH-1];
             always @(posedge clk) begin