connect_phase() 启动时会发生此错误,需要查看组件的所有connect_phases。由于它指向uvm_port_base,检查连接调用的port、export、imp、fifo、analysis_XXX,确保没有空句柄。
思路:
- 检查你的port、export、imp、fifo、analysis_XXX有没有创建。
class XXX_env extends uvm_env;
uvm_tlm_analysis_fifo#(.T(hmac_sha256_item)) fifo;
virtual function void build_phase(uvm_phase phase);
super.build_phase(phase);
begin
/*省略*/
fifo=new("fifo", this);
end
endfunction : build_phase
virtual function void connect_phase(uvm_phase phase);
// TODO Auto-generated function stub
super.connect_phase(phase);
XXX_agent.ap.connect(fifo.analysis_export);
XXX_reference_model.port.connect(fifo.blocking_get_export);
endfunction : connect_phase
endclass : XXX_env
- 调用C/C++的方法时,即使用DPI时,function类型申明不对
sv一侧代码如下:
import "DPI-C" context function int main(input logic[127:0] state_model,
input logic[256:0] key_model);
/*省略*/
class aes_256_refmod extends uvm_component;//参考模型
/*省略*/
task run_phase(uvm_phase phase);
forever begin
in_port.get(tr_in);
tr_in.print();
tr_out.out = main(tr_in.state, tr_in.key);
tr_out.print();
end
endtask : run_phase
···
endclass : aes_256_refmod
c语言一侧代码如下:
#include"svdpi.h"
int main(const svLogicVecVal * state_model, const svLogicVecVal * key_model) {
return 0;
}
- 留坑,遇到问题再说 2021年12月10日