报错信息:
Error-[IND] Identifier not declared
/........./test_cfg.sv, 470
Identifier "i" has not been declared yet. If this error is not expected,
please checke if you have set 'default_nettype' to none.
报错源码:
foreach(sgl_list[i][j]) begin
`uvm_info("[test_cfg][post_randomize]", $sformatf(sgl_list[%h][%h]] is %h, i, j ,sgl_list[i][j]), UVM_LOW)
end
解决办法:fearch能识别的二维数组格式为sgl_list[i,j],所以应修改为
foreach(sgl_list[i,j]) begin
`uvm_info("[test_cfg][post_randomize]", $sformatf(sgl_list[%h][%h]] is %h, i, j ,sgl_list[i][j]), UVM_LOW)
end
注意,UVM 不能识别该二维数组格式(sgl_list[i,j]), 仅能识别sgl_list[i][j].
若误改为:
foreach(sgl_list[i,j]) begin
`uvm_info("[test_cfg][post_randomize]", $sformatf(sgl_list[%h][%h]] is %h, i, j ,sgl_list[i,j]), UVM_LOW)
end
该行会报错syntax error