You can use MacOS, Linux or Windows.
For MacOS on the Apple M1 chip, just download and run the x86-64
version of the toolchain and MacOS will transparently translate the toolchain to M1.
For Windows users, use WSL (Windows Subsystem for Linux) in step1-3.
Here are the tutorial videos for MacOS, Linux and Windows.
Setup your working directory and name it as $EGOS
.
> export EGOS=/home/yunhao/egos
> cd $EGOS
> git clone https://github.com/yhzhang0128/egos-2000.git
# now the code repository is at $EGOS/egos-2000
Download the SiFive riscv-gcc compiler to the working directory $EGOS
.
> cd $EGOS
> tar -zxvf riscv64-unknown-elf-gcc-8.3.0-2020.04.1-x86_64-xxx-xxx.tar.gz
> export PATH=$PATH:$EGOS/riscv64-unknown...../bin
> cd $EGOS/egos-2000
> make
mkdir -p build/debug build/release
......
After this step, build/release
holds the ELF format binary executables and build/debug
holds the human readable assembly files.
Make sure you have a C compiler (i.e., the cc
command) in your shell environment.
> cd $EGOS/egos-2000
> make install
-------- Create the Disk Image --------
......
[INFO] Finish making the disk image
-------- Create the BootROM Image --------
......
[INFO] Finish making the bootROM binary
[INFO] Finish making the bootROM mcs image
This will create disk.img
, bootROM.bin
and bootROM.mcs
in the tools
directory.
You can use balena Etcher or the dd
shell command to program disk.img
to your microSD card.
Download the QEMU emulator for egos-2000 to the working directory $EGOS
.
> cd $EGOS
> tar -zxvf riscv-qemu-xxx.tar.gz
> export PATH=$PATH:$EGOS/riscv-qemu-5.2.0-...../bin
> cd $EGOS/egos-2000
> make qemu
-------- Simulate on QEMU-RISCV --------
cp build/release/earth.elf tools/qemu/qemu.elf
riscv64-unknown-elf-objcopy --update-section .image=tools/disk.img tools/qemu/qemu.elf
qemu-system-riscv32 -readconfig tools/qemu/sifive-e31.cfg -kernel tools/qemu/qemu.elf -nographic
[INFO] -----------------------------------
[INFO] Start to initialize the earth layer
......
Download OpenOCD v0.11.0-1 to the working directory $EGOS
.
> cd $EGOS
> tar -zxvf xpack-openocd-0.11.0-1-xxx-xxx.tar.gz
> export PATH=$PATH:$EGOS/xpack-openocd-0.11.0-1-xxx-xxx/bin
> cd $EGOS/egos-2000
> make program
-------- Program the on-board ROM --------
cd tools/openocd; time openocd -f 7series.txt
......
Info : sector 188 took 223 ms
Info : sector 189 took 223 ms
Info : sector 190 took 229 ms
Info : sector 191 took 243 ms # It will pause at this point for a while
Info : Found flash device 'micron n25q128' (ID 0x0018ba20)
real 2m51.019s
user 0m11.540s
sys 0m37.338s
Install Vivado Lab Edition which can be downloaded here. You may need to register a Xilinx account, but the software is free.
- Open Vivado Lab Edition and click "Open Hardware Manager"
- Click "Open target" and "Auto Connect"; the Arty board should appear in the "Hardware" window
- In the "Hardware" window, right click
xc7a35t
and click "Add Configuration Memory Device" - Choose memory device "mt25ql128-spi-x1_x2_x4" and click "Program Configuration Memory Device"
- In the "Configuration file" field, choose the
bootROM.mcs
file compiled in step 2 - Click "OK" and wait for the program to finish
In 4, new versions of Arty may use "s25fl128sxxxxxx0" as memory device. If you choose the wrong one, 6 will tell you.
In 2, if the Arty board doesn't appear, try to install Digilent Adept or reinstall the USB cable drivers following these instructions. If it still doesn't work, it may be an issue with Vivado and please contact Xilinx.
- After step4.1, Press the
PROG
red button on the left-top corner of the Arty board - To restart, press the
RESET
red button on the right-top corner - For Linux users, type in your shell
> sudo chmod 666 /dev/ttyUSB1
> screen /dev/ttyUSB1 115200
[INFO] -----------------------------------
[INFO] Start to initialize the earth layer
[SUCCESS] Finished initializing the tty device
[CRITICAL] Choose a disk:
Enter 0: use the microSD card
Enter 1: use the on-board flash ROM @0x20800000
......
- For MacOS users, use the same commands but check your
/dev
directory for the device name (e.g.,/dev/tty.usbserial-xxxxxx
) - For Windows users, find the board in your "Device Manager" (e.g., COM4) and use
PuTTY
to connect with the board with the following configuration: