mirror of
https://github.com/retroSoC/retroSoC.git
synced 2026-11-06 14:55:14 +00:00
feat: implement SRAM support for ICS55 in tc_usb2_packet_ram and add corresponding test
This commit is contained in:
3 files changed
+99
-1
No files matched your search
@@ -0,0 +1,31 @@
|
||||
// Copyright (c) 2026 Yuchi Miao <miaoyuchi@ict.ac.cn>
|
||||
// retroSoC is licensed under Mulan PSL v2.
|
||||
|
||||
module SRAM_4096X32_M8_BW (
|
||||
input logic [11:0] A,
|
||||
input logic [31:0] D,
|
||||
input logic CEB,
|
||||
input logic CLK,
|
||||
input logic GWEB,
|
||||
input logic [31:0] WEB,
|
||||
input logic MARE,
|
||||
input logic [ 3:0] MAR,
|
||||
output logic [31:0] Q
|
||||
);
|
||||
logic [31:0] s_memory[0:4095];
|
||||
|
||||
always_ff @(posedge CLK) begin
|
||||
if (!CEB) begin
|
||||
if (!GWEB) begin
|
||||
for (int bit_index = 0; bit_index < 32; bit_index++) begin
|
||||
if (!WEB[bit_index]) begin
|
||||
s_memory[A][bit_index] <= D[bit_index];
|
||||
end
|
||||
end
|
||||
end else begin
|
||||
Q <= s_memory[A];
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
endmodule
|
||||
Reference in new issue
Block a user