Skip to content

Instantly share code, notes, and snippets.

@garytwong
Created April 30, 2020 16:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save garytwong/650f48f7b222623317f324a14925abde to your computer and use it in GitHub Desktop.
Save garytwong/650f48f7b222623317f324a14925abde to your computer and use it in GitHub Desktop.
Trivial block RAM module
module top( input clk,
input [ 10:0 ] waddr,
input [ 7:0 ] wdata,
input [ 10:0 ] raddr,
output reg[ 7:0 ] rdata ); // ***** change the size to 6:0 and yosys no longer infers block RAM *****
reg [ 7:0 ] ebr[ 2047:0 ];
always @( posedge clk ) begin
ebr[ waddr ] <= wdata;
rdata <= ebr[ raddr ];
end
endmodule
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment