In reply to Imane EL:
Hello Dave
First of all ,I would like to thank you for your response . I am a newbie to UVM and systemverilog, so please be patient with me :). I will need some spoon feeding.
I have changed the testbench and write the original version (taken from the book )and modify only what i have to modify depending on my circuit,you will find it below.still I have a fatal error but not like the previous one :
"# UVM_FATAL @ 0: reporter [INVTST] Requested test from call to run_test(lpi_basic_test) not found.
"
and with warning :
"# UVM_WARNING @ 0: reporter [BDTYP] Cannot create a component of type ‘lpi_basic_test’ because it is not registered with the factory.
".
So I had to search for how to parametrize a class,then I find out that “lpi top environment.sv” should be parametrized then I can pass the arguments to “lpi_basic_test”
(please correct me if I’m wrong ).However,I don’t fully understand (I have watched your videos and read some papers)if this is the problem ,if so how to derive it and what should I derive ?
I have included this line in “lpi_top_env.sv”
class lpi_top_env extends uvm_env;
typedef uvm_component_registry #(lpi_env, "lpi_env") type_id;
//`uvm_component_utils(lpi_top_env)
// rest of the code
and it is constructed in “lpi_basic_test”
//....code
// Build Phase
function void build_phase(uvm_phase phase);
super.build_phase(phase);
m_lpi_top_env= lpi_top_env::type_id::create("m_lpi_top_env",this);
//...code
please have a look to my code above
thank you
***lpi_testbench.sv
`include "uvm_macros.svh"
`default_nettype wire
module lpi_testbench();
import uvm_pkg::*;
reg lpi_dut_clk;
reg dut_rst_n;
//Interface
lpi_if lpi_dut_if (.lpi_clk(lpi_dut_clk));
//set lpi_if to config DB
initial
begin
uvm_config_db#(virtual lpi_if)::set(null, "", "lpi_vif",lpi_dut_if);
end
lpi dut_lpi(
.clk(lpi_dut_clk),
.rst_n(dut_rst_n),
.a(lpi_dut_if.a),
.b(lpi_dut_if.b),
.sum(lpi_dut_if.sum)
);
initial
begin
lpi_dut_clk = 0;
dut_rst_n = 0;
#1000ns;
dut_rst_n = 1;
end
always
begin
#10ns lpi_dut_clk = ~lpi_dut_clk;
end
initial
begin
#0; run_test("lpi_basic_test");
end
endmodule