Welcome, Guest. Please login or register.
Did you miss your activation email?

Username: Password:


Pages: [1]   Go Down

Author Topic: Largest size of pawn script?  (Read 8223 times)

GarethNelson

  • Coffee leaf addict
  • *** Posts: 52
  • Male
Largest size of pawn script?
« on: August 10, 2010, 10:19:09 AM »

I'm wondering how big a compiled pawn script can be - presumably the pleo loads the whole thing into RAM and doesn't read it dynamically from SD, or not?
Logged


Your resident hacker type (of hardware, software and wetware - and pleos)

InmemoryofRomeo

  • Global Moderator
  • Pleo Grand Master RB
  • * Posts: 6903
  • au Female
  • Pleo(s): Lilo, Stitch, Pleakley, Jumba, Nani, Yuki, Angus, Pluto
  • : 2011 winner2009 winnerTomato Harvest Festivals
  • SAVE THE EARTH It's the only planet with chocolate
    • Professor
    • Wile_E_Coyote
    • Marcie
Re: Largest size of pawn script?
« Reply #1 on: August 10, 2010, 07:03:35 PM »

I don't think you will ever run into major issues, I think it will depend on the script if Pleo loads it or not, there is coding in that could allow for it, although whether we can access that I don't know. Pleo has very very little internal memory though so if you do load something permanent to Pleo you need to be careful of size.

If you check out the downloads available most of them are only a few Meg and that's mostly due to the audio files.
Logged
Eagerly awaiting Vector and Blue!

GarethNelson

  • Coffee leaf addict
  • *** Posts: 52
  • Male
Re: Largest size of pawn script?
« Reply #2 on: August 10, 2010, 07:33:34 PM »

The audio files are seperate though :)

How much RAM is there actually? I've not been able to find those specs anywhere.
Logged
Your resident hacker type (of hardware, software and wetware - and pleos)

InmemoryofRomeo

  • Global Moderator
  • Pleo Grand Master RB
  • * Posts: 6903
  • au Female
  • Pleo(s): Lilo, Stitch, Pleakley, Jumba, Nani, Yuki, Angus, Pluto
  • : 2011 winner2009 winnerTomato Harvest Festivals
  • SAVE THE EARTH It's the only planet with chocolate
    • Professor
    • Wile_E_Coyote
    • Marcie
Re: Largest size of pawn script?
« Reply #3 on: August 10, 2010, 07:42:53 PM »

I have no idea, Degers would probably be the one to answer that. I have very very limited knowledge of this pawn stuff, I can fill in the blanks on someone else's code but creating my own is beyond me :P I'd love to learn but it's not particularly relevant to my line of work so I don't think I shall ever be able to devote the time to do it.

I checked what scripts I do have though, the largest is 107 kb :P
Logged
Eagerly awaiting Vector and Blue!

grumpy

  • Administrator
  • Pleosmith
  • * Posts: 599
  • we Male
  • : 2008 winnerTomato Harvest Festivals
    • Skipper
    • Wile_E_Coyote
    • Statler
    • Lucy
    • Bob the Pleo
Re: Largest size of pawn script?
« Reply #4 on: August 11, 2010, 11:51:18 AM »

the main processor is an Atmel AT91SAMS256  32-bit ARM microprocessor with 256 KB embedded flash.  This holds the data and main OS.  Not much room left . . .
Logged

GarethNelson

  • Coffee leaf addict
  • *** Posts: 52
  • Male
Re: Largest size of pawn script?
« Reply #5 on: August 11, 2010, 03:47:32 PM »

That's flash, not RAM. I just checked out pleo/limits.inc included in the PDK, and found there's roughly 4MB for the main VM, 3MB for sensors VM, 2MB for behaviour VM (in LifeOS 1.0, it's 5MB in 1.1)
And it also mentions "streaming code" - which implies that it does indeed stream from SD.

This is good news......
Logged
Your resident hacker type (of hardware, software and wetware - and pleos)

InmemoryofRomeo

  • Global Moderator
  • Pleo Grand Master RB
  • * Posts: 6903
  • au Female
  • Pleo(s): Lilo, Stitch, Pleakley, Jumba, Nani, Yuki, Angus, Pluto
  • : 2011 winner2009 winnerTomato Harvest Festivals
  • SAVE THE EARTH It's the only planet with chocolate
    • Professor
    • Wile_E_Coyote
    • Marcie
Re: Largest size of pawn script?
« Reply #6 on: August 11, 2010, 07:37:57 PM »

Wow that's not a lot :) If it streams from the SD card though then you could potentially have massive files :)
Logged
Eagerly awaiting Vector and Blue!

grumpy

  • Administrator
  • Pleosmith
  • * Posts: 599
  • we Male
  • : 2008 winnerTomato Harvest Festivals
    • Skipper
    • Wile_E_Coyote
    • Statler
    • Lucy
    • Bob the Pleo
Re: Largest size of pawn script?
« Reply #7 on: August 12, 2010, 10:26:38 AM »

There is an additional 4MB Atmel AT45DB321D flash  memory component on the main board, but I'm not sure about RAM....
Logged

PleoPet

  • Pleontologist
  • * Posts: 162
  • Female
Re: Largest size of pawn script?
« Reply #8 on: August 16, 2010, 06:49:09 AM »

See here for tech specs on hardware: http://www.aibohack.com/pleo/tech1.htm and http://www.aibohack.com/pleo/tech2.htm (page is somewhat old, but still accurate AFAIK)

For RAM, the main chip has 64KB total static RAM. That is used for the low level OS, as well as any currently running Pawn programs and data.
The Pawn interpreter is pretty smart. It will page in code (AMX) into RAM as needed. It also will page-in sound and motion resources as needed (ie. it will 'stream' from the SD or built in personality).
That is not a typo - 64KB as in kilobytes (65536 bytes of RAM total)

The  PLEOPM default personality is ~4MB in size (stored in Flash), but paged into RAM as needed.
----
For custom programs you write yourself, you will probably not run out of space because the program, sound or motion data.

IMHO the big limit is the static data in the program.
I hit that with the YAPT interpreter. I loaded all the table based behavior into RAM.

=====
> I just checked out pleo/limits.inc included in the PDK, and found there's roughly 4MB for the main VM, 3MB for sensors VM, 2MB for behaviour VM (in LifeOS 1.0, it's 5MB in 1.1)
That's the file to look in.
However they aren't MB ... they are KB (no joke)

