From b403da8f02c1e7e18d82b2376bf3af4cff3be8c0 Mon Sep 17 00:00:00 2001 From: VarshaAnand2402 <35148324+VarshaAnand2402@users.noreply.github.com> Date: Sat, 25 Jul 2020 20:26:10 +0100 Subject: [PATCH] Update fifo_input_mon.sv Updated to send transactions to mailbox only when there is a read or a write --- SVA_and_coverage/fifo_input_mon.sv | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/SVA_and_coverage/fifo_input_mon.sv b/SVA_and_coverage/fifo_input_mon.sv index 3ee9d70..c553901 100644 --- a/SVA_and_coverage/fifo_input_mon.sv +++ b/SVA_and_coverage/fifo_input_mon.sv @@ -28,12 +28,24 @@ class fifo_input_mon; trans = new(); @(posedge fifo_vif.clk); - trans.wr_en = fifo_vif.wr_en; - trans.data_in = fifo_vif.data_in; - trans.rd_en = fifo_vif.rd_en; - $display("\tINPUT MONITOR::sample() : Transaction info: wr_en = %0d, rd_en = %0d, data_in=%0d\n",trans.wr_en,trans.rd_en,trans.data_in); - @(posedge fifo_vif.clk); - in_mon2sb.put(trans); + if (!fifo_vif.rstN) begin + fork + begin + if (fifo_vif.wr_en == 1) + trans.wr_en = fifo_vif.wr_en; + trans.data_in = fifo_vif.data_in; + $display("\tINPUT MONITOR::sample() : Write detected, updating mailbox to send to scoreboard. Transaction info: wr_en = %0d, rd_en = %0d, data_in=%0d\n",trans.wr_en,trans.rd_en,trans.data_in); + in_mon2sb.put(trans); + end + begin + if (fifo_vif.rd_en == 1) + trans.rd_en = fifo_vif.rd_en; + $display("\tINPUT MONITOR::sample() : Read detected, updating mailbox to send to scoreboard.Transaction info: wr_en = %0d, rd_en = %0d, data_in=%0d\n",trans.wr_en,trans.rd_en,trans.data_in); + in_mon2sb.put(trans); + end + join_none + end + end endtask endclass