Giter VIP home page Giter VIP logo

bwa-mem-sw's Introduction

Introduction

This package consists of the hardware implementation of BWA-MEM Smith-Waterman using an Altera FPGA and the software BWA which links Intel AALSDK. Please make sure you have properly unpacked and compiled the AALSDK. The code has been tested against AALSDK 4.1.0.

Getting started

Checkout the github repo bwa-mem-sw for RTLs and bwa-mem-quickassist for the software host.

git clone https://github.com/peterpengwei/bwa-mem-sw.git
git clone https://github.com/peterpengwei/bwa-mem-quickassist.git --brach smith-waterman

Build the software host

Please change the AAL_SRCDIR and AAL_BUILDDIR in bwa-mem-quickassist/bwa-0.7.8/Makefile and point them to your own copy of AALSDK.

cd bwa-mem-quickassist/bwa-0.7.8/
make

This should build the software host for you. Next we need to change the script to run the program.

cd ..
vi pipeline.sh

Please change BWA and ODIR to point to your executable and a writable directory respectively. Change ROOT if the input and reference files are moved in our server.

Notice in the command in pipeline.sh

$BWA --target=ASE mem -t $NTHREAD -b $NBATCH_SIZE -Ma -R $HDR $FASTA $IN1

only the second argument --target is passed to the AAL host and the rest is for BWA. There are two options for it:

  • ASE for simulation using ASE
  • Direct for direct interaction with the FPGA

No matter using which mode, the hardware end need to be launched first as the software will try to detect the presence of hardware upon running.

Compile the hardware implementation (for simulation)

In this step, we need to tell the ASE simulator the location of our RTL so that it can compile them into the simulator.

First, go to the directory of your ASE.

cd /path/to/ase

Then use the python script to configure the environment, and compile.

python scripts/gen_afu_env.py /path/to/rtl/bwa-mem-sw
make

Now the simulator is ready. Launch the hardware simulation by

make sim

Open another terminal and set the ASE environment for running the software with --target=ASE.

export ASE_WORKDIR=/path/to/ase

Once the simulation is terminated, the ASE transaction history will be stored in transaction.tsv and the waveform is stored in inter.vpd in the ase directory.

Synthesize the design and generate bitstream (for on-board test)

This step needs to be performed on JC1 or other servers with Altera Quartus installed.

For synthesis, we use an afu template and redirect source files to our RTLs. You can either copy it from my directory (/curr/haoyc/afu-quickassist/afu_template) or ask from Prof. Lei.

cd /path/to/afu_template
vi set_env

Again, please change the AAL environment AAL_SRC AAL_SDK AAL_RTL AAL_PAR and LD_LIBRARY_PATH accordingly.

csh
source set_env
setenv WORKDIR $PWD/fpga/IP

Modify the script to create a new project for the synthesis.

cd fpga/build
vi run_ca.sh

Make sure the DEFAULT_PROJ_NAME does not conflict with any folder names within the same directory, otherwise the synthesis can not proceed.

Next we need to link our RTLs. Please find the afu_par_files.tcl under the RTL folder, and within that file change the absolute directory of source codes to yours. Now back to the afu_template/fpga/build directory, we can start the synthesis.

./run_ca.sh -ccis_afu /path/to/rtl/afu_par_files.tcl

The wait shall begin.

Test using the Quickassist machine

The test involves loading the bitstream onto the FPGA and running the software host on the same machine.

Log on to JC1 with ssh -X as we need to start Quartus GUI.

cd /path/to/afu_template
csh
source set_env

Go to the project directory and launch Quartus.

cd fpga/build/your_project/your_project_seed0/
quartus *.qpf

Then we can use the programmer in Quartus to program the FPGA.

Now log on to gene3 and install the CCI driver.

cd /INTEL_QAFPGA_Starter_Kit_4_1_0/aalsdk_splrm‐4.1.0/aalsdk_splrm‐4.1.0/mybuild/
sudo ./aalkernel/insdrv direct‐jkt

Then we can launch the software host with --target=Direct for testing.

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.