Given the following code, located in the run_phase of a uvm_driver:
task get_and_drive();
seq_item_port.get_next_item(trans);
$display("DRIVER ISSUE: %p @%t", trans, $time);
while(credits.is_available() == 0) begin
@(vif.cb);
end
`uvm_info(get_type_name(), trans.sprint(), UVM_DEBUG)
if (trans.valid == 1)
credits.consume();
vif.cb.valid <= trans.valid;
vif.cb.instr <= trans.instr;
vif.cb.data <= trans.data;
vif.cb.sb_id <= trans.sb_id;
vif.cb.csr <= trans.csr;
test_valid = trans.valid
$display("DRIVER ISSUE TEST VALID: %0d @%t", test_valid, $time);
seq_item_port.item_done();
@(vif.cb);
vif.cb.valid <= 1'b0;
test_valid = 0;
$display("DRIVER ISSUE TEST VALID2: %0d @%t", test_valid, $time);
trans = null;
endtask : get_and_drive
I would expect an output like:
# DRIVER ISSUE: '{m_leaf_name:"m_req", m_inst_id:3358, use_uvm_seeding:1, m_inst_count:3369, __m_uvm_status_container:@uvm_status_container@1, uvm_global_copy_map:'{ }, events:@uvm_object_string_pool__2@331, begin_event:@uvm_event__1@173, end_event:@uvm_event__1@174, m_transaction_id:8, begin_time:320000, end_time:18446744073709551615, accept_time:18446744073709551615, initiator:null, stream_handle:null, tr_recorder:null, m_sequence_id:8, m_use_sequence_info:1, m_depth:3, m_sequencer:@avispado_issue_sequencer@1, m_parent_sequence:@spike_seq@1, print_sequence_info:0, issued1:0, issued2:0, valid:1, instr:1577239255, data:1, sb_id:5, csr:139588599808, type_name:"avispado_issue_trans"} @320000
# DRIVER ISSUE TEST VALID: 1 @320000
# DRIVER ISSUE TEST VALID2: 0 @340000
But what I get is:
# DRIVER ISSUE: '{m_leaf_name:"m_req", m_inst_id:3358, use_uvm_seeding:1, m_inst_count:3369, __m_uvm_status_container:@uvm_status_container@1, uvm_global_copy_map:'{ }, events:@uvm_object_string_pool__2@331, begin_event:@uvm_event__1@173, end_event:@uvm_event__1@174, m_transaction_id:8, begin_time:320000, end_time:18446744073709551615, accept_time:18446744073709551615, initiator:null, stream_handle:null, tr_recorder:null, m_sequence_id:8, m_use_sequence_info:1, m_depth:3, m_sequencer:@avispado_issue_sequencer@1, m_parent_sequence:@spike_seq@1, print_sequence_info:0, issued1:0, issued2:0, valid:1, instr:1577239255, data:1, sb_id:5, csr:139588599808, type_name:"avispado_issue_trans"} @320000
# DRIVER ISSUE TEST VALID: 1 @320000
# DRIVER ISSUE TEST VALID2: 0 @320000
Instead if we do the following modification in the code:
$display("DRIVER ISSUE TEST VALID: %0d @%t", test_valid, $time);
seq_item_port.item_done();
@(vif.cb);
@(vif.cb);
vif.cb.valid <= 1'b0;
test_valid = 0;
$display("DRIVER ISSUE TEST VALID2: %0d @%t", test_valid, $time);
Note the second @(vif.cb)
The output generated is the following:
# DRIVER ISSUE: '{m_leaf_name:"m_req", m_inst_id:3358, use_uvm_seeding:1, m_inst_count:3369, __m_uvm_status_container:@uvm_status_container@1, uvm_global_copy_map:'{ }, events:@uvm_object_string_pool__2@331, begin_event:@uvm_event__1@173, end_event:@uvm_event__1@174, m_transaction_id:8, begin_time:320000, end_time:18446744073709551615, accept_time:18446744073709551615, initiator:null, stream_handle:null, tr_recorder:null, m_sequence_id:8, m_use_sequence_info:1, m_depth:3, m_sequencer:@avispado_issue_sequencer@1, m_parent_sequence:@spike_seq@1, print_sequence_info:0, issued1:0, issued2:0, valid:1, instr:1577239255, data:1, sb_id:5, csr:139588599808, type_name:"avispado_issue_trans"} @320000
# DRIVER ISSUE TEST VALID: 1 @320000
# DRIVER ISSUE TEST VALID2: 0 @360000
Do you have any hint on why the time with one @(vif.cb) do not advance but if we put two @(vif.cb) it does it twice ?
Thanks.
Salut!