make better

This commit is contained in:
Nicholas Orlowsky 2024-04-07 23:39:15 -05:00
parent fdd6553f11
commit f2c0935b60
Signed by: nickorlow
GPG key ID: 838827D8C4611687
128 changed files with 39530 additions and 530 deletions

27
memory.sv Normal file
View file

@ -0,0 +1,27 @@
module memory #(parameter RAM_SIZE_BYTES = 4096) (
input wire clk_in,
input wire do_write,
input wire [$clog2(RAM_SIZE_BYTES)-1:0] write_address,
input wire [7:0] data_in,
input wire [$clog2(RAM_SIZE_BYTES)-1:0] read_address,
output logic [7:0] data_out/*,
input wire [$clog2(RAM_SIZE_BYTES)-1:0] read_address_gfx,
output logic [7:0] data_out_gfxA*/
);
logic [7:0] mem [0:RAM_SIZE_BYTES-1];
initial begin
$readmemh("fontset.bin", mem, 0);
$readmemb("rom.bin", mem, 'h200);
end
always_ff @(negedge clk_in) begin
if (do_write) begin
mem[write_address] <= data_in;
end
//$display("MEM : Reading address %h (%h)", read_address, mem[read_address]);
data_out <= mem[read_address];
//data_out_gfx <= mem[read_address_gfx];
end
endmodule