| @@ -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 | |||||