Prop2 - More Cog memory
hippy
Posts: 1,981
Distinct from the "More Cogs versus More Memory" debate, so I thought I'd open a new debate / flame war ...
In the Propeller MkII, would it be possible to increase the size of Cog memory to 1K or 2K longs, maybe more ?
That can be done without breaking the existing scheme and Cog instruction set by loading 1K/2K longs on COGNEW (*) but only giving execution access to the first 512 Longs, $000-$1FF. The 1K/2K would be split into 256 long pages, on initial loading the first mapped to $000-$0FF, the second to $100-$1EF ( control registers still at $1Fx ). Without any further intervention, Cogs in MkII would look and behave just as they do now.
With suitable Paging Bits, the top and bottom halves of the 512 Cog memory could be dynamically mapped to any one of the 4/8 256 long pages. There are instructions which are 'meaningless' which could be subverted to provide the means to control the page bits; "SHL d,#33", unused HUBOP's etc. It would be nice to be able page both top and bottom halves, but just paging the top half would still be useful.
(*) COGNEW could still load 512 (496) longs as it does now, filling Page 0 and 1, and the Cog Programmer could be left to fill the rest. This would actually be more sensible as the additional pages may only be sparsely populated with code.
There are issues as to how to write and implement code for a Paged Cog scheme but they can be overcome. Even if the Propeller Tool did not initially support anything other than what there is now, enterprising Assembler Programmers would still be able to take advantage of a larger, paged cog memory scheme.
I think it would be useful expansion to have.
In the Propeller MkII, would it be possible to increase the size of Cog memory to 1K or 2K longs, maybe more ?
That can be done without breaking the existing scheme and Cog instruction set by loading 1K/2K longs on COGNEW (*) but only giving execution access to the first 512 Longs, $000-$1FF. The 1K/2K would be split into 256 long pages, on initial loading the first mapped to $000-$0FF, the second to $100-$1EF ( control registers still at $1Fx ). Without any further intervention, Cogs in MkII would look and behave just as they do now.
With suitable Paging Bits, the top and bottom halves of the 512 Cog memory could be dynamically mapped to any one of the 4/8 256 long pages. There are instructions which are 'meaningless' which could be subverted to provide the means to control the page bits; "SHL d,#33", unused HUBOP's etc. It would be nice to be able page both top and bottom halves, but just paging the top half would still be useful.
(*) COGNEW could still load 512 (496) longs as it does now, filling Page 0 and 1, and the Cog Programmer could be left to fill the rest. This would actually be more sensible as the additional pages may only be sparsely populated with code.
There are issues as to how to write and implement code for a Paged Cog scheme but they can be overcome. Even if the Propeller Tool did not initially support anything other than what there is now, enterprising Assembler Programmers would still be able to take advantage of a larger, paged cog memory scheme.
I think it would be useful expansion to have.
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Paul Baker
Propeller Applications Engineer
Parallax, Inc.
Maybe for the MkIII
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Paul Baker
Propeller Applications Engineer
Parallax, Inc.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Realize that I am really a mad scientist··· and
Don't forget it!
http://raydillon.com/Images/Illustration/GameArt/WildIsle/WildIsle-Ink-ScientistClose.jpg
·
But hey, more cogs equals more total cog memory also ... :P
Have you looked at the Large Memory Model stuff? It adds partial interpretation to the machine with most instructions executed directly and a few (mostly jumps) semi-interpreted. It adds roughly 200% overhead to what is a very fast machine (instructions execute on average about 30% of the actual instruction execution rate). With careful use of caching and some other optimizations, this can be brought down for "real code". The C compiler due later this year will use this model. It makes the 496 long word cog memory size much less of a "limitation". Particularly with the larger hub memory of the PropV2 and the increased speed (and built-in multiply), this should be quite a chip regardless of the cog memory size. The cog memory will be used as I think it should be for special, very time sensitive routines. The LMM stuff will be used for moderate speed routines and Spin can be used for large complex routines where the overhead for interpretation is pretty much irrelevant.
[noparse][[/noparse]quote]It adds partial interpretation to the machine with most instructions executed directly and a few (mostly jumps) semi-interpreted. It adds roughly 200% overhead to what is a very fast machine (instructions execute on average about 30% of the actual instruction execution rate).
Sounds quite cool really. A practical way of dealing with the situation. WIll be interesting to compare with Spin.
On the real estate side of things, keeping the cog ram size small means we also get more cogs and hub ram to play with. [noparse]:)[/noparse]