// sdp_ram.sv // Simple dual-port RAM: one write port, one read port, one clock. // The read is synchronous. OUT_REG = 1 adds a second output register // (read latency 2), which most block RAMs can absorb and which shortens // the path from the RAM to the logic that uses dout. `timescale 1ns/1ps module sdp_ram #( parameter int DW = 16, parameter int AW = 10, parameter bit OUT_REG = 1'b0 ) ( input logic clk, // write port input logic we, input logic [AW-1:0] waddr, input logic [DW-1:0] din, // read port input logic re, input logic [AW-1:0] raddr, output logic [DW-1:0] dout ); logic [DW-1:0] mem [0:(1<