Giter VIP home page Giter VIP logo

riscv-gcc-prebuilt's Introduction

Prebuilt RISC-V GCC Toolchains for Linux

Test_Toolchains license

The toolchains were built according to the instructions of the official RISC-V GNU Compiler Toolchain repository using Ubuntu on a 64-bit x86 machine (actually on Ubuntu on Windows). The provided toolchains support all ratified and implemented ISA extensions (e.g. A and Zicsr). These prebuilt toolchains are part of the NEORV32 RISC-V Processor project.

Note

Platform-specific instructions for building the toolchain from scratch can be found in NEORV32 UG: Building The Toolchain From Scratch

Available Toolchains

Toolchain prefix: riscv32-unknown-elf or riscv64-unknown-elf (see the individual releases)

Status Release (tag) Download GCC binutils march mabi c-lib
๐ŸŸข rv32e-231223 ๐Ÿ’พ download 13.2.0 2.41 rv32e ilp32e newlib
๐ŸŸข rv32i-131023 ๐Ÿ’พ download 13.2.0 2.41 rv32i ilp32 newlib
๐Ÿ”ด rv32i-4.0.0 ๐Ÿ’พ download 12.1.0 2.39 rv32i ilp32 newlib

๐ŸŸข active / recommended, ๐Ÿ”ด outdated

Download

Warning

Cloning this repository (via git clone) will not include the release assets and will not include the actual toolchain archives! The compressed toolchain archives (.tar.gz) are available as releases assets only.

Via Browser

Click on the according download link in the table above to directly download the archive of choice from the according release page via the release assets.

Via Command Line

You can use wget to directly download a toolchain archive from the table above. Select the toolchain of choice, right-click on the "download" link, click "copy link address" and use that as argument for wget. Example:

wget https://github.com/stnolting/riscv-gcc-prebuilt/releases/download/rv32i-4.0.0/riscv32-unknown-elf.gcc-12.1.0.tar.gz

Installation

Create a folder where you want to install the toolchain, for example /opt/riscv (you might need sudo to create this folder and copy data to it).

$ sudo mkdir /opt/riscv

Navigate to the download folder. Decompress your toolchain (replace TOOLCHAIN with your toolchain archive of choice). Again, you might have to use sudo if your target directory is protected.

$ sudo tar -xzf TOOLCHAIN.tar.gz -C /opt/riscv/

Now add the toolchain's bin folder to your system's PATH environment variable. Your can also add this line to your .bashrc if applicable.

$ export PATH=$PATH:/opt/riscv/bin

Test the toolchain:

$ riscv32-unknown-elf-gcc -v
Using built-in specs.
COLLECT_GCC=riscv32-unknown-elf-gcc
COLLECT_LTO_WRAPPER=/opt/riscv/libexec/gcc/riscv32-unknown-elf/12.1.0/lto-wrapper
Target: riscv32-unknown-elf
Configured with: /tmp/rv_gcc/riscv-gnu-toolchain/gcc/configure --target=riscv32-unknown-elf --prefix=/opt/riscv --disable-shared --disable-threads --enable-languages=c,c++ --with-pkgversion=g1ea978e3066 --with-system-zlib --enable-tls --with-newlib --with-sysroot=/opt/riscv/riscv32-unknown-elf --with-native-system-header-dir=/include --disable-libmudflap --disable-libssp --disable-libquadmath --disable-libgomp --disable-nls --disable-tm-clone-registry --src=/tmp/rv_gcc/riscv-gnu-toolchain/gcc --disable-multilib --with-abi=ilp32 --with-arch=rv32i --with-tune=rocket --with-isa-spec=2.2 'CFLAGS_FOR_TARGET=-Os   -mcmodel=medlow' 'CXXFLAGS_FOR_TARGET=-Os   -mcmodel=medlow'
Thread model: single
Supported LTO compression algorithms: zlib
gcc version 12.1.0 (g1ea978e3066)

License

This project is released under the GPL-2.0 license. No copyright infringement intended. Other implied or used projects might have different licensing - see their documentation to get more information.

Limitation of Liability for External Links

