【E167】High Frequency Trading using Vivado HLS

2021-08-16 10:29:11      索炜达电子      440     

项目编号:E167

文件大小:3.7M

源码说明:带中文注释

开发环境:Verilog

Summary

This project is an HFT subsystem for Xilinx FPGAs, that provides a very low latency (<450ns roundtrip) abstract view of a FAST (FIX Adapted For Streaming) financial data Eternet feed. The core idea is to factor out the common aspects of an HFT system (efficient networking, encoding/decoding, sorting and storing market data) into an easy to use moidule that is accesible entirely through AXI Streams, so that more specialized HFT trading algortihms can be built on top of it.

The module also supports timestamping outgoing orders for in-hardware latency profiling

How to use

Step 1: Build the HLS IP cores:

  • Navigate to src folder and run the following comands:

vivado_hls -f build_fast_core.tcl vivado_hls -f build_microblaze_to_switch_core.tcl vivado_hls -f build_order_book_core.tcl vivado_hls -f build_threshold_core.tcl

Step 2: Build the Vivado IP Integrator Project

  • Navigate to src folder and open vivado tcl console using the following comand:

vivado -mode tcl

  • In the tcl console run the following comand

build_project.tcl

Step 3: Program the FPGA

  • Open vivado and open the project in src/hft_proj

  • click generate bitstream: this will run through the vivado synth and place and route flow

  • Export bitstream and launch the sdk if you wish to program the microblaze (step not needed)

  • program the device using the sdk src files found in src/sdk_src

Step 3: Run the scripts

scripts/testSystem.py [input testcase from createTestVectors.py]

  • Tests the system using the provided testcase. Order book is displayed in a GUI window. scripts/manualPacketTest.py

  • Allows simple sending of hex number over the network.

Repository structure

src/ Contains the Vivado project used to build the project

