GithubHelp home page GithubHelp logo

abzac / python-on-a-chip Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 0.0 3.07 MB

Automatically exported from code.google.com/p/python-on-a-chip

License: Other

Makefile 1.51% Python 8.84% C 28.33% C++ 59.74% Assembly 0.21% Shell 0.01% Perl 6 0.19% Perl 0.77% Prolog 0.30% Batchfile 0.02% Objective-C 0.09%

python-on-a-chip's People

Contributors

bjones1 avatar dwhall avatar jsnyder avatar offe avatar padelt avatar polymorphm avatar

Watchers

 avatar

python-on-a-chip's Issues

Update pmDist.py for new repository

src/tools/pmDist.py should be updated to use the new repository.

Also update HowToReleasePyMite.txt to remove the redundant step of tagging 
the release branch; pmDist.py takes care of that.

Original issue reported on code.google.com by [email protected] on 21 Apr 2009 at 2:52

Change src/platform and src/lib to use LGPL

The platform ports and cross-platform libraries should use LGPL so Dean can 
avoid copyright issues with people who contribute ports and libs.

Add the LGPL text to src/platform/LICENSE and src/lib/LICENSE.

Original issue reported on code.google.com by [email protected] on 16 Apr 2009 at 7:00

Make mbed's "make zip" work without needing a local compiler

What steps will reproduce the problem?
1. Assume local PC does not have arm-elf-gcc.
2. $ cd src/platform/mbed; make zip

What is the expected output? What do you see instead?
Want a zip file, but the the ARM compiler is invoked.
Would like to get the zip file without needing an ARM compiler installed.

Original issue reported on code.google.com by [email protected] on 22 May 2009 at 2:51

Make ipm so it doesn't fail when an exception occurs

Currently, ipm can't handle exceptions and requires the user to quit/reset.  
After exceptions are implemented, ipm should be changed to catch exceptions, 
print any traceback, but continue.

Depends on issue #6

Original issue reported on code.google.com by [email protected] on 19 Apr 2009 at 2:57

  • Blocked on: #6

Fix SLICE_0

What steps will reproduce the problem?
Example 1: In string case, should use TOS not pobj1.
Example 2:
ipm> t1 = (1,2,3)
ipm> t2 = t1[:]
ipm> assert id(t1) != id(t2)

What is the expected output? What do you see instead?
Example 1: I can't find a way to make it error, but visual inspection shows 
it is wrong.
Example 2: t1 and t2 should have different addresses.


Original issue reported on code.google.com by [email protected] on 18 May 2009 at 10:25

Add support for try/finally/except

What steps will reproduce the problem?
ipm> try:
 a=4/0
except Exception, e:
 print "in exception"
finally:
 print "in finally"

What is the expected output? What do you see instead?

Expected:
in exception
in finally

Got:
NotImplementedError:Illegal bytecode (122/0x7a/SETUP_FINALLY) comes at 
offset 0 in file <ipm>.

Solution depends on classes in order to create the Exception class.

Original issue reported on code.google.com by [email protected] on 16 Apr 2009 at 5:31

Fix argument passed when method is created

Jan Wedel discovered this issue while porting the PyMite VM to Java ME.  
Here is the problem description in his words: 

in the LOAD_ATTR section of “interp.c” , there is the following part (~line 
1312ff):

                /* If obj is an instance and attr is a func, create method 
*/
                if ((OBJ_GET_TYPE(TOS) == OBJ_TYPE_CLI) &&
                    (OBJ_GET_TYPE(pobj3) == OBJ_TYPE_FXN))
                {
                    pobj2 = pobj3;
>>>                    retval = class_method(pobj1, TOS, pobj2, &pobj3);
                    PM_BREAK_IF_ERROR(retval);
                }

At the state where “class_method” is called, obj1 is a DICT, obj2 is 
INSTANCE and obj4 is FUNC. Shouldn’t use the “cli_class” of the instance 
in 
obj2 to access the class object? Or am I mistaken something? I was just 
wondering because I got a class cast exception in Java which lead me to 
this issue.

Original issue reported on code.google.com by [email protected] on 9 Oct 2009 at 10:43

Fix 64-bit FTBFS

PyMite fails to build from source on 64-bit machines. 

This issue was started on the previous issue-tracking system; it was numbered 
#186.  A branch was created in the repository: issue_0186_dwhall_64bit_build.  
Work is partway done.

Original issue reported on code.google.com by [email protected] on 16 Apr 2009 at 10:13

Fix float endian issue

Floats work for the desktop, but are byte-reversed on the mbed platform.

