Shop OBEX P1 Docs P2 Docs Learn Events
Can I use all the RAM — Parallax Forums

Can I use all the RAM

ShaelShael Posts: 17
edited 2009-04-07 23:50 in Propeller 1
The other day I found the source code for for one of the original pascal pcode compilers. I thought it would be a fun project to port to the Propeller chip.

To test the concept I do not want to add external ram. So to maximize the ram available to my application I want to do the follow;

1) have program start as normal and create all COG objects in SPIN.
2) stop the COG running SPIN
3) Have my master COG Initilize memory address in a global table
4) Allow the remaining COGS to run
5) when the application finishes have the ability to reset Propeller chip.

I have used the Propeller chip for a while now and do not see any real problems with this, but I do not know if there is any global memory that can not be used. Also is there any problem whith stopping the main COG running SPIN. If anyone has a better idea please share it...

Comments

  • Cluso99Cluso99 Posts: 18,069
    edited 2009-04-07 13:33
    This would be a great project smile.gif

    All 1..5 are doable, but your final question has some problems because the compiler builds tables to hlold the spin objects which are paced in hub ram on loading.
    So I will defer to others who understand this area better.

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

    · Home of the MultiBladeProps: TriBladeProp, SixBladeProp, website (Multiple propeller pcbs)
    · Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
    · 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·· MultiBladeProp is: www.bluemagic.biz/cluso.htm
  • MagIO2MagIO2 Posts: 2,243
    edited 2009-04-07 14:31
    Of course you can load all COGs with PASM code, even the one which is currently running the SPIN-code. You have to use COGINIT for that one.
    And yes, you can use the whole memory except the first 16 bytes, as there the clkfreq, clock-mode and pll mode are stored. I am not sure if it is a good idea to change that while the program is running. (Have to figure it out some day ;o)
  • hippyhippy Posts: 1,981
    edited 2009-04-07 20:56
    @ Shael : It should be possible and you can do all that you want; use all RAM, stop the Spin Interpreter in the main Cog and load your own pcode interpreter.

    I did have a go with porting P4 earlier but ran into a brick wall. The biggest problem I've found is that you (1) you cannot find pre-built binaries to execute to generate pcode, (2) you cannot find anything which will create the binaries from the compiler source, (3) the pcode isn't quite what you'd like so needs fixing in the compiler and then you run into (2).

    If you are looking at using P4 or similar the following links may be useful, if something else it would be interesting to hear what you are thinking of using.

    propeller.wikispaces.com/Programming+in+Pascal
    http://forums.parallax.com/showthread.php?p=705104
  • waltcwaltc Posts: 158
    edited 2009-04-07 21:14
    You might consider Wirth's Modula-2 M-code compiler for DOS as a alternative. Both source and binaries are available.

    Link:
    http://www.cfbsoftware.com/modula2/

    Or use Wirth's book on Compiler Construction. In it he has all the source code for a Oberon-0(a subset of Oberon which is a successor to Pascal and Modula-2). Its pretty easy to understand as well compared to the Dragon book.

    You could either convert the code into Turbo Pascal or Delphi(since its a close cousin so to speak) or use one of the freely available Oberon compilers like POW.

    Link:
    http://www.fim.uni-linz.ac.at/pow/Pow.htm
  • ShaelShael Posts: 17
    edited 2009-04-07 23:50
    Thanks very much for all the info....

    I have original pascal source code for the for both pascal-s and pascal-m, and Turbo Pascal code for pascal-s. The "pascal-m" is a multitasking version. Both of these versions require that you get the interpreter coded first then the compiler can be run as it is just a pascal program. The biggest issue I see is that I will require some form of file stream to load the pascal source from and write compiled pcode to. I have wanted to try the SD/FAT code and this seams like a good project for me to get my feet wet.

    If I can get the speed up to say 300k..500K p-codes per sec I will consider optimizing the pcode/compiler to produce smaller p-code and add in·special functions to support·the Propeller chip. In the end it would be like a VIC20/C64 that used pascal instead of basic. Years ago I had written an extended version of the pascal-s to add support for more data types. So I believe it should not take to long to do the interpreter. If all goes well·it should make a fun low cost project.

    PS: For my real job I program in Delphi and have been a Pascal programer since the the first version of Turbo Pascal for CPM came out.
Sign In or Register to comment.