7. uvm
7. uvm
INTRODUCTION
apb_agent m_apb_agent;
uart_agent m_uart_agent;
uart_env_config m_cfg;
uart_scoreboard m_scoreboard;
uart_virtual_sequence m_v_sqr;
…
endclass
TESTBENCH ARCHITECTURE
Example(3)
class apb_agent extends uvm_agent;
`uvm_component_utils(apb_agent)
apb_driver m_driver;
apb_monitor m_monitor;
apb_sequencer m_sequencer;
apb_agent_config m_cfg;
//interface
virtual apb_if APB;
//config apb agent
apb_agent_config m_cfg;
//interface
virtual apb_if APB;
//config apb agent
apb_agent_config m_cfg;
…
endclass
UVM CLASS LIBRARY
Example(3)
class apb_sequencer extends uvm_sequencer #(apb_seq_item);
`uvm_component_utils(apb_sequencer)
…
endclass
UVM_COMPONENT PHASE
Overview
UVM_COMPONENT PHASE
Component phase description(1)
endclass
UVM_COMPONENT PHASE
Example(3)
class apb_driver extends uvm_driver #(apb_seq_item);
…
function void build_phase(uvm_phase phase);
…
endfunction
endclass
TESTBENCH MODULE
Overview
//instance interface
apb_if APB(pclk, presetn);
uart_if UART();
//instance DUT
uart_top dut(.pclk(pclk),
.presetn(presetn),
.penable(APB.PENBLE),
…);
TESTBENH MODULE
Example(2)
initial begin //run testcase
run_test();
$finish;
end
endmodule
TESTBENCH MODULE
Example(3)
logic PWRITE;
logic PENABLE;
logic [15:0] PSEL;
logic [PADDR_WIDTH -1:0] PADDR;
logic [PWDATA_WIDTH-1:0] PWDATA;
logic [PRDATA_WIDTH-1:0] PRDATA;
endinterface
COMPILE AND SIMULATION
Overview
◼ Example
UVM REPORT
Controlling message verbosity
◼ UVM defines verbosity: UVM_NONE, UVM_LOW,
UVM_MEDIUM, UVM_HIGH, UVM_FULL,
UVM_DEBUG