Shop OBEX P1 Docs P2 Docs Learn Events
Quick Status Update of ImageCraft Propeller C — Parallax Forums

Quick Status Update of ImageCraft Propeller C

ImageCraftImageCraft Posts: 348
edited 2008-01-21 23:10 in Propeller 1
Hi, just thought I owe you all a quick status update: ImageCraft Propeller C beta is late :-( Basically we had some resource scheduling issues and one of the main pieces that we were going to use (the assembler and linker), is based off a new asm/linker that we were developing for the ARM tools. The ARM asm/linker ran into some stability issues so everything just got bumped off down the road a bit. I have now re-allocated some resources and the Propeller C is the highest priority new development here at ImageCraft. When I have a better sense of when the beta will be available, I will post here.

Thank you for your patience. Feel free to contact me richard @ imagecraft.com if you have any comments and suggestions.

// richard
«1

Comments

  • Beanie2kBeanie2k Posts: 83
    edited 2007-11-18 00:42
    Thanks for the update. It's always a good feeling to hear how a project is progressing, even when the inevitable bumps in the road occur. Hope everything is going smoothly now, and please do keep us informed.
  • ImageCraftImageCraft Posts: 348
    edited 2007-11-29 02:02
    The assembler and linker effort are (finally) going well. Current status:

    ****
    The assembler handles
    Instructions ( Cog Control, Flow control, Main Memory Access, Common Operations )
    Relocation
    Symbol resolution
    Effects and Conditions
    ORG Directive

    Following are the TBD tasks:
    Directives FIT and RES.
    Process control instructions.
    Unary and binary operators
    Macros.
    ****

    Some kind of alpha look-see may be available by the end of Dec. Since we are leveraging a lot of our existing code base, once things start moving, it should go pretty fast.

    Will keep the forum updated as warranted. Thank you for your patience.

    // richard
  • Christof Eb.Christof Eb. Posts: 1,161
    edited 2007-11-29 19:15
    Hi Richard,

    in my opinion 25%...50% of the strength of the propeller lies in this forum and the code: spin and assembler, that is already there for very different questions. Is there any chance to use the spin system and your compiler together? For example translate a c-source to a assembler module to be included into a spin program?

    Christof
  • Joel RosenzweigJoel Rosenzweig Posts: 52
    edited 2007-11-29 19:21
    Can you post the names of the functions that are included in the·C run-time library?· I'd like to know what high level functions will be built as libraries and made available for use.

    Thanks,
    Joel
  • ImageCraftImageCraft Posts: 348
    edited 2007-11-30 01:35
    Christof Eb. said...
    Hi Richard,

    in my opinion 25%...50% of the strength of the propeller lies in this forum and the code: spin and assembler, that is already there for very different questions. Is there any chance to use the spin system and your compiler together? For example translate a c-source to a assembler module to be included into a spin program?

    Christof

    That's a laudable goal. In theory, one can take a C translated asm module, and if it doesn't use the C library functions, include it to their own spin/asm program. We will try to make our asm syntax as compatible as with the existing asm as possible, but the big issue is that we will (at first) generating Large Memory Model code, so the generated asm is relying on a C Virtual Machine (*) running on the COG.

    Of course going the other way of incorporating existing asm modules into C projects are supported. In fact, the hope is that most existing Propeller objects will be translated for use under the ICC environment and we will do everything possible to facilitate that.


    (*) Again, this is a low overhead VM and not a byte code interpreter ala SPIN. The performance goal is 2x to 4x slower than asm code.
  • ImageCraftImageCraft Posts: 348
    edited 2007-11-30 01:37
    Joel Rosenzweig said...
    Can you post the names of the functions that are included in the C run-time library? I'd like to know what high level functions will be built as libraries and made available for use.


    Thanks,

    Joel

    We support most C99 functions except some esoteric math (bessel) and stdio where it relies of a file system. Most of our libraries are written in C and can be ported easily. We write certain heavily loop oriented functions like strcpy in asm to get the max. speed.

    Since the SD interface seems to be popular, at some point, we will support that too, one way or another.
  • rjo_rjo_ Posts: 1,825
    edited 2007-11-30 05:21
    Richard,

    What is most exciting is that you appear to have filtered all of the feedback and come up with a development model that will not only speak to your customer base but also add real heterogeneity to the tool set. An introductory text-book to C based on your product would be
    a real asset. Even professors are sometimes reluctant to embrace yet another new language. But given the opportunity of using the Prop and C together, I don't see how a real teacher could resist it.

    Rich
  • Chris MerckChris Merck Posts: 55
    edited 2007-12-01 07:10
    @rjo_, I agree entirely about C on the propeller lowering the hurdle for new users, especially in the academic sector.

    I believe that "You can program it in C" draws people in and if they give Spin a try they will most likely switch to it since it is so well integrated with the hardware. I have had a hell of a time convincing friends to try the prop since it cannot yet be programmed in C from a Linux machine (yes... my buddies are purists).
  • Joel RosenzweigJoel Rosenzweig Posts: 52
    edited 2007-12-04 19:48
    ImageCraft said...
    Joel Rosenzweig said...
    Can you post the names of the functions that are included in the C run-time library? I'd like to know what high level functions will be built as libraries and made available for use.


    Thanks,

    Joel

    We support most C99 functions except some esoteric math (bessel) and stdio where it relies of a file system. Most of our libraries are written in C and can be ported easily. We write certain heavily loop oriented functions like strcpy in asm to get the max. speed.

    Since the SD interface seems to be popular, at some point, we will support that too, one way or another.
    So the C99 libraries are a good start, but I was thinking of something more than that.··Developers would be looking for libraries that do many of the functions in the SPIN object library.· For example, there should be set of routines for reading and writing the EEPROM over I2C, generic I2C I/O, serial I/O functions, a graphics library etc.· That is, there should be libraries for accessing much of the·embedded goodness that the Prop offers above and beyond a basic no frills computing machine.· The object exchange does a great job of exposing these capabilities.· If a developer were to use the C compiler to write programs, it would be beneficial to have access to a similar set of libraries.· If you have developed some other mechanism for interleaving C and SPIN, then I suppose you wouldn't need to provide any of these libraries above and beyond C99.· Perhaps that was your plan?

    Thanks,
    Joel-
  • Mike GreenMike Green Posts: 23,101
    edited 2007-12-04 20:50
    Joel,
    You misunderstand the relationship between Spin and Assembly language. Essentially there is no mechanism for interleaving C and Spin. Some of the assembly routines contained in the various I/O drivers could be copied over to ImageCraft's assembler and modified to use C interfaces rather than Spin interfaces, but that would have to be done by someone and probably would not be done for the initial releases because of the time and effort involved. ImageCraft has also talked about optionally targeting code that would run in a cog directly rather than by using the Large Memory Model interpreter. It's also not clear whether they will have that capability in initial releases although that would ease the conversion of many of the I/O drivers to a mixture of C and assembly.
  • Joel RosenzweigJoel Rosenzweig Posts: 52
    edited 2007-12-05 02:45
    Mike,

    My question about interleaving C and SPIN (not C and Assembly) isn't the main idea of the question.· That's just a non-compiler guy like me asking a question about how something will be implemented.· The main idea of the question is what library support is available to support the high level functions that we currently enjoy from the SPIN object exchange today.· If I write a program in C for the Prop, I really want access to high level functions to take advantage of the chip.· If I bother to use a C compiler, I expect that it will have a useful library of I/O functions that take advantage of the underlying hardware.· Some of the items in the object exchange would make a great set of primitives.·Based on the response so far, it appears that·there are no plans to provide this type of high level library support.· That is too bad.

    In order for the C compiler to be useful to the general developer population, it needs some high level and interesting primitives to thrive.· I think the SPIN object exchange meets that need for all of us as SPIN developers.· But if you replace SPIN with C, you need something to replace those high level objects for the C developers.··

    Joel-
    ·
  • hippyhippy Posts: 1,981
    edited 2007-12-05 03:32
    It's a fair point; are Propeller C programs completely standalone or is there a way to include them ( as generated object code ) as part of a Spin program, and is it then possible to interact between Spin/Assembler and that C generated code.

    Much as existing Large Memory Model ideas would co-exist alongside other Cogs running the Spin interpreter or Assembler, would C object code be usable in the same way ?
  • Bill HenningBill Henning Posts: 6,445
    edited 2007-12-05 03:47
    I am guessing it will be stand-alone.

    My large model work has been significantly hobbled by having to "trick" spin; that's why I've been working on a large model macro assembler / linker.
    hippy said...
    It's a fair point; are Propeller C programs completely standalone or is there a way to include them ( as generated object code ) as part of a Spin program, and is it then possible to interact between Spin/Assembler and that C generated code.

    Much as existing Large Memory Model ideas would co-exist alongside other Cogs running the Spin interpreter or Assembler, would C object code be usable in the same way ?
    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.mikronauts.com - a new blog about microcontrollers
  • Paul BakerPaul Baker Posts: 6,351
    edited 2007-12-05 05:32
    There might be a method of including a .bin file in a C program as data and strap up a Spin interpreter, there will be the complication of address offset that will occur but its not insurmountable (but very akward at best).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker
    Propeller Applications Engineer

    Parallax, Inc.
  • ImageCraftImageCraft Posts: 348
    edited 2007-12-05 06:10
    Joel Rosenzweig said...
    .... Based on the response so far, it appears that there are no plans to provide this type of high level library support. That is too bad.

    In order for the C compiler to be useful to the general developer population, it needs some high level and interesting primitives to thrive. I think the SPIN object exchange meets that need for all of us as SPIN developers. But if you replace SPIN with C, you need something to replace those high level objects for the C developers.

    Joel-

    Well, Joel, the only official ImageCraft spokeperson is... me, so you couldn't have known what the official ImageCraft response is smile.gif

    First: I'd think everyone would agree that having the high level objects available to the C programmers would be a good thing. Regardless how it is implemented, they will appear to the C program as library functions.

    As for How it will be implemented, my current understanding with SPIN / Propeller etc. is that a clean implementation in C or asm is probably what we are looking at, and not somehow executing SPIN code. This may change but my guess is that it is just a lot easier this way.

    As for When and Who, our primary goal right now is get a working compiler. As you may know, we are sort of late already, so this is definitely not a First Release item. Once we get the compiler out the door, we will throw some resources at the problem, and who knows, may be we can even get some help from the community and may be even Parallax itself. We shall see.

    Thanks for your interest.
    // richard
  • hippyhippy Posts: 1,981
    edited 2007-12-05 08:54
    Even if the C Compiler is entirely standalone there would undoubtedly be some way of getting a Cog running the Spin interpreter. As long as there's some way of getting the right addresses to the interpreter it would work. So whether a C generated .bin included in a Spin program or a Spin generated .binary in a C program it should be possible with the same end result.

    The worst case scenario ( if there were address incompatibilities or conflicts ) would be someone had to write a Spin interpreter in C which would then run in its own Cog and interpret the embedded Spin .binary code making sure it didn't step on the C object code.

    Alternatively, and perhaps easier ... if the ImageCraft object code is not encrypted or can be decoded it shouldn't be that hard to determine the C-kernel code or memory layout expected by it, modify/rewrite that, include and launch the new C-kernel from Spin and let it run. That's really no different to running any LMM code from a Spin program.

    I do not see why Ram cannot be split between the two, Spin and C, and the two co-exist with their user PC and configuration dataset origins at different locations. Because the C implementation is entirely software that's likely the easiest to adjust. Only if the C object code used particular absolute addresses would there be an issue and even that could be overcome.

    If ImageCraft and Parallax could work together on that it would save a lot of end-user hacking effort ( although some may relish the idea of achieving it themselves ! ). I wouldn't want to see the C compiler delayed though because of any integration issues, that can always be resolved and implemented later.
  • AleAle Posts: 2,363
    edited 2007-12-05 11:36
    hippy said...
    Alternatively, and perhaps easier ... if the ImageCraft object code is not encrypted or can be decoded it shouldn't be that hard to determine the C-kernel code or memory layout expected by it, modify/rewrite that, include and launch the new C-kernel from Spin and let it run. That's really no different to running any LMM code from a Spin program.

    If any of that happens, it will be very unfortunate. We do not need more obscurity, ... in that case we are better with an open source approach.
    Did anybody attempt a port of gcc to a new uP before ? (It is quite tricky).

    edit: corrected lousy mistake.

    Post Edited (Ale) : 12/5/2007 4:02:58 PM GMT
  • Chris MerckChris Merck Posts: 55
    edited 2007-12-05 14:32
    Ale said...
    anybody attempted a port of gcc to a new uP before ? (It is quite tricky).

    I certainly have not. However, regardless of the possibly gargantuan effort required to port gcc to the Prop, suppose for a minute it can be done. A well-working GCC port would be a _huge_ asset to anyone with an interest in the propeller (and assuming the architecture doesn't change overmuch, the prop2 as well).

    That said, perhaps a less tricky option would be to port sdcc: sdcc.sourceforge.net/

    However that would still require thousands of lines of laborious (and since it is gpl'ed, self-less) work.

    Someone up to the challenge?
  • RaymanRayman Posts: 14,162
    edited 2007-12-05 15:00
    It seems like such a big task, creating a C compiler for the Prop... I'll be impressed if ImageCraft actually pulls it off!
  • ImageCraftImageCraft Posts: 348
    edited 2007-12-05 21:40
    Rayman said...
    It seems like such a big task, creating a C compiler for the Prop... I'll be impressed if ImageCraft actually pulls it off!

    Nah, Propeller is relatively easy. The worst is designing the runtime architecture...

    As for object code etc.: it's not encrypted.

    As for integrating Spin and C: it may be possible, lets wait and see.

    As for GCC and SDCC: feel free to try. Good luck.
  • RaymanRayman Posts: 14,162
    edited 2007-12-05 23:47
    What about the VGA/TV drivers? These are a combo of SPIN and ASM (Ok, mostly ASM)... Are you going to translate these to C? Then, they wouldn't be fast enough, right?
  • Mike GreenMike Green Posts: 23,101
    edited 2007-12-05 23:51
    Rayman,
    Don't forget. The C compiler includes an assembler. A combination of C and assembly works just as well as a combination of Spin and assembly for drivers.
  • RaymanRayman Posts: 14,162
    edited 2007-12-05 23:57
    Mike: Are you thinking about converting FemtoBasic to C?
  • rokickirokicki Posts: 1,000
    edited 2007-12-06 00:21
    I wrote the original femtobasic, and it started life as C code that was then automatically translated to Spin.
    The C code, of course, still exists and presumably will run with the ImageCraft compiler.
  • RaymanRayman Posts: 14,162
    edited 2007-12-06 00:37
    I still don't see how the C code is going to work for VGA/TV... I think I read that they plan on using a large memory model so that speed will be 1/4 that of native assembly. I don't think this will be fast enought for the VGA/TV drivers...
  • Mike GreenMike Green Posts: 23,101
    edited 2007-12-06 00:54
    Rayman,
    A number of I/O drivers with tight timing constraints like the VGA/TV drivers will still need to have their assembly portions in assembly language. Since ImageCraft's C compiler includes an assembler, they should be convertable into a mixture of C and assembly with the assembly portion pretty much unchanged.
  • hippyhippy Posts: 1,981
    edited 2007-12-06 01:46
    I can see we are all going to have to come up with some common terms so we can distinguish between which "Assembler" is which - native, LMM or C-LMM - or we're going to get into problems. I had to read Rayman's comment twice to understand the problem he was perceiving; as Mike says, native prop Assembler in a Cog will still be the core drivers, only the character formatting and so on code currently in Spin needs changing to be a C-based interface library.
  • ImageCraftImageCraft Posts: 348
    edited 2007-12-19 12:02
    Dec 19 2007 Status:

    Compiler:
    - All non-floating point operations supported
    - need to do: function entry / exit code
    - need to do: register allocator tuning, peephole, codegen optimizations

    Assembler:
    - all instructions, effects etc. supported
    - most directives supported. Memory area attributes need to be done
    - operators not yet supported

    Linker:
    - Most relocations done
    - need to support library files

    Library
    - at the minimum, need to support mul and div/mod

    C machine LMM kernel
    - Design mostly complete, coding to be started

    IDE
    - not yet started, need Propeller download utility

    // richard
  • CardboardGuruCardboardGuru Posts: 443
    edited 2007-12-19 12:47
    Propeller Wiki updated:

    Programming in C

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Help to build the Propeller wiki - propeller.wikispaces.com
    Play Defender - Propeller version of the classic game
    Prop Room Robotics - my web store for Roomba spare parts in the UK
  • AleAle Posts: 2,363
    edited 2007-12-19 13:05
    CardboradGuru, not to be picky, but I already provided a functional LMM assembler (in the wiki only says that Bill is working on one assembler). The kernel is still under development, the caching part is written and works. My specification is already written, but not fully implemented.
Sign In or Register to comment.