beepo/tests/spmem.v

26 lines
440 B
Coq
Raw Normal View History

2023-11-15 06:15:56 -06:00
module spMem(
output [7:0] dout,
input clk,
input oce,
input ce,
input reset,
input wre,
input [15:0] ad,
input [7:0] din
);
reg [0:255] mem = {
8'h0,
8'h48, 8'h01, 8'h23,
8'h48, 8'h02, 8'h46,
8'h03, 8'h01, 8'h01, 8'h02,
168'h0
};
2023-11-15 13:30:43 -06:00
reg [7:0] r_out;
assign dout = r_out;
always @(negedge clk) begin
r_out <= mem[ad*8+:8];
end
2023-11-15 06:15:56 -06:00
endmodule