Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
micropython
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
card10
micropython
Commits
99dde4ed
Commit
99dde4ed
authored
10 years ago
by
Damien George
Browse files
Options
Downloads
Patches
Plain Diff
qemu-arm: Enable GC and native code-gen; enable more tests.
parent
3f9f9cac
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
qemu-arm/main.c
+4
-0
4 additions, 0 deletions
qemu-arm/main.c
qemu-arm/mpconfigport.h
+3
-3
3 additions, 3 deletions
qemu-arm/mpconfigport.h
qemu-arm/test_main.c
+16
-0
16 additions, 0 deletions
qemu-arm/test_main.c
tools/tinytest-codegen.py
+2
-2
2 additions, 2 deletions
tools/tinytest-codegen.py
with
25 additions
and
5 deletions
qemu-arm/main.c
+
4
−
0
View file @
99dde4ed
#include
<stdint.h>
#include
<stdio.h>
#include
<string.h>
#include
<malloc.h>
#include
"py/nlr.h"
#include
"py/obj.h"
...
...
@@ -9,6 +10,7 @@
#include
"py/runtime0.h"
#include
"py/runtime.h"
#include
"py/stackctrl.h"
#include
"py/gc.h"
#include
"py/repl.h"
#include
"py/pfenv.h"
...
...
@@ -51,6 +53,8 @@ void do_str(const char *src) {
int
main
(
int
argc
,
char
**
argv
)
{
mp_stack_set_limit
(
10240
);
void
*
heap
=
malloc
(
16
*
1024
);
gc_init
(
heap
,
(
char
*
)
heap
+
16
*
1024
);
mp_init
();
do_str
(
"print('hello world!')"
);
mp_deinit
();
...
...
This diff is collapsed.
Click to expand it.
qemu-arm/mpconfigport.h
+
3
−
3
View file @
99dde4ed
...
...
@@ -4,11 +4,11 @@
#define MICROPY_ALLOC_PATH_MAX (512)
#define MICROPY_EMIT_X64 (0)
#define MICROPY_EMIT_THUMB (
0
)
#define MICROPY_EMIT_INLINE_THUMB (
0
)
#define MICROPY_EMIT_THUMB (
1
)
#define MICROPY_EMIT_INLINE_THUMB (
1
)
#define MICROPY_MEM_STATS (0)
#define MICROPY_DEBUG_PRINTERS (0)
#define MICROPY_ENABLE_GC (
0
)
#define MICROPY_ENABLE_GC (
1
)
#define MICROPY_STACK_CHECK (1)
#define MICROPY_HELPER_REPL (0)
#define MICROPY_HELPER_LEXER_UNIX (0)
...
...
This diff is collapsed.
Click to expand it.
qemu-arm/test_main.c
+
16
−
0
View file @
99dde4ed
#include
<stdint.h>
#include
<stdio.h>
#include
<string.h>
#include
<malloc.h>
#include
"py/nlr.h"
#include
"py/obj.h"
...
...
@@ -9,6 +10,7 @@
#include
"py/runtime0.h"
#include
"py/runtime.h"
#include
"py/stackctrl.h"
#include
"py/gc.h"
#include
"py/repl.h"
#include
"py/pfenv.h"
...
...
@@ -58,6 +60,8 @@ end:
int
main
()
{
const
char
a
[]
=
{
"sim"
};
mp_stack_set_limit
(
10240
);
void
*
heap
=
malloc
(
256
*
1024
);
gc_init
(
heap
,
(
char
*
)
heap
+
256
*
1024
);
mp_init
();
int
r
=
tinytest_main
(
1
,
(
const
char
**
)
a
,
groups
);
mp_deinit
();
...
...
@@ -66,6 +70,18 @@ int main() {
}
void
gc_collect
(
void
)
{
gc_collect_start
();
// get the registers and the sp
jmp_buf
env
;
setjmp
(
env
);
volatile
mp_uint_t
dummy
;
void
*
sp
=
(
void
*
)
&
dummy
;
// trace the stack, including the registers (since they live on the stack in this function)
gc_collect_root
((
void
**
)
sp
,
((
uint32_t
)
MP_STATE_VM
(
stack_top
)
-
(
uint32_t
)
sp
)
/
sizeof
(
uint32_t
));
gc_collect_end
();
}
mp_lexer_t
*
mp_lexer_new_from_file
(
const
char
*
filename
)
{
...
...
This diff is collapsed.
Click to expand it.
tools/tinytest-codegen.py
+
2
−
2
View file @
99dde4ed
...
...
@@ -46,8 +46,8 @@ testgroup_member = (
## XXX: may be we could have `--without <groups>` argument...
# currently these tests are selected because they pass on qemu-arm
test_dirs
=
(
'
basics
'
,)
# 'float', 'import', 'io', 'misc')
exclude_tests
=
(
'
basics/builtin_override.py
'
,
'
basics/class_super_object.py
'
,
'
basics/memoryview_g
c.py
'
,
)
test_dirs
=
(
'
basics
'
,
'
micropython
'
,
'
inlineasm
'
)
# 'float', 'import', 'io', 'misc')
exclude_tests
=
(
'
basics/builtin_override.py
'
,
'
basics/class_super_object.py
'
,
'
micropython/heapallo
c.py
'
)
output
=
[]
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment