CPU/RAM/EEPROM Usage
Hi,
Is there any way I can get the:
CPU Usage
RAM Usage
EEPROM Usage
Of the propeller. I was able to code a way to get the current number of cogs being used - but I really want to find out how to program these other things.
Thanks,
John
Is there any way I can get the:
CPU Usage
RAM Usage
EEPROM Usage
Of the propeller. I was able to code a way to get the current number of cogs being used - but I really want to find out how to program these other things.
Thanks,
John
Comments
-John
[EDIT] While I'm programming it, and running the code.
What kind of processing are you doing?
In most embedded application on micro-controllers like the Prop the resource usage is fixed.
Memory is statically allocated when you write your variable declarations and the number of instances of objects in Spin is normally determined at compile time. Fixed at run time. Except for the fact that stack usage is a little woolly but even there you have control over the amount of stack each process gets and can make a good guess if it is sufficient.
In the Prop COG usage is also normally know at compile time. It is not many applications were people are starting and stopping a random assortment of COG depending on incoming data or events. In fact I don't think I have heard of one yet. You write the code, you know what will be running.
The actual execution rate of your COG code rather depends on things like waitpeq and waitcnt. Again hopefully you know what your inputs are and have written your code to handle those data rates.
So apart from a slight question mark over stack usage I'm not sure what you are asking for, It's not as if we are dealing with a unix like OS juggling multiple threads and virtual memory where process monitoring almost becomes essential.
P.S. There is somewhere here a tool to determine stack usage from your source code and another that attempts to monitor stacks at run time. I have not had the need to use these yet.
I kind of wish the prop had more proccessors :P Maybe that can be something for Prop 3
-John
-John
As you add more processors to a shared memory architecture like the Prop you get decreasing returns in overall performance as the access to RAM becomes an increasing bottle neck. Imagine, in the extreme an infinite number of processors sharing RAM would have zero performance! Once one had accessed data in RAM it has to wait an infinite amount of time to get its chance again.
A while back Chip did pose the question here "16 COGs or more RAM fro Prop II?". I think the forum convinced him that 16 COGs may be detrimental to performance and more RAM would be better. Tough call I think.
If Python works for you on the server end of a Prop to WEB page connection then why not. It's a fine language even if I don't like the white space block delimiting.
I just like the idea of using the same language at server and client end of a project. I'm sure JavaScript will start to annoy me with it's quirks soon enough:)
I've been down in the shed (The place where all my father's and my "great" inventions have been made) programming the robot. The comp it is getting entered into is only a month away now! It's kind of odd going back to "primative" coding after programming in a language such as python and Java - Casting, Heaps of threads, Function address passing, Classes, and all the rest of it I've gotten too accustomed too!
Well, I'll let you know how it goes
-John
Do you mean Variables you may have declared, but never used ?
Some tools will report that, at least in a simplistic ' not directly referenced' manner, (not sure if any do on the Prop ?) but it is small enough a Text editor can be used.
The classic way to time something critical, is to toggle a pin. Or use a simulator.
(A Cog always runs at full speed, unless you have a WAITxx opcodes.)
Cog1(Timer Cog):
Cog2 (Cog to be timed)
I'm not sure if this code is 100% accurate... but I think you get the picture (If you can make head or tail of my code).
>Do you mean Variables you may have declared, but never used ?
Yes.
-John
Of course you may still have referenced variables that are not actually used because the code that references them is never executed. But who would write code like that:)
Me - for one!
One way is to write to information to a log file or a terminal session.
I use the method below when unit testing. DisplayMemory writes hub memory to the PST given a hub starting address, length, and a flag for Hex or ASCII. There are other techniques like counting the number of times a method is invoked or counting loops. Regardless of the technique, implementation is up to the programmer. That means a little thought has to go into the process.