-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
42 changed files
with
14,024 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
|
||
/* | ||
The designers: | ||
Ahmet Can Mert <ahmetcanmert@sabanciuniv.edu> | ||
Ferhat Yaman <ferhatyaman@sabanciuniv.edu> | ||
To the extent possible under law, the implementer has waived all copyright | ||
and related or neighboring rights to the source code in this file. | ||
http://creativecommons.org/publicdomain/zero/1.0/ | ||
*/ | ||
|
||
// read latency is 1 cc | ||
|
||
module BRAM(input clk, | ||
input wen, | ||
input [7:0] waddr, | ||
input [11:0] din, | ||
input [7:0] raddr, | ||
output reg [11:0] dout); | ||
// bram | ||
(* ram_style="block" *) reg [11:0] blockram [255:0]; | ||
|
||
// write operation | ||
always @(posedge clk) begin | ||
if(wen) | ||
blockram[waddr] <= din; | ||
end | ||
|
||
// read operation | ||
always @(posedge clk) begin | ||
dout <= blockram[raddr]; | ||
end | ||
|
||
endmodule |
Oops, something went wrong.