We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hello to all,
I am working on Cortex-M4 and would like to know about the hazard situation. In order to see the effect of Data-Hazard, I have executed few application codes. For example,
LDR R5,[R6,#offset]
ADD R5,R8,R2
ADD R3,R8,R2
Where R6 = SRAM0 address. From both the program it's clearly visible that the Program-1 would have the situation of hazard compared to Program-2. But on the execution of both these, I have observed NO DIFFERENCE in the CURRENT CONSUMPTION as well as the NUMBER of CYCLES. Why is it so?
Also, regarding the consumption of the number of cycles, I didn't find any documentation. From the observation the following table has been made:
(Cycle count on execution
of only LDR instruction)
ADD instruction
of only ADD instruction)
Therefore I have two major queries:
Thanking you,
Kind regards,
Himanshu
Dear Mr. Yiu,
Thank you very much for the information provided by you. I have gone through the link provided by you, which has been listed out the cycle time consumption for all the instruction, while applied individually. But, couldn't get to know how to compute the cycle time for a combination of two or more instructions. From the documentation, I have read about the dependencies of different factors play in the computation of consumption of cycle.
Still sorry to ask you again, is there any formula being used to calculate for a pair or more instruction sequence (as shown in the original question, where only LDR and ADD instruction are being executed in a pair) OR it can only be tell based on experiments??
Very sorry for the trouble.
Thanking you once again,
Regards,