1 Lab notes
Day 1.
- got a de0 nano.
- installed Lubuntu 13.04 in VirtualBox, 32-bit, 6GB space.
- tried to install the Altera Quartus II suite. Not enough space.
- bigger HD image: 10GB.
- installed the tools. Fits.
- tried to download/install OpenRISC tools. Not enough space.
- ordered external SSD drive.
Day 2, new HD delivered.
- configured/installed VirtualBox/Lubuntu again, 30GB HD space.
- installed Quartus II suite from Altera, OK.
- installed the or1k-elf- tool chain (binutils, gcc) as per OpenCores wiki, OK.
Day 3.
- looked at OpenCores wiki page on FPGA dev boards, saw a reference to a pre-build image from Stefan K from October 2012.
quartus_pgm
complains that it cannot find a JTAG hardware.- (lots of search / trying things out afterwards) Quartus II 10.1 as shipped on the de0 nano DVD can’t work directly with Ubuntu 13.04 because it required usbdevfs mounted /proc/bus/usb and Ubuntu does not provide that.
- Used a workaround to make /proc/bus/usb available.
- uploaded Stefan K’s prebuilt image to the board. OK.
- found the UART pin assignments from a file
UART0_pin_assignments.tcl
in Stefan’s orpsoc repository. Says PIN_C16 and PIN_D15, which according to the de0 manual map to GPIO_23 and GPIO_25 at the back of the board. - Missing some cables to connect to the configured UART.
- upgraded Quartus II install to 13sp1.
- wrote this doc.
- discovered the OpTiMSoC project which provides ready-to-use VirtualBox images.
- discovered the “new OpenRISC SoC dev board” page on the OpenRISC wiki.
Things to do: find some cables to connect to the image already flashed to the de0 nano. Build own linux image. Build own orpsoc image. Check the OpTiMSoC virtualbox image out.
Learned on the way:
- Quartus tools are required to upload an image to the board (
quartus_pgm
). - Both the SoC bitstream and the linux kernel image can be integrated into one image that flashes both the FPGA and attached SPI flash. The orpsoc image can boot from the SPI flash.
- binutils, gcc, built for target “or1k-elf”, are required to build the linux kernel and other binaries.
- Quartus tools are required to build orpsoc and core Verilog code to FPGA bitstream.
- pre-built bitstreams available from various people (ask on IRC).
2 Web Resources
September 2013. git.openrisc.net :: Source code repositories, mirrored (partially?) on GitHub. Main Contributors: Stefan Kristiansson, Julius Baxter, Jonas Bonn.
Sources for the binutils, gcc, llvm, linux kernel, orpsoc, other things.
(Unclear which version is authoritative, but git.openrisc.net seems to have more activity.)
August 2013. opencores.org :: or1k wiki :: OpenRISC tool chain. Editors: Olof Kindgren, Stefan Kristiansson, Julius Baxter.
Explains how to build the binutils, gcc, newlib, uClibc from source.
Note from August 2013:
Note: There is an ongoing transition away from the or32- prefix to or1k-. In practice this means that the stable toolchain uses the old CPU target or32 (e.g. or32-elf, or32-linux), while the new/developemnt toolchain uses or1k (eg. or1k-elf, or1k-linux). Please consider using the new or1k toolchain - especially if you’re building straight from the development repos and don’t have any issues with backwards compatibility.
August 2013. OpTiMSoC. Maintainers: Stefan Wallentowitz, Philipp Wagner, Michael Tempelmeier.
An integrated framework for a multi-core OpenRISC in simulation and FPGA, from Technische Universität Munchen.
Sub-resources:
- June 2013: optimsoc.org :: Get OpTiMSoC - downloadable Virtual Box image, running Xubuntu
- April 2013: arXiv.org :: Open Tiled Manycore System-on-Chip - OpTiMSoC tech report, edited regularly
February 2013. opencores.org :: or1k wiki :: FPGA Development Boards. Editors: Rdeyi, Stefan Kristiansson, Julius Baxter, Olof Kindgren.
October 2012. kevinmehall :: Getting Started with OpenRISC. Author: Kevin Mehall. Partially outdated, refers to ‘older’ tool versions.
December 2011. opencores.org :: or1k wiki :: Ubuntu VirtualBoximage updates and information. Probably outdated.
November 2011. opencores.org :: or1k wiki :: The NEW OpenRISC System-on-Chip FPGA development board.
Contains the same FPGA chip as the de0 nano, but has more I/O devices. 2-3x more expensive.
July 2011. openrisc.net :: Building the OpenRISC Toolchain. Author(s) unknown. OUTDATED
3 Snippets
The Quartus II delivered on DVD with the de0 nano board (v10.1) does not work directly with Ubuntu 13.04. In particular its JTAG flashing component requires usbfs in /proc/bus/usb which is disabled in the latest versions of Ubuntu. Solutions:
Install Quartus II 13+ from the Altera web site. This can use /sys/bus/usb directly; or
alternatively, work around the problem using the following:
sudo killall jtagd sudo chmod 755 /sys/kernel/debug/usb/devices sudo chmod 755 /sys/kernel/debug/usb sudo chmod 755 /sys/kernel/debug sudo mount --bind /dev/bus /proc/bus sudo ln -s /sys/kernel/debug/usb/devices /proc/bus/usb/devices
The guide from Kevin Mehall suggests uploading the Linux kernel to the board via the USBBlaster link and an OCD utility. Instead, it is possible to flash the vmlinux image on the board so it can boot autonomously. Use the following snippet (courtesy of Stefan K.):
rm linux/vmlinux.bin.gz orpsoc.jic make -C linux -j3 make -C u-boot -j3 gzip linux/vmlinux.bin u-boot/tools/mkimage -A or1k -T kernel -C gzip -a 0 -e 0x100 -d linux/vmlinux.bin.gz uImage.bin orpsoc/sw/utils/bin2binsizeword u-boot/u-boot.bin bu-boot.bin bin2hex.py uImage.bin uImage.hex bin2hex.py bu-boot.bin bu-boot.hex cp orpsoc/boards/altera/de0_nano/syn/quartus/run/orpsoc.sof ./ quartus_cpf -c orpsoc.cof quartus_pgm --mode=jtag -o pi\;orpsoc.jic
4 People
- Olof Kindgren / irc: olofk / OpenCores: olof / SE
- Stefan Kristiansson / irc: stekern / OpenCores: stekern / SE
- Julius Baxter / irc: juliusb / OpenCores: julius / UK
- Jonas Bonn / / OpenCores: jonibo / South Pole / SE
- Jeremy Benett / / OpenCores: jeremybenett / Embecosm / UK
- Stefan Wallentowitz / / TUM
- Philipp Wagner / / TUM
- Michael Tempelmeier / / TUM