toshihikoyanase / connect

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Chiptip Connect

Chiptip Connect is a distributed computation framework for CPU-FPGA heterogeneous environment.

Getting Started

Here, we will walk you through the process of building a simple cluster that consists of one CPU and one FPGA.

Requirements

  • Any computer with a 100M Ethernet port and the following software installed
  • Arty FPGA board
  • Ethernet cable connecting the computer and the FPGA board
    • IP address for the ethernet port on the computer should be set to 192.168.1.30

Clone the repository and set environment variables

$ git clone https://github.com/chiptiptech/connect.git
$ export MYSTR_HOME=<connect_dir>/platform/software
$ export PYTHONPATH=$MYSTR_HOME/lib/

Set your computer's MAC address in the shell

Change the MAC address (tx_eth_dst_addr) on line 74 in file

<connect_dir>/platform/hardware/xilinx/modules/axis_network_interface/axis_network_interface.cpp

to your computer's MAC address.

ARP FPGA's MAC address

Associate the IP address and the MAC address of the FPGA.

$ sudo arp -i <eth interface on your computer> -s 192.168.1.10 10:00:5e:00:fa:ce

Build FPGA shell

$ cd <connect_dir>/platform
$ ./build.sh all

Integrate app logic to shell

We take the 'echo' app for example here. This app sends nubers from the computer and the FPGA just echoes them back.

$ cd <connect_dir>/apps/echo
$ ./build.sh

Write bit stream to FPGA

$ cd ./hardware/xilinx
$ vivado -mode tcl -source program.tcl

Set FPGA's MAC address

$ python3

In Python3's interactive shell,

>>> import serial
>>> import struct
>>> ser = serial.Serial('/dev/ttyUSB1', 115200) # ttyUSB1 might be ttyUSB2 or something else
>>> mac = struct.pack('<BBBBBB', 0x10, 0x00, 0x5e, 0x00, 0xfa, 0xce)
>>> ser.write(mac)

Start JobManager and software TaskManager

$ cd <connect_dir>/platform/software/bin
$ ./JobManager

Open a new console and type the following.

$ cd <connect_dir>/platform/software/bin
$ ./TaskManager sv0

Run app

Open a new console and type the following.

$ cd <connect_dir>/platform/software/bin
$ ./Client submit FPGAJob.py testjob
$ ./Client prepare testjob
$ ./Client run testjob

Open a new console and type the following.

$ tail -f /tmp/fpga.out

You will see the numbers echoed back from the FPGA in the console. To finish, type ^C in the TaskManager console.

About

License:Apache License 2.0


Languages

Language:C++ 43.0%Language:Python 35.8%Language:Tcl 18.8%Language:Shell 2.4%