Giter Club home page Giter Club logo

xbsv's Introduction

CONNECTAL

CONNECTAL provides a hardware-software interface for applications split between user mode code and custom hardware in an FPGA. Portal can automatically build the software and hardware glue for a message based interface and also provides for configuring and using shared memory between applications and hardware. Communications between hardware and software are provided by a bidirectional flow of events and regions of memory shared between hardware and software. Events from software to hardware are called requests and events from hardware to software are called indications, but in fact they are symmetric.

A logical request/indication pair is referred to as a portal". An application can make use of multiple portals, which may be specified independently. A portal is specified by a BSV interface declaration, from which connectalgen generates BSV and C++ wrappers and proxies.

CONNECTAL has a mailing list: https://groups.google.com/forum/#!forum/connectal

Supported Platforms

CONNECTAL supports Android on Zynq platforms, including zedboard and zc702.

CONNECTAL supports Linux on x86 with PCIe-attached Virtex and Kintex boards (vc707, kc705).

CONNECTAL supports bluesim as a simulated hardware platform.

Installation

  1. Checkout out the following from github: git clone git://github.com/cambridgehackers/connectal

If you are generating code for an FPGA, check out fpgamake: git clone git://github.com/cambridgehackers/fpgamake

It appears that this requires buildcache to be checked out also: git clone git://github.com/cambridgehackers/buildcache

Add USE_BUILDCACHE=1 to your calls to make to enable it to cache, otherwise it will rerun all compilation steps.

  1. Install the Bluespec compiler. CONNECTAL is known to work with 2013.09.beta1, 2014.05.beta1, and 2014.07.A

Install the bluespec compiler. Make sure the BLUESPECDIR environment variable is set appropriately:

export BLUESPECDIR=~/bluespec/Bluespec-2013.09.beta1/lib
  1. Install connectal dependences. This installs ubuntu packages used by connectal or during compilation:

    cd connectal; sudo make install-dependences

  2. If you are using an FPGA attached to your machine, install the drivers:

    make all sudo make install

Preparation for Zynq

  1. Get [http://www.xilinx.com/support/download/index.html/content/xilinx/en/downloadNav/vivado-design-tools/2013-2.html](Vivado 2013.2)

[Note] CONNECTAL for Zynq also works with 2013.4 and 2014.1.

  1. Download the Android Native Development Kit (NDK) from: http://developer.android.com/tools/sdk/ndk/index.html (actual file might be: http://dl.google.com/android/ndk/android-ndk-r9d-linux-x86_64.tar.bz2 )

    CONNECTAL uses NDK to compile code to run on Zynq platforms.

    Add the NDK to your PATH.

    URL=http://dl.google.com/android/ndk/android-ndk-r9d-linux-x86_64.tar.bz2
    curl -O `basename $URL` $URL
    tar -jxvf `basename $URL`
    PATH=$PATH:/scratch/android-ndk-r9d/
    
  2. Download and install ADB from the Android Development Tools.

    The Android Debug Bridge (adb) is packaged in platform-tools. CONNECTAL uses adb to transfer files to and from the Zedboard over ethernet and to run commands on the Zedboard.

    User your browser to accept the conditions and download the SDK installation tarball:

    http://dl.google.com/android/android-sdk_r22.6.2-linux.tgz
    

    Unpack the installation tarball:

    tar -zxvf android-sdk_r22.6.2-linux.tgz
    

    Run the android tool to install SDK components

    ./android-sdk-linux/tools/android
    

    Deselect all components except for "Android SDK Platform-Tools" (screenshot) and then click the "Install ... package" button to install (screenshot) and then accept the license. (screenshot)

    Add adb to your path:

    PATH=$PATH:$PWD/android-sdk-linux/platform-tools
    
  3. git clone git://github.com/cambridgehackers/zynq-boot.git

The boot.bin is board-specific, because the first stage boot loader (fsbl) and the devicetree are both board-specific.

To build a boot.bin for a zedboard:

make BOARD=zedboard all

Then copy sdcard-zedboard/* /media/sdcard

To build a boot.bin for a zc702:

make BOARD=zc702 all

Then copy sdcard-zc702/* /media/sdcard

Eject the card and plug it into the zedboard/zc702 and boot.

Preparation for Kintex and Virtex boards

  1. Get [http://www.xilinx.com/support/download/index.html/content/xilinx/en/downloadNav/vivado-design-tools/2013-2.html](Vivado 2013.2)

  2. Build the drivers

    cd drivers/pcieportal; make && sudo make install

  3. Load the drivers

    cd drivers/pcieportal; make insmod

  4. Install the Digilent cable driver

    cd /scratch/Xilinx/Vivado/2013.2/data/xicom/cable_drivers/lin64/digilent sudo ./install_digilent.sh

  5. Get fpgajtag

    git clone git://github.com/cambridgehackers/fpgajtag cd fpgajtag make all && sudo make install

Examples

Generally cd to the top level directory connectal then type

make examples/examplename.<something>

where something is

Command suffix Function
bluesim compile for simulation
bluesimrun build and run simulator
zedboard compile for zedboard
zedboardrun compile and run on attached zedboard
zc702 compile for zc702 board
zc702run compile and run on attached board
kc705 compile for kc705 board
kc705run compile and run on attached board
vc707 compile for vc707 board
vc707run compile and run on attached board

To turn on more verbosity for debugging when running make, add V=1 to the end of the command, as

make examples/examplename.<something> V=1

If you undertand why adding V=1 at the beginning of the line doesn't work, let us know.

Echo Example


    ## this has only been tested with the Vivado 2013.2 release
    . Xilinx/Vivado/2013.2/settings64.sh

    make examples/echo.zedboard
or
    make examples/echo.zc702
or
    make examples/echo.kc705
or
    make examples/echo.vc707

To run on a zedboard with IP address aa.bb.cc.dd:
    RUNPARAM=aa.bb.cc.dd make examples/echo.zedboardrun

Memcpy Example
BOARD=vc707 make -C examples/memcpy

HDMI Example


[Note]
This example does not work. -Jamey 4/29/2014.

For example, to create an HDMI frame buffer from the example code:

To generate code for Zedboard:
    make examples/hdmidisplay.zedboard

To generate code for a ZC702 board:
    make examples/hdmidisplay.zc702

The result .bit file for this example will be:

    examples/hdmi/zedboard/hw/mkHdmiZynqTop.bit.bin.gz

Sending the bitfile:
    adb push mkHdmiZynqTop.bit.bin.gz /mnt/sdcard

Loading the bitfile on the device:
    mknod /dev/xdevcfg c 259 0
    cat /sys/devices/amba.0/f8007000.devcfg/prog_done
    zcat /mnt/sdcard/mkHdmiZynqTop.bit.bin.gz > /dev/xdevcfg
    cat /sys/devices/amba.0/f8007000.devcfg/prog_done
    chmod agu+rwx /dev/fpga0

Restart surfaceflinger:
   stop surfaceflinger; start surfaceflinger

Sometimes multiple restarts are required.

Zynq Hints
-------------

To remount /system read/write:

    mount -o rw,remount /dev/block/mmcblk0p1 /system



xbsv's People

Contributors

jankcorn avatar jameyhicks avatar chamdoo avatar lstewart avatar

Watchers

James Cloos 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.