Take a look on the web version: Website · Repository
The simulator can be installed on Your PC (no internet link needed after installation) or accessed by means of a web browser interface (no installation required).
This repository offers
- remote access to physical FPGA board
- configure the FPGA board remotely using SystemVerilog HDL
- interact with the FPGA board remotely by graphical browser interface
- compile C or Assembly to run on a RISC-V processor implemented on the FPGA board
- write Your own Systemverilog description of a RISC-V processor, implement it, and test it running C or Assembly code
- simulate all of the above on Your own PC or using a web interface
- simulate RISC-V ISA from C, Assembly or binary machine code using a graphical interface for the oficial RISC-V toolchain
- install the RISC-V ISA simulator on Your PC or use a web interface
Installation of this typefont is recomended: http://lad.ufcg.edu.br/loac/uploads/OAC/led_counter-7.ttf
Execute the following commands in a terminal window:
sudo apt-get update
sudo apt-get install libfltk1.3-dev make g++ libpng-dev zlib1g-dev git flex bison libfl-dev libboost-all-dev
wget https://www.veripool.org/ftp/verilator-3.922.tgz
tar xf verilator-3.922.tgz
cd verilator-3.922
./configure
make
sudo make install
cd ..
git clone https://github.com/Icaro-Lima/LabarcFPGASimulatorDesktop.git
cd LabarcFPGASimulatorDesktop
http://lad.ufcg.edu.br/loac/uploads/OAC/icaro_install.mp4
Execute the following commands in a terminal window:
sudo apt-get update
sudo apt-get install verilator libfltk1.3-dev make g++ libpng-dev zlib1g-dev git flex bison libfl-dev libboost-all-dev
git clone https://github.com/Icaro-Lima/LabarcFPGASimulatorDesktop.git
cd LabarcFPGASimulatorDesktop
Execute the following commands in a terminal window:
yum -y --enablerepo=epel install verilator fltk-devel make gcc-c++ libpng-devel zlib-devel boost-devel
git clone https://github.com/Icaro-Lima/LabarcFPGASimulatorDesktop.git
cd LabarcFPGASimulatorDesktop
Install VNC Viewer and Userland. Inside Userland, choose Ubuntu. Inside Ubuntu, follow instruction above for Ubuntu 18.04.
Restrictions: maximum 32 bit variables.
Only the rightmost 8 digits of the LCD display (lcd_a
and lcd_b
) are working.
Download MSYS2 from https://www.msys2.org/ and install.
Open an MSYS2 terminal window and execute the following commands:
pacman -Syu
pacman -Sy
pacman -Su
pacman -S --needed base-devel mingw-w64-x86_64-toolchain
When asked which packages of MinGW You want to install, answer "1-19". Do not answer "all".
When finished, close the MSYS2 terminal window and open a new MinGW terminal window. Execute the following commands:
Caution: You must change the terminal window from MSYS2 to MinGW
pacman -S git make mingw-w64-x86_64-verilator mingw-w64-x86_64-fltk mingw-w64-x86_64-boost
git clone https://github.com/Icaro-Lima/LabarcFPGASimulatorDesktop.git
cd LabarcFPGASimulatorDesktop
Restrictions: maximum 32 bit variables.
Only the rightmost 8 digits of the LCD display (lcd_a
and lcd_b
) are working.
Baixe o homebrew na sua máquina (se já tiver, não precisa baixar novamente)
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" < /dev/null 2> /dev/null
Após isso basta executar os seguintes comandos:
brew install verilator
brew install fltk
Existe uma issue na biblioteca fltk no macOS Mojave, em que o simulador fica completamente vazio ao realizar make
. O problema foi corridor por este commit. Caso este seja o seu caso, existe um workaround possível:
-
Remover qualquer versão existente da FLTK
brew uninstall fltk
-
Clonar o repositório com a versão nova de FLTK
git clone https://github.com/fltk/fltk.git
-
Navegue até o repositório
cd fltk
-
Realizar checkout no commit com o fix da issue
git checkout f76d2a2bf8c35c0c313f05bbd6deda49dd344efc
-
Instale
make clean && make install
OBS.: Não há uma previsão de quando haverá uma nova atualização no pacote disponível no Homebrew com o fix dessa issue.
Change into the directory LabarcFPGASimulatorDesktop
. Open the file top.sv
. Edit it as You wish. In order to run the simulation type make
.
The display is updated once per second, indepenetly from the frequency of the clk_2
input. Only if the frequency of clk_2
is equal or less than 0.5 Hz, it can be observerd correctly. If the frequency of clk_2
is greater than 1 Hz, the display may skip some changes which would be visible on the display of the real FPGA board.
The rightmost character of the first line shows the signal called Branch
. _
means 0
and *
means 1
.
The next character to the left shows MemWrite
.
The rightmost character of the second line shows RegWrite
asnd the adjacent character to the left shows MemtoReg
.
Only the first 16 registers are shown. The remaining registers can be used but are not shown.
Use the link http://lad.ufcg.edu.br/hdl/simulate.php and upload Your files. The GUI will appear in the browser.
There are 20 FPGA boards similar to this one, available for simulataneous use:
Use the link http://lad.ufcg.edu.br/hdl/remote.php and upload Your files. After completing synthesis, the GUI will appear in the browser. The GUI reflects the position of the switches, the LEDs and the LCD of the board You are using.
Close the window or tab of the browser to end the session and make the FPGA board available for another users. After a timeout of several minutes the FPGA is disconnected from Your session automatically.
http://lad.ufcg.edu.br/loac/uploads/OAC/remote_FPGA.mp4
The RISC-V toolchain must be installed, including spike
compiled with boost installed,
see instructions here.
Windows installation apparently is impossible.
Change into the directory LabarcFPGASimulatorDesktop
.
Put C files (.c
and .h
), assembly files (.s
), or one binary instruction file (.101
) into it. Examples can be found in the subdirectory server
. Type the command:
make isa
Whenever there is a binary instruction file, C and assembly files are ignored.
To clean up all ISA simulator related files, use the command:
make isa-clean
Use the link http://lad.ufcg.edu.br/isa
Í. Lima and E. Melcher, “Um Simulador Didático para o Ensino de SystemVerilog”, Workshop sobre Educação em Arquitetura de Computadores, 2018: http://lad.dsc.ufcg.edu.br/lad/uploads/Lad/WEAC_2018.pdf
Proceedings WCAS 20211, paper "Remote FPGA Lab for Distance Learning" on pages 27-30: https://bit.ly/wcas21
presentation video: https://youtu.be/PMbBgx9OTNU