Permalink
Browse files

Merge pull request #58 from suehtamacv/pulpino

PULPino port
  • Loading branch information...
jlbirccyn committed Jul 3, 2017
2 parents 99258e3 + 0908fe6 commit 43dadf1d740de72b2527b2bbe3b6ae8aef68cd1f
Showing with 6,513 additions and 4 deletions.
  1. +9 −4 README.md
  2. +53 −0 examples/riscv/pulpino/blink/README.md
  3. +40 −0 examples/riscv/pulpino/blink/blink.c
  4. +86 −0 examples/riscv/pulpino/blink/blink.oil
  5. +672 −0 goil/templates/build/riscv/pulpino/build_py.goilTemplate
  6. +35 −0 goil/templates/check/riscv/pulpino/custom_check.goilTemplate
  7. +82 −0 goil/templates/code/riscv/counter_call.goilTemplate
  8. +42 −0 goil/templates/code/riscv/custom_code.goilTemplate
  9. +235 −0 goil/templates/code/riscv/interrupt_table.goilTemplate
  10. +22 −0 goil/templates/code/riscv/process_specific.goilTemplate
  11. +107 −0 goil/templates/code/riscv/pulpino/handler_body.goilTemplate
  12. +9 −0 goil/templates/code/riscv/pulpino/service_call.goilTemplate
  13. +185 −0 goil/templates/code/riscv/pulpino/tpl_primary_irq.goilTemplate
  14. +322 −0 goil/templates/code/riscv/tpl_interrupt_vectors.goilTemplate
  15. +7 −0 goil/templates/code/riscv/tpl_invoque_s.goilTemplate
  16. +91 −0 goil/templates/config/riscv/config.oil
  17. +193 −0 goil/templates/config/riscv/pulpino/config.oil
  18. +20 −0 goil/templates/config/riscv/pulpino/counterSources.oil
  19. +20 −0 goil/templates/config/riscv/pulpino/interruptSources.oil
  20. +6 −0 goil/templates/linker/gnu_ld/riscv/pulpino/memory_map.goilTemplate
  21. +138 −0 goil/templates/linker/gnu_ld/riscv/pulpino/script.goilTemplate
  22. 0 goil/templates/linker/gnu_ld/riscv/pulpino/script_specific.goilTemplate
  23. +88 −0 machines/riscv/libs/bench_lib/inc/bench.h
  24. +147 −0 machines/riscv/libs/bench_lib/src/bench.c
  25. +30 −0 machines/riscv/libs/string_lib/inc/string_lib.h
  26. +293 −0 machines/riscv/libs/string_lib/src/qprintf.c
  27. +23 −0 machines/riscv/libs/sys_lib/inc/bar.h
  28. +105 −0 machines/riscv/libs/sys_lib/inc/cpu_hal.h
  29. +87 −0 machines/riscv/libs/sys_lib/inc/event.h
  30. +88 −0 machines/riscv/libs/sys_lib/inc/gpio.h
  31. +102 −0 machines/riscv/libs/sys_lib/inc/i2c.h
  32. +88 −0 machines/riscv/libs/sys_lib/inc/int.h
  33. +91 −0 machines/riscv/libs/sys_lib/inc/pulpino.h
  34. +97 −0 machines/riscv/libs/sys_lib/inc/spi.h
  35. +749 −0 machines/riscv/libs/sys_lib/inc/spr-defs.h
  36. +69 −0 machines/riscv/libs/sys_lib/inc/timer.h
  37. +80 −0 machines/riscv/libs/sys_lib/inc/uart.h
  38. +101 −0 machines/riscv/libs/sys_lib/inc/utils.h
  39. +27 −0 machines/riscv/libs/sys_lib/src/exceptions.c
  40. +99 −0 machines/riscv/libs/sys_lib/src/gpio.c
  41. +46 −0 machines/riscv/libs/sys_lib/src/i2c.c
  42. +56 −0 machines/riscv/libs/sys_lib/src/int.c
  43. +96 −0 machines/riscv/libs/sys_lib/src/spi.c
  44. +27 −0 machines/riscv/libs/sys_lib/src/timer.c
  45. +72 −0 machines/riscv/libs/sys_lib/src/uart.c
  46. +77 −0 machines/riscv/libs/sys_lib/src/utils.c
  47. +243 −0 machines/riscv/pulpino/crt0.riscv.S
  48. +19 −0 machines/riscv/pulpino/tpl_asm_definitions.h
  49. +32 −0 machines/riscv/pulpino/tpl_machine.h
  50. +234 −0 machines/riscv/pulpino/tpl_machine_riscv.c
  51. +112 −0 machines/riscv/pulpino/tpl_machine_riscv.h
  52. +63 −0 machines/riscv/pulpino/tpl_os_std_types.h
  53. +170 −0 machines/riscv/pulpino/tpl_sc_handler.S
  54. +13 −0 tests/machines/riscv/pulpino/ArchEmb.mk
  55. +11 −0 tests/machines/riscv/pulpino/GOIL_testSequences.txt
  56. +85 −0 tests/machines/riscv/pulpino/arch.oil
  57. +92 −0 tests/machines/riscv/pulpino/arch.sh
  58. +64 −0 tests/machines/riscv/pulpino/archTestConfig.c
  59. +37 −0 tests/machines/riscv/pulpino/archTestConfig.h
  60. +161 −0 tests/machines/riscv/pulpino/functional_testSequences.txt
  61. +65 −0 tests/machines/riscv/pulpino/softwareIT.oil
