Origen-SDK / origen_sim

Plugin to enable Origen patterns to be run in a dynamic Verilog simulation
MIT License
1 stars 4 forks source link

OrigenSim documentation feedback #53

Closed jiangliu23 closed 2 years ago

jiangliu23 commented 2 years ago

The error handling description from the OrigenSim's website is incorrect, OrigenSim would not fail if the user does the following, but according to the documentation they should:

Origen.log.error "This is some message"
Origen.log.error "This is an ERROR message"
Origen.log.info "This is an ERROR message"

The way that seems to trigger OrigenSim failure is through the use of OrigenSim.error method and not neccesarily related to what the content of the log output is. Please help update the OrigenSim website to document how users should be logging simulation errors and how OrigenSim handles different types of ERROR messages.

from OrigenSim web documentation:

"By default, OrigenSim will automatically suppress all simulator log output except for any lines that contain the text WARNING or ERROR (case insensitive); both of these will be logged to the console and any occurrences of the latter will also make the result of the simulation be classed as a FAIL."

ginty commented 2 years ago

The way it works currently is the way it is intended to work, the key part of the documentation you quote is "...suppress all simulator log output...".

So OrigenSim monitors log ouput produced by the simulator and if it is logging errors then it will cause the simulation to be considered a failure.

The Origen log is not monitored in the same way, which is consistent with how Origen works in general - sending output to the error log does not automatically mean that any operation is considered a failure currently.

If you want to induce a failure from Origen application code then the way to do it currently is either to raise a Ruby error, or allow it to continue but fail at the end of the simulation by using OrigenSim.error which is documented here - https://origen-sdk.org/origen/guides/simulation/patterns/#Creating_Simulation-Only_Assertions

The way you thought it should work could of course be added, but that is potentially a breaking change that would need to be more widely discussed.

jiangliu23 commented 2 years ago

Thanks for the explanation.