diff --git a/axi_agent.sv b/axi_agent.sv new file mode 100644 index 0000000..628fc80 --- /dev/null +++ b/axi_agent.sv @@ -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 + diff --git a/axi_env.sv b/axi_env.sv new file mode 100644 index 0000000..70654e7 --- /dev/null +++ b/axi_env.sv @@ -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 + + diff --git a/top.sv b/top.sv new file mode 100644 index 0000000..62dbf9d --- /dev/null +++ b/top.sv @@ -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