"UVM driver" is a component that interfaces between the testbench and the design under test (DUT) to drive stimulus to the DUT's input ports and capture its output responses. The driver is responsible for converting high-level transactions from the testbench into appropriate signal-level stimuli to exercise the DUT during the verification process.
Task/Function | Description |
---|---|
build_phase | The driver's build phase task to set up resources and connections. |
connect_phase | The driver's connect phase task to connect to the DUT's interface. |
run_phase | The driver's run phase task where the primary stimulus generation and response handling take place. |
drive_item | A function/task to drive a transaction item (sequence item) to the DUT's input ports. |
get_response | A function/task to capture and retrieve the DUT's response from its output ports. |
wait_for_completion | A function/task to wait for the DUT to complete processing the current transaction. |
report_phase | The driver's report phase task where the driver can generate reports and logs. |
// Filename : basic_driver.sv class basic_driver extends uvm_driver #(basic_transaction); `uvm_component_utils(basic_driver) extern function new(string name, uvm_component parent); extern virtual function void build_phase(uvm_phase phase); extern virtual function void connect_phase(uvm_phase phase); extern virtual function void end_of_elaboration_phase(uvm_phase phase); extern virtual function void start_of_simulation_phase(uvm_phase phase); extern virtual task main_phase(uvm_phase phase); extern virtual function void extract_phase(uvm_phase phase); extern virtual function void check_phase(uvm_phase phase); extern virtual function void report_phase(uvm_phase phase); extern virtual function void final_phase(uvm_phase phase); endclass //------------------------------------------------------------------// function basic_driver::new(string name, uvm_component parent); super.new(name, parent); endfunction: new //------------------------------------------------------------------// function void basic_driver::build_phase(uvm_phase phase); super.build_phase(phase); endfunction: build_phase //------------------------------------------------------------------// function void basic_driver::connect_phase(uvm_phase phase); super.connect_phase(phase); endfunction: connect_phase //------------------------------------------------------------------// function void basic_driver::end_of_elaboration_phase(uvm_phase phase); super.end_of_elaboration_phase(phase); endfunction: end_of_elaboration_phase //------------------------------------------------------------------// function void basic_driver::start_of_simulation_phase(uvm_phase phase); super.start_of_simulation_phase(phase); endfunction: start_of_simulation_phase //------------------------------------------------------------------// task basic_driver::main_phase(uvm_phase phase); super.main_phase(phase); phase.raise_objection(this); phase.drop_objection(this); endtask: main_phase //------------------------------------------------------------------// function void basic_driver::extract_phase(uvm_phase phase); super.extract_phase(phase); endfunction: extract_phase //------------------------------------------------------------------// function void basic_driver::check_phase(uvm_phase phase); super.check_phase(phase); endfunction: check_phase //------------------------------------------------------------------// function void basic_driver::report_phase(uvm_phase phase); super.report_phase(phase); endfunction: report_phase //------------------------------------------------------------------// function void basic_driver::final_phase(uvm_phase phase); super.final_phase(phase); endfunction: final_phase