/src/*_src/ Contains the src code of HLS projects for the various parts of our project. All project cores were developed using Vivado HLS.

Authors

Brett Grady, Mustafa Abbas, Andrew Boutros

Acknowledgements

Thanks to Dan Ly-Ma for providing the initial base project (simple demonstration of Xilinx Network Stack on 8K5) which this project used as a base.

文件列表:

目录│文件列表:

 └ ECE1373_2016_hft_on_fpga

    ├ docs

    │  │ high-frequency-trading-final-pres-slides.pdf

    │  └ high-frequency-trading-report.pdf

    ├ scripts

    │  │ createTestVectors.py

    │  │ dynamic_table.py

    │  │ generatePackets.py

    │  │ manualPacketTest.py

    │  │ testSystem.py

    │  └ inputTestcases

    │     │ demo_testcase

    │     └ fixed_demo_testcase

    └ src

       │ ad_8k5.xdc

       │ block_design.tcl

       │ build_fast_core.tcl

       │ build_microblaze_to_switch_core.tcl

       │ build_order_book_core.tcl

       │ build_project.tcl

       │ build_threshold_core.tcl

       ├ fast_src

       │  │ fast_decoder.cpp

       │  │ fast_decoder.h

       │  │ fast_encoder.cpp

       │  │ fast_encoder.h

       │  │ fast_protocol.cpp

       │  │ fast_protocol.h

       │  │ in.dat

       │  │ out.dat

       │  └ test_bench.cpp

       ├ microblaze_to_switch_src

       │  │ MBtoSW.cpp

       │  │ MBtoSW.hpp

       │  └ MBtoSW_tb.cpp

       ├ order_book_src

       │  │ priority_queue.cpp

       │  │ priority_queue.hpp

       │  └ tb.cpp

       ├ sdk_src

       │  │ helloworld.c

       │  │ lscript.ld

       │  │ platform.c

       │  │ platform.h

       │  └ platform_config.h

       ├ threshold_src

       │  │ simpleThreshold.cpp

       │  └ simpleThreshold.hpp

       └ udp_hls

          │ udp_portTable_portTable_1_ram.dat

          ├ .Xil

          │  └ tcp_ip_propImpl.xdc

          ├ arp_server

          │  │ auxiliary.xml

          │  │ component.xml

          │  │ pack.sh

          │  │ run_ippack.tcl

          │  │ xilinx_labs_hls_arp_server_1_14.zip

          │  ├ bd

          │  │  └ bd.tcl

          │  ├ constraints

          │  │  └ arp_server_ooc.xdc

          │  ├ doc

          │  │  └ ReleaseNotes.txt

          │  ├ example

          │  │  │ ipi_example.sh

          │  │  └ ipi_example.tcl

          │  ├ hdl

          │  │  └ verilog

          │  │     │ arp_server.v

          │  │     │ arp_server_ap_rst_if.v

          │  │     │ arp_server_macUpdate_resp_if.v

          │  │     │ arp_server_top.v

          │  │     │ FIFO_arp_server_arpReplyMetaFifo_V.v

          │  │     │ FIFO_arp_server_arpRequestMetaFifo_V_V.v

          │  │     └ FIFO_arp_server_arpTableInsertFifo_V.v

          │  ├ misc

          │  │  └ logo.png

          │  └ xgui

          │     └ arp_server_v1_14.tcl

          ├ arp_server_wrapper_ip

          │  │ component.xml

          │  ├ src

          │  │  │ arpServerWrapper.vhd

          │  │  │ SmartCamCtlArp.edn

          │  │  │ SmartCam_ARP_inst.vhd

          │  │  └ arp_server_ip

          │  │     │ arp_server_ip.xci

          │  │     └ arp_server_ip.xml

          │  └ xgui

          │     └ arpServerWrapper_v1_0.tcl

          ├ dhcp_client

          │  │ auxiliary.xml

          │  │ component.xml

          │  │ pack.sh

          │  │ run_ippack.tcl

          │  │ xilinx_labs_hls_dhcp_client_1_05.zip

          │  ├ bd

          │  │  └ bd.tcl

          │  ├ constraints

          │  │  └ dhcp_client_ooc.xdc

          │  ├ doc

          │  │  └ ReleaseNotes.txt

          │  ├ example

          │  │  │ ipi_example.sh

          │  │  └ ipi_example.tcl

          │  ├ hdl

          │  │  └ verilog

          │  │     │ dhcp_client.v

          │  │     │ dhcp_client_ap_rst_if.v

          │  │     │ dhcp_client_Block_codeRepl_proc.v

          │  │     │ dhcp_client_Block_codeRepl_proc253.v

          │  ├ misc

          │  │  └ logo.png

          │  └ xgui

          │     └ dhcp_client_v1_05.tcl

          ├ echo_server

          │  │ auxiliary.xml

          │  │ component.xml

          │  │ pack.sh

          │  │ run_ippack.tcl

          │  │ xilinx_labs_hls_echo_server_application_1_02.zip

          │  ├ bd

          │  │  └ bd.tcl

          │  ├ constraints

          │  │  └ echo_server_application_ooc.xdc

          │  ├ doc

          │  │  └ ReleaseNotes.txt

          │  ├ example

          │  │  │ ipi_example.sh

          │  │  └ ipi_example.tcl

          │  ├ hdl

          │  │  └ verilog

          │  │     │ echo_server_application.v

          │  ├ misc

          │  │  └ logo.png

          │  └ xgui

          │     └ echo_server_application_v1_02.tcl

          ├ icmp_server

          │  │ auxiliary.xml

          │  │ component.xml

          │  │ pack.sh

          │  │ run_ippack.tcl

          │  │ xilinx_labs_hls_icmp_server_1_67.zip

          │  ├ bd

          │  │  └ bd.tcl

          │  ├ constraints

          │  │  └ icmp_server_ooc.xdc

          │  ├ doc

          │  │  └ ReleaseNotes.txt

          │  ├ example

          │  │  │ ipi_example.sh

          │  │  └ ipi_example.tcl

          │  ├ hdl

          │  │  ├ verilog

          │  │  │  │ FIFO_icmp_server_validFifo_V.v

          │  │  │  │ icmp_server.v

          │  │  │  │ icmp_server_check_icmp_checksum.v

          │  │  │  │ icmp_server_dropper.v

          │  │  │  │ icmp_server_insertChecksum.v

          │  │  │  │ icmp_server_udpAddIpHeader.v

          │  │  │  └ icmp_server_udpPortUnreachable.v

          │  │  └ vhdl

          │  │     │ FIFO_icmp_server_checksumStreams_V_V_0.vhd

          │  │     │ FIFO_icmp_server_checksumStreams_V_V_1.vhd

          │  │     │ icmp_server_udpAddIpHeader.vhd

          │  │     └ icmp_server_udpPortUnreachable.vhd

          │  ├ misc

          │  │  └ logo.png

          │  └ xgui

          │     └ icmp_server_v1_67.tcl

          ├ ip_handler

          │  │ auxiliary.xml

          │  │ component.xml

          │  │ pack.sh

          │  │ run_ippack.tcl

          │  │ xilinx_labs_hls_ip_handler_1_21.zip

          │  ├ bd

          │  │  └ bd.tcl

          │  ├ constraints

          │  │  └ ip_handler_ooc.xdc

          │  ├ doc

          │  │  └ ReleaseNotes.txt

          │  ├ example

          │  │  │ ipi_example.sh

          │  │  └ ipi_example.tcl

          │  ├ hdl

          │  │  ├ verilog

          │  │  │  │ FIFO_ip_handler_ipDataCheckFifo_V.v

          │  │  │  │ ip_handler_ip_invalid_dropper.v

          │  │  │  │ ip_handler_length_check.v

          │  │  │  │ ip_handler_length_check_wordBuffer_Array_data_V.v

          │  │  │  │ ip_handler_length_check_wordBuffer_Array_keep_V.v

          │  │  │  └ ip_handler_length_check_wordBuffer_Array_last_V.v

          │  │  └ vhdl

          │  │     │ FIFO_ip_handler_ipDataCheckFifo_V.vhd

          │  │     │ FIFO_ip_handler_ipDataCutFifo_V.vhd

          │  │     │ FIFO_ip_handler_ipDataDropFifo_V.vhd

          │  ├ misc

          │  │  └ logo.png

          │  └ xgui

          │     └ ip_handler_v1_21.tcl

          ├ mac_ip_encode

          │  │ auxiliary.xml

          │  │ component.xml

          │  │ pack.sh

          │  │ run_ippack.tcl

          │  │ xilinx_labs_hls_mac_ip_encode_1_04.zip

          │  ├ bd

          │  │  └ bd.tcl

          │  ├ constraints

          │  │  └ mac_ip_encode_ooc.xdc

          │  ├ doc

          │  │  └ ReleaseNotes.txt

          │  ├ example

          │  │  │ ipi_example.sh

          │  │  └ ipi_example.tcl

          │  ├ misc

          │  │  └ logo.png


TAGHLS
  • 4 次
  • 1 分