Giter VIP home page Giter VIP logo

vitis_make's Introduction

Vitis_Make

This make file use xilinx v++ tool to build hls kernels, link the kernels and run sw/hw emulation. It is required to set correct vitis platform path in the makefile and specify the project name and kernels to build. The makefile provides more freedom and less load.

  1. Apply the official y2k bacth if you haven't do that. (https://support.xilinx.com/s/article/76960?language=en_US)
  2. The cpp file that contains the kenrel to build must have the same name with the kernel. For example, if the kernel function name is 'func', its source file must be named as 'func.cpp'
  3. The path of tools and platform shall be set in the Makefile.
  4. The project name must be specified in the Makefile.
  5. The kernel targets are deduced with the filename. <filename>.cpp will be compiled to <filename>.xo.
  6. The linker.cfg in kernel_src folder must be edit before building the 'link'. The syntax to write link file (especially [connectivity]) can be found online.Xilinx --connectivity
  7. Before running the emulation, you must source Xilinx Vitis settings and Xilinx XRT settings. Source (shell run 'source ...') the setup_xrt.sh in the folder may help (you have to specify your path in setup_xrt.sh).
  8. You can set the debug mode in debuging_setup.ini. If you set the 'debug_mode' as 'gui', you can enjoy the live waveform. Reference
  9. If you want to use AWS F1 instance, you have to further generate the *.awsxclbin file. The recommended way is to create a folder called to_aws and then copy the *.xclbin file into the to_aws. After that, you can run the generation commands provided by AWS-FPGA inside this folder. The check_status.sh script is to help you check if the awsxclbin is ready to use. You can run it with './check_status.sh to_aws' (to_aws can be replaced).

To run, simply type:

make <target> -j<threads_allowed> TARGET=<target sw_emu, hw_emu, hw>

For example, if you want build kernels with 8 threads in parallel for hardware emulation, run:

make kernel -j8 TARGET=hw_emu

If you have multiple kernels to build, it is suggested to use as many threads as possible. The maximum number should not exceed the physical number of threads of you computer of course.

It is suggested to run 'make kernel' first and check the maximum allowed frequency. Vitis set the frequency to 250MHz, if the maximum allowed frequency of your kernel is less than 250MHz, the routing (TARGET=hw) will fail. The clock frequency can also be set in the Makefile.

(UPDATE) Now, if the target is 'hw_emu' or 'sw_emu', the '-g' will be added for both kernel compiling and linking, or it won't be added to reduce the overhead.

Targets

all (default target)

Build kernels, link kernels, build host program and copy them to the current folder.

kernel

Build kernels. The new kernels are saved in the ./build/vitis_hls. The temporay hls projects are also saved there so that they can be opend with GUI and you can check the scheduling and debuging the kernel.

To open the vitis_hls project for each kernel, you can use:

vitis_hls -p build/vitis_hls/<kernel_name>/<kernel_name>/<kernel_name>

link

Link the kernels. The linker file ./kernel_src/linker.cfg shall be edit beforehead. The xclbin will be generated in ./build/vivado. Build link will trigger build the kernels if the kernels haven't been build before.

To open the vivado project, you can use:

vivado -p build/vivado/link/vivado/vpl/prj/prj.xpr

host

Just build the host excutable file. It does not depend on any other objects.

run

Run the emulation (directly on hardware is not supported, it is designed for AWS). It depends on the excutable file and binary container that in the current folder. If the host and link have been build, the files will be copied to the current folder; if not, it triggers all compiling.

clean

Clean up the project. Be careful.

kill

Force all simulation threads to stop. Done by 'kill_simulation.sh' script, which found all pid number with 'xsim' in the command line and send 9 (SIGKILL) signal to those threads. Use it carefully.

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.