📄 async_fifo_tb_env.sv
字号:
typedef enum {WR,RD} FAST_WRD;parameter DSIZE = 8;parameter ASIZE = 4;parameter wclk_period = 0;parameter rclk_period = 0;parameter wrd_ratio = ((wclk_period/rclk_period)== 0) ? (rclk_period/wclk_period) : (wclk_period/rclk_period);parameter wrd_selct_fast = ((wclk_period/rclk_period)== 0) ? 1'b0 : 1'b1;int wrd_ratio_rand;`include "async_fifo_tb_wr.sv"`include "async_fifo_tb_rd.sv"`include "async_fifo_checker.sv"`include "async_fifo_defines.v"class async_fifo_tb_env; rand FAST_WRD fast_wrd; virtual async_fifo_if async_fifo_inf; async_fifo_tb_rd async_fifo_tb_rd_o; async_fifo_tb_wr async_fifo_tb_wr_o; async_fifo_checker async_fifo_checker_o; function new (virtual async_fifo_if async_fifo_inf); if ((wclk_period/rclk_period)== 0) this.fast_wrd = WR; else this.fast_wrd = RD; this.async_fifo_inf = async_fifo_inf; async_fifo_tb_rd_o = new(async_fifo_inf, fast_wrd); async_fifo_tb_wr_o = new(async_fifo_inf, fast_wrd); async_fifo_checker_o = new(async_fifo_inf, fast_wrd); fork begin ratio_calc; end join_none async_fifo_inf.threshhold = 4;//3; endfunction : new task ratio_calc(); while(1'b1) begin wrd_ratio_rand = ((async_fifo_inf.wclk_period_rand/async_fifo_inf.rclk_period_rand)== 0) ? (async_fifo_inf.rclk_period_rand/async_fifo_inf.wclk_period_rand) : (async_fifo_inf.wclk_period_rand/async_fifo_inf.rclk_period_rand); #1; end endtaskendclassinitialbegin wait(async_fifo_inf.end_of_sim); $display("no of emptys = %d", async_fifo_tb_program_U.async_fifo_tb_env_o.async_fifo_checker_o.no_of_fifo_empty); $display("no of fulls = %d", async_fifo_tb_program_U.async_fifo_tb_env_o.async_fifo_checker_o.no_of_fifo_full); $display("no of fulls and empties= %d", async_fifo_tb_program_U.async_fifo_tb_env_o.async_fifo_checker_o.no_of_fifo_empty_full); wait(1'b0);end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -