From fa1e516c7082f98ba7712543b026bdf0bd94ba55 Mon Sep 17 00:00:00 2001 From: Pooja Das Date: Thu, 9 May 2024 05:38:12 +0100 Subject: [PATCH] new seq_lib file --- axi_seq_lib.sv | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 axi_seq_lib.sv diff --git a/axi_seq_lib.sv b/axi_seq_lib.sv new file mode 100644 index 0000000..15c043e --- /dev/null +++ b/axi_seq_lib.sv @@ -0,0 +1,43 @@ +//base sequence : things common to all sequence +class axi_base_seq extends uvm_sequence #(axi_tx); +uvm_phase phase; +`uvm_object_utils(axi_base_seq) +`NEW_OBJ +task pre_body(); + //raise objection + phase = get_starting_phase(); + if (phase !=null) begin + phase.raise_objection(this); + phase.phase_done.set_drain_time(this,100); + end +endtask +task post_body(); + //drop objection + if (phase !=null) begin + phase.drop_objection(this); + end +endtask +endclass + +//functional sequence: things specific to current sequence +class axi_wr_rd_seq extends axi_base_seq; +axi_tx tx; +axi_tx txQ[$]; +`uvm_object_utils(axi_wr_rd_seq) +`NEW_OBJ +task body(); +//write/read to same loc +repeat(1) begin + `uvm_do_with (req, {req.wr_rd==1;}); + tx = new req; //shallow copy + txQ.push_back(tx); +end +//read_tx +repeat(1) begin + tx = txQ.pop_front(); + `uvm_do_with (req, {req.wr_rd==0; req.burst_len ==tx.burst_len; req.addr == tx.addr;}); +end +endtask +endclass + +