Giter Site home page Giter Site logo

pulp-runtime's Introduction

PULP runtime

About

This module is a simple runtime for the Pulp architecture.

Runtime build

You need to first install the Linux dependencies (see below).

Choose the configuration for which you want to compile the runtime, for example:

$ source configs/pulp.sh

Then you can get one of the pulp example, compile and run it.

Linux dependencies

Here are the required system dependencies for building the runtime and its dependencies.

Ubuntu 16.04

Starting from a fresh Ubuntu 16.04 distribution, here are the commands to be executed to get all required dependencies:

$ sudo apt install git python3-pip gawk texinfo libgmp-dev libmpfr-dev libmpc-dev
$ sudo pip3 install pyelftools

Dependencies

Build

Have a look at the dependencies documentation to see how to build them.

You can have a look here for the toolchain.

Setup

The toolchain must be built separately and the following environment variable should set:

$ export PATH=<path to the folder containing the bin folder of the toolchain>/bin:$PATH

RTL platforms should also be built separately (see the platform documentation for that) and the following environment variable must point to the folder where the platform was installed (this example is for pulpissimo):

$ export VSIM_PATH=<pulpissimo root folder>/sim

Examples

Some examples can be found here: [email protected]:pulp-platform/pulp-runtime-examples.git

Useful options

The vsim gui can be opened with this option:

$ make run gui=1

The uart can be selected for the printf with this option:

$ make all run io=uart

The baudrate can also be specified with:

$ make all run io=uart CONFIG_IO_UART_BAUDRATE=9600

pulp-runtime's People

Contributors

alex96295 avatar bluewww avatar haugoug avatar luca-valente avatar micprog avatar mp-17 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

pulp-runtime's Issues

Missing malloc

Dear all,

As of commit 252cecb, the malloc function is not provided by the pulp-runtime. Is that a choice or an omission?

Steps to reproduce

  1. Clone the repository: git clone https://github.com/pulp-platform/pulp-runtime.git
  2. Got to the root of the repository: cd pulp-runtime
  3. Search for malloc with grep: grep -R "void \*malloc"

This should yield a single result, which is the declaration of malloc in the stdlib header file.

Alternatively, one can:

  1. Install the pulp-builder toolchain, which in turns installs pulp-runtime
  2. Write a project which uses malloc
  3. Compile it. The compiler won't complain because malloc is declared in a header, however the linker will fail because no implementation for the function is provided

Additional Information

The function was provided in the pulp-rt repository, see io.c, and there is a low-level allocator in the current pulp-runtime, see the pos_alloc function in the kernel.

Note that the free function is also missing.

Request for Change

Would it be possible to provide an implementation for malloc if it was forgotten? Should the removal be intentional, could the declaration be also removed from the stdlib header? That way, the compiler will warn a user about the missing malloc, instead of yielding a more obscure linker error.

On the other hand, if there is a reason for keeping the situation as it is now, would it possible to provide the explanation either as a comment in the stdlib header, or maybe in the README of the repository?

Regardless, thank you all for the work on this great project!

numpy error

Hello everyone.
I'm having some trouble in running the "hello-world" example. In particular, despite the fact that numpy is corretly installed and updated, slm_hyper.py file execution reports the following issue:

File "$HOME/pulp-runtime/bin/slm_hyper.py", line 18, in
import numpy as np
ModuleNotFoundError: No module named 'numpy'

Does anyone encounter this problem? I've already tried to set up manually python path in the file, updating the NumPy package, but the error still remain.

Thanks you

synch_barrier not define when using pulpissimo configuration

When running tests from https://github.com/pulp-platform/regression_tests/

E.g.
regression_tests/sequential_bare_tests/fft

...
$ export PULP_RISCV_GCC_TOOLCHAIN=/xxx/v1.0.16-pulp-riscv-gcc-centos-7
$ source pulp-runtime/configs/pulpissimo.sh
$ cd regression_tests/sequential_bare_tests/fft
$ make clean
$ make all
LD  pulp-platform/regression_tests/sequential_bare_tests/fft/build/test/test
pulp-platform/regression_tests/sequential_bare_tests/fft/build/test/main.o: In function `main':
main.c:(.text.startup.main+0x18): undefined reference to `synch_barrier'
main.c:(.text.startup.main+0x24): undefined reference to `synch_barrier'
main.c:(.text.startup.main+0x8e): undefined reference to `synch_barrier'
collect2: error: ld returned 1 exit status
...

synch_barrier is declared in include/pulp.h, and defined in kernel/cluster.c, but kernel/cluster.c will not be compiled when using pulpissimo configuration.

To override this issue, I edit include/pulp.h by replacing

void synch_barrier();

by

#ifdef ARCHI_HAS_CLUSTER 
 
void synch_barrier(); 
 
#else 
 
static inline void synch_barrier() {} 
 
#endif 

-march may be wrong when using pulpissimo configuration

When running tests from https://github.com/pulp-platform/regression_tests/

At least, I found 3 cases freeze forever:

  • sequential_bare_tests/seidel
  • sequential_bare_tests/fdtd-1d
  • sequential_bare_tests/jacobi-1d-imper

And I use sequential_bare_tests/seidel to debug, the simulation hangs just before floating-point operations:

        a[i][j] = (a[i-1][j-1] + a[i-1][j] + a[i-1][j+1]
            + a[i][j-1] + a[i][j] + a[i][j+1]
            + a[i+1][j-1] + a[i+1][j] + a[i+1][j+1])/9.0f;

Finally, I edited rules/pulpos/targets/pulpissimo.mk, use -march=rv32imfcxpulpv2, and all the 3 cases run to the end.

Original

ifdef USE_IBEX
PULP_LDFLAGS +=
PULP_CFLAGS += -D__ibex__ -U__riscv__ -UARCHI_CORE_HAS_PULPV2 -DRV_ISA_RV32
PULP_ARCH_CFLAGS ?= -march=rv32imc
PULP_ARCH_LDFLAGS ?= -march=rv32imc
PULP_ARCH_OBJDFLAGS ?= -Mmarch=rv32imc
else
PULP_LDFLAGS      += 
PULP_CFLAGS       +=  -D__riscv__
# PULP_ARCH_CFLAGS ?=  -march=rv32imcxgap9
# PULP_ARCH_LDFLAGS ?=  -march=rv32imcxgap9
# PULP_ARCH_OBJDFLAGS ?= -Mmarch=rv32imcxgap9
PULP_ARCH_CFLAGS ?=  -march=rv32imfcxpulpv2
PULP_ARCH_LDFLAGS ?=  -march=rv32imfcxpulpv2
PULP_ARCH_OBJDFLAGS ?= -Mmarch=rv32imfcxpulpv2
endif

I tried to use -march=rv32imfcxvpulpv3 as pulp-platform/pulpissimo#183 , and encounter the same error:

cc1: error: -march=rv32imfcxvpulpv3: unsupported ISA substring XVPULPV3

I checked pulp-sdk build by cd pulpissimo; make build-pulp-sdk, -march=rv32imfcxpulpv2 is used for pulpissimo, -march=rv32imcxgap9 is used for vega.

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.