- Marshall the input data from MATLAB to C/C++
- Establish communication with the actual processor (hardware)
- Execute the code in processor
- Marshall back the results from C/C++ to MATLAB
ARM Cortex A-chip emulator: How to estimate processing time?
1 view (last 30 days)
Bernardo Hernandez on 10 Jun 2021
I have a piece of code and I would like to know how fast it would run on an ARM Cortex A-chip. I downloaded and installed the required emulator packages as described HERE. My code is not a SIMULINK model, but a bunch of MATLAB functions, so I am using the example in HERE as a guideline as to how to properly compile it and run it.
I got the example (simple addition of two vectors of singles) running no problem, however I am not sure how to estimate the processing time. If I open the profiling report (as described on the example page) I get average and maximum times that are way lower compared to what I get from (tic,toc). Why could that be?
As far as I have read, when you use the profiler for standard MATLAB code it only consider functions and it deactivates some JIT features, but I am using it for a single PIL MEX function here so I don't think those come into play.
I have some guesses, but I would appreciate the input of someone who knows.
Darshan Ramakant Bhat on 11 Jun 2021
You have observed it correctly.
When you execure a PIL MEX at a high level below things will happen :
So the tic toc will measure the time taken by all these events.
On the otherhand the profiler will capture only the actual execution time in the processor using the instrumenting techniques.
So the profiler data will give you some estimation of the actual exectuion time if you were to deploy the code to the hardware and execute natively in that hardware.
I have created a similar example for SIL execution time. I my machine below are the timing data :
Time taken by SIL using tic-toc : 5.2 ms
Profiler exection time (Average) : 0.6 ms
I hope this helps.