mirror of
https://github.com/YosysHQ/yosys
synced 2025-08-30 23:10:09 +00:00
Add tests for Xilinx UG901 examples
This commit is contained in:
parent
0d037bf9d8
commit
2ae7dec530
89 changed files with 2962 additions and 0 deletions
29
tests/xilinx_ug901/rams_sp_rf_rst.v
Normal file
29
tests/xilinx_ug901/rams_sp_rf_rst.v
Normal file
|
@ -0,0 +1,29 @@
|
|||
// Block RAM with Resettable Data Output
|
||||
// File: rams_sp_rf_rst.v
|
||||
|
||||
module rams_sp_rf_rst (clk, en, we, rst, addr, di, dout);
|
||||
input clk;
|
||||
input en;
|
||||
input we;
|
||||
input rst;
|
||||
input [9:0] addr;
|
||||
input [15:0] di;
|
||||
output [15:0] dout;
|
||||
|
||||
reg [15:0] ram [1023:0];
|
||||
reg [15:0] dout;
|
||||
|
||||
always @(posedge clk)
|
||||
begin
|
||||
if (en) //optional enable
|
||||
begin
|
||||
if (we) //write enable
|
||||
ram[addr] <= di;
|
||||
if (rst) //optional reset
|
||||
dout <= 0;
|
||||
else
|
||||
dout <= ram[addr];
|
||||
end
|
||||
end
|
||||
|
||||
endmodule
|
Loading…
Add table
Add a link
Reference in a new issue