This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to benchmark code on FVP_MPS2_Cortex-M4 simulator?

I need to benchmark some C++ code on the FVP_MPS2_Cortex-M4 simulator.

I considered using CMSIS function osKernelGetTickCount() to provide timestamps but the resolution of the tick timer seems to be 1ms, which is too coarse.

What would be a suitable clock counter to use for the timings?  

Would ARM_CM_DWT_CYCCNT be suitable and, if so, how would I access it?

Best regards

David

Parents
  • Hi David,

    FVPs and Fast Models (FM) sacrifice accuracy to get fast simulation speed so the result you see is expected. As I previously posted, users should not expect cycle accuracy from them. Please check what the models cannot in the link that I put in my previous post (see below in case you missed it).

    https://developer.arm.com/documentation/100964/1116/Introduction-to-the-Fast-Models-Reference-Manual/Model-capabilities

    --

    Fast Models can:

    • Accurately model instructions.
    • Correctly execute architecturally-correct code.
    • Model some unpredictable behavior.

    Fast Models cannot:

    • Validate the hardware.
    • Model all unpredictable behavior.
    • Model cycle counting.
    • Model timing sensitive behavior.
    • Model SMP instruction scheduling.
    • Measure software performance.
    • Model bus traffic.

    --

    You can increase accuracy with a smaller number of quantum (-Q) or minimum sync latency (-M) listed in Table 4 Timing and performance options of the FVP reference guide below, however, please note that even if you set them to the minimum number i.e. 1, you won't be able to see the expected result because this is how the model is implemented (they are not designed to produce accuracy but to run very fast) so again users should not expect cycle accuracy with FVP/FM.

    developer.arm.com/.../FVP-command-line-options

    Please note that smaller numbers to these parameters will make the model run slowly. Speed vs Accuracy is always exclusive.

    Kind regards,
    Toshi

Reply
  • Hi David,

    FVPs and Fast Models (FM) sacrifice accuracy to get fast simulation speed so the result you see is expected. As I previously posted, users should not expect cycle accuracy from them. Please check what the models cannot in the link that I put in my previous post (see below in case you missed it).

    https://developer.arm.com/documentation/100964/1116/Introduction-to-the-Fast-Models-Reference-Manual/Model-capabilities

    --

    Fast Models can:

    • Accurately model instructions.
    • Correctly execute architecturally-correct code.
    • Model some unpredictable behavior.

    Fast Models cannot:

    • Validate the hardware.
    • Model all unpredictable behavior.
    • Model cycle counting.
    • Model timing sensitive behavior.
    • Model SMP instruction scheduling.
    • Measure software performance.
    • Model bus traffic.

    --

    You can increase accuracy with a smaller number of quantum (-Q) or minimum sync latency (-M) listed in Table 4 Timing and performance options of the FVP reference guide below, however, please note that even if you set them to the minimum number i.e. 1, you won't be able to see the expected result because this is how the model is implemented (they are not designed to produce accuracy but to run very fast) so again users should not expect cycle accuracy with FVP/FM.

    developer.arm.com/.../FVP-command-line-options

    Please note that smaller numbers to these parameters will make the model run slowly. Speed vs Accuracy is always exclusive.

    Kind regards,
    Toshi

Children