Hi,
I am trying to use uvm_hdl_force to force design signals, however, it doesn’t work. However, force works. I wonder what is the difference between uvm_hdl_force and force except the syntax.
Interestingly, VCS and Incisive give different results on uvm_hdl_force.
For the below example,
VCS output: X
Incisive: Z 1 0 X Z
import uvm_pkg::*;
module tb;
dut dutI();
initial run_test("test1");
initial $monitor($time,,dutI.force_bit);
initial begin
$dumpfile("test.vcd");
$dumpvars(0, tb);
end
`ifdef USE_FORCE
initial begin
force tb.dutI.force_bit = 1;
#1ns;
force tb.dutI.force_bit = 0;
#1ns;
force tb.dutI.force_bit = 'x;
#1ns;
force tb.dutI.force_bit = 'z;
#1ns;
end
`endif
endmodule
class test1 extends uvm_test;
string force_path = "tb.dutI.force_bit";
`uvm_component_utils(test1)
function new(string name, uvm_component parent);
super.new(name,parent);
endfunction
virtual function void start_of_simulation_phase(uvm_phase phase);
super.start_of_simulation_phase(phase);
//uvm_hdl_force force the value of 'z
`ifndef USE_FORCE
uvm_hdl_force(force_path,'z);
`endif
endfunction
virtual task run_phase(uvm_phase phase);
logic val_set[$] = '{1,0,'x,'z};
phase.raise_objection(this);
#1ns;
`ifndef USE_FORCE
foreach(val_set[i]) begin
uvm_hdl_force(force_path,val_set[i]);
#1ns;
end
`endif
#10ns;
phase.drop_objection(this);
endtask
endclass
module dut();
logic[1:0] force_bit;
model modelI(.*);
endmodule
module model(input logic[1:0] force_bit);
parameter ONE = 1;
//initial force force_bit = ONE;
endmodule