PDA

View Full Version : Any documentation on Propeller LMM ?



Bean
03-19-2009, 09:38 AM
I've been away from the propeller for awhile, but I seen various topics about code that uses a "Large Memory Model". I'm interested in writing some code that uses LMM.

Is there any good documentation on how it works ?

Thanks, Bean.


▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
There is a fine line between arrogance and confidence. Make sure you don't cross it...

·

Mike Huselton
03-19-2009, 09:59 AM
Bean,

These are the Wiki summaries:

propeller.wikispaces.com/Large+Memory+Model (http://propeller.wikispaces.com/Large+Memory+Model)
propeller.wikispaces.com/LMM+Phil+Pilgrim+(PhiPi) (http://propeller.wikispaces.com/LMM+Phil+Pilgrim+(PhiPi))
propeller.wikispaces.com/LMM+Pacito (http://propeller.wikispaces.com/LMM+Pacito)
propeller.wikispaces.com/LMM+AiChip+Industries (http://propeller.wikispaces.com/LMM+AiChip+Industries)

Are these adequate?

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
JMH

Post Edited (James Michael Huselton) : 3/19/2009 2:23:08 AM GMT

Bill Henning
03-19-2009, 11:38 AM
Hi Bean,

Unfortunately right after I came up with LMM I got too busy; however my schedule is much better now, so I've resumed spending a lot of hours on the Propeller and LMM.

If you follow the original thread, there is some documentation there, and I am writing "proper" docs; they will be needed for my LMM macro assembler. Status of macro assembler: all op codes assemble properly, and have been verified, I just need to finish fixing up forward references and finish implementing macro's. I expect an "alpha" version roughly at the end of this month.


Bean (Hitt Consulting) said...
I've been away from the propeller for awhile, but I seen various topics about code that uses a "Large Memory Model". I'm interested in writing some code that uses LMM.


Is there any good documentation on how it works ?



Thanks, Bean.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.mikronauts.com (http://www.mikronauts.com) - a new blog about microcontrollers

Bean
03-19-2009, 06:48 PM
Bill,
Thanks. That is great news. I can't wait. I'll just muddle through with what is on the threads for now.

Bean.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
There is a fine line between arrogance and confidence. Make sure you don't cross it...

·

heater
03-19-2009, 07:09 PM
You could download the trial ImageCraft C compiler for the Propeller and check out it's LMM kernel and how it generates it's LMM code.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
For me, the past is not over yet.

hippy
03-20-2009, 01:49 AM
All credit goes to Bill for his innovation and realisability of LMM on the Prop which inspired a number of us to go in that direction, and I'm sure we are all glad we did.

It's a very simple but extremely powerful concept / tool which busts open many of the perceived restrictions of a 496 instruction Cog with only a reasonable reduction in processing power. I'd say it's one of the key technologies one needs to know to push the Prop to the boundaries. It crops up in a few places but I don't see much mainstream take-up or a growing LMM evangelism choir - ImageCraft perhaps being the notable user of the technique.

There's no real definitive use of LMM so it's quite flexible and can be used / twisted in a number of ways. It's an advantage but also a disadvantage, because it's hard to define beyond the basic concepts, after that it's go-your-own-way. I believe that its uptake has been held back by not having the tools or a standard reference design so Bill's return to the scene and renewed interest is very welcome.

If ( hint, hint ) Chip does add enhancements to the Prop II which makes running 16-bit LMM thumb-style PASM fast and easy, that will IMO create a zinger of a microcontroller. PASM overheads of multiple bit-field extractions and shiftings is currently a big overhead which stands in the way of that being high-speed.

Bill Henning
03-20-2009, 02:34 AM
Thanks Hippy!

I am currently working on a "definitive" LMM kernel, detailed documentation, and a proper LMM macro assembler so that LMM can really take off.

Chip has already said he will be adding an auto-increment RDLONG/WRLONG to PropII, which along with the REP instruction will allow 8 cycle execution of all but hub instructions in a modified LMM on PropII (and if he implements the double or quad long reads, even lower cycle counts are possible) - so that means LMM will run at 20Mips (same as current pasm) on Prop2! The other additions of Prop2 will also allow me to create far better FCACHE and relatives. I'm working on other related goodies that I am not ready to announce yet - I've been bitten too many times with coming up with something neat only to have to shelve it due to consulting gigs so I won't announce early any more.


hippy said...
All credit goes to Bill for his innovation and realisability of LMM on the Prop which inspired a number of us to go in that direction, and I'm sure we are all glad we did.

It's a very simple but extremely powerful concept / tool which busts open many of the perceived restrictions of a 496 instruction Cog with only a reasonable reduction in processing power. I'd say it's one of the key technologies one needs to know to push the Prop to the boundaries. It crops up in a few places but I don't see much mainstream take-up or a growing LMM evangelism choir - ImageCraft perhaps being the notable user of the technique.

There's no real definitive use of LMM so it's quite flexible and can be used / twisted in a number of ways. It's an advantage but also a disadvantage, because it's hard to define beyond the basic concepts, after that it's go-your-own-way. I believe that its uptake has been held back by not having the tools or a standard reference design so Bill's return to the scene and renewed interest is very welcome.

If ( hint, hint ) Chip does add enhancements to the Prop II which makes running 16-bit LMM thumb-style PASM fast and easy, that will IMO create a zinger of a microcontroller. PASM overheads of multiple bit-field extractions and shiftings is currently a big overhead which stands in the way of that being high-speed.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.mikronauts.com (http://www.mikronauts.com) - a new blog about microcontrollers

ImageCraft
03-20-2009, 03:06 AM
Search for "Propeller C" in the imagecraft blog: http://imagecraft.wordpress.com, someone commented that it's the most concise explanation of LMM they have read...

// richard

jazzed
03-20-2009, 03:54 AM
Richard,·you have·a nice explanation of the basic idea and a neat reference to Bill's initial observation. Unfortunately, I could not find anything there on the usage of the "primitives" defined in kernel.s. I know most of them, but nothing beats a clear enumerated reference for all to quickly understand (except possibly getting our latest project fully working ;). The ICCPROP community would benefit greatly from a good ICC specific LMM reference with usage examples.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
--Steve


Propalyzer: Propeller PC Logic Analyzer (http://www.brouhaha.com/~sdenson/Propalyzer)
http://forums.parallax.com/showthread.php?p=788230 (http://forums.parallax.com/showthread.php?p=788230)

Jetfire
03-20-2009, 03:57 AM
I think this is the link: Parallax Propeller and the Propeller C Compiler (http://imagecraft.wordpress.com/2008/08/27/parallax-propeller-and-the-propeller-c-compiler/)

I recently started looking at making a converter so that it is easy to build LMM code. One thing I noticed right away is that self modifying code or using the movi, movs, and movd become very difficult to use with the hub. Using a style based on hippy's LMM you are practically switching from von Neumann to Harvard architecture. A mov of a variable in cog ram is basically the same, but in PASM you could mov in a whole new instruction. With the code in the hub, some commands require jumping out the LMM load-increment-execute to run more complex commands involving a jump out, then hub addresses; you can't really modify a command. So is self modification out entirely or what is available?

Post Edited (Jetfire) : 3/19/2009 8:02:34 PM GMT

Bill Henning
03-20-2009, 04:05 AM
Self modifying code is available in FCACHE'd blocks :) generally my intention was to use hub based code to "glue" togeather FCACHE'd blocks of looping code, thus approaching the speed of raw pasm very closely.


Jetfire said...
I think this is the link: Parallax Propeller and the Propeller C Compiler (http://imagecraft.wordpress.com/2008/08/27/parallax-propeller-and-the-propeller-c-compiler/)

I recently started looking at making a converter so that it is easy to build LMM code. One thing I noticed right away is that self modifying code or using the movi, movs, and movd become very difficult to use with the hub. Using a style based on hippy's LMM you are practically switching from von Neumann to Harvard architecture. A mov of a variable in cog ram is basically the same, but in PASM you could mov in a whole new instruction. With the code in the hub, some commands require jumping out the LMM load-increment-execute to run more complex commands involving a jump out, then hub addresses; you can't really modify a command. So is self modification out entirely or what is available?

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.mikronauts.com (http://www.mikronauts.com) - a new blog about microcontrollers

Timothy D. Swieter
03-20-2009, 07:05 AM
Bill -

On the recent webinar with Chip, there was mention of being able to read four longs at a time out of HUB RAM. We can confirm this when the videos are posted. Overall it makes it very exciting for LMM constructions and execution.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Timothy D. Swieter, E.I.
www.brilldea.com (http://www.brilldea.com) - Prop Blade, LED Painter, RGB LEDs, 3.0" LCD Composite video display, eProto for SunSPOT
www.tdswieter.com (http://www.tdswieter.com)

Cluso99
03-20-2009, 10:25 AM
I did 2 things that may help. Both are in the prop tools thread pointed to in my signature.

1. Fast overlay loader (for executing code within the cog). Heater is using this in his ZiCog.
2. Zero footprint Spin & Pasm debugger - uses an LMM style debugger located in shaddow ram $1F0-$1F3. It takes into account the self-modifying jmp/call/jmpret/ret instructions.

The problems with LMM I see are the self-modifying instructions and jmp/jmpret/call/ret instruction.

I have acknowledgements in the code to those who helped paved the way, Hippy in particular.

Currently I have heaters z80 code (the actual z80 cpm code, not prop pasm) running from external SRAM on my TriBladeProp design. BUT, this takes almost ALL I/O pins, and is limited to only 1 cog at a time, so a locking mechanism is required for multiple cog access. This SRAM is only byte wide access only.

By the time we get PropII, 256KB of hub memory is not going to be enough for what some of us are doing, but we will have more I/O pins to attach SRAM.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Links to other interesting threads:

· Home of the MultiBladeProps: TriBladeProp (http://forums.parallax.com/showthread.php?p=786418), SixBladeProp (http://forums.parallax.com/showthread.php?p=780033), website (Multiple propeller pcbs) (http://bluemagic.biz/cluso.htm)
· Single Board Computer·using the TriBladeProp board (ZiCog Z80 Emulator) (http://forums.parallax.com/showthread.php?p=790917)
· Prop Tools under Development or Completed (Index) (http://forums.parallax.com/showthread.php?p=753439)
· Emulators (Micros eg Altair, and Terminals eg VT100) - index (http://forums.parallax.com/showthread.php?p=778427)
· Search the Propeller forums (via Google) (http://search.parallax.com/search?site=parallax&client=parallax&output=xml_no_dtd&proxystylesheet=parallax&proxycustom=<HOME/>&ie=&oe=&lr=)

My cruising website is: ·www.bluemagic.biz (http://www.bluemagic.biz)·· MultiBladeProp is: www.bluemagic.biz/cluso.htm (http://www.bluemagic.biz/cluso.htm)

ImageCraft
03-21-2009, 03:54 AM
jazzed said...
Richard, you have a nice explanation of the basic idea and a neat reference to Bill's initial observation. Unfortunately, I could not find anything there on the usage of the "primitives" defined in kernel.s. I know most of them, but nothing beats a clear enumerated reference for all to quickly understand (except possibly getting our latest project fully working ;). The ICCPROP community would benefit greatly from a good ICC specific LMM reference with usage examples.


The reason I haven't done it is because I wasn't sure the LMM routines will not be changing. Now that we are almost a year since release, I guess it should be pretty solid. I will add it to the list of things to do...

ImageCraft
03-21-2009, 04:01 AM
BTW, a number of the forumers are working on XMM-Propeller boards. My intention is to make Propeller C generic enough so that it can work on different memory expansion schemes without too many changes to the compiler, but just to the XMM aware kernel. With 512K to a few megabytes to play with, this really would open up the possibility of porting large programs to the Propeller based design. The runtime perofrmance would not be pretty but hey we did so much with a 7.18 MHz 68K on the Amiga http://forums.parallax.com/images/smilies/smile.gif

I should be getting a prototype XMM board in a few days and hopefully I can report something soon.

Mike Huselton
03-21-2009, 11:27 AM
Imagecraft,

My feeling of developers' guilt over Imagecraft has been brought to a broil recently.
As a pro, I feel a need to give back to the Parallax and Imagecraft arenas that have given me so much.

If you can reveal the vendor of the XMM eapansion, can you do so?
Just a link, any link. I want to replicate the direction of your thinking.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
JMH

Ale
03-21-2009, 06:19 PM
I'm sure a custom kernel can be ported to use Cluso's boards, but as Richard (imageCraft) said they want to make it general enough. Cluso's board supports some 2 to 4 MB if you get the right SRAMs.

kwinn
03-21-2009, 10:57 PM
My apologies for somewhat hijacking this thread, but after reading it to this point I have to point out that having the 64 I/O prop would be a great boost to this effort. Even better would be having 3 or 4 registers that could be pre/post auto incremented added with the extra I/O pins. Changing the core instructions or design of the prop would not even be necessary.