You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Once the ebreak instruction executes, an exception is raised and the processor will change control flow to the MTVEC address 0x1010.
I have use an STF_FORCE_PC record to describe this change of control flow.
There are a few things in the spec which are not clear to me:
From the "Terminology / Definitions" section of the spec:
COF is logged in the trace using the STF_INST_PC_TARGET record for deterministic and with STF_FORCE_PC, STF_INST_EXCEPTION_PC_TARGET and STF_EVENT_PC_TARGET for non-deterministic cases.
...
Non-deterministic COF cases: These COF cases happen due to interruptions in a program thread due to exceptions being raised either by the program thread context itself or due to external interruptions.
This makes it seem like STF_FORCE_PC can be used to describe this.
I cant find any other mention of the STF_INST_EXCEPTION_PC_TARGET or STF_EVENT_PC_TARGET records, are they from an older version?
My STF file seems to parse okay through the stf_dump utility, however stf_check is less happy with this:
stf_check -n trace.stf
...
stf_check: ERROR PC_DISCONTINUITY: PC discontinuity found between instruction #4 and 5 first pc value: 000000000000100c second pc value: 0000000000001010
This is also the preferred method for recording execution mode changes that aren't caused by an exception (e.g. ecall/sret/mret/etc.), but in this case the EventRecord should have a type of STF_EVENT_MODE_CHANGE.
I am looking for some clarification with regards to recording exception handling.
I am running the following test program, and trying to produce an STF trace file when executing it:
Currently I produce the following STF records for the program (HRG isn't shown):
Once the
ebreak
instruction executes, an exception is raised and the processor will change control flow to the MTVEC address 0x1010.I have use an
STF_FORCE_PC
record to describe this change of control flow.There are a few things in the spec which are not clear to me:
From the "Terminology / Definitions" section of the spec:
This makes it seem like
STF_FORCE_PC
can be used to describe this.I cant find any other mention of the
STF_INST_EXCEPTION_PC_TARGET
orSTF_EVENT_PC_TARGET
records, are they from an older version?My STF file seems to parse okay through the
stf_dump
utility, howeverstf_check
is less happy with this:The
stf_check
tool doesn't seems to take into account anSTF_FORCE_PC
record during itsvalid_jump
check here: https://github.com/sparcians/stf_tools/blob/ddbdc3598bdcec9e5136f16531a8e29a88b94af4/tools/stf_check/stf_check.cpp#L317Only events seem to be factored in here, is there just a missing piece of logic here, or is my approach just wrong?
Attached is a .zip version of my
trace.stf
file used in this issue:trace.zip
Your help would be appreciated, thanks!
The text was updated successfully, but these errors were encountered: