-
Notifications
You must be signed in to change notification settings - Fork 140
BORPH
BORPH (http://www.borph.org) is an operating system designed for FPGA-based reconfigurable computers, implemented as an extension of the Linux kernel. Reconfigurable hardware, such as FPGAs, are treated as computational resources within the operating system. These resources are defined as hardware regions (HWRs), which can be implemented as an entire FPGA, or partially reconfigurable regions within a single FPGA.
This abstraction allows the kernel to deal with the platform specific details and removes the need for the application designer to address these low level implementation details. Through a UNIX process model, BORPH provides a unified hardware/software application runtime environment. Runtime support services, such as file system access, network access, and signal handling are made available to hardware designs by the kernel.
BORPH aims to provide increased usability for reconfigurable platforms, with a focus on simplifying hardware/software co-design. An entire design, consisting in part of either hardware, software or both hardware and software components, is encapsulated in a BORPH executable (BOF) file. A unified interface to execution and communication with the application is provided by the kernel. This allows designers to focus efforts on the application specific functionality of their designs, without the need to worry about low level implementation details such as writing device drivers for communication.
- Status :
- Version : 1.0
- Authors :
- Maintainer :
- NetFPGA base source :
There are multiple options for obtaining BORPH, choose one which is most suitable for you:
- Ubuntu 10.04 LiveCD (included BORPH kernel and NetFPGA package)
- Precompiled Ubuntu packages
- Kernel Source Code
Download the LiveCD and boot from it:
The NetFPGA environment has been setup, and the modified NetFPGA base package can be found in /opt/netfpga_borph.
Using the LiveCD, commands should be run as a root user, in a terminal type
$> sudo su -
Continue to the section 'Using BORPH' below.
Download the kernel deb packages:
Choose either:
Ubuntu patched kernel source:
Clean kernel.org source: Install the kernel deb packages:sudo dpkg -i linux-image-2.6.32-24-borph_2.6.32-24.42_i386.deb linux-headers-2.6.32-24-borph_2.6.32-24.42_i386.deb
Notes:
Make sure to have the following packages installed in Ubuntu for compilation of the NetFPGA code:
- libpcap-dev
- libnet1-dev
- libxml-simple-perl
- Download the Linux 2.6 kernel: linux-2.6.34.1.tar.bz2
- Download the BORPH kernel patch: borph-netfpga-kernel_2.6.34.1.patch
Unpack the kernel:
tar -jxvf linux-2.6.34.1.tar.bz2
Apply the BORPH patch:
cd linux-2.6.34.1 patch -p1 < borph-netfpga-kernel_2.6.34.1.patch
Make your kernel config:
cp /boot/config-`uname -r` .config make oldconfig
Compile the kernel:
make
In the BORPH operating system, projects are encapsulated into executable BOF files. A BOF file contains the FPGA bitstream, as well as an optional software component.
Running a BOF file will result in the configuration of the FPGA by the kernel, and a hardware process will be created (with a corresponding process id), just as with any normal software. Interaction with the running hardware is achieved through the registers exposed as files in the /proc system directory.
An old tutorial on using BORPH can be found here
Refer to the following papers for more in depth details of the BORPH kernel:
- H. K.-H. So and R. Brodersen, "A Unified Hardware/Software Runtime Environment for FPGA-Based Reconfigurable Computers using BORPH," ACM Transactions on Embedded Computing Systems (TECS), Volume 7, Issue 2, Feb, 2008, New York, NY, USA.
- H. K.-H. So and R. Brodersen, "File System Access from Reconfigurable FPGA Hardware Processes in BORPH," in Proc. International Conference on Field Programmable Logic and Applications (FPL'08), pp.567-570, 8-10 Sep. 2008.
A modified version of the NetFPGA base package 2.1.1 is available for downloading: netfpga_borph_2.1.1.tar.gz
This package includes examples of the NetFPGA projects converted for use in BORPH (a 'sw_borph' directory has been added to each project directory tree).
All the functionality of the NetFPGA kernel module, as well as the scripts to download designs and access registers is included as part of the BORPH kernel.
If you are running the BORPH kernel, the NetFPGA card will automatically be registered and you DO NOT need to install the kernel module included in the base package.
In order to convert the software component of existing NetFPGA projects, a few simple steps are needed.
- Convert Memory Addressed reads with File I/O (accessing registers is achieved through writing/reading corresponding files in the /proc/<pid>/hw/ioreg directory)
- Convert Makefile to produce BOF file (a utility called mkbof if provided in the modified NetFPGA package for creating these executable BOF file)
BOF files can be created by optionally passing a compiled software executable (ELF) file to the mkbof utility. This will cause the kernel to configure the FPGA and automatically run the embedded ELF file on execution of the BOF file (the software and hardware processes will have a single process id). If the embedded software program exits, the hardware process will be killed and no longer be running. As an example of this, see the modified SCONE project in the base package.
In the case of no software component (ELF) being included in a BOF file (i.e. only an FPGA bitstream), the kernel will configure the FPGA and the software component of the process will run in an waiting loop until the process is killed. If starting this type of BOF file from a terminal command line, running the file as a background process is advisable. As an example of this, see the modified reference_nic project in the base package.
Executing a BOF file is done in the same way as starting a software process in Linux.
Starting a background hardware process:
$> ./reference_nic.bof & [1] 8033
Starting a combined hardware/software process:
$> ./scone.bof
Once the hardware process has been started, the kernel will automatically configure the FPGA, and then execute the embedded software (if included). Registers will now be available in the proc filesystem to communicate with the running FPGA.
Listing registers for hardware process with pid _8033_
$> ls /proc/8033/hw/ioreg/
Writing to or Reading from these files will transfer the data to/from the FPGA registers. The files can be accessed in binary mode (preferable if accessing from a program), or ascii mode (if accessing from a command line tool). The default access is set to binary mode when a hardware process is created.
Writing a 0 (for ascii) or a 1 (for binary) to the ioreg_mode file will set the mode.
Setting ascii mode:
$> echo "0" >> /proc/8033/hw/ioreg_mode
To stop the process and unconfigure the FPGA, kill the running task:
$> kill -9 8033
-- Main.BrandonHamilton - 01 Sep 2010