aboutsummaryrefslogtreecommitdiff
path: root/qemu-arm
AgeCommit message (Collapse)Author
2015-07-20qemu-arm: Enable array slice assignment to get memoryview1 test to pass.Delio Brignoli
2015-06-22bare-arm, minimal, qemu-arm: Make do_str() take parse-input-kind as arg.Damien George
The do_str() function is provided essentially as documentation to show how to compile and execute a string. This patch makes do_str take an extra arg to specify how the string should be interpreted: either as a single line (ie from a REPL) or as multiple lines (ie from a file).
2015-04-16qemu-arm: Get compiling again with recent changes to print framework.Damien George
2015-04-16py: Overhaul and simplify printf/pfenv mechanism.Damien George
Previous to this patch the printing mechanism was a bit of a tangled mess. This patch attempts to consolidate printing into one interface. All (non-debug) printing now uses the mp_print* family of functions, mainly mp_printf. All these functions take an mp_print_t structure as their first argument, and this structure defines the printing backend through the "print_strn" function of said structure. Printing from the uPy core can reach the platform-defined print code via two paths: either through mp_sys_stdout_obj (defined pert port) in conjunction with mp_stream_write; or through the mp_plat_print structure which uses the MP_PLAT_PRINT_STRN macro to define how string are printed on the platform. The former is only used when MICROPY_PY_IO is defined. With this new scheme printing is generally more efficient (less layers to go through, less arguments to pass), and, given an mp_print_t* structure, one can call mp_print_str for efficiency instead of mp_printf("%s", ...). Code size is also reduced by around 200 bytes on Thumb2 archs.
2015-04-04stmhal, qemu-arm: Enable sys.maxsize attribute.Damien George
2015-02-28qemu-arm: Handle sys.exit() to allow skip tests in testsuite.Paul Sokolovsky
2015-02-16qemu-arm: Enable source line numbers, for easier debugging.Damien George
2015-02-07py: Protect mp_parse and mp_compile with nlr push/pop block.Damien George
To enable parsing constants more efficiently, mp_parse should be allowed to raise an exception, and mp_compile can already raise a MemoryError. So these functions need to be protected by an nlr push/pop block. This patch adds that feature in all places. This allows to simplify how mp_parse and mp_compile are called: they now raise an exception if they have an error and so explicit checking is not needed anymore.
2015-01-12qemu-arm: Enable GC and native code-gen; enable more tests.Damien George
2015-01-09py: Disable stack checking by default; enable on most ports.Damien George
2015-01-09qemu-arm: Add 'test' target to Makefile to run and verify test suite.Damien George
Replaces RUN_TEST=1 definition; now "make test" in qemu-arm directory will run tests/basics/ and check that they all succeed. This patch also enables the test on Travis CI.
2015-01-08qemu-arm: Get "make RUN_TESTS=1" compiling after changes to core.Damien George
2015-01-08qemu-arm: Set stack limit in main.Damien George
2015-01-01qemu-arm: Prefix includes with py/; remove need for -I../py.Damien George
2014-12-27Makefiles: Support py/*.h includes per #1022.Paul Sokolovsky
2014-12-08modsys: Add sys.print_exception(exc, file=sys.stdout) function.Paul Sokolovsky
The function is modeled after traceback.print_exception(), but unbloated, and put into existing module to save overhead on adding another module. Compliant traceback.print_exception() is intended to be implemented in micropython-lib in terms of sys.print_exception(). This change required refactoring mp_obj_print_exception() to take pfenv_t interface arguments. Addresses #751.
2014-12-05py: Fix printing of size_t entity; fix qemu-arm for changes to lexer.Damien George
2014-11-17ports: Define mp_off_t.Paul Sokolovsky
2014-10-29Add -Wpointer-arith flag to prevent problems with pointer arithmetic on void*stijn
2014-10-21Implement kwargs for builtin open() and _io.FileIOstijn
This makes open() and _io.FileIO() more CPython compliant. The mode kwarg is fully iplemented. The encoding kwarg is allowed but not implemented; mainly to allow the tests to specify encoding for CPython, see #874
2014-10-05py: Make compiler return a proper exception on SyntaxError.Damien George
2014-09-23py: Free non-interned strings in the parser when not needed.Damien George
mp_parse_node_free now frees the memory associated with non-interned strings. And the parser calls mp_parse_node_free when discarding a non-used node (such as a doc string). Also, the compiler now frees the parse tree explicitly just before it exits (as opposed to relying on the caller to do this). Addresses issue #708 as best we can.
2014-09-01Declare do_str() function before the implementationChris Dearman
This ensures that GCC does not discard the do_str implementation in some cases eg when compiling tests with debug enabled: make RUN_TESTS=1 DEBUG=1
2014-08-24py: Fix bug where GC collected native/viper/asm function data.Damien George
Because (for Thumb) a function pointer has the LSB set, pointers to dynamic functions in RAM (eg native, viper or asm functions) were not being traced by the GC. This patch is a comprehensive fix for this. Addresses issue #820.
2014-08-04Put call to qstr_init and mp_init_emergency_exc_buf in mp_init.Damien George
qstr_init is always called exactly before mp_init, so makes sense to just have mp_init call it. Similarly with mp_init_emergency_exception_buf. Doing this makes the ports simpler and less error prone (ie they can no longer forget to call these).
2014-07-03Rename machine_(u)int_t to mp_(u)int_t.Damien George
See discussion in issue #50.
2014-07-02qemu: fix typo in readmeIlya Dmitrichenko
2014-06-08Provide definition of alloca() in mpconfigport.h.Damien George
2014-05-30qemu-arm: Add port README.Paul Sokolovsky
Based on https://github.com/micropython/micropython/pull/630 by @errordeveloper.
2014-05-24Rename configuration variables controling Python features.Damien George
Now of the form MICROPY_PY_*. See issue #35.
2014-05-21Tidy up some configuration options.Damien George
MP_ALLOC_* -> MICROPY_ALLOC_* MICROPY_PATH_MAX -> MICROPY_ALLOC_PATH_MAX MICROPY_ENABLE_REPL_HELPERS -> MICROPY_HELPER_REPL MICROPY_ENABLE_LEXER_UNIX -> MICROPY_HELPER_LEXER_UNIX MICROPY_EXTRA_* -> MICROPY_PORT_* See issue #35.
2014-05-19qemu-arm: Disable "io" module.Paul Sokolovsky
2014-05-08qemu-arm: fully integrated test suite.Ilya Dmitrichenko
This is primarily intended to provide testing of Thumb-specific code within Travis CI as well as if anyone else want to run it locally. As discussed in purposes. This is currently agains an emulated Cortex-M3 core, however in the near future it can extended to support M0, M0+ as well M4 (work in progress exists in sushihangover/qemu). It's probably true that most of the code base can be covered running uPy natively on a POSIX system, however we do have the tiny bit of assembly code. There may exist bugs related to endianness and type aliases, let alone potential standard library or compiler bugs or even architecture-specific optimisations. This could also incorporate lwIP (or other TCP/IP stack) integration as well as SDIO+FATFS drivers. The solution to inline the test cases was chose due to simplicity. It could alternatively be implemented in a number of different way (see #515), but this looked the simplest. Inclusion of tinytest was just to avoid writing boilerplate code for counting failed tests and other utility functions. Currently only a few functions are used, however this could be extended. Checking in the code instead of using submodule was a personal preference, but if people do want the pain of submodules, this can provided. This particular framework is also pretty good if one desires to run unit test on target. The approach with scripts being inlined is probably not quite suited for the size of memory an MCU has, but the tinytest itself should be good, if lower-level C code is to be unit tested.
2014-05-02bare-arm, qemu-arm: Make "mpconfig.h" be first included, as other headers ↵Paul Sokolovsky
depend on it.
2014-04-21qemu-arm: update makefile (d553be5).Ilya Dmitrichenko
2014-04-21qemu-arm: more generic port name.Ilya Dmitrichenko