neorv32/README.md

219 lines
48 KiB
Markdown
Raw Normal View History

2024-02-24 08:22:30 +00:00
# neorv32
2024-02-27 23:53:49 +00:00
neorv32 with modiefied Makefiles, compatible with MSYS2 64 for cross compilatation on Windows and Linux.
2024-02-24 09:34:09 +00:00
2024-02-24 08:36:08 +00:00
2024-02-28 22:18:59 +00:00
# Windows Installation and example of cross compilation
### 1. Installation
2024-02-24 09:34:09 +00:00
You must download the latest RISCV precompiled binaries for your platform from: https://github.com/xpack-dev-tools/riscv-none-elf-gcc-xpack/releases/
in this case the architecture x64 for windows binaries(https://github.com/xpack-dev-tools/riscv-none-elf-gcc-xpack/releases/download/v13.2.0-2/xpack-riscv-none-elf-gcc-13.2.0-2-darwin-x64.tar.gz), then extract these under the folder C:\riscv_precompiled\
2024-02-28 00:05:51 +00:00
2024-02-28 22:18:59 +00:00
<span style="color:red">Note: If you change the location where you installed the RISC-V precompiled binaries, you need to modify line 42 of the file common.mk. This will be explained further in this manual at point number 8.</span>
2024-02-28 00:05:51 +00:00
2024-02-28 22:43:31 +00:00
<span style="color:magenta">Your precompiled binaries should look like this on your file system:</span>
2024-02-28 00:06:23 +00:00
2024-02-24 09:34:09 +00:00
<br>
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAnwAAAGICAYAAADbBj3EAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAGSVSURBVHhe7d0PdBvXfSf6L+TapmS7atI6EOA/cl3J2yp6ZEg0f0w1idtuGYpmap+21jvbpuXqPZZq9hxTalylTKm2ZxNxxcabRGJOm0jLLk0nm27l9hwnhiGZ3SbNHylxsiSfUEVJLCXxH4kgnE0aO5b1z+K8+7tzLzAYzIAgRZDg6Ps5HnPmYubODABivrz3DhR79ZV/c6Do/y2amPlJ1Vm+z9fivq8WTtgzHnY+811/rvWR33J9h11tqn+d+N6vHwvzWvhfe2+tEfj9rXR6oh5O0RzTCjmWCDzlRDU3198T/l4REV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jlcXbpEhEREUUcAx8RERFRxDHwEREREUUcAx8RERFRxDHwEREREUUcAx8RERFRxDHwEREREUVc7NVX/k1/c0vY17fURt1/S84ywefRb7avKZpNtb8HtX7m7XFcXa/w4n4K0WIqvrb+97T/VeenWv0Iey0qfz7N9nvs3eoq/Z2v/ASG/1KEPV1VPs4WvmXtKv1lWSLyO2OnWlus/dQPvpeJiGqJgY+oCldX+CIioqhh4CMiIiKKOAY+IiIioohj4KNIsWPf/BMtNRmjx3F6RERLhYGPiIiIaLEsUUtEbOLpsTn+2b0QR1leR9lB2FXCjs5bhXcdXe6r31+H5+HZT95XV1UHdOVmPy5rYfd7ZerpWOZncV7dWqr+nbO47HGFPZP
style="float: left; margin-right: 10px;" />
2024-02-28 22:18:59 +00:00
### 2. Cloning repository
2024-02-28 22:20:49 +00:00
Clone or download this repository on your windows machine.
2024-02-28 22:18:59 +00:00
```
$ git clone https://gitea.squirrelnut.synology.me:5001/FPGALover/neorv32
```
### 2. Download and install MSYS2(msys2-x86_64-20240113.exe) --> https://www.msys2.org/
2024-02-28 22:20:49 +00:00
Once MSYS2 is installed, run MSYS2, and run the command using the MYSS2 command shell (pacman -S mingw-w64-ucrt-x86_64-gcc)
2024-02-28 22:18:59 +00:00
<br>
```
$ pacman -S mingw-w64-ucrt-x86_64-gcc
```
<br><br>
Select ALL dependencies by pressing Enter and select Y[yes].
<br>
```
resolving dependencies...
looking for conflicting packages...
Packages (15) mingw-w64-ucrt-x86_64-binutils-2.41-2
mingw-w64-ucrt-x86_64-crt-git-11.0.0.r216.gffe883434-1
mingw-w64-ucrt-x86_64-gcc-libs-13.2.0-2 mingw-w64-ucrt-x86_64-gmp-6.3.0-2
mingw-w64-ucrt-x86_64-headers-git-11.0.0.r216.gffe883434-1
mingw-w64-ucrt-x86_64-isl-0.26-1 mingw-w64-ucrt-x86_64-libiconv-1.17-3
mingw-w64-ucrt-x86_64-libwinpthread-git-11.0.0.r216.gffe883434-1
mingw-w64-ucrt-x86_64-mpc-1.3.1-2 mingw-w64-ucrt-x86_64-mpfr-4.2.1-2
mingw-w64-ucrt-x86_64-windows-default-manifest-6.4-4
mingw-w64-ucrt-x86_64-winpthreads-git-11.0.0.r216.gffe883434-1
mingw-w64-ucrt-x86_64-zlib-1.3-1 mingw-w64-ucrt-x86_64-zstd-1.5.5-1
mingw-w64-ucrt-x86_64-gcc-13.2.0-2
Total Download Size: 49.38 MiB
Total Installed Size: 418.82 MiB
:: Proceed with installation? [Y/n]
[... downloading and installation continues ...]
```
<br><br>
2024-02-28 22:20:49 +00:00
After the installation is completed, add the *Path* *"C:\msys64\ucrt64\bin"* under the enviroments variable on Windows.
2024-02-24 09:34:09 +00:00
<br>
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAR0AAAA/CAYAAADdeRzyAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAq3SURBVHhe7Z39a1vXGce/DvsHluy3tHmbtOINEdLBQGYZg7CAjMMMo15ZmJv+Ii9jMAvmrluqdo2TZcM/SAzWYrWDRO26oaxgRpBgoyQhYP1UghGZ40lJnTRLQhLy8gfEd+c595x7z5WuHFsvx4r1fMKJztu997nH9z73eY7ueYSlpSXn/v37Xrp3755Md+/e9dKdO3ec27dvO7du3ZLpt+/8wXn06JHz8OFD58GDB4H+ut/Nmzed5eVl5/r1606tVnPoOFevXnWuXLniVCoVZ2Fhwbl8+bJz9uxZ5/Hjxx1Jx09lnVWpZpw4kk5RFRsoJh3EM05VFqpOJh53Mm5BUXSSMOvMsptPJuMO9DHk8SDKbkqaBzba4pnMqvspJv19wNuJOnbR3w81VTO0nd5vQHhF/TloGs/F6xM4Dz1+ND66Tp/bKmOWEWOr+gbkammMgm2+TKbca5WPsc0W8QfpL+KDiKrs6kQwmY6hcK6myo3UstPIxccwElEVKKMymIfjzCKBEiaiKcSKjiiLVM2gMjyErNxdsC2PAnJye425HyAxq/bhFJHMTat9EGWkpoE8tQnNlBs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V4Anl5w/7czr7D+CVhT/i2MdfqgrL2ApXSgpM7T8QLpNciVgOuZjvooT3pZCcYyjIXzyIyjmf+tjjoQTk9ZWs3P8chTPXiLb5ImJGyM9wC4u+njYmkjsiFxFHbNG17MgyihVbDO/R6t+H2TAG6Afwtm3bJgv0lNKfOk/QanD9SfXvf/hXucpcl/WnzruhLTL4+oVP8foOpy5cKbUv48zhYcwsAEdOFZA92uOrzIVS6GRoS3rPZW70GT/90g4dlrdjdEuuXj1fJpQuKp2f4hO5FfEqPvzvcXxXtrlJhre48RGOpf+NTy5eVP3a47kIbUEvJwrLKs+RApk+pW33ihQNmciNuOFKr127hmp1GvtFP0IrJ4kMV7rdzW966CtqciUKGOOQmkwfY39O51IeH3m/f/Ulqv/5n8pvdmgOhRQuh9Rk+pu23av6NrfOD1f62ot+lEBqf/r0At751s+6+hM0HK6UYXqXLikdP5mhSandLFPicKUM01+0rHRELzgrfj+5Df1T27pJ9Fd9AnVG+StbHBz/3VtyH+3CSodhep+WlI5OVK5vMz8phVk6Zvvy8jIOHTok99EurHQYpvexP5HMMExfw0qHYRirsNJhGMYqrHQYhrHKpptIZhimt9lUSodhmN6nJfeKlIZJfdmkfl1W+DothmH6BZ7TYRjGKqx0GIaxCisdhmGswkqHYRirsNJhGMYqrHQYhrEKKx2GYazCSodhGKuw0mEYxiqsdBiGscozlY5e4kCfegkDfep6XUdls6/OE836MAzTf7ClwzCMVVjpMAxjFVY6DMNYhZUOwzBWYaXDMIxVWOkwDGMVVjoMw1iFlQ7DMFZhpcMwjFVY6TAMYxVP6ay2LMFcxrAe9LIHvZ3eD2HmGYbpH9jSYRjGIsD/ASAs8oYBfBNBAAAAAElFTkSuQmCC"
style="float: left; margin-right: 10px;" />
2024-02-28 22:18:59 +00:00
<br><br>
2024-02-28 22:20:49 +00:00
Open a windows cmd and run the command (gcc --version)
2024-02-28 22:18:59 +00:00
```
$ gcc --version
gcc.exe (Rev2, Built by MSYS2 project) 13.2.0
```
<br><br>
2024-02-28 22:20:49 +00:00
Using windows explorer, go to the folder C:\msys64\ucrt64\bin make a copy of the file **mingw32-make.exe** and name it **make.exe**
2024-02-24 09:46:47 +00:00
<br>
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQYAAABBCAYAAAAzHwpcAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAf6SURBVHhe7d1RaFvXGQfwv1bYHroW3Ic1eehoQcqD8UMf/JBJ2x4CGZXcFa8DQQPF0Ab5pSCNVIQGt6WdcFlFG92SUSzSBzNIwLBiRi0NAnmTl4c8BU0Pvlrx2lL6NEPaPtRpqn3fuUfX17pyLCmyG0v/Hxx0z7nnHkkh57vfPTY+kZYAEVHAvoFhYwv415fAd3dtAxGNvH0Dw/K/gSceAX7+U9tARCNv38BQvgU8/QvgoYhtIKKR9xP7SkTkY2AgohAGBiIKYWAgopC+Fx//+dE7+Pb2/7xKnx5+9DE88/JrtkZED6q+M4Z+gsLM72d3vQ4aUIjocPWdMfz9Yh5v/XnRq/Tpzdcv4I9/KtraMFWxeKyAp27U8MKTtomIBjbwGsPly5dNUcc//ALH//oZjl/6L459sInHnU/x+MX/mHPBfkR0NAwcGM6ePWuK+mH7Dn64870td9DSV2lTwX5EdDQMJWNoSTDQQHB3e9t7/c4LFGr/jEEfAxK4et3BS8cimJayeB34vJwwx1peKjdtX6CW99pMyVdta5COFzi3uTPu9LF51LzW3UJ9mrj6bOB9r89j+lkHn3u13sYkOsKGkzFIENAsobXtvWrW0F/GsI733gfe+qqFm1cy+PhMBG9iGTdt/dYbRX/yJYrSpu1fVfD83wq4umlPGDqhU8AVOV9MSl2CxMkVnL5hr7kCfBQIMp5ufYAXPqkgat5Xzp8BnE+yeGLP/p1jEh1tQ8kY/GxBgsJdOdYAocGhd3Gcu2Qn3qlZPC/107+LmjNevY7P2gFA797mTp3Cx7ap7dorMVx7zsWFU7Zhc0NChQSdk/bufqaMW65rT1p79knigkz6rL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dBt8EvL9j9ochYZqadn7K3Y1OvY6Pp/VK7L26kZ7NfckAlfQvtUNLsg56zYJOJ13cpe40Id6YW0RgapN6Fxof2+0WzNmyCzqxIgAlmFmaQRFCZd1NqLHXveafv4Xnr3Nten/CDWtjIXw0rahR+f9Ptp0InZ90yVsd7o2OV7zz5JLMmkT8n7oLK0E9h6GZPGxtDWGA5lG/xhiM4gLRnEWrOK1XoaM0mtN+A216RV6nbe+pJLqGTW4c0RDQpzmgLsBAVlFkXtnbYVmGy90sBiEgK93kVp19qFt71/eJJmbH9bumQ1vfUJ6rc/jarhZAwmGHiBwRQ5PpBt8HulC4brORTtrbvpFAJ34ShmNEmYK6CenpGa1utYLTY0XfDu7lVNtNskgJTj3hNGtYjc1MLwfyriNrAen4R5iNEApbHAJ1nGcg0VpHbWBsyCaLn740M7u7lXHxOENG0IZDd79qdxNJSM4dC2we+ZpsveM72mxXOSCfiPEiKqkUEmn//YIPV6WR4r2ulCbAMFk9ZrMQ/iJhg0N+qQQW27V3YteA4qmUcJOcR0zLkGprr8tCO55CK9ErOLhfL93BIk79/5LKEFy259HLNW4a2NJJEv1ZHyFx97GZPGxQC/Er2Ira3BtsGfmJhA/vyPsA2+puqxBhYGSfOJxtBY/Pl4/VFgql6C66/AE9G9jGhg0EXCGHL+s7ouqjFbIOoVN5whopCBFx+JaHQxMBBRCAMDEYUwMBBRCAMDEYUwMBBRCAMDEYUwMBBRCAMDEYUwMBBRCAMDEXUA/g+REJUismYM0gAAAABJRU5ErkJggg=="
style="float: left; margin-right: 10px;" />
2024-02-28 22:18:59 +00:00
<br><br>
### 3. Cross-Compiling
Using the windows CMD, go to the directory where you cloned or donwloaded this repository to the directory **neorv32\sw\example\demo_blink_led_asm**
<br><br>
```
$ cd neorv32\sw\example\demo_blink_led_asm
```
<br>
<span style="color:red">Note: if you changed the location of the precompiled RISCV binaries, you need to modify the file "neorv32\sw\common\common.mk" at the line # 42:</span>
2024-02-28 00:05:51 +00:00
2024-02-28 22:18:59 +00:00
```
# Compiler toolchain
RISCV_PREFIX = **<your directory to where you installed the prebuilt compiler>\riscv-none-elf-**
```
2024-02-28 00:05:51 +00:00
2024-02-28 22:18:59 +00:00
Run the command **make all** (make sure all antivirus are disabled)
2024-02-28 00:05:51 +00:00
2024-02-28 22:18:59 +00:00
```
$ make all
"Memory utilization:"
text data bss dec hex filename
432 0 0 432 1b0 main.elf
"Generationg APP BIN"
"OK - APP BIN"
"Generationg APP IMG VHD"
"OK - APP IMG VHD"
"Generationg RAW HEX"
"OK - RAW HEX"
"Generationg RAW BIN"
"OK - RAW BIN"
"Generationg BOOT IMG VHD"
"OK - BOOT IMG VHD"
"Memories Generated"
```
List the generated files and you will see
<br>
```
$ ls -l
-rw-rw-rw- 1 adriz 0 6781 2024-02-24 01:45 main.asm
-rw-rw-rw- 1 adriz 0 432 2024-02-24 01:45 main.bin
-rw-rw-rw- 1 adriz 0 8708 2024-02-24 01:45 main.elf
-rw-rw-rw- 1 adriz 0 5456 2024-02-23 16:14 main.S
-rw-rw-rw- 1 adriz 0 2764 2024-02-24 01:45 main.S.o
-rw-rw-rw- 1 adriz 0 274 2024-02-24 01:16 makefile
-rw-rw-rw- 1 adriz 0 1882 2024-02-24 01:45 neorv32_application_image.vhd
-rw-rw-rw- 1 adriz 0 1878 2024-02-24 01:45 neorv32_bootloader_image.vhd
-rw-rw-rw- 1 adriz 0 444 2024-02-24 01:45 neorv32_exe.bin
-rw-rw-rw- 1 adriz 0 432 2024-02-24 01:45 neorv32_raw_exe.bin
-rw-rw-rw- 1 adriz 0 972 2024-02-24 01:45 neorv32_raw_exe.hex
```
You have been able to Assemble assembly code for the RISCV on windows.
Go con the folder **neorv32\sw\example\demo_blink_led** which is the same example as the previous one but written on C code., and run the line "make all"
2024-02-28 00:05:51 +00:00
2024-02-28 22:18:59 +00:00
```
$ make all
"Memory utilization:"
2024-02-24 09:49:52 +00:00
text data bss dec hex filename
2024-02-28 22:18:59 +00:00
1092 0 0 1092 444 main.elf
"Generationg APP BIN"
"OK - APP BIN"
"Generationg APP IMG VHD"
"OK - APP IMG VHD"
"Generationg RAW HEX"
"OK - RAW HEX"
"Generationg RAW BIN"
"OK - RAW BIN"
"Generationg BOOT IMG VHD"
"OK - BOOT IMG VHD"
"Memories Generated"
2024-02-27 23:48:10 +00:00
```
2024-02-28 22:18:59 +00:00
Now you have cross-compiled sucessfuly on windows for C and Assembly code.
If you go to the folder **neorv32\sw\example**, and run the command "make all" you will be able to build all the projects within this folder.
2024-02-27 23:48:10 +00:00
Enjoy!
2024-02-24 09:55:28 +00:00
2024-02-28 22:18:59 +00:00
# Linux Installation and example of cross compilation
### 1. Installation
Open shell and run:
```
sudo apt-get update
sudo apt-get install autoconf automake autotools-dev curl python3 python3-pip libmpc-dev libmpfr-dev libgmp-dev gawk build-essential bison flex texinfo gperf libtool patchutils bc zlib1g-dev libexpat-dev ninja-build git cmake libglib2.0-dev
git clone https://github.com/riscv/riscv-gnu-toolchain
cd riscv-gnu-toolchain/
mkdir build/
cd build
sudo mkdir /opt/riscv32im
sudo chown $USER /opt/riscv32im
./configure --with-arch=rv32im --prefix=/opt/riscv32im
make -j$(nproc)
```
### 2. Clone this repo
2024-02-28 22:20:49 +00:00
Using shell, go to the directory where you cloned or donwloaded this repository to the directory **neorv32\sw\example\demo_blink_led_asm**
2024-02-28 22:18:59 +00:00
```
$ git clone https://gitea.squirrelnut.synology.me:5001/FPGALover/neorv32
$ cd neorv32\sw\example\demo_blink_led
```
<span style="color:red">Note: if you changed the location of the RISCV compiler, you need to modify the file "neorv32\sw\common\common.mk" on the line # 448:</span>
```
...
# Compiler toolchain
RISCV_PREFIX = **<path where you installed your compiler under linux file system>/bin/riscv32-unknown-elf-**
...
```
### 3. Cross-Compile
Run the command **make all**
```
$ make all
Memory utilization:
text data bss dec hex filename
1012 0 0 1012 3f4 main.elf
Executable (neorv32_exe.bin) size in bytes:
1024
Installing application image to ../../../rtl/core/neorv32_application_image.vhd
```
List the generated files and you will see
```
$ ls -l
-rw-r--r-- 1 adrizcorp adrizcorp 18160 Feb 24 01:54 main.asm
-rw-r--r-- 1 adrizcorp adrizcorp 1012 Feb 24 01:54 main.bin
-rw-r--r-- 1 adrizcorp adrizcorp 4314 Feb 23 15:08 main.c
-rw-r--r-- 1 adrizcorp adrizcorp 7696 Feb 24 01:54 main.c.o
-rwxr-xr-x 1 adrizcorp adrizcorp 42856 Feb 24 01:54 main.elf
-rw-r--r-- 1 adrizcorp adrizcorp 141 Feb 23 15:08 makefile
-rw-r--r-- 1 adrizcorp adrizcorp 3704 Feb 24 01:54 neorv32_application_image.vhd
-rw-r--r-- 1 adrizcorp adrizcorp 1024 Feb 24 01:54 neorv32_exe.bin
-rw-r--r-- 1 adrizcorp adrizcorp 1012 Feb 24 01:54 neorv32_raw_exe.bin
-rw-r--r-- 1 adrizcorp adrizcorp 2277 Feb 24 01:54 neorv32_raw_exe.hex
```
Now you have been able to compile C code for the RISCV processor.
2024-02-24 10:10:44 +00:00
Enjoy!