Our website contains links to the websites of third parties ("external links"). As the content of these websites is not under our control, we cannot assume any liability for such external content. In all cases, the provider of information of the linked websites is liable for the content and accuracy of the information provided. At the point in time when the links were placed, no infringements of the law were recognizable to us. As soon as an infringement of the law becomes known to us, we will immediately remove the link in question.

riscv-gcc-prebuilt's People

Contributors

stnolting 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  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  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

riscv-gcc-prebuilt's Issues

riscv-gcc-prebuilt: add builded commit hash to doc

Hi Stephan,

your Prebuilt GCC is a real big deal. It makes the compile of source code easily. But whenever you are in need to build your GCC from scratch it would be very helpful to store also the used commit for build in your table:

image

This table could for instance modified to:

Status Release (tag) Download GCC binutils march mabi c-lib
๐Ÿ”ด rv32i-4.0.0 ๐Ÿ’พ download 12.1.0 2.39 rv32i ilp32 newlib

Could this suitable?

Thanks and BR,
Andreas

adding custom instructions

I've been trying to add some custom instructions to this prebuilt toolchain (rv64imc-3.0.0), which requires me to find opcode definitions in riscv-opc.h and riscv-opc.c.

I've found that if you build the original toolchain, the above files could be found under binutils/include/opcode and binutils/opcodes/riscv-opc.c, respectively.

However I've been struggling to find the binutils folder in the downloaded/extracted toolchain here, any help regarding where I might be able to find the folder or something that serves similar functionality?

Install prebuilt toolchain corretly

Hey,

I have a problem when I use the toolchain after installation.
Although the make check cmd says:

---------------- Check: NEORV32_HOME folder ----------------
NEORV32_HOME: /home/ucycg/Dokumente/neoipe/ext/neorv32
---------------- Check: Shell ----------------
/bin/sh
/usr/bin/bash
---------------- Check: riscv32-unknown-elf-gcc ----------------
Using built-in specs.
COLLECT_GCC=riscv32-unknown-elf-gcc
COLLECT_LTO_WRAPPER=/home/ucycg/Programme/riscv/bin/../libexec/gcc/riscv32-unknown-elf/12.1.0/lto-wrapper
Target: riscv32-unknown-elf
Configured with: /tmp/rv_gcc/riscv-gnu-toolchain/gcc/configure --target=riscv32-unknown-elf --prefix=/opt/riscv --disable-shared --disable-threads --enable-languages=c,c++ --with-pkgversion=g1ea978e3066 --with-system-zlib --enable-tls --with-newlib --with-sysroot=/opt/riscv/riscv32-unknown-elf --with-native-system-header-dir=/include --disable-libmudflap --disable-libssp --disable-libquadmath --disable-libgomp --disable-nls --disable-tm-clone-registry --src=/tmp/rv_gcc/riscv-gnu-toolchain/gcc --disable-multilib --with-abi=ilp32 --with-arch=rv32i --with-tune=rocket --with-isa-spec=2.2 'CFLAGS_FOR_TARGET=-Os -mcmodel=medlow' 'CXXFLAGS_FOR_TARGET=-Os -mcmodel=medlow'
Thread model: single
Supported LTO compression algorithms: zlib
gcc version 12.1.0 (g1ea978e3066)
---------------- Check: riscv32-unknown-elf-objdump ----------------
GNU objdump (GNU Binutils) 2.39
Copyright (C) 2022 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) any later version.
This program has absolutely no warranty.
---------------- Check: riscv32-unknown-elf-objcopy ----------------
GNU objcopy (GNU Binutils) 2.39
Copyright (C) 2022 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) any later version.
This program has absolutely no warranty.
---------------- Check: riscv32-unknown-elf-size ----------------
GNU size (GNU Binutils) 2.39
Copyright (C) 2022 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) any later version.
This program has absolutely no warranty.
---------------- Check: NEORV32 image_gen ----------------
<<< NEORV32 executable image generator >>>
by Stephan Nolting
Three arguments are required.
1st: Option
-app_bin : Generate application executable binary (binary file, little-endian, with header)
-app_img : Generate application raw executable memory image (vhdl package body file, no header)
-raw_hex : Generate application raw executable (ASCII hex file, no header)
-raw_bin : Generate application raw executable (binary file, no header)
-bld_img : Generate bootloader raw executable memory image (vhdl package body file, no header)
2nd: Input file (raw binary image)
3rd: Output file
4th: Project folder (optional)
---------------- Check: Native GCC ----------------
Es werden eingebaute Spezifikationen verwendet.
COLLECT_GCC=/bin/gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/8/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Ziel: x86_64-redhat-linux
Konfiguriert mit: ../configure --enable-bootstrap --enable-languages=c,c++,fortran,lto --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://bugs.rockylinux.org/ --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --with-isl --disable-libmpx --enable-offload-targets=nvptx-none --without-cuda-driver --enable-gnu-indirect-function --enable-cet --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux
Thread-Modell: posix
gcc-Version 8.5.0 20210514 (Red Hat 8.5.0-16) (GCC)

