Hello,
I am having an unexpected behaviour when adding a Delay in my driver or in the sequence. After writing to a register i have to wait some time, i have tried adding a delay in my sequence after writing to the register, but the test hang at this point. I tried to add the delay in the driver before driving the stimulus so i would be waiting sometime before any write(waiting the last one to complete), but the test hangs at this point too.
Additionally i tried to add a second write to the same register just to add some delay, but the test hangs in the driver while waiting for the next clock cycle.
Like i am just debugging this issue and my DUT is not configured so it cannot received any stimulus, my test finishes right away after writing this register(if i don’t include any delay) and i am not able to see this write in my waveform, so i decided to include a Delay in my test run_phase before dropping the objection, but again it hangs at this point.
I have this same test bench fully working with a different register interface, i just made a copy of the functional tb and created a new UVC for the new register interface.
This is part of my virtual sequence:
class serdes_virtual_base_sequence extends uvm_sequence;
`uvm_object_utils(serdes_virtual_base_sequence)
virtual task body();
h_chip_config = p_sequencer.h_chip_config;
h_ds_config = p_sequencer.h_ds_config;
config_reg();
//config_cs();
//config_ds();
//generate_stimulus();
endtask : body
//------------------------------------------------
virtual task config_reg();
`uvm_do_on_with(h_reg_write_seq,p_sequencer.h_reg_sequencer,{h_reg_write_seq.reg_addr_l == `SERDES_CNTRL_ADDR; h_reg_write_seq.reg_be_l == `SERDES_CNTRL_BE; h_reg_write_seq.reg_write_data_l == {29'h0, 3'b000};})
`uvm_do_on_with(h_reg_write_seq,p_sequencer.h_reg_sequencer,{h_reg_write_seq.reg_addr_l == `TXEN_ADDR; h_reg_write_seq.reg_be_l == `TXEN_BE; h_reg_write_seq.reg_write_data_l == {25'h0, 7'h40};})
**#100** //when adding this delay the test hangs
//if i add this second write to this register or any other write or read the test hangs in the driver waiting for the next clock
//**`uvm_do_on_with(h_reg_write_seq,p_sequencer.h_reg_sequencer,{h_reg_write_seq.reg_addr_l == `TXEN_ADDR; h_reg_write_seq.reg_be_l == `TXEN_BE; h_reg_write_seq.reg_write_data_l == {25'h0, 7'h40};})**
endtask // config_reg
//------------------------------------------------
endclass : serdes_virtual_base_sequence
This is part of the driver:
class reg_driver #(int ADDR_WIDTH = 14, int DATA_WIDTH = 32) extends uvm_driver #(reg_seq_item #(ADDR_WIDTH, DATA_WIDTH));
`uvm_component_param_utils(reg_driver#(ADDR_WIDTH, DATA_WIDTH))
//------------------------------------------
virtual task run_phase(uvm_phase phase);
reset_dut_inputs();
forever begin
seq_item_port.get_next_item(req);
drive_transfer(req);
seq_item_port.item_done();
end
endtask : run_phase
//------------------------------------------------
virtual task drive_transfer(reg_seq_item#(ADDR_WIDTH, DATA_WIDTH) seq_item);
#100 **//when include this delay the test hangs here**
set_dut_inputs(seq_item);
populate_and_send_response_for_read_txn(seq_item);
endtask : drive_transfer
//------------------------------------------------
virtual task set_dut_inputs (reg_seq_item #(ADDR_WIDTH, DATA_WIDTH) seq_item);
@(vif.dr_cb); **//when trying to write an additional register the test hangs here**
#(h_reg_agent_config.pclk_period*0.1);
vif.dr_cb.reg_write <= seq_item.reg_write;
vif.dr_cb.reg_read <= seq_item.reg_read;
vif.dr_cb.reg_addr <= seq_item.reg_addr;
vif.dr_cb.reg_be <= seq_item.reg_be;
vif.dr_cb.reg_write_data <= seq_item.reg_write_data;
endtask : set_dut_inputs
//------------------------------------------------
endclass : reg_driver
Can anyone please give an idea why this is happening and how to debug the problem?
Thank you