Shop OBEX P1 Docs P2 Docs Learn Events
Anyone seen what the GCC guys have done lately? — Parallax Forums

Anyone seen what the GCC guys have done lately?

Dr_AculaDr_Acula Posts: 5,484
edited 2012-04-27 13:38 in Propeller 1
Ok, there is this thread at the top of the propeller forum talking about an C alpha test forum. Rather than read what they are doing, I thought I would test it out on a propeller board. Any propeller board, really. I just grabbed the nearest one.

It is amazingly easy to get something working! You don't even need to read a manual (who reads manuals, anyway?)


Step 1: Download GCC for your computer from this page http://code.google.com/p/propgcc/downloads/list For windows, put it in a directory called c:\propgcc The windows version is the 6th one down on the list. *** addit - see posts further down, it appears you can skip step 1 and just get the package in step 2. Even better! ***

Step 2: Download an IDE from http://code.google.com/p/propside/downloads/detail?name=Simple-IDE_0-6-7_setup.zip&can=2&q= (thanks to Leon post #2 for the updated link)

wait a bit. A few hundred megabytes there...

Step 3: Install and run the IDE. It defaults to a simple test program. Hit F10 to run it.

Step 4: On the top right of the IDE screen is a little computer screen picture. Open it and it displays a terminal so you can see "Hello World" coming back.


It shouldn't be this easy, but it is.

Top marks to all those in the GCC team.
1018 x 740 - 137K
gcc.jpg 136.5K