Toolchain check OK

When I actually try to: make clean_all install in the demo_blink_led directory I encounter an error:

[ucycg@itiv-work5 demo_blink_led]$ make clean_all install /home/ucycg/Programme/riscv/bin/../libexec/gcc/riscv32-unknown-elf/12.1.0/cc1: error while loading shared libraries: libmpfr.so.6: cannot open shared object file: No such file or directory make: *** [/home/ucycg/Dokumente/neoipe/ext/neorv32/sw/common/common.mk:182: main.c.o] Fehler 1
As I already noticed I installed the the whole toolchain in /home/ucycg/Programme/riscv instead of /opt/riscv
when I ran a grep cmd I realized that there are a lot of files where this /opt/riscv path is specified in some form. Could this be related to my problem? Also for example in the gcc configuration sysroot=/opt/riscv/riscv32-unknown-elf is specified
Do you have any idea how to change that in a convinient way or is this even possible?

I am working over a remotedesktop access to server at my uni since I don't have sudo rights I installed it in my own directory instead of /opt/riscv since getting someone to create this for me would be probably a pain.

Thx in advance and kind regards

Justin

Simulate Bootloader functionality with Testbench

I'm currently running the NEORV32 Code via Cadence xcelium and was able to simulate successfully the blinky LED example via the application image.

Is there anything on the Github that lets me test the bootloader by sending a code example via uart to the processor and all of this inside Cadence Xcelium? My idea so far would be to write my own UART TX module as part of a testbench somehow that transmits the Code to the CPU with the bootloader code.

If there is anything like this already existing I would be glad to know that or if you think there is a better idea to do what I want to do.

The final goal for me is to do a physical chip design with the NEORV32

Error with stdint.h

Hi
When I tried using prebuilt binaries in Mint, I got this error. stdint.h no such file or directory.
Thanks

image

neorv32 example "hello_world" fails to build with rv32i-131023

When I follow the instructions here to build the neorv32 "hello world" example, the build fails with the error extension 'zicsr' required:

rweeks@dev-compiler-build:~/projects/neorv32/sw/example/hello_world$ make USER_FLAGS+="-DUART0_SIM_MODE -DUART1_SIM_MODE" MARCH=rv32imc clean_all sim
../../../sw/lib/include/neorv32_cpu.h: Assembler messages:
../../../sw/lib/include/neorv32_cpu.h:343: Error: unrecognized opcode `csrc 836,a0', extension `zicsr' required
../../../sw/lib/include/neorv32_cpu.h:329: Error: unrecognized opcode `csrs 772,a0', extension `zicsr' required
../../../sw/lib/include/neorv32_cpu.h:343: Error: unrecognized opcode `csrc 772,a0', extension `zicsr' required
../../../sw/lib/include/neorv32_cpu.h:343: Error: unrecognized opcode `csrc 836,a0', extension `zicsr' required

According to this section of the neorv32 docs, the zicsr extension is mandatory and can't ben enabled/disabled, so I'm not sure what's gone wrong.

Reverting to the 4.0.0 toolchain fixes the problem.

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.