System that will (hopefully) accelerate SHA-256 on an FPGA.
Amazon F1 instances will be used to test the system on real hardware. CPU and FPGA will communicate through DRAM connected to PCIe with
Amazon's EDMA driver an XDMA driver through OpenCL. Both host code and FPGA kernel will be written in OpenCL C/C++ and compiled using Xilinx's SDAccel tool.
A double buffer will be used to allow the CPU and FPGA to write and read buffers in parallel.
Code is mostly self-documenting.
Notes from daily and weekly scrum together with other various information can be found in our blog.
From an FPGA Developer AMI, clone the repository, cd into it and run:
# setup environment for building source source_files.sh # make and run program ./run_make # set up environment for stand alone program source enable_manual_run.sh # run stand alone program ./sha256
Default target is software emulation. For hardware emulation simply add a
hw flag to
Use ./sha256 -h for more help on how to run the program.
Example: ./sha256 -d -f foo.txt -s 100
Useful options: -b Activates benchmark mode. Will append run time info to results/output.csv if -o flag is not used. -o Specifies output file for benchmarking. The output file is set to results/output.csv as default. -v Activates verification mode. Verifies results to a third-party program. -f Specify which file to read. The program will read password.txt if the flag is not specified. -s Specify how many Megabytes to read. The whole file will be read if the flag is not specified. -d Activates debug mode. -B Defines buffer size in MB. Default is four chunks per buffer. -h Help page.
Benchmarks can be generated for both device and host.
Generate enough passwords (100 GB required for benchmarks script) with:
python host/generate_random_passwords.py 100000
Compile the wanted target. For host:
cd host && make
source source_files.sh make clean make TARGETS=hw DEVICES=$AWS_PLATFORM all
Run the benchmarks with:
./benchmark.sh myoutput.csv random_passwords.txt <host/hw>
myoutput.csv will be populated with the benchmarking data.