mirror of
https://github.com/YosysHQ/yosys
synced 2025-08-22 02:57:51 +00:00
iCE40 bram tests and fixes
This commit is contained in:
parent
d6f7698f59
commit
308a59aa18
6 changed files with 181 additions and 16 deletions
19
techlibs/ice40/tests/test_bram.v
Normal file
19
techlibs/ice40/tests/test_bram.v
Normal file
|
@ -0,0 +1,19 @@
|
|||
module bram #(
|
||||
parameter ABITS = 8, DBITS = 8
|
||||
) (
|
||||
input clk,
|
||||
|
||||
input [ABITS-1:0] WR_ADDR,
|
||||
input [DBITS-1:0] WR_DATA,
|
||||
input WR_EN,
|
||||
|
||||
input [ABITS-1:0] RD_ADDR,
|
||||
output reg [DBITS-1:0] RD_DATA
|
||||
);
|
||||
reg [DBITS-1:0] memory [0:2**ABITS-1];
|
||||
|
||||
always @(posedge clk) begin
|
||||
if (WR_EN) memory[WR_ADDR] <= WR_DATA;
|
||||
RD_DATA <= memory[RD_ADDR];
|
||||
end
|
||||
endmodule
|
Loading…
Add table
Add a link
Reference in a new issue