View
@@ -3,11 +3,13 @@
Trampoline is a static RTOS for small embedded systems.
Its API is aligned with OSEK/VDX OS and AUTOSAR OS 4.2 standards.
5 platforms are supported by now :
6 platforms are supported by now :
* cortex
* Cortex-M (M0+, M3 and M4 for now) instruction set
* Cortex-A (A7) instruction set. This port is under heavy development.
* riscv
* PULPino microprocessor with 32bits RISC-V instruction set.
* ppc: PowerPC 32bits instruction set
* posix: virtual platform for POSIX systems (tested on Linux and OS X)
* avr: AVR 8 bits microcontrollers
@@ -17,7 +19,7 @@ Its API is aligned with OSEK/VDX OS and AUTOSAR OS 4.2 standards.
And we welcome external contributors to extend this list.
Trampoline runs on the following plateforms :
Trampoline runs on the following platforms :
| MCU | Architecture | Cores | Evaluation Board |
|------------------------------|--------------------|:-----:|-----------------------------------|
@@ -28,6 +30,7 @@ Trampoline runs on the following plateforms :
| NXP LPC2294 | ARM7 | 1 | Olimex LPC-L2294-1MB |
| NXP / Freescale MK20DX256 | Cortex-M4 | 1 | Teensy31 |
| NXP / Freescale MPC564xL | Power Architecture | 2 | XPC56XX EVB + XPC56XL MINI-MODULE |
| PULPino | RISC-V | 1 | ZedBoard |
| STMicroelectronics STM32F4xx | Cortex-M4 | 1 | STM32F4DISCOVERY with STM32F407VG |
| STMicroelectronics STM32F30x | Cortex-M4 | 1 | Nucleo-32 STM32F303 |
| MicroSemi SmartFusion2 | Cortex-M3 | 1 | starterKit |
@@ -71,14 +74,16 @@ Some examples have been added (check examples):
* **blink_2c_opticks**. Same as the two cores blink example but optimizes ticks.
* **button_2c**. Waits for a button input to light a led. Switch it off using Timing Protection watchdog. Multicore example.
* **spinlocks**. Producer/Consumer example.
* PULPino : `riscv/pulpino`
* **blink**. Has two tasks who alternate outputting on UART interface.
* virt-v7 :
* **firmware**. Builds a firmware that can be used as a guest on XVisor.
More examples are coming.
## Precompiled binaries of goil, the OIL compiler
Updated to version 3.1.3 on october 18.
Updated to version 3.1.3 on October 18.
* Mac OS X: [goil-mac-os-x.zip](http://trampolinebin.rts-software.org/goil-mac-os-x.zip)
* Mac OS X Cocoa Application with editor: [CocoaGoil.app.zip](http://trampolinebin.rts-software.org/CocoaGoil.app.zip)
@@ -88,7 +93,7 @@ Updated to version 3.1.3 on october 18.
## Useful links
* [ARM development tools](https://launchpad.net/gcc-arm-embedded) compiled for various plateforms.
* [ARM development tools](https://launchpad.net/gcc-arm-embedded) compiled for various platforms.
The OSEK-VDX portal is down since at least june because the working group has been disbanded in favor of AUTOSAR. Here are copies of a part of the documents that were available for download:
@@ -0,0 +1,53 @@
# Blink example
This application is a simple periodic example which toggles between two tasks in PULPino.
Have a look into "blink.oil" file.
The system is based scheduled with a 1ms SysTick "TA_CMP".
## Build prerequiste
This build requires that `spiload` is installed at the ZedBoard. The procedure is exposed [here](https://github.com/pulp-platform/pulpino/tree/master/fpga).
Currently we use a SSH connection to flash PULPino. After connecting the ZedBoard Ethernet interface and retrieving its IP address, export the variable `FPGA_HOSTNAME` so it has the form
```
export FPGA_HOSTNAME="root@ZEDBOARD_IP"
```
Now you should be able to connect through ssh to the board. It might be useful to install your public key (with `ssh-copy-id`) so the board password is not asked at each interaction.
You should also export the `PULPINO_PATH` variable, that points to the root of your PULPino installation.
## Build for GNU/Linux
The option `CPU->OS->BUILD->SYSTEM` should be set to `PYTHON`.
Configure the application with:
```
goil --target=riscv/pulpino --templates=../../../../goil/templates blink.oil
```
The `goil` compiler generates the `make.py` [python build script](https://github.com/TrampolineRTOS/trampoline/wiki/Application-Build-system). Then run the script:
```
./make.py
```
The `blink_exe` should be generated.
To copy the executable to the board and flash it on PULPino memories, the following commands are used.
```
scp slm_files/spi_stim.txt $FPGA_HOSTNAME:/root/blink.spi
ssh -t $FPGA_HOSTNAME /root/spiload --timeout=-1 /root/blink.spi
```
## Clean
Use the `clean` target of the make.py:
```
./make.py clean
```
@@ -0,0 +1,40 @@
#include "tpl_os.h"
#include <spi.h>
#include <gpio.h>
#include <uart.h>
#include <utils.h>
#include <int.h>
#include <string_lib.h>
#include <pulpino.h>
#include <timer.h>
int sleeper = 1;
int main(void)
{
StartOS(OSDEFAULTAPPMODE);
return 0;
}
TASK(blink)
{
int blinker = 1;
while (1) {
int_disable();
printf("Blinking %d !\n", blinker);
int_enable();
blinker++;
sleep_busy(1000);
}
TerminateTask();
}
TASK(sleeping)
{
int_disable();
printf("Sleeping... %d\n", sleeper);
int_enable();
sleeper++;
sleep_busy(1000);
TerminateTask();
}
@@ -0,0 +1,86 @@
OIL_VERSION = "2.5";
IMPLEMENTATION trampoline {
/* This fix the default STACKSIZE of tasks */
TASK {
UINT32 STACKSIZE = 300 ;
} ;
/* This fix the default STACKSIZE of ISRs */
ISR {
UINT32 STACKSIZE = 200 ;
} ;
};
CPU blink {
OS config {
STATUS = EXTENDED;
BUILD = TRUE {
TRAMPOLINE_BASE_PATH = "../../../..";
APP_SRC = "blink.c";
APP_NAME = "blink_exe";
CFLAGS = "-O3";
ASFLAGS = "-march=RVIMAFD";
LDFLAGS = "-Wl,-Map=build.map";
LDFLAGS = "-L../../ -nostartfiles";
COMPILER = "riscv32-unknown-elf-gcc";
ASSEMBLER = "riscv32-unknown-elf-as";
LINKER = "riscv32-unknown-elf-gcc";
COPIER = "riscv32-unknown-elf-objcopy";
SYSTEM = PYTHON;
LIBRARY = pulpino;
LIBRARY = string;
};
SYSTEM_CALL = TRUE;
MEMMAP = TRUE {
COMPILER = gcc;
LINKER = gnu_ld { SCRIPT = "script.ld"; };
ASSEMBLER = gnu_as;
MEMORY_PROTECTION = FALSE;
};
};
APPMODE std {};
TASK blink {
PRIORITY = 1;
AUTOSTART = FALSE;
ACTIVATION = 1;
SCHEDULE = FULL;
};
ALARM alarm_blink {
COUNTER = SystemCounter;
ACTION = ACTIVATETASK {
TASK = blink;
};
AUTOSTART = TRUE {
APPMODE = std;
ALARMTIME = 2;
CYCLETIME = 2;
};
};
TASK sleeping {
PRIORITY = 2;
AUTOSTART = FALSE;
ACTIVATION = 1;
SCHEDULE = FULL;
};
ALARM alarm_sleeping {
COUNTER = SystemCounter;
ACTION = ACTIVATETASK {
TASK = sleeping;
};
AUTOSTART = TRUE {
APPMODE = std;
ALARMTIME = 4;
CYCLETIME = 4;
};
};
};
Oops, something went wrong.

0 comments on commit 43dadf1

Please sign in to comment.