Wikipedia says floats have no defined endianness 
(http://en.wikipedia.org/wiki/Endianness#Floating-point_and_endianness).
James says that the ARM EABI defines an endianness.

Make an env var for the build systems, define them as little or big for all 
the platforms and update the Makefile additions in HowToPortPyMite.txt


Original issue reported on code.google.com by [email protected] on 16 Apr 2009 at 7:26

Fix scons build on Windows

From Tyler Wilson:

For SCons to work on Windows, the SConstruct file in src/platform/desktop 
should not include a suffix in the output name. If it is put there, it 
fails with the following error in a command prompt using the default 
Windows Python:

scons: *** An executable should have exactly one target with the suffix: 
.exe
File "C:\Projects\ThirdParty\pymite\src\platform\desktop\SConscript", line 
23, in <module>

Note that without the suffix, under cygwin a main.exe will be generated and 
under *unix a 'main' program will be generated. So (again), the PMVM_EXE 
value will have to change from main.out to "main" or "main.exe" depending 
on the platform.

Note I am still working on the SCons under Windows issues - I need to 
recreate one in my windows platform project, since the desktop plat.c 
cannot be built on Windows due to a lack of SIGALRM support.

Original issue reported on code.google.com by [email protected] on 16 Apr 2009 at 11:14

Fix classes during ipm

Running interactive PyMite (ipm) reveals defects with classes/instances:

ipm> class Foo():
 def __init__(self, v):
  self.v = v 
ipm> f = Foo(42)
Error:     0xE5
  Release: 0x08
  FileId:  0x09
  LineNum: 928
Traceback (top first):
  __init__()
  <ipm>()
  ipm()
  main()
  <module>.


Original issue reported on code.google.com by [email protected] on 2 May 2009 at 5:30

Eliminate remnants of unused OBJ_TYPE_EXN

What steps will reproduce the problem?
1. assert 0 == 1

What is the expected output? What do you see instead?
Expect AssertionError (0xE4).  Got TypeError (0xED).

Since Exceptions were rolled into real classes, their type is no longer 
OBJ_TYPE_EXN (0x0E).  They are now of type OBJ_TYPE_CLI (0x09) and inherit 
from the Exception class.

Original issue reported on code.google.com by [email protected] on 25 Sep 2009 at 2:47

  • Blocking: #64

Convert object and Exceptions to Classes instead of C types

Currently, exceptions are implemented as C types: OBJ_TYPE_EXN and created by 
the builtin function _exn().

The root object can be created by: class object(): pass
and exceptions can be declared as classes.

This allows the _exn() and _clo() builtin functions to be removed and makes 
for a more cleaner implementation. 

Original issue reported on code.google.com by [email protected] on 20 May 2009 at 6:57

Fix endian issue (again)

What steps will reproduce the problem?
ipm> print 3.14
-490.564453 
ipm> print 1.0
 0.000000 

What is the expected output? What do you see instead?
3.140000
1.000000

Original issue reported on code.google.com by [email protected] on 7 Sep 2009 at 3:51

Simplify the root object

Currently, the root object uses the builtin _clo() to create the root class 
object.

Check to see if this can be changed to the code "class object(): pass".  The 
first error that pops up is that the code above tried to do a LOAD_NAME of 
"__name__" and when it is not found in the module, it searches PM_BUILTINS 
which is still null at this point in execution.

So, if modules are given their __name__ attribute, the lookup won't fail and 
the code might work.  But you should also check that doing it this way is 
smaller or faster.  Don't give all modules __name__ attrs just for this (it 
would be a waste of memory since a reasonable workaround is already in 
place).

Original issue reported on code.google.com by [email protected] on 29 Apr 2009 at 3:07

Create static memory for one-time chunk allocations

This issue is a customer request; and a good one at that.

Some objects can be declared outside of the heap to a new memory space to 
reduce the time spent during GC.  Would need to create a second memory space 
for one-time static allocations, create an allocator for the new space, 
adjust the GC to skip static objects and find a suitable set of objects to 
declare as static.

The first guesses at objects to put in the static memory space are: globals, 
builtins and the customer's API module.

Original issue reported on code.google.com by [email protected] on 8 Oct 2009 at 7:14

Add support for LocalFileSystem on mbed

The mbed platform has the LocalFileSystem class in the API that allows access 
to a file system on the device.  This file system is also accessible as a USB 
mass storage device.  It would be very useful to be able to access pre-built 
code images stored in files.

Steps:
1. Design file-system abstraction layer
2. Implement LocalFileSystem layer for mbed platform
3. Adjust mbed build system so that pmImgCreator can create files from user 
.py files.

Original issue reported on code.google.com by [email protected] on 23 Sep 2009 at 4:34

Make pyserial module optional for ipm-host

