mirror of
https://github.com/YosysHQ/yosys
synced 2025-08-30 06:50: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
30
tests/xilinx_ug901/ram_simple_dual_two_clocks.v
Normal file
30
tests/xilinx_ug901/ram_simple_dual_two_clocks.v
Normal file
|
@ -0,0 +1,30 @@
|
|||
// Simple Dual-Port Block RAM with Two Clocks
|
||||
// File: simple_dual_two_clocks.v
|
||||
|
||||
module simple_dual_two_clocks (clka,clkb,ena,enb,wea,addra,addrb,dia,dob);
|
||||
|
||||
input clka,clkb,ena,enb,wea;
|
||||
input [9:0] addra,addrb;
|
||||
input [15:0] dia;
|
||||
output [15:0] dob;
|
||||
reg [15:0] ram [1023:0];
|
||||
reg [15:0] dob;
|
||||
|
||||
always @(posedge clka)
|
||||
begin
|
||||
if (ena)
|
||||
begin
|
||||
if (wea)
|
||||
ram[addra] <= dia;
|
||||
end
|
||||
end
|
||||
|
||||
always @(posedge clkb)
|
||||
begin
|
||||
if (enb)
|
||||
begin
|
||||
dob <= ram[addrb];
|
||||
end
|
||||
end
|
||||
|
||||
endmodule
|
Loading…
Add table
Add a link
Reference in a new issue