|
|
# Purpose of this experiment
|
|
|
|
|
|
Install nessesary tools to establish development environment for building an SoC with Gowin FPGA board.
|
|
|
|
|
|
# 1. PC requirements
|
|
|
|
|
|
In this course, Gowin FPGA development board is recommended as it has a relative low hardware requirements(Harddisk drive space). Most tools are open source ones, only non-open-source tool is the Gowin Designer for FPGA systhesis, fortunately there is an educational version available.
|
|
|
|
|
|
PC requirements have some different between native linux and linux on virtual machine.
|
|
|
|
|
|
## Native Linux platform
|
|
|
|
|
|
- CPU: 2~4 cores
|
|
|
- RAM: 8GB above, 16GB+ recommanded.
|
|
|
- HDD: 10GB+ (Gowin Designer + RISC-V tool chain in binary release) / 60BG+ (RISC-V tool chain from source code), **Recomment using RISC-V tool chain in binary release.**
|
|
|
|
|
|
## Linux on virtual machine in Windows
|
|
|
|
|
|
- CPU: 4+ cores
|
|
|
- RAM: 16GB at least
|
|
|
- HDD: 30GB (Gowin Designer + RISC-V tool chain in binary release)
|
|
|
|
|
|
# 2.Linux Distribution Release to use
|
|
|
|
|
|
Ubuntu Linux Desktop is highly recommended for our course experiment. The best release will be Ubuntu Desktop 22.04.3 LTS, which has been verified in last year. Here is the install image for download:
|
|
|
|
|
|
[https://mirrors.tuna.tsinghua.edu.cn/ubuntu-releases/22.04.3/ubuntu-22.04.3-desktop-amd64.iso](https://mirrors.tuna.tsinghua.edu.cn/ubuntu-releases/22.04.3/ubuntu-22.04.3-desktop-amd64.iso)
|
|
|
|
|
|
If you suppose to install a native linux on a bare-metal computer, you need an USB flash disk as a install media, find some instructions with search engines or the official document.
|
|
|
|
|
|
In most cases, it is better to install ubuntu on a virtual machine. Follow instructions below.
|
|
|
|
|
|
# 3.Virtual machine tools on Windows
|
|
|
|
|
|
Vmware workstation player is recommended for our development, as it has been verified to work fine. Some open source solutions such as Virtual Box or Hyper-V from Microsoft should work fine but not verified.
|
|
|
|
|
|
Vmware Workstation 17/16 Player is free for personal use. You can download from following links:
|
|
|
|
|
|
[https://www.vmware.com/content/vmware/vmware-published-sites/us/products/workstation-player.html](https://www.vmware.com/content/vmware/vmware-published-sites/us/products/workstation-player.html)
|
|
|
|
|
|
NOTE: no license is needed, just skip license code input during installation.
|
|
|
|
|
|
|
|
|
# 4.Installing Ubuntu linux
|
|
|
|
|
|
No other special care should be taken than choose "normal installation" during install procedure. After finished installing, some frequently used tools can be installed with following instructinos:
|
|
|
|
|
|
Press <key>CTRL</key>+<key>ALT</key>+<key>T</key>key to open a linux terminal, then input following commands to install "vim" and "git":
|
|
|
|
|
|
```shell
|
|
|
sudo apt update
|
|
|
sudo apt upgrade
|
|
|
sudo apt install vim git
|
|
|
```
|
|
|
Here "vim" is a text edit tool in linux terminal, and "git" is a source version control tool, we will use it to clone source code from remote repositories.
|
|
|
|
|
|
|
|
|
# 5. Installing iVerilog and gtkwave
|
|
|
|
|
|
iVerilog(aka. Icarus verilog) is an open source verilog synthesizer, which is used to "translate" verilog code to netlist. It can also generate timing info which simulate the behaviour of the circuit.
|
|
|
|
|
|
gtkwave is another open source software which can be used to view the waveform generated from iverilog. It helps us to understand how circuits works and to debug verilog issues.
|
|
|
|
|
|
in linux terminal, use following commands to install these two software.
|
|
|
|
|
|
```shell
|
|
|
sudo apt update
|
|
|
sudo apt install iverilog
|
|
|
sudo apt install gtkwave
|
|
|
```
|
|
|
|
|
|
# 6. Installing Visual Studio Code (aka. VSCode) for code editing
|
|
|
|
|
|
Under linux system, you can use both vim or VSCode to input your verilog code. But VSCode is more suitable for managing a multiple-file project. You can download VSCode installation pack in:
|
|
|
|
|
|
[https://code.visualstudio.com/](https://code.visualstudio.com/)
|
|
|
|
|
|
Use firefox browser under linux to access the homepage, the webpage will identify your system type (linux) and will provide you a download link of an install pack for linux system. Choose "Linux x64 stable .deb" to download. See below.
|
|
|
|
|
|
![image1](uploads/441aa6230ced30af16bb878e8026e37c/image1.png)
|
|
|
|
|
|
# 7. Installing Gowin Designer
|
|
|
|
|
|
Gowin Designer is the systhesize tool to convert verilog project to an FPGA bitstream for Gowin FPGAs.
|
|
|
|
|
|
Here is the website of Gowin Semi:
|
|
|
|
|
|
[https://www.gowinsemi.com/en/support/download_eda/](https://www.gowinsemi.com/en/support/download_eda/)
|
|
|
|
|
|
Register and login to download. Note that you should choose Educational edition for linux, which is license free.
|
|
|
|
|
|
here is the chinese version for download if you have difficulty in finding proper software package.
|
|
|
|
|
|
[http://cdn.gowinsemi.com.cn/Gowin_V1.9.9Beta-4_Education.tar.gz](http://cdn.gowinsemi.com.cn/Gowin_V1.9.9Beta-4_Education.tar.gz)
|
|
|
|
|
|
You'd better also download the Gowin Programmer for windows in case the programmer does not work in linux on virtual machine.
|
|
|
|
|
|
# 8. Installing RISC-V compiler tool chain for microcontroller
|
|
|
|
|
|
Using xpack-riscv-none-embed-gcc as the compiler, here is the download link:
|
|
|
|
|
|
[https://git.tongji.edu.cn/intelli_chip_and_system_design_course/asserts/-/blob/main/tools/xpack-riscv-none-embed-gcc-10.2.0-1.2-linux-x64.tar.gz](https://git.tongji.edu.cn/intelli_chip_and_system_design_course/asserts/-/blob/main/tools/xpack-riscv-none-embed-gcc-10.2.0-1.2-linux-x64.tar.gz)
|
|
|
|
|
|
Download it to your personal folder in linux (eg. ~/Download), use following command to extract the pack.
|
|
|
|
|
|
```shell
|
|
|
cd ~/Download
|
|
|
tar zxvf xpack-riscv-none-embed-gcc-10.2.0-1.2-linux-x64.tar.gz
|
|
|
|
|
|
```
|
|
|
Then move xpack-riscv-none-embed-gcc to /opt folder. Note that you need to add `sudo` before `mv` command.
|
|
|
|
|
|
```shell
|
|
|
sudo mv /xpack-riscv-none-embed-gcc-10.2.0-1.2 /opt
|
|
|
```
|
|
|
Then add `/opt/xpack-riscv-none-embed-gcc-10.2.0-1.2/bin` into system environment variable to enable direct access to riscv-none-embed-gcc binary files. Use following command to open vim to edit your profile, add this path to $PATH.
|
|
|
|
|
|
```shell
|
|
|
vim ~/.bashrc
|
|
|
```
|
|
|
In vim interface, roll to last line, press <key>i</key> key to enter "Insert" mode, appending followings to .bashrc last line.
|
|
|
|
|
|
```
|
|
|
export PATH=$PATH:/opt/xpack-riscv-none-embed-gcc-10.2.0-1.2/bin/
|
|
|
```
|
|
|
Press <key>ESC</key> key to exit "insert" mode ,then press <key>:wq</key> to save file.
|
|
|
|
|
|
in terminal, execute
|
|
|
```
|
|
|
source ~/.bashrc
|
|
|
```
|
|
|
to refresh system variables.
|
|
|
|
|
|
Now you can try `riscv-none-embed-gcc -v` to see if RISC-V GCC works.
|
|
|
|
|
|
|