UVM predictor takes too long to update from monitor bus

To solve the problem I observed, where the separate threads of the read/write and external predict could execute in orders that cause the bit bash to fail, I created a callback which I attached to a field within each register. The callback synchronized between the post_write / post_read and the post_predict. To attach the callback, I created a basic function that looped through the registers and attached the callback to one field in each register.

This may not work for all forms of register behaviour, but it seem to solve the observed problem by making the register model behave in a similar way that the model operates when auto_predict is used. Please if anybody knows of a more appropriate solution, then please reply to the thread.


  //----------------------------------------------------------------------------
  // pre_read
  //------------------------------------------------------------------
  virtual task pre_read (uvm_reg_item rw);
    if (rw.path == UVM_FRONTDOOR)
    begin
      m_waiting_on_ext_predict.put();
    end
  endtask : pre_read

  //----------------------------------------------------------------------------
  // pre_write
  //------------------------------------------------------------------
  virtual task pre_write (uvm_reg_item rw);
    if (rw.path == UVM_FRONTDOOR)
    begin
      m_waiting_on_ext_predict.put();
    end
  endtask : pre_write

  //----------------------------------------------------------------------------
  // post_read
  //------------------------------------------------------------------
  virtual task post_read (uvm_reg_item rw);
    if (rw.path == UVM_FRONTDOOR)
    begin
      m_ext_predict_done.get();
    end
  endtask : post_read

  //----------------------------------------------------------------------------
  // post_write
  //------------------------------------------------------------------
  virtual task post_write (uvm_reg_item rw);
    if (rw.path == UVM_FRONTDOOR)
    begin
      m_ext_predict_done.get();
    end
  endtask : post_write

  //----------------------------------------------------------------------------
  // post_predict
  //------------------------------------------------------------------
  virtual function void post_predict (input uvm_reg_field fld,
                                      input uvm_reg_data_t previous,
                                      inout uvm_reg_data_t value,
                                      input uvm_predict_e kind,
                                      input uvm_path_e path,
                                      input uvm_reg_map map);
    if (m_waiting_on_ext_predict.try_get())
    begin
      m_ext_predict_done.put();
    end

  endfunction : post_predict