Comments

  • LeonLeon Posts: 7,620
    edited 2012-04-27 01:57
    There is something wrong with your Step 2 URL (404 error). I think it should be:

    http://code.google.com/p/propside/downloads/detail?name=Simple-IDE_0-6-7_setup.zip&can=2&q=

    That is the latest version, uploaded this morning.

    I'd previously tried out gcc using the command line, and it's a bit awkward. I just tried the IDE, and I agree with Drac that it does make things very easy. It's actually easier than using the Propeller Tool, especially if terminal I/O is required, as one doesn't have to run a separate program.
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2012-04-27 02:55
    Thanks Leon. I edited post #1 with your link.

    I agree, command line is awkward, to the point I gave up a few times over the last few months. Which is why the IDE is such a huge step forward for this project.

    Very exciting. GCC can run big programs, much bigger than the propeller memory.
  • mindrobotsmindrobots Posts: 6,506
    edited 2012-04-27 03:27
    It's even easier! I believe all the IDE packages have propgcc included so all you should really need to do is grab the IDE you need (Win, Mac, Linux), install it and away you go!

    This team should get a big round of applause, especially Steve with SimpleIDE!
  • MacTuxLinMacTuxLin Posts: 821
    edited 2012-04-27 03:28
    Agreed Dr Acula. I like the SimpleIDE. Its just that, simple.
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2012-04-27 05:17
    It's even easier! I believe all the IDE packages have propgcc included so all you should really need to do is grab the IDE you need (Win, Mac, Linux), install it and away you go!

    I think I downloaded it in a different order. So are you saying that the simple IDE contains all the files in c:\propgcc as well?
  • mindrobotsmindrobots Posts: 6,506
    edited 2012-04-27 05:30
    There are linux versions of the IDE download with and without the GCC tool chain. The Win and Mac versions include the tool chain so you really can just download and install the IDE package and be up and running with a C development environment. SWEET!!! I've been playing with it for a while now on various machine installing and uninstalling and updating and most of them never had the full tool chain loaded, just the IDE package.

    Its ease of use and comfort level is right up there with that Arduino environment. When the libraries get finalized, it will be a very simple, very complete C development environment.
  • SapiehaSapieha Posts: 2,964
    edited 2012-04-27 05:48
    BUT be aware that ASM part are not compatible with PASM
    > NED rewriting of drivers already existing in PASM.

    First Hole in theirs SHIP !
    mindrobots wrote: »
    There are linux versions of the IDE download with and without the GCC tool chain. The Win and Mac versions include the tool chain so you really can just download and install the IDE package and be up and running with a C development environment. SWEET!!! I've been playing with it for a while now on various machine installing and uninstalling and updating and most of them never had the full tool chain loaded, just the IDE package.

    Its ease of use and comfort level is right up there with that Arduino environment. When the libraries get finalized, it will be a very simple, very complete C development environment.
  • jazzedjazzed Posts: 11,803
    edited 2012-04-27 05:59
    Dr_Acula wrote: »
    I think I downloaded it in a different order. So are you saying that the simple IDE contains all the files in c:\propgcc as well?

    Yes. Oddly enough the Windows SimpleIDE package includes everything you need to be productive and is smaller than the standalone GCC package.
  • prof_brainoprof_braino Posts: 4,313
    edited 2012-04-27 06:39
    I just downloaded the SimpleIDE 0-6-5 Windows .zip and the Hello World program ran immediately. It is so simple a child of 5 could use it.

    However, I have been struggling ever since getting a project to run. Someone fetch me a child of 5 so I can get this compiled.

    I get the same bunch of errors whether I use GCC or catalina. I guess that there are things one "just has to know" about using a C compiler that are omitted from the instructions. For example, Adding main to a project doesn't add all the include files, and doesn't find the .c files in the same directory. Also, there are livraries that are included automatically, but there is no list that describe what these are or what they contain. At least not via the Help option in the IDE. I get the impression that the IDE is used to install the packages, but "real" users work from the command line and "just know" where all the parts are and how they work; while the IDE does most functions but leaves the new guy hanging at key points.

    So my issues stem from not using C for 20 years. I'll have to give it more concentration when there are fewer distractions.
  • jazzedjazzed Posts: 11,803
    edited 2012-04-27 06:59
    I just downloaded the SimpleIDE 0-6-5 Windows .zip and the Hello World program ran immediately. It is so simple a child of 5 could use it.

    However, I have been struggling ever since getting a project to run. Someone fetch me a child of 5 so I can get this compiled.

    I get the same bunch of errors whether I use GCC or catalina. I guess that there are things one "just has to know" about using a C compiler that are omitted from the instructions. For example, Adding main to a project doesn't add all the include files, and doesn't find the .c files in the same directory. Also, there are livraries that are included automatically, but there is no list that describe what these are or what they contain. At least not via the Help option in the IDE. I get the impression that the IDE is used to install the packages, but "real" users work from the command line and "just know" where all the parts are and how they work; while the IDE does most functions but leaves the new guy hanging at key points.

    So my issues stem from not using C for 20 years. I'll have to give it more concentration when there are fewer distractions.

    Version 0-6-7 is the latest. It labels those boxes you asked about.

    Both Ross and I have followed up with you on this in your threads. Can we finish that?

    GCC offers GAS with PASM-like syntax (required for the tool-chain) and can use PASM via tools like BSTC.
    Simple IDE allows you to add Spin/PASM programs to the project and this integrates very smoothly.
  • Heater.Heater. Posts: 21,230
    edited 2012-04-27 07:05
    Sapieha,

    BUT be aware that ASM part are not compatible with PASM

    > NED rewriting of drivers already existing in PASM.

    First Hole in theirs SHIP !

    Not quite. It is possible to compile PASM to binary blobs with BST (Or HomeSpun I think) and then link those blobs into a propgcc program. So no rewriting is necessary from that point of view.
    If I remember correctly there are examples of doing this in the propgcc demos.

    Of course you will run into problems if the PASM code has linkage to Spin code. Say relying on Spin to set up parameters in DAT before loading the DAT into COG. In that case C code does not know where to "POKE" those values. It's best to modify the PASM to get all it's setup info via PAR at start up.

    Then there is the new opensource Spin/PASM compiler coming along which I'm sure will be able to produce propgcc object files from PASM at some point.
  • ctwardellctwardell Posts: 1,716
    edited 2012-04-27 07:05
    For me SimpleIDE made the difference between just playing around a little PropGCC and really diving in and getting some work done.

    I've been taking some steps at "looking under the hood" of PropGCC and it is amazing how much work the entire team has put into this project.

    C.W.
  • SapiehaSapieha Posts: 2,964
    edited 2012-04-27 07:52
    Hi Heater.

    But is it possible to simple copy PASM code as IN-LINE to be compiled by PropGCC.
    Heater. wrote: »
    Sapieha,

    Not quite. It is possible to compile PASM to binary blobs with BST (Or HomeSpun I think) and then link those blobs into a propgcc program. So no rewriting is necessary from that point of view.
    If I remember correctly there are examples of doing this in the propgcc demos.

    Of course you will run into problems if the PASM code has linkage to Spin code. Say relying on Spin to set up parameters in DAT before loading the DAT into COG. In that case C code does not know where to "POKE" those values. It's best to modify the PASM to get all it's setup info via PAR at start up.

    Then there is the new opensource Spin/PASM compiler coming along which I'm sure will be able to produce propgcc object files from PASM at some point.
  • jazzedjazzed Posts: 11,803
    edited 2012-04-27 11:24
    Sapieha wrote: »
    Hi Heater.

    But is it possible to simple copy PASM code as IN-LINE to be compiled by PropGCC.

    Yes. It is possible to use Propeller GCC GAS in-line ASM which has PASM-like syntax.
    The standard GNU GAS compiler can share symbols with C programs.

    Roy's compiler can produce blobs already - I want to cut in his compiler within a few months.
  • SapiehaSapieha Posts: 2,964
    edited 2012-04-27 11:27
    Hi jazzed.

    PASM-like syntax else PASM compatible.

    Can I simply paste it from existing PASM programs to be compiled ?

    jazzed wrote: »
    Yes. It is possible to use Propeller GCC GAS in-line ASM which has PASM-like syntax.
  • jazzedjazzed Posts: 11,803
    edited 2012-04-27 11:29
    Sapieha wrote: »
    Hi jazzed.

    PASM-like syntax else PASM compatible.

    Can I simply paste it from existing PASM programs to be compiled ?

    Not for GAS. There are GCC related requirements.

    As mentioned, if you want PASM you can include it in a Spin/PASM file.
    Everyone else is very happy with this arrangement.
  • SapiehaSapieha Posts: 2,964
    edited 2012-04-27 11:37
    With other words.

    My first post in this thread was correct!

    jazzed wrote: »
    Not for GAS. There are GCC related requirements.

    As mentioned, if you want PASM you can include it in a Spin/PASM file.
    Everyone else is very happy with this arrangement.
  • Dave HeinDave Hein Posts: 6,347
    edited 2012-04-27 11:38
    The syntax and instructions used with the PropGCC assembler are almost the same as PASM. The one big difference it how it treats symbol addresses. In PASM, symbols use 9-bit long addresses in the range from 0 to 511. In the PropGCC assembler, the symbols use byte addresses. The jump instruction automatically compensates for this, and a "jmp #loop" does the right thing. However, a "mov temp,#loop" will put the byte address of loop in temp, and not the long address.

    When porting existing PASM drivers, it's probably best to use BSTC to produce a binary blob rather than port it to GAS.
  • jazzedjazzed Posts: 11,803
    edited 2012-04-27 11:51
    Sapieha wrote: »
    With other words.

    My first post in this thread was correct!

    Code written to take advantage of spin features will need to be changed.

    Why do you think this is a problem?
  • ctwardellctwardell Posts: 1,716
    edited 2012-04-27 11:58
    Dave Hein wrote: »
    The syntax and instructions used with the PropGCC assembler are almost the same as PASM. The one big difference it how it treats symbol addresses. In PASM, symbols use 9-bit long addresses in the range from 0 to 511. In the PropGCC assembler, the symbols use byte addresses. The jump instruction automatically compensates for this, and a "jmp #loop" does the right thing. However, a "mov temp,#loop" will put the byte address of loop in temp, and not the long address.

    Dave,

    Can you expand on this or point to some documentation?

    I haven't ran into any issues yet, but I can see this being the cause of a great deal of head banging if not properly understood.

    Thanks,

    C.W.
  • Dave HeinDave Hein Posts: 6,347
    edited 2012-04-27 11:58
    Some objects have Spin start methods that modify variables within the PASM cog image. I think the easiest way to handle that is to move those variables to the beginning of the cog image, and put a jump instruction at location zero to skip over them. That way, a C struct can be defined to match the setup variables at the beginning of a PASM program.
  • Dave HeinDave Hein Posts: 6,347
    edited 2012-04-27 12:34
    ctwardell wrote: »
    I haven't ran into any issues yet, but I can see this being the cause of a great deal of head banging if not properly understood.
    Yes, it can, and has caused some head banging. :) There was some discussion about documenting this in the GCC Developer's forum a while ago, but I don't see anything in the wiki on it. The main thing is to undertand that all symbols use byte addresses. An instruction at cog location 12 has a byte address of 48. As I said the jump instructions compensate for this. This would include jmp, call and djnz. I'm not sure how jmpret handles the destination address, but it handles the source address correctly. I think the trade-off for the jump instructions is that you need to specify a byte address when using a constant source address. A jump to cog location 12 would be "jmp #48" and not "jmp #12".

    The other instructions do not compensate for byte addresses. As I said, "mov test, #loop" deosn't give you the result you would expect from a PASM program. There is a psuedo-op defined for mov that does compensate for byte addresses. I believe it's called "mova". So instead of "mov test, #loop" you would do "mova test, #loop". However, there are no other psuedo-ops like that for the other instructions, such as movs, movd, add, etc.
  • ctwardellctwardell Posts: 1,716
    edited 2012-04-27 13:38
    Thanks Dave, I understand it now.

    That's going to be a source of constant, no pun intended, pain.

    C.W.
Sign In or Register to comment.