Giter Site home page Giter Site logo

connect's Introduction

Chiptip Connect

Chiptip Connect is a distributed computation framework for CPU-FPGA heterogeneous environment. In this README, there are two tutorials.

Getting Started with One CPU

Here, we will walk through the process of running a simple task on your local computer.

Requirements

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 JobManager and TaskManager's IP addresses to your local address.

$ vim <connect_dir>/platform/software/conf/cluster.yaml  # user your favorite editor to edit

On line 5, 11, 17, and 20, change the IP address to '127.0.0.1'.

You can also change the MAC address to your own one, but it has no effect as long as you are using only CPUs.

Save the change and close the file.

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 ThreeOps.py testjob
$ ./Client prepare testjob
$ ./Client run testjob

Open a new console and type the following.

$ tail -f /tmp/1.dat
$ tail -f /tmp/2.dat
$ tail -f /tmp/3.dat

You will see numbers flowing through the screen.

Finish the app

$ ./Client pause testjob
$ ./Client cancel testjob

Check whether no more lines are added to /tmp/1.dat, 2.dat, or 3.dat.

Getting Started with 1 CPU and 1 FPGA

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

Requirements

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.

connect's People

Contributors

rasshai avatar toshihikoyanase avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.