Files
axipg/tb/tb_env.sv
Mahesh Asolkar 800e9c4008 Initial commit
* Bare skeleton implementation of everything
* Testbench builds with Verilator
* Test runs
2025-08-23 14:34:23 -07:00

41 lines
1.5 KiB
Systemverilog

// Testbench environment for UVM-based verification
class tb_env extends uvm_env;
axi_agent axi_m;
axi_agent axi_s;
`uvm_component_utils(tb_env)
// ------------------------------------------------------------
function new(string name, uvm_component parent);
super.new(name, parent);
endfunction
// ------------------------------------------------------------
virtual function void build_phase(uvm_phase phase);
axi_m = axi_agent::type_id::create("axi_m", this);
axi_s = axi_agent::type_id::create("axi_s", this);
`uvm_info("tb_env", $sformatf("Building testbench environment: %s", get_full_name()), UVM_LOW)
// Set agent types in AXI agents
axi_m.set_agent_type(MANAGER);
axi_s.set_agent_type(SUBORDINATE);
endfunction
// ------------------------------------------------------------
virtual function void connect_phase(uvm_phase phase);
`uvm_info("tb_env", $sformatf("Connecting testbench environment: %s", get_full_name()), UVM_LOW)
endfunction
// ------------------------------------------------------------
virtual function void report_phase(uvm_phase phase);
`uvm_info("tb_env", $sformatf("Reporting for testbench environment: %s", get_full_name()), UVM_LOW)
// Add any specific report phase tasks here
endfunction
// ------------------------------------------------------------
function uvm_sequencer_base get_axi_m_sequencer();
return axi_m.sequencer;
endfunction
endclass : tb_env