How To: Tune DSim Messaging
DSim allows you to control the severity and the maximum count of messages during the compilation and/or simulation. Even when there are no error messages, it is good practice to review all warning messages. You can filter messages and debug your simulation by tuning DSim messaging.
The following command-line options can be passed as arguments to the DSim Cloud CLI (mdc) commands
mdc dsim
mdc dvlcom
mdc dvhcom
See DSim Cloud CLI simulator commands for details. They can be used individually or together to tune DSim messaging.
Tuning Severity
You can tune DSim messaging to satisfy your needs. One strategy to achieve this is:
-
Start your debugging activity from the strict mode, where the bulk of exceptions is flagged as an error.
-
Vet the flagged errors, and determine error-by-error whether they should be demoted to a warning, informational note, or suppressed entirely.
1. Enable the strict mode
To enable the strict mode, use the option
-error warning
which will promote all warnings to errors.
2. Demote a specific error to a warning while in the strict mode
For instance, if you determined that the
=E:[Array] Assignment to static array of different size
error should be demoted to a warning, use the option
-error warning -warn Array
which will promote all warnings to errors and demote any Array
error to a warning.
3. Demote a specific error to a note while in the strict mode
For instance, if you determined that the
=E:[Queue] test.sv:100: assignment to invalid index
error should be demoted to an informational note, use the option
-error warning -info Queue
which will promote all warnings to errors and demote any Queue
error to an informational note.
4. Suppress a specific error while in the strict mode
For instance, if you determined that the
=E:[$warning call] test.sv:200: from top @ 10
error should be suppressed, use the option
-error warning -suppress '$warning call'
which will promote all warnings to errors and suppress all $warning call
errors.
5. Combine message demotions
Once you are done with vetting the flagged errors, you may combine all the desired demotions together. For instance, the previous demotions may be combined together using the option
-error warning -warn Array -info Queue -suppress '$warning call'
For more information on these options, see the Controlling Error Messaging section of User Guide: DSim Common Options.
Setting Max Count of Errors
You can set a maximum count of errors by using the following option
-exit-on-error n
where n
shall be a positive integer. The simulation will be terminated once the count of run-time errors reaches the n
threshold. For instance, if you wish to terminate the simulation after 10 errors, use the option
-exit-on-error 10
Once the count of run-time errors reaches 10, you will get a fatal error
=F:[LimitReached]: The message limit has been reached 10 errors have been found
By default, this capability is not enabled.
This option is available as an argument to the mdc dsim command during run-time of the simulation. See the Error Message Limits section of User Guide: DSim Common Options for more information.
Further Debugging
In addition to the above options to tune DSim messaging, you can debug your simulation using the -debug-verbose
option. See the Debugging section of User Guide: DSim Common Options for more information.
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article