From Tyler Wilson:

Since the ipm.py may be used in a desktop-only environment, the
pyserial package is not strictly needed. (In addition, under sygwin,
there is no pyserial package available in the setup, so it must be
installed from source, which is a bit more work than perhaps most want
to deal with). So in the ipm.py, instead of a direct import serial, it
may make sense to do something like:

try:
   import serial
except:
   print("No serial package available. Will default to desktop
mode.")

I tested this locally, and it worked fine for me.

Original issue reported on code.google.com by [email protected] on 16 Apr 2009 at 11:08

Create integer object cache

Heap memory could be saved by creating a cache for integer objects.  This 
would also affect the case where "6 is 4+2" returns False.

Original issue reported on code.google.com by [email protected] on 16 Apr 2009 at 7:03

Fix list comparisons

What steps will reproduce the problem?
ipm> [] == [1,2,3]
True

What is the expected output? What do you see instead?
False
True

Please use labels and text to provide additional information.


Original issue reported on code.google.com by [email protected] on 16 May 2009 at 6:43

Fix string replication

What steps will reproduce the problem?
ipm> print 'a' * 20
aaaaaaaaaaaaaaaaaaaa
ipm> print 'a' * 21

What is the expected output? What do you see instead?
aaaaaaaaaaaaaaaaaaaaa


Original issue reported on code.google.com by [email protected] on 3 May 2009 at 8:55

Fix cases where string contains an embedded null

What steps will reproduce the problem?
ipm> a = "bob"
ipm> b = "\0tim"
ipm> s = a+b
ipm> len(s)
3

What is the expected output? What do you see instead?
Expected s == "bob\0tim"

The error is that string_create() only accepts chars up to the first null.

Original issue reported on code.google.com by [email protected] on 3 Sep 2009 at 8:13

Add support for the keyword exec

Add support for the keyword exec ONLY if it provides utility more than eval.

This might work differently than Python's exec().  It might use the output 
from __bi.Co().

Original issue reported on code.google.com by [email protected] on 16 Apr 2009 at 7:35

Fix generator return exception handling

What steps will reproduce the problem?
1. The following ipm session:

ipm> def fib():
 a,b = 0,1
 while True:
  yield a
  a,b = b,a+b
  if a > 900:
   break

ipm> for f in fib():
 print f

ipm> print "hello"
Connection read error, type Ctrl+D to quit.

What is the expected output? What do you see instead?
When a generator returns (via break stmt) it raises an exception and 
attempts to handle it immediately.  It looks like the handling code is at 
fault.


Original issue reported on code.google.com by [email protected] on 22 May 2009 at 3:35

Make ipm help messages cross-platform

From Tyler Wilson:

There are a number of places that refer to Ctrl+D as an EOF shortcut
- in ipm.py, in particular. On Windows, note that the EOF shortcut is
Ctrl+Z. Likely want to check the platform in ipm.py and print the
right one. For example, in my local ipm.py, I added this below the
last import:

if sys.platform == "win32":
   EOF_KEY = "Ctrl+Z"
else:
   EOF_KEY = "Ctrl+D"

And then changed:

   self.stdout.write("Connection write error, type Ctrl+D to quit.
\n")

to:

   self.stdout.write("Connection write error, type " + EOF_KEY + " to
quit.\n")

Original issue reported on code.google.com by [email protected] on 16 Apr 2009 at 11:09

Add support for string format operation

What steps will reproduce the problem?
ipm> a = 42
ipm> print "the answer is %d" % a

What is the expected output? What do you see instead?

Expect: "the answer is 42"

Got:
Error:     0xED
  Release: 0x07
  FileId:  0x00
  LineNum: 0
Traceback (top first):
  <ipm>()
  ipm()
  main()
  <module>.

Please use labels and text to provide additional information.


Original issue reported on code.google.com by [email protected] on 16 Apr 2009 at 5:16

Add support for the yield keyword

What steps will reproduce the problem?
ipm> def foo():
 i = 0
 while True:
  yield i
  i += 1

What is the expected output? What do you see instead?

Expect: code to work
Got:
AssertionError:Unsupported code identified by co_flags (0x63).


Please use labels and text to provide additional information.


Original issue reported on code.google.com by [email protected] on 16 Apr 2009 at 5:41

Document a useful scons option

From Tyler Wilson:

I was playing with the SCons build version (under cygwin, since the Windows 
version does not work yet). It should be noted that the SCons works as 
expected from the root of the pymite tree, but if you 'cd 
src/platform/desktop' and type scons, it will not work. The magic incantation 
if you are working in a sub-folder is 'scons -u' to tell scons to search up 
the tree for other SConstruct files. Perhaps this should be noted in the 
BuildSystem.txt and/or local README file(s)?

Original issue reported on code.google.com by [email protected] on 16 Apr 2009 at 11:11

Add support for backtick operation (UNARY_CONVERT)

What steps will reproduce the problem?
ipm> x = 4
ipm> filename = "A:/log" + `x` + ".log"

What is the expected output? 
filename = "A:/log4.log"

What do you see instead?
NotImplementedError:Illegal bytecode (13/0xd/UNARY_CONVERT) comes at offset 
6 in file <ipm>.


Please use labels and text to provide additional information.

Original issue reported on code.google.com by [email protected] on 7 Sep 2009 at 1:53

Add support for string concatenation

What steps will reproduce the problem?
ipm> a="test"
ipm> b="thing"
ipm> a+b
Error:     0xED
  Release: 0x08
  FileId:  0x09
  LineNum: 407
Traceback (top first):
  <ipm>()
  ipm()
  main()
  <module>.

What is the expected output? What do you see instead?
"testthing"


Original issue reported on code.google.com by [email protected] on 31 Aug 2009 at 2:55

Import PyMite subversion repository

Ask webfaction for a dump of the current PyMite repository.  Import the dump 
into this google code repository.  These instructions look like they should 
work: http://code.google.com/support/bin/answer.py?answer=56673&topic=10386


Original issue reported on code.google.com by [email protected] on 16 Apr 2009 at 2:20

Update mbed plat.py

Now that classes are available, update the mbed plat.py to use classes, 
instances, etc.

Could also add support for float arguments.

Original issue reported on code.google.com by [email protected] on 29 Apr 2009 at 3:57

Make test builds use the vm built for desktop

What steps will reproduce the problem?
1. make check
2. edit a file in src/vm/
3. make

What is the expected output? What do you see instead?
cc -o main.out main.o plat.o main_nat.o main_img.o 
../../vm/libpmvm_desktop.a
Undefined symbols:
  "_float_negative", referenced from:
      _interpret in libpmvm_desktop.a(interp.o)
  "_float_op", referenced from:
      _interpret in libpmvm_desktop.a(interp.o)
  "_float_compare", referenced from:
      _interpret in libpmvm_desktop.a(interp.o)
ld: symbol(s) not found
collect2: ld returned 1 exit status


Since make check used its own pmfeatures.h (with float disabled) and then 
make for desktop tried to build with float enabled, a build error resulted.  
Things could be cleaner by making src/tests/unit and src/tests/system re-
use the platform files from src/platform/desktop.


Original issue reported on code.google.com by [email protected] on 20 May 2009 at 7:25

Fix pmImgCreator so two classes can have same method name

What steps will reproduce the problem?
In one .py file, define two distinct classes.  In each class define a method 
having the same name, such as __init__.

What is the expected output? What do you see instead?
The C compiler complains that the augmented C function names are identical: 
nat_plat___init__.


Original issue reported on code.google.com by [email protected] on 2 May 2009 at 7:10

Fix GC when 2+ unlinked allocs occur

What steps will reproduce the problem?
1. Revision 369, system test t141
2. Change lines 28, 35 from:
r = map(chr, range(start, start+36))
to
r = map(chr, range(start, start+35))
3. Debug; enable heap_dump and set breakpoint.
4. Notice that GC occurs during interp.c:1192 (BUILD_LIST) where there is a 
warning about list_new() followed by multiple calls to list_insert().

What is the expected output? What do you see instead?
I expect the test to run, but the heap gets corrupted.

Original issue reported on code.google.com by [email protected] on 20 May 2009 at 10:50

Create a sizeof module

Create an objsize module to print out the sizes of the common object types.  
This will help show differences in platforms and gives an idea of the cost of 
heap use.

Original issue reported on code.google.com by [email protected] on 16 Apr 2009 at 7:06

Restore all builtin functions

The builtins module, src/lib/__bi.py, had some of its functions commented-out 
in order to not consume to much memory.  

Release 10 will target devices with greater resources.  So for release 10, 
the comments can be removed.

Original issue reported on code.google.com by [email protected] on 16 Apr 2009 at 4:57

Add a de-initialize function to the platform interface

From Tyler Wilson:

I think there should be a plat_uninit function to balance the plat_init 
function. On some platforms, in order to support timers, callbacks, etc. we 
ought to be 'good citizens' and kill any timers, etc. that were created in 
the plat_init call. The most logical place would be a plat_uninit that is 
called just before exiting the application. Perhaps a pm_uninit which is 
called after the pm_run returns?

Original issue reported on code.google.com by [email protected] on 16 Apr 2009 at 11:19

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.