|
OVM Env Example :
`ifndef __MEM_ENV__
`define __MEM_ENV__
class mem_env extends ovm_env;
protected virtual interface mem_if m_if ;
mem_master_monitor m_monitor;
mem_master_sequencer m_sequencer;
mem_master_driver m_driver;
`ovm_component_utils_begin(mem_env)
`ovm_component_utils_end
// new - constructor
function new(string name, ovm_component parent);
super.new(name, parent);
endfunction : new
// Function to assign the virtual intf for all components in this env
function void assign_vi(virtual interface mem_if mif);
$display ("INSIDE ASSIGN MEM_ENV \n");
m_if = mif ;
if( m_monitor != null) begin
m_monitor.assign_vi(mif);
end
m_sequencer.assign_vi(mif);
m_driver.assign_vi(mif);
endfunction : assign_vi
function void build();
string inst_name;
super.build();
$display ("INSIDE ASSIGN BUI:D \n");
m_monitor = mem_master_monitor::type_id::create("m_monitor", this);
$display ("INSIDE ASSIGN BUI:D 1 \n");
m_driver = mem_master_driver::type_id::create("m_driver", this);
$display ("INSIDE ASSIGN BUI:D 2 \n");
m_sequencer = mem_master_sequencer::type_id::create("m_sequencer", this);
//m_monitor = new ("m_monitor", this);
//m_driver = new ("m_driver", this);
//m_sequencer = new ("m_sequencer", this);
$display ("OUT NOW ASSIGN BUI:D \n");
endfunction : build
endclass : mem_env
`endif //__MEM_ENV__
|
|
This Articles is written/submitted by puneet (Puneet Aggarwal). You can also contribute to Asicguru.com. Click here to start
|
Prev << OVM Env
|
Next >> Dut Interface
|