How to determine the number of Cogs?
Is there a quick way of finding out programmatically the number of cogs actually present on a Propeller chip? I know there are actually 8 on all current chips, but I also know there are potentially versions of the Propeller 2 with other numbers of cogs. So how can a program find out from within an executing program how many there actually are?
It is easy enough from within a program to count the number of free cogs, but this is not what I need - I need the total number of cogs, where some cogs may be busy and cannot be interrupted.
I am sure there must be a simple trick (e.g. it just occurred to me as I wrote this that you could probably calculate it from the number of clock ticks taken between two hub instructions) but I wonder if there is actually an easier or more "official" method?
Ross.
Comments
That sounds pretty easy.
There is a chip version letter somewhere in the ROM. It would likely be more work to do anything with that than counting the hub cycles.
Thanks, I'll look it up. But it may be easier than I thought ... this was my first attempt:
This prints:
Cogs = 8
I do hope very much, that on a future Propeller the hub eggbeater would be configurable. I often need only less than 8 cogs and it would be very good, if only 4 cogs are used, they would have double memory bandwidth.
deleted
I found this in an old P2 ROM listing ...
But the only place 'ver' seems to be used is in the prompt text string ...
So there are several problems with using this method ...
However, this was from an old P2 ROM listing (2018!). Is there a more up to date one?
Ross.
https://forums.parallax.com/discussion/169695/new-fpga-files-for-next-silicon-version-5th-final-release-contains-new-rom/p1
since the boot-message states # of COGs there should be some rom location containing it.
But after running debug rom is gone. On the other hand I guess a "P3" will take some more years to appear, so no worries @RossH
Mike
I'll be long gone by the time the P3 comes along. But I am hoping to see a 16 cog P2 before I pop my clogs!
Ross.
I think Chip will be happy with just a family of Prop2s as well. Fix the errors and use finer fabrication processes.