So to be clear, the total RAM limit for Stack and Data (and a little overhead) for the Main VM is 4KB (ie. 4096 BYTES!!!)
(the Sensor VM limit is 3KB, the User VM limit is 2KB, the Behavior VM limit is 2KB or 2.5KB)

Unfortunately,  this is no joke.

« Last Edit: August 16, 2010, 07:00:26 AM by PleoPet »
Logged

GarethNelson

  • Coffee leaf addict
  • *** Posts: 52
  • Male
Re: Largest size of pawn script?
« Reply #9 on: August 16, 2010, 10:59:12 AM »

One wonders if a hardware hack to upgrade would be feasible - in theory, if it's a seperate chip, considering how there's no fancy virtual memory allocation going on, so long as the OS blindly refuses to allocate outside of that range, replacing the chip should suffice.
Of course, you'd have to be pretty mad to risk doing so - I was scared to hell when I had a botched firmware update! (Fixed it, but it was still scary)
Logged
Your resident hacker type (of hardware, software and wetware - and pleos)

grumpy

  • Administrator
  • Pleosmith
  • * Posts: 599
  • we Male
  • : 2008 winnerTomato Harvest Festivals
    • Skipper
    • Wile_E_Coyote
    • Statler
    • Lucy
    • Bob the Pleo
Re: Largest size of pawn script?
« Reply #10 on: August 16, 2010, 02:02:27 PM »

The Pleo Teardown on the iFixit site ( http://www.ifixit.com/Teardown/Pleo-Teardown/597/3 )has some good shots of the circuit boards. 

Logged

PleoPet

  • Pleontologist
  • * Posts: 162
  • Female
Re: Largest size of pawn script?
« Reply #11 on: August 16, 2010, 03:16:37 PM »

re: hardware hack to increase RAM, computing power etc.

If there is an application that needs it, I recommend slapping on a more powerful CPU (or embedded computer) and attach it to the serial port of the Pleo. That way you aren't limited to the hardware design of the Pleo.
Or use an XBee or Bluetooth connection to your PC, and use the power of a wireless attached PC.
(check older threads on this board for info)

The advantages: you can write the program in any language you like (not just Pawn). You aren't limited to a low cost processor. You don't need to re-write the PLEO primitives (you are using the Pleo as a robot puppet, under control of your smarter program).

BUT please start with the Pleo PDK. You can do most simple things with the PDK and no extra hardware.
----
Commentary on virtual memory (a little history):
In these days where an iPhone4 has 1/2 GB of RAM, the poor old Pleo has only 64KB (1/8000th) of that RAM.
You may wonder why these dinosaurs became extinct ;->

But to their credit, the UGOBE engineers did do amazing things with such little memory.
The Pawn interpreter swapping technology is amazingly efficient. They worked with the Pawn interpreter folks (compuphase.com) so that the large 4MB personality could work within a few KB of RAM.

======
re: Pleo Teardown

Tearing apart a Pleo is rather fun...
The hard part is putting it back together ;->
Logged

GarethNelson

  • Coffee leaf addict
  • *** Posts: 52
  • Male
Re: Largest size of pawn script?
« Reply #12 on: August 17, 2010, 05:53:44 AM »

I do intend to get a wireless module of some sort actually - but bearing in mind the expense (yeah, i'm a poor fool) it might take me a long time before I can use more than just a long USB cable.

What I would love to do is write native code (not pawn) that can run inside the head CPU and do more in-depth image analysis. I'm something of a wizard with machine vision and could probably implement something better than the simplistic colour tracking (say, an optimised version of SIFT for example, then send a bunch of tuples containing corners data).
Logged
Your resident hacker type (of hardware, software and wetware - and pleos)
Pages: [1]   Go Up
 

SimplePortal 2.3.5 © 2008-2012, SimplePortal