Skip to content
Adam edited this page Feb 28, 2013 · 3 revisions

Table of Contents

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.

Project summary

Status :
Initial release (beta version)
Version : 1.0
Authors :
Brandon Kyle Hamilton, Hayden Kwok-Hay So
Maintainer :
Brandon Kyle Hamilton
NetFPGA base source :
2.1.1

Installation

There are multiple options for obtaining BORPH, choose one which is most suitable for you:

Ubuntu 10.04 BORPH LiveCD

Download the LiveCD and boot from it:

BORPH LiveCD (NetFPGA)

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.

Installing Pre-compiled packages in Ubuntu

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
Continue to the section 'Using BORPH' below.

Compiling from Kernel source code

If a patch is required for a specific kernel version, please contact http://netfpga.org/forums/member.php?783-brandon][Brandon] for details.http://netfpga.org/forums/member.php?783-brandon][Brandon] for details.

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

Using BORPH

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:

NetFPGA base package

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).

NOTE: USING BORPH REPLACES THE NEED FOR THE NETFPGA KERNEL MODULE

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.

Developing for BORPH

Converting Existing Projects

In order to convert the software component of existing NetFPGA projects, a few simple steps are needed.

  1. Convert Memory Addressed reads with File I/O (accessing registers is achieved through writing/reading corresponding files in the /proc/<pid>/hw/ioreg directory)
  2. Convert Makefile to produce BOF file (a utility called mkbof if provided in the modified NetFPGA package for creating these executable BOF file)
Refer to the modified NetFPGFA base package above for examples of how this can be done.

Hardware/Software integration

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.

Running Projects

Executing a BOF file is done in the same way as starting a software process in Linux.

Starting a background hardware process:

$&gt; ./reference_nic.bof &amp;
&#91;1&#93; 8033

Starting a combined hardware/software process:

$&gt; ./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_

$&gt; 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:

$&gt; echo &quot;0&quot; &gt;&gt; /proc/8033/hw/ioreg_mode 

To stop the process and unconfigure the FPGA, kill the running task:

$&gt; kill &#45;9 8033 

-- Main.BrandonHamilton - 01 Sep 2010

Clone this wiki locally