import Vivado project, rearrange Verilog sources

This commit is contained in:
slederer 2024-09-27 22:13:23 +02:00
parent 18b95b6bb6
commit a441e7e042
29 changed files with 789 additions and 742 deletions

View file

@ -1,28 +0,0 @@
`timescale 1ns / 1ps
// taken from https://danstrother.com/2010/09/11/inferring-rams-in-fpgas/
// modified for one read/write-port and one read-only-port,
/// A parameterized, inferable, true dual-port, dual-clock block RAM in Verilog.
module palette #(
parameter SLOTS_WIDTH = 4, COLOR_WIDTH = 12
) (
input wire wr_clk,
input wire rd_clk,
input wire wr_en,
input wire [SLOTS_WIDTH-1:0] wr_slot,
input wire [COLOR_WIDTH-1:0] wr_data,
input wire [SLOTS_WIDTH-1:0] rd_slot,
output wire [COLOR_WIDTH-1:0] rd_data
);
// Shared memory
reg [COLOR_WIDTH-1:0] colors [(2**SLOTS_WIDTH)-1:0];
assign rd_data = colors[rd_slot];
always @(posedge wr_clk) begin
if(wr_en) colors[wr_slot] <= wr_data;
end
endmodule