GAS Toggle: CMM vs LMM mode
SRLM
Posts: 5,045
Hi All,
I'm getting inconsistent results. The attached program works in LMM mode, but not CMM mode.
In CMM mode, it outputs only the first hello, world and some gibberish characters (not shown above), and doesn't toggle the pins. In LMM mode it seems to operate correctly.
I'm getting inconsistent results. The attached program works in LMM mode, but not CMM mode.
user@desktop/propgcc/projects/gastoggle$ propeller-elf-g++ -mcmm -O0 -o main.elf toggle.cpp toggle.S user@desktop/propgcc/projects/gastoggle$ propeller-load -r -t main.elf Propeller Version 1 on /dev/ttyUSB0 Loading main.elf to hub memory 4600 bytes sent Verifying RAM ... OK [ Entering terminal mode. Type ESC or Control-C to exit. ] hello, world! user@desktop/propgcc/projects/gastoggle$ propeller-elf-g++ -mlmm -O0 -o main.elf toggle.cpp toggle.S user@desktop/propgcc/projects/gastoggle$ propeller-load -r -t main.elf Propeller Version 1 on /dev/ttyUSB0 Loading main.elf to hub memory 6468 bytes sent Verifying RAM ... OK [ Entering terminal mode. Type ESC or Control-C to exit. ] hello, world! toggle cog has started
In CMM mode, it outputs only the first hello, world and some gibberish characters (not shown above), and doesn't toggle the pins. In LMM mode it seems to operate correctly.
Comments
A bit of background: when ".compress on" is in effect (the default with -mcmm) the assembler output is compressed bytecode, which must be decompressed by the CMM kernel. The assembly language instruction sets for LMM and CMM modes are basically the same, but the binary representations are very different. LMM code is the native instruction set, so it can execute directly on the COG, but CMM can't.
Eric
Would it be appropriate to add the .compress statements to the official GAS toggle demo on the Google Code site?
Yes, that's a good idea -- those demos were written before we had a CMM mode.
Thanks,
Eric
Since you have commit access, if you like you could commit the change to both default and p2test branches.
The change MUST be exactly the same for both branches to avoid branch merge conflicts later.
We could guide you through the process.
If you prefer not to commit the change, just post your diffs here and someone will take care of it.
--Steve
Eric