beepo/tests/spmem.v
2023-11-15 18:58:20 -05:00

27 lines
469 B
Verilog

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'h49, 8'h01, 8'h23, 8'h46,
8'h49, 8'h02, 8'h46, 8'h23,
8'h03, 8'h01, 8'h01, 8'h02,
8'h01,
144'h0
};
reg [7:0] r_out;
assign dout = r_out;
always @(negedge clk) begin
r_out <= mem[ad*8+:8];
end
endmodule