More COG memory suggestion for Prop 2
tellurian
Posts: 52
I have been using the propeller now for a while and am a definitely a fan. I have been catching up on my reading in this forum and it dawned on me that there have been no suggestions about more COG memory. The 2k COG RAM seems a bit spartan. How about 4k or 8k per cog? I realize this may be late in the game, but if possible I expect that it would definitely ratchet up throughput of SPIN and C programs as well as allow for more powerful and sophisticated ASM drivers and apps.
Lame? Late? ... or not?
Lame? Late? ... or not?
Comments
Have you looked at the architecture of a cog instruction?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Cardinal Fang! Fetch the comfy chair.
9 Bits for source, 9 Bits for destination. That means you have 512 addresses to choose from.
Unless you would like two memory maps in each cog where you would need different instructions to switch between memory maps, and then while were at it we could throw in interrupts and maybe some...
Its RISC for a reason...
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nyamekye,
Or alternatively let's assume that access to the hub RAM will become faster. Then we could use some LMM or other virtual memory mechanism. Or maybe even with some small hardware support for that? Oh well, I'm dreaming...
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Airspace V - international hangar flying!
www.airspace-v.com/ggadgets for tools & toys
Ha! OK. Well I'm a C hack and have avoided asm (on anything) for the past 20 years so I did not look at the instruction set ... I guess I should have. Too bad eh, a bit more COG memory would go a long way.
Since I think more intuitive will win out on that and they will keep all data as usable registers I think having a secondary cog memory which can not be used for executing code but can be used for storing local data with only 2 instructions able to access it would be the best trade off. It would be just like accessing hub ram now but always taking 1 cycle instead of the 1 to 8 that hub instructions will take. This method also has the benefit of allowing the same 512 long copy as the prop 1 and just zeroing out the higher cog memory on coginit. So very few changes to the architecture is required. The big question is, is there enough space to fin another 512+ longs/cog?
Well, what about a stack machine? Yeah, sounds frightening for assembler programming, but as soon as you've got the idea it's very convenient. A stack processor only needs single address for read and write instructions. All processing instructions are without address. Stack machines are simple, fast, and compilers can easily generate code for them. There was a a processor family some time ago: the Transputer. Cute device, but overtaken by regular RISC technology. Maybe because chips have become cheaper, maybe they were meant for special purpose, maybe the also had a new strange high level language...
Well, I don't know their current offers, but the old HP pocket calculators also have been stack machines called reverse polish notation (RPN) in this context. They have been technical and commercial success.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Airspace V - international hangar flying!
www.airspace-v.com/ggadgets for tools & toys
I too believed the Cog RAM needed extending but having used LMM that is IMO a suitable alternative for most cases although it does mean a reduction of execution speed and can shift the issue to being a shortage of Hub RAM.
The future Prop II will reduce speed and Hub RAM issues. If it comes with some thumb-style 16-bit 'PASM' instruction support for speeding up LMM that will be the icing on the cake.
You are right, significant architectural changes are not going to happen, and with good reason. Doubling the size of COG ram would have been awesome, but I now see why that is not so simple given the machine addressing. LMM it will have to be, suitable or not that is all there is. I suppose I really should learn PASM then, but it is just so tedious and persnickety compared to C. I must say though that SPIN is really great, surprisingly flexible and comprehensive. I just bought ICCV7 and can see that I will be using all three languages. Some real hardware peripherals (UART, I2C, SPI, ADC ) would propagate the Propeller into design discussions very fast. I know a number of engineers whose main beefs were 1) no C and 2) no peripherals. So many engineers snub their noses at software UART or I2C implementations. Me too (at first). C has been taken care of now, and with some basic peripherals on board I think the Prop would become a much easier sell at design time, goodbye RTOS for many many applications.
Pasm is fairly simple to learn. You should give it a try with a simple program like flashing LEDs, then progress to using the FullDuplexSerial object, the the VGA object. The instructions are so regular and you only need to learn a few initially.
Now for the peripherals. That is what the cogs are for. They each have very powerful counters/registers which are used for video and pwm. However, I think a UART, I2C and SPI silicon peripherals may have been nice to save cogs in the future. I think the cogs are going to be the next scarce resource on the Prop II, as will be I/O pins. An external memory interface (SDRAM ro SRAM) may be a nice addition also.
Anyway, we shall just have to wait and see what Chip has install for us with the PropII.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Links to other interesting threads:
· Home of the MultiBladeProps (SixBladeProp)
· Prop Tools under Development or Completed (Index)
· Emulators (Micros eg Altair, and Terminals eg VT100) - index
· Search the Propeller forums (via Google)
My cruising website is: ·www.bluemagic.biz
If you add the high speed floating point, that would take another 1-2 cogs depending on the features you need. With 1 cog for the main program, you're using at most 8 cogs, 7 if you're using composite video output rather than VGA.
Post Edited (Mike Green) : 2/7/2009 6:46:53 AM GMT