Browse Source

test(resource): exercise isolated EF2 block RAM

root 3 tháng trước cách đây
mục cha
commit
1d3775ce38

+ 1 - 1
td/resource/prod2u_6400_architecture_ab.tcl

@@ -24,7 +24,7 @@ import_device ef2_4.db -package EF2L45BG256B
 set_param rtl directive:async_reg on
 set_param place async_reg on
 
-analyze -file $candidate_source
+analyze -file $candidate_source -define PROD2U_TD_VENDOR_RAM
 elaborate -top $top
 read_adc $pin_constraints
 read_sdc $timing_constraints

+ 24 - 7
tests/resource/architecture_ab_candidates.v

@@ -126,17 +126,34 @@ endmodule
 
 module ab_store_eram (
     input wire clk, input wire wr_en, input wire [7:0] wr_addr, input wire [7:0] wr_data,
-    input wire [7:0] rd_addr, output reg [7:0] rd_data
+    input wire [7:0] rd_addr, output wire [7:0] rd_data
 );
-    // TD follows its documented synthesis directives here; the generic
-    // attributes above were silently ignored and therefore did not constitute
-    // an actual FF-versus-eRAM comparison.
-    /* synthesis force_ram */
-    reg [7:0] mem [0:255] /* synthesis ram_style = bram_9k */;
+`ifdef PROD2U_TD_VENDOR_RAM
+    wire [7:0] port_a_data;
+    EF2_LOGIC_BRAM #(
+        .DATA_WIDTH_A(8), .DATA_WIDTH_B(8),
+        .ADDR_WIDTH_A(8), .ADDR_WIDTH_B(8),
+        .DATA_DEPTH_A(256), .DATA_DEPTH_B(256),
+        .BYTE_ENABLE(0), .BYTE_A(1), .BYTE_B(1),
+        .MODE("DP"), .REGMODE_A("NOREG"), .REGMODE_B("NOREG"),
+        .WRITEMODE_A("NORMAL"), .WRITEMODE_B("NORMAL"),
+        .RESETMODE("ASYNC"), .IMPLEMENT("9K")
+    ) u_ram (
+        .dia(wr_data), .addra(wr_addr), .cea(1'b1), .ocea(1'b1),
+        .clka(clk), .wea(wr_en), .rsta(1'b0), .bea(1'b1),
+        .dib(8'd0), .addrb(rd_addr), .ceb(1'b1), .oceb(1'b1),
+        .clkb(clk), .web(1'b0), .rstb(1'b0), .beb(1'b1),
+        .doa(port_a_data), .dob(rd_data)
+    );
+`else
+    reg [7:0] mem [0:255];
+    reg [7:0] rd_data_reg;
+    assign rd_data = rd_data_reg;
     always @(posedge clk) begin
         if (wr_en) mem[wr_addr] <= wr_data;
-        rd_data <= mem[rd_addr];
+        rd_data_reg <= mem[rd_addr];
     end
+`endif
 endmodule
 
 module ab_pi_positional #(