Hi,
I am trying to use $system task to do some grep operations on run log file. So when I run the test, everything gets dumped in the run log. At the end of the test, I want to grep the run log for some errors, e.g errors from some vendor models. My code is as below, I am using mentor simulator version: 10.7c_2_64.
The issue I see is that sometimes the grep works fine but sometime it does not. Even though the text ‘ERROR:’ is in the log, I will see model_err.txt has 0 in it. This causes no error to flag even though there is modeling error.
Also I am 100% sure that the grepping happens after the text ‘ERROR:’ is in the log. There is a 19us gap between the error and the error checking.
Please let me know if any insights.
int fp, model_err;
$system("grep -c 'ERROR:' run.log > model_err.txt"); ----- > prints the number of times 'ERROR:' is in the log
fp = $fopen("model_err.txt","r");
$fscanf(fp, "%d", model_err);
$fclose(fp);
if(model_err) `uvm_error("MODEL_ERR", "Error from vendor model")
Thanks.