vid_palette.v 746 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. * vid_palette.v
  3. *
  4. * Video palette memory
  5. *
  6. * vim: ts=4 sw=4
  7. *
  8. * Copyright (C) 2021 Sylvain Munaut <tnt@246tNt.com>
  9. * SPDX-License-Identifier: CERN-OHL-P-2.0
  10. */
  11. `default_nettype none
  12. module vid_palette (
  13. // Write port
  14. input wire [ 7:0] w_addr_0,
  15. input wire [15:0] w_data_0,
  16. input wire w_ena_0,
  17. // Read port
  18. input wire [ 7:0] r_addr_0,
  19. output wire [15:0] r_data_1,
  20. // Clock
  21. input wire clk
  22. );
  23. SB_RAM40_4K #(
  24. .WRITE_MODE(0),
  25. .READ_MODE(0)
  26. ) ebr_I (
  27. .RDATA (r_data_1),
  28. .RADDR ({3'b000, r_addr_0}),
  29. .RCLK (clk),
  30. .RCLKE (1'b1),
  31. .RE (1'b1),
  32. .WDATA (w_data_0),
  33. .WADDR ({3'b000, w_addr_0}),
  34. .MASK (16'h0000),
  35. .WCLK (clk),
  36. .WCLKE (w_ena_0),
  37. .WE (1'b1)
  38. );
  39. endmodule // vid_palette