fifo仿真通过

main
阳光少年 8 months ago
parent 057f49b773
commit 641621efd0

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

@ -1,5 +1,5 @@
`timescale 1ns/1ns `timescale 1ns/1ns
module tb_fifo() module tb_fifo();
reg sys_clk; reg sys_clk;
reg sys_rst; reg sys_rst;

@ -2,27 +2,28 @@
// : , , , // : , , ,
// : , , // : , ,
// , , // , ,
// /, , 1, / // /(is_full/is_empty), , 1, /
// is_emptyfifo_wr_data03, is_empty,,
// , 0, fullemtpy, // , 0, fullemtpy,
module test_fifo( module test_fifo(
input wire sys_clk, // U18 (*mark_debug="true"*)input wire sys_clk, // U18
input wire sys_rst //J15 input wire sys_rst //J15
); );
wire clk_100m; (*mark_debug="true"*)wire clk_100m;
wire clk_50m; (*mark_debug="true"*)wire clk_50m;
wire locked; (*mark_debug="true"*)wire locked;
wire logic_rst; wire logic_rst;
assign logic_rst = sys_rst && locked; // () assign logic_rst = sys_rst && locked; // ()
wire is_empty; (*mark_debug="true"*)wire is_empty;
wire is_almost_full; (*mark_debug="true"*)wire is_almost_full;
wire is_wr_rst_busy; (*mark_debug="true"*)wire is_wr_rst_busy;
wire fifo_wr_en; (*mark_debug="true"*)wire fifo_wr_en;
wire fifo_wr_data; (*mark_debug="true"*)wire [7:0]fifo_wr_data;
fifo_wr u_fifo_wr( fifo_wr u_fifo_wr(
.wr_clk(clk_50m), .wr_clk(clk_50m),
@ -34,11 +35,11 @@ fifo_wr u_fifo_wr(
.fifo_wr_data(fifo_wr_data) .fifo_wr_data(fifo_wr_data)
); );
wire is_full; (*mark_debug="true"*)wire is_full;
wire is_almost_empty; (*mark_debug="true"*)wire is_almost_empty;
wire is_rd_rst_busy; (*mark_debug="true"*)wire is_rd_rst_busy;
wire fifo_rd_en; (*mark_debug="true"*)wire fifo_rd_en;
wire fifo_rd_data; (*mark_debug="true"*)wire [7:0]fifo_rd_data;
fifo_rd u_fifo_rd( fifo_rd u_fifo_rd(
@ -58,8 +59,8 @@ clk_wiz_0 u_clk_wiz_0(
.locked(locked) .locked(locked)
); );
wire [7:0]rd_data_count; (*mark_debug="true"*)wire [7:0]rd_data_count;
wire [7:0]wr_data_count; (*mark_debug="true"*)wire [7:0]wr_data_count;
fifo_generator_0 u_fifo_generator_0( fifo_generator_0 u_fifo_generator_0(
.rst(~logic_rst), // ip, , logic_rst() .rst(~logic_rst), // ip, , logic_rst()
.wr_clk(clk_50m), .wr_clk(clk_50m),
@ -69,7 +70,9 @@ fifo_generator_0 u_fifo_generator_0(
.rd_en(fifo_rd_en), .rd_en(fifo_rd_en),
.dout(fifo_rd_data), .dout(fifo_rd_data),
.full(is_full), .full(is_full),
.almost_full(is_almost_empty), .almost_full(is_almost_full),
.empty(is_empty),
.almost_empty(is_almost_empty),
.rd_data_count(rd_data_count), .rd_data_count(rd_data_count),
.wr_data_count(wr_data_count), .wr_data_count(wr_data_count),
.wr_rst_busy(is_wr_rst_busy), .wr_rst_busy(is_wr_rst_busy),

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Loading…
Cancel
Save