Pre-processing before UVM_TIMEOUT

I’m using UVM_TIMEOUT=value in my sim command line to stop the sim after some time. Simulator will fail out and complain with an uvm_fatal message. Is there a way to force UVM to call a pre-processing function right before the uvm_fatal is called, so that I can parse the current sim environment situation and to print out some report?

Thanks,
Richard

In reply to hctseng:

You can use uvm_report_catcher. There are a number of example here or elsewhere you can search for.

In reply to dave_59:

Thanks Dave. I finally got it work, but there is a lot of code changes involved for UVM_TIMEOUT. I’m not sure if that is worth it. Also the function, “uvm_report_cb::add_by_name()” does not seem to work. Is this function really supported by UVM?

Would people usually fork off a thread to implement the watchdog timer? That seems to be a lot easier. I thought since UVM already provide the UVM_TIMEOUT, we should reuse that instead of creating our own process.

Richard

In reply to hctseng:

You need to be more specific about what you are trying to accomplish. +UVM_TIMEOUT is just safety switch to prevent run-away simulations. A watchdog timer is periodically reset after some event. Perhaps you may want to generate an error, have the test end, and use the traditional extract/report phases.

In reply to dave_59:

In my sims, I wait for all the sequences have been launched and finished, and then after all scoreboards finish their comparison jobs, then scoreboards will drop objections and terminate the sim.

In many cases, DUT did not operate as expected to generate all outputs, and so scoreboards were waiting for DUT outputs to compare. Eventually TB reached the +UVM_TIMEOUT value and failed out the sim. What I need is when TB raises the UVM_FATAL due to this timeout reason, I’d like to dump out scoreboard queue statuses.

The uvm_report_cb works, but I have to pass the scoreboard handles thru factory to the callback when it catches the UVM_FATAL. It seems to be overkill to handle this kind of error with callback. Since we specify +UVM_TIMEOUT for all sim environments, I don’t want to start another process in TB just for this.

Do you have a suggestion to handle this in a different or a better way?

Thanks,
Richard

In reply to dave_59:

In my sims, I wait for all the sequences have been launched and finished, and then after all scoreboards finish their comparison jobs, then scoreboards will drop objections and terminate the sim.

In many cases, DUT did not operate as expected to generate all outputs, and so scoreboards were waiting for DUT outputs to compare. Eventually TB reached the +UVM_TIMEOUT value and failed out the sim. What I need is when TB raises the UVM_FATAL due to this timeout reason, I’d like to dump out scoreboard queue statuses.

The uvm_report_cb works, but I have to pass the scoreboard handles thru factory to the callback when it catches the UVM_FATAL. It seems to be overkill to handle this kind of error with callback. Since we specify +UVM_TIMEOUT for all sim environments, I don’t want to start another process in TB just for this.

Do you have a suggestion to handle this in a different or a better way?

Thanks,
Richard

In reply to hctseng:

My recommendation is to not have any objections in the scoreboard to prevent the scenario that you are seeing.

Instead, you should end the test when all of your sequences have completed, set the drain_time appropriately to allow all transactions to complete in the DUT, then query the scoreboards to determine if they have accounted for everything that they expected to see.

If the scoreboards haven’t seen all of the expected transactions, they can then generate an error.

In reply to cgales:

Thanks for your input.

Richard