mirror of
https://github.com/YosysHQ/yosys
synced 2025-04-27 02:45:52 +00:00
Fix run-test.sh; Add new test for dpram.
This commit is contained in:
parent
0b25dbf1c6
commit
3c10f58d04
4 changed files with 120 additions and 1 deletions
20
tests/ice40/dpram.v
Normal file
20
tests/ice40/dpram.v
Normal file
|
@ -0,0 +1,20 @@
|
|||
module top (din, write_en, waddr, wclk, raddr, rclk, dout);
|
||||
parameter addr_width = 8;
|
||||
parameter data_width = 8;
|
||||
input [addr_width-1:0] waddr, raddr;
|
||||
input [data_width-1:0] din;
|
||||
input write_en, wclk, rclk;
|
||||
output [data_width-1:0] dout;
|
||||
reg [data_width-1:0] dout;
|
||||
reg [data_width-1:0] mem [(1<<addr_width)-1:0]
|
||||
/* synthesis syn_ramstyle = "no_rw_check" */ ;
|
||||
always @(posedge wclk) // Write memory.
|
||||
begin
|
||||
if (write_en)
|
||||
mem[waddr] <= din; // Using write address bus.
|
||||
end
|
||||
always @(posedge rclk) // Read memory.
|
||||
begin
|
||||
dout <= mem[raddr]; // Using read address bus.
|
||||
end
|
||||
endmodule
|
Loading…
Add table
Add a link
Reference in a new issue