-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Successful extmem for data test, cache bug fixes
- Loading branch information
1 parent
142d42d
commit 27da3f0
Showing
7 changed files
with
153 additions
and
43 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
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
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
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
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
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,40 @@ | ||
|
||
// Copyright © 2024, Julian Scheffers, see LICENSE for more information | ||
|
||
`timescale 1ns/1ps | ||
|
||
|
||
|
||
// Simulated zero-latency synchronous SRAM. | ||
module raw_sram#( | ||
// Address width of the SRAM. | ||
parameter alen = 8, | ||
// Storage depth. | ||
localparam depth = 1 << alen | ||
)( | ||
// Write clock. | ||
input logic clk, | ||
|
||
// Read enable. | ||
input logic re, | ||
// Write enable. | ||
input logic we, | ||
// Address. | ||
input logic[alen-1:0] addr, | ||
// Write data. | ||
input logic[7:0] wdata, | ||
// Read data. | ||
output logic[7:0] rdata | ||
); | ||
// Data storage. | ||
logic[7:0] storage[depth]; | ||
|
||
// Read access logic. | ||
assign rdata = re && !we ? storage[addr] : 'bz; | ||
// Write access logic. | ||
always @(posedge clk) begin | ||
if (we) begin | ||
storage[addr] <= wdata; | ||
end | ||
end | ||
endmodule |
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