1451
Comment:
|
5383
|
Deletions are marked like this. | Additions are marked like this. |
Line 1: | Line 1: |
PyMite is a flyweight Python interpreter written from scratch to execute on 8-bit microcontrollers. It is a work-in-progress, but is developed enough to run demonstration programs. Because PyMite runs on 8-bit architectures, one should not expect the interpreter to do everything its desktop counterpart can do. However, it's capability is increasing daily. Since PyMite is a re-implementation of Python, written in ANSI C, it also has a few new features: stackless from the start; fast, easy, native function support and a hybrid mark-sweep garbage collector. | === What is PyMite === |
Line 3: | Line 3: |
PyMite is not yet available for public consumption. The PyMite source will be posted to sourceforge in time for PyCon 2003. PyMite currently compiles to a Linux desktop and cross compiles (using avr-gcc) to an Atmel atmega103. | PyMite is a flyweight Python interpreter written from scratch to execute on 8-bit and 32-bit microcontrollers. PyMite supports a subset of the Python 2.0 syntax and can execute a subset of the Python 2.0 bytecodes. PyMite can be compiled, tested and executed on a desktop computer and also targeted for embedded systems with resources as limited as 32 KiB of program memory (flash) and 4 KiB of RAM. Considering PyMite is designed to run on embedded 8-bit architectures, one should not expect PyMite to do everything Python can do. However, it's capability is comparable to Basic. Since PyMite is written from scratch, it has a few features that set it apart: stackless from the start; fast, easy, native C function support and a hybrid mark-sweep garbage collector. === Availability === PyMite r 03 was released 2006/09/18 and is available from http://pymite.python-hosting.com/ |
Line 5: | Line 12: |
=== Conversation Before PyCon 2003 === |
|
Line 11: | Line 20: |
Line 19: | Line 29: |
This is a fascinating project. I've been looking for an embeddable system-on-a-chip that would run a reduced-size python. It would be a great help to attendees of your talk without previous microcontroller background to see on this wiki a list of typical devices you are targeting, so that we might familiarize ourselves with them beforehand. I'm specifically interested in the [http://developer.axis.com/products/etrax100lx/ AxisETRAX] as an embedded system. It seems capable enough (runs linux) that it might run a standard python, given enough RAM and eliminating unecessary libraries. PyMite is exciting because it might run (and run fast) on the standard [http://developer.axis.com/products/etrax100lx/ standard chip] or [http://developer.axis.com/products/mcm/index.html MCM] with no additional storage. -Jeff Kowalczyk ---- Very impressive effort. I have written a multitasking OS for AVRs and working on a simple language compiler but I like the look of PyMite better! I am wondering at the performance you have observed with PyMite - all those overheads are not noticed on a desktop processor, but they must be a problem on small MCUs. I am looking forward to giving PyMite a spin and seeing what it can do. Cheers, MikeS - mike at acslink stop net stop au === Comments & Answers on feedback === All, I have made release_01 available on Sourceforge under the Artistic License. This release is ugly in the sense that I have not made one ounce of effort to make the directory structure pretty. I simply zipped up the development tree as it exists in version 7 (I'm using Subversion for source code management). I apologize for the ugliness please send feedback on how I can improve this. The URL is: http://sourceforge.net/projects/thmonkeeproject Brian, thanks for the enthusiasm. I can say that reading/writing to Ports and peripherals is critically important and is supported. However, my approach is a bit more generic than your example. My first crack at solving this is to employ peek(addr) and poke(addr, val) operations which read and write values in memory. Since most MCUs have their peripheral control registers mapped into memory, these two operations allow abundant flexibility and a platform-neutral interface. Jeff, one early bit of feedback I got was to avoid talking too much about hardware (when I felt I had barely mentioned hardware in my paper). So it is good to hear your comments which ask for more hardware details; this balances the scales. As I said above, the primary target is the Atmel AtMega103 (or 128) because this is the device I have driving my robot controller board. However, any device in the AtMega family which meets these requirements: 20KiB Flash and 4K RAM, will run today. But the 4K heap is rather small and limits the complexity of programs that can be run. I am also intending to port PyMite to the popular Motorola HC11-through-Star12 family. Porting to the HC11 would allow PyMite to run on MIT's popular Handyboard robot controller. These first two porting targets are simply my preference. This does not limit in any way someone takng the PyMite source and porting it to the processor of their choice. The only requirements so far are an ANSI C compiler, and a fair amount of porting effort. Jeff, you mention the Axis controller. I find the "standard chip" to be more like a microprocessor and the MCM to be more like a microcontroller (memory and peripherals are on-board). If linux (uCLinux?) runs on this device, PyMite would offer less resource consumption than running the full Python interpreter. However, PyMite is still too early in development to make any claims that it would be "better" for this environment. ---- |
What is PyMite
PyMite is a flyweight Python interpreter written from scratch to execute on 8-bit and 32-bit microcontrollers. PyMite supports a subset of the Python 2.0 syntax and can execute a subset of the Python 2.0 bytecodes. PyMite can be compiled, tested and executed on a desktop computer and also targeted for embedded systems with resources as limited as 32 KiB of program memory (flash) and 4 KiB of RAM.
Considering PyMite is designed to run on embedded 8-bit architectures, one should not expect PyMite to do everything Python can do. However, it's capability is comparable to Basic. Since PyMite is written from scratch, it has a few features that set it apart: stackless from the start; fast, easy, native C function support and a hybrid mark-sweep garbage collector.
Availability
PyMite r 03 was released 2006/09/18 and is available from http://pymite.python-hosting.com/
Conversation Before PyCon 2003
I would like to know how many people plan to attend this presentation. I would also like to target my presentation as best I can to those people attending. So please add questions/suggestions below; for example:
- I would attend if ...
Will PyMite run on ...
- etc.
your question/comment here
Very Cool! I have an AVR board that is just itching to have this installed. I will definitely be in attendance! I'm especially interested in what kind of hardware interfaces you're providing (avr.porta.write(0x34)?) and what kind of simulation environment (if any) exists. -PyConBrianWarner
This is a fascinating project. I've been looking for an embeddable system-on-a-chip that would run a reduced-size python. It would be a great help to attendees of your talk without previous microcontroller background to see on this wiki a list of typical devices you are targeting, so that we might familiarize ourselves with them beforehand.
I'm specifically interested in the [http://developer.axis.com/products/etrax100lx/ AxisETRAX] as an embedded system. It seems capable enough (runs linux) that it might run a standard python, given enough RAM and eliminating unecessary libraries. PyMite is exciting because it might run (and run fast) on the standard [http://developer.axis.com/products/etrax100lx/ standard chip] or [http://developer.axis.com/products/mcm/index.html MCM] with no additional storage. -Jeff Kowalczyk
Very impressive effort. I have written a multitasking OS for AVRs and working on a simple language compiler but I like the look of PyMite better! I am wondering at the performance you have observed with PyMite - all those overheads are not noticed on a desktop processor, but they must be a problem on small MCUs. I am looking forward to giving PyMite a spin and seeing what it can do.
Cheers, MikeS - mike at acslink stop net stop au
Comments & Answers on feedback
All, I have made release_01 available on Sourceforge under the Artistic License. This release is ugly in the sense that I have not made one ounce of effort to make the directory structure pretty. I simply zipped up the development tree as it exists in version 7 (I'm using Subversion for source code management). I apologize for the ugliness please send feedback on how I can improve this. The URL is: http://sourceforge.net/projects/thmonkeeproject
Brian, thanks for the enthusiasm. I can say that reading/writing to Ports and peripherals is critically important and is supported. However, my approach is a bit more generic than your example. My first crack at solving this is to employ peek(addr) and poke(addr, val) operations which read and write values in memory. Since most MCUs have their peripheral control registers mapped into memory, these two operations allow abundant flexibility and a platform-neutral interface.
Jeff, one early bit of feedback I got was to avoid talking too much about hardware (when I felt I had barely mentioned hardware in my paper). So it is good to hear your comments which ask for more hardware details; this balances the scales. As I said above, the primary target is the Atmel AtMega103 (or 128) because this is the device I have driving my robot controller board. However, any device in the AtMega family which meets these requirements: 20KiB Flash and 4K RAM, will run today. But the 4K heap is rather small and limits the complexity of programs that can be run. I am also intending to port PyMite to the popular Motorola HC11-through-Star12 family. Porting to the HC11 would allow PyMite to run on MIT's popular Handyboard robot controller. These first two porting targets are simply my preference. This does not limit in any way someone takng the PyMite source and porting it to the processor of their choice. The only requirements so far are an ANSI C compiler, and a fair amount of porting effort.
Jeff, you mention the Axis controller. I find the "standard chip" to be more like a microprocessor and the MCM to be more like a microcontroller (memory and peripherals are on-board). If linux (uCLinux?) runs on this device, PyMite would offer less resource consumption than running the full Python interpreter. However, PyMite is still too early in development to make any claims that it would be "better" for this environment.