Hi Muhammad,
On 17 April 2018 at 09:58, Muhammad Abdul WAHAB muhammadabdul.wahab@centralesupelec.fr wrote:
Hi Mike,
Le 17/04/2018 à 10:33, Mike Leach a écrit :
Hi Muhammed,
I have looked at the decoder you indicate - for PTM trace it resolves to individual trace packets, but does not fully decode the trace.
PTM uses program flow trace - that is only trace waypoints result in packets output. Thus not all address values are explicitly traced if they can be deduced from the code. The decoder counts the branches when it sees E/N atoms, but does not resolve them - which can only be done by examination of the code image traced.*
Yes, if the branch broadcast feature is not enabled. Then, only E/N atom packets are sent in trace. But, if branch broadcast feature is enabled, then all branch addresses (direct or indirect) are sent by the PTM. I am using this feature to get all branch addresses. It works well if I configure PTM with small address range. But, as soon as I specify the whole .text section, I don't get full trace of the application. I thought that there is a FIFOFULL event inside PTM that happens. But I don't know how to check that a FIFOFULL event happens. Do you know what is the expected behavior of PTM if a FIFOFULL event occurs ?
If the PTM overflows then once the error condition is cleared - i.e. the trace sink can accept trace again - the PTM will restart with and ISYNC packet, with the reason set to overflow. Using branch broadcast mode is likely to considerably increase the chances of an overflow occurring. Normally we would recommend that branch broadcast be used only in restricted circumstances - i.e. address filtered trace as you were using - due to the large increase in output trace bandwidth required.
Regards
Mike
*For example, if you have a loop as follows:-
label: <loop code> BNZ label:
Then this may well be traced as a series of E atoms as the code loops back, followed by a single N atom on loop termination. Assuming the value of label: is fully encoded into the BNZ instruction (i.e. it is not BNZ rN) then no address value for label: will ever appear in the trace. The only way to decode this trace is to use a code follower and look for the BNZ label: within the code and resolve for each E/N atom seen. The decode can then assume that all instructions from label: to BNZ have been executed.
If we enable branch broadcast, then the PTM sends a branch address packet each time it encounters a branch instruction which allow us to compute the exact address without looking at the program image.
This could be why you are not seeing all the addresses you are expecting.
Regards
Mike
Thank you so much for your help. Best regards, Muhammad