ISP/rtl/BayerProcess/Gowin_SDPB.sv

36 lines
719 B
Systemverilog
Raw Normal View History

2024-10-22 20:31:51 +08:00
//Gowin SDPB IP<49>˷<EFBFBD><CBB7><EFBFBD><EFBFBD>ļ<EFBFBD>
`timescale 1ns / 1ps
module Gowin_SDPB (
input wire clka,
input wire clkb, //no use
input wire reset,
input wire cea,
input wire ceb,
input wire [10:0] ada,
input wire [10:0] adb,
input wire [15:0] din,
output reg [15:0] dout,
input wire oce //no use
);
reg [15:0] bram[2048];
integer i;
initial for (i = 0; i < 2048; i = i + 1) bram[i] = 0;
always @(posedge clka) begin
if (reset) for (i = 0; i < 2048; i = i + 1) bram[i] <= 0;
else if (cea) bram[ada] <= din;
end
always @(posedge clka) begin
if (reset) dout <= 0;
else if (ceb) dout <= bram[adb];
end
endmodule