Giter Club home page Giter Club logo

fpga-runtime's Introduction

FPGA Runtime

This project provides a convenient runtime for PCIe-based FPGAs programmed under the OpenCL host-kernel model. Both Intel and Xilinx platforms are supported.

Prerequisites

  • Ubuntu 16.04+

Install from Binary

./install.sh

Usage

Invoking

template <typename... Args>
fpga::Instance Invoke(const std::string& bitstream, Args&&... args);

This invokes the kernel contained in file bitstream. bitstream should be a file that can be read via ifstream and can be a pipe with proper EOF. args are the arguments to the kernel. If an argument is not a scalar, it needs to be wrapped in one of the following wrappers:

ReadOnly(T* ptr, size_t n);
WriteOnly(T* ptr, size_t n);
ReadWrite(T* ptr, size_t n);

This will tell the runtime the data exchange direction and how many elements are allocated. The directions are with respect to the host, not the device (because this is host code). Passing a host pointer directly will not work (doesn't even compile).

Profiling

Invoke returns an fpga::Instance object that contains profiling information.

double Instance::LoadTimeSeconds();
double Instance::ComputeTimeSeconds();
double Instance::StoreTimeSeconds();
double Instance::LoadThroughputGbps();
double Instance::StoreThroughputGbps();

Streaming

Streaming is supported (on Xilinx platforms).

class fpga::ReadStream;
class fpga::WriteStream;

The streams need to be created and passed to fpga::Invoke as a parameter. If the arguments to fpga::Invoke contains a stream, it will not wait for the kernel to finish; instead, it will return an fpga::Instance object immediately. The host program can read from fpga::ReadStream and/or write to fpga::WriteStream. When all stream I/O are done, instance.Finish() should be invoked to wait until the kernel finishes.

fpga-runtime's People

Contributors

blaok avatar

Watchers

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