Now will try to utilize the 64 bit global timer that we have in a zinc processing system to perform
the profiling of with the implication that we did utilizing any time or so.
Since this is an internal resource of raising processing system, we do not need to enable or disable
anything, right?
So the fundamental thing processing system block design that we are utilizing from the beginning could
be utilized.
OK to you, the 64 bit global timer.
So this is the block design that we have created utilizing the script, and we just proceed to generate
and still output and create a system out of it, right?
So we'll directly discuss application code that we tried to perform or profiling with the 64 bit time,
right?
The first, the important driver file that you need to include is the extreme I'm the square elder decorator.
This consist of all the APIs, as well as each state that could be used to work around within 64 bit.
Global Times if you just go in the driver.
OK.
So Extreme underscore a lot of weight and access to the 64 bit global counter.
OK.
That is what we're going to utilize, and this counter increases by one degree to brussaux clocks.
This basically means 64 bit of global counter operate at half off dosing frequency, right?
And the mode of operation is up great.
So it increases by.
Great.
So this basically signifies that this will be operating in a moderate.
The leader that is it is extreme, which is basically an unsafe 64bit, right?
And then you have a series of macros, right?
So you have a count per second.
So how you calculate the count per second is you have the access to the CPU clock frequency.
I knew just you eight divided by two, right?
So that that basically mean that global timer is always clocked at top of the CPU frequency rate.
Only thing that we need to understand is how you calculate the nanosecond a microsecond out of a great.
And then you have a gate and sit down function.
Right?
So if you just understand first how we will be calculating the delay, so we know that the frequency
at which are 64 bit global timer operators see fewer frequency by.
Right.
So if you take an inverse of it, that is true by CPU frequency that would basically give us a period
in second rate.
So once we have a period in second to get the period in nanosecond, we just need to multiply by the
fact that often this tonight.
And to get the period in microsecond, we just need to multiply by the factor of 10 to six.
This is how you convert the value from second to nanosecond and microsecond rate.
And this is an algorithm that we are going to implement, right?
So let's go through a quick.
So we declare the next time this is the leader that we need when we are working with the 64 bit global
counter right to, we declared start and end ready, but.
So this is the same application that we provide utilizing NASA timer.
So just before our application, we are capturing the value that we have for us.
Global counter OK.
So that can be done like this.
So it's getting right.
And this just required the.
A pointer to the same variable rate, so this will automatically store the value of a counter in that
variable.
So here we just need to use ampersand and start rate.
So this will automatically store the value of a counter in the variable star at the start of an application
that will allow enough time for our application to execute.
Then we are again submitting the time right.
So again we call getting ampersand and energy right.
So now we have the access to the starting and ending counter value that we have.
As we execute our application, right, so we now know that the counter value before the start of an
application and we also know the value of a counter after we complete an execution of an application
rate.
So we know that in the previous case, when we are utilizing the same zeal in debt profile, we are
getting around two point forty six rating out there.
The timer resolution that we are utilizing is 32 bit, right, but here now we are working at only 64
bit account.
So we are expecting a slightly good accuracy as compared to our 32 bit account rate.
So we first proceed and then we print.
The number of ticks, Rachel.
Number of clock ticks will be simply equal to now, we know that this count, they're operating a lot
more, so we just need to calculate.
OK, so N.G. will have an higher value as compared to start rate.
So we'll be subtracting energy minus start rate and to bring the long, long unsigned value, which
is basically a new 64 bit value we need to use if Wal-Mart specifies L, which basically is equal to
long, long unsigned rate.
So here we are utilizing since zero and this is for Max specify OK.
And then we are printing the value of an minus start right now to calculate the value in a nanosecond.
We know that we need to multiply by the factor of industry.
Nine.
Rachel, If you just analyze an expression, OK, so it will be two.
OK, then turn this to nine and we need to divide by CPU frequency rate.
So this is what we are doing over here.
So and minus Daji Cross.
OK.
So this is basically to do this tonight, and then we are dividing by the clock frequency that we have
for, I think, grassing system, right?
So this is how you calculate the delay nanosecond.
And to calculate the delay in microsecond rate.
We are again performing and minus strategy.
OK, and then we are multiplying to integrate this to six OK, divide by the zinc and frequency rate.
Now remember that we are dividing by some number.
So we are expecting the value to be floating point, right?
So that for that reason, we are utilizing person to up in both cases.
So this is how you perform the profiling using 64 bit global timer.
So let me just compare whether we are getting the same value or a bit more accurate value as compared
to our previous rate.
So first, we proceed to build our application project.
So ones are successful, we proceed and debug as we launch on it.
So let's click on resume to.
So you could see the number of clock ticks that we are consuming is that only fifty seven.
And that basically mean the time elapsed in nanoseconds to fly seven zero.
OK.
And time elapsed in microseconds around 2.5 separate.
So this is a bit more as compared to what we are getting in a previous case when we are utilizing site
that for it.
And this is expected because now we are working with that 64 bit timer, right?
And in the previous case, we are working only with that 32 bit timer.
Right now, you understand the process of how you utilise the 64 bit of global counter that you have
in a zinc glass existing to perform a profiling, right?