| @@ -0,0 +1,22 @@ | |||||
| class axi_agent extends uvm_agent; | |||||
| axi_drv drv; | |||||
| axi_sqr sqr; | |||||
| axi_mon mon; | |||||
| axi_cov cov; | |||||
| `uvm_component_utils_begin(axi_agent)// factory registration | |||||
| `NEW_COMP | |||||
| function void build_phase(uvm_phase phase); | |||||
| super.build_phase(phase); | |||||
| mon = axi_mon::type_id::create("mon", this); | |||||
| drv =axi_drv::type_id::create("drv", this);// creating from factory | |||||
| sqr = axi_sqr::type_id::create("sqr", this); | |||||
| cov = axi_cov::type_id::create("cov", this); | |||||
| end | |||||
| endfunction | |||||
| function void connect_phase(uvm_phase phase); | |||||
| drv.seq_item_port.connect(sqr.seq_item_export); | |||||
| mon.ap_port.connect(cov.analysis_export); | |||||
| end | |||||
| endfunction | |||||
| endclass | |||||
| @@ -0,0 +1,12 @@ | |||||
| class axi_env extends uvm_env; | |||||
| axi_agent magent; | |||||
| `uvm_component_utils(axi_env);// factory registration | |||||
| `NEW_COMP | |||||
| function void build_phase(uvm_phase phase); | |||||
| super.build_phase(phase); | |||||
| magent = axi_agent::type_id::create("magent", this); | |||||
| uvm_config_db#(int)::set(this, "magent", "mst_slv_f", `MSTR); | |||||
| endfunction | |||||
| endclass | |||||
| @@ -0,0 +1,41 @@ | |||||
| `include "uvm_pkg.sv" | |||||
| import uvm_pkg ::*; | |||||
| `include "uvm_macros.svh" | |||||
| `define WIDTH 32 | |||||
| `define DEPTH 64 | |||||
| `define ADDR_WIDTH $clog2(`DEPTH) | |||||
| `include "axi_tx.sv" | |||||
| `include "axi_seq_lib.sv" | |||||
| `include "axi_sqr.sv" | |||||
| `include "axi_drv.sv" | |||||
| `include "axi_mon.sv" | |||||
| `include "axi_cov.sv" | |||||
| `include "axi_agent.sv" | |||||
| `include "axi_env.sv" | |||||
| module top; | |||||
| reg clk, rst; | |||||
| axi_intf pif(clk,rst); | |||||
| axi_env env = new(); | |||||
| initial begin | |||||
| clk = 0; | |||||
| forever #5 clk = ~clk; | |||||
| end | |||||
| initial begin | |||||
| rst = 1; | |||||
| repeat(2) @(posedge clk); | |||||
| rst = 0; | |||||
| // #1000; | |||||
| // $finish; | |||||
| end | |||||
| initial begin | |||||
| run_test("axi_wr_rd_test"); | |||||
| end | |||||
| //initial begin | |||||
| // $dumpvars(); | |||||
| // $dumpfile("1.vcd"); | |||||
| //end | |||||
| endmodule | |||||