Copyright (c) 2018-2020, Wuklab, UCSD.
This is an operating system (OS) running inside FPGA providing familiar OS abstractions (e.g., mm, sched, net) for FPGA applications. This is an inmature early stage research prototype. Most of the code is written in Xilinx HLS. It has been tested on VCU118 and VCU108.
It's made public for educational purpose. Hope you find it useful.
host/: Host side network stack and DMA driversalloc/: memory allocatormm/: memory managementnet/: network subsystemkernel/: some PR related codesystem/: Final big integrated systemsapp/: Application can have both FPGA and Host code.include/: header files used by both FPGA and host code. E.g., network headers.
include/fpga: headers used by HLS onlyinclude/uapi: headers used by both HLS and host codetools/: various helpersscripts/: template script filesgenerated_ip/: all generated IPs sleep heregenerated_hls_project/: Vivado HLS projectgenerated_vivado_project/: Vivado projectFormat:
run_hls.tcl name.mm_axi_wrapper is the AXI wrapper IP under MM subsystem.make help to see detailed explanation.make at top-level will compile the whole project using default board.
system/ foldermake at each subfolder will compile that folder only.Workflow: you should compile the project when you first download the source code. All small, medium IPs, and big projects will be ready to use. After this, you can focus on the IPs you are building. Changes will be reflected automatically within Vivado.
Also, pay attention to which board you are targeting.
The goal of using scripts are two-fold
generated_vivado_project/ folder, at the same folder
where the corresponding script and source code are.Those Vivado project-mode scripts are generated by Vivado itself. And those scripts can be used to rebuild the whole project AS IS.
Those are my unformal steps to create and hack those scripts:
Run:
vivado -mode tcl -source run_vivado.tcl
generated_vivado_project/ will be created at the current foldergenerated_ip/ folder.Creation:
write_project_tcl to generate the script. You SHOULD let the new
script know that the going-to-be-rebuilt project should be placed under
under folder's generated_vivado_project. And you SHOULD name the script
to run_vivado.tcl.write_project_tcl -force -no_copy_sources -target_proj_dir ./generated_vivado_project ./run_vivado.tclwrite_project_tcl -force -target_proj_dir ./generated_vivado_project ./run_vivado.tclHack:
Add IP paths to top-level script:
generated_ip/ folder. This makes IP tracking easier.
You can add few lines to the script so that Vivado knows where to look for new IPs.
Check out scripts/template_vivado_ip.tcl for those lines.Package IP automatically:
generated_ip/. For example,
ipx::package_project -root_dir ../../generated_ip/mm_axi_wrapper -vendor wuklab -library user -taxonomy UserIP -import_files -set_current false -forceipx::package_project -root_dir ../../generated_ip/mm_axi_rab_vcu118 -vendor wuklab -library user -taxonomy UserIP -module THE_BD_NAME -import_filesAdd more source/xdc/simulation files:
top.v, add_files etc.write_project_tcl again
to generate another script. Then check out the differences.Autogenerate BD wrapper
Other settings:
write_project_tcl to generate a new script
and save the corresponding changes. Once you get familiar with Vivado commands, you
should be able to do manually by changing script.Caveats:
For now, you can find example scripts at the mm/axi_wrapper/run_vivado.tcl, and mm/sys/run_vivado.tcl.
Vivado only supports one IP version in each version. It's super annonying if we use generated script. Luckily, there is one way to workaround it. The following code replace the IP string with a variable. However, be careful if the updated IP has different ports.
set axis_data_fifo [get_ipdefs -filter NAME==axis_data_fifo]
Replace all `xilinx.com:ip:axis_data_fifo:1.1` with `$axis_data_fifo
The Vivado HLS script is relatively easier than Vivado script.
You can find the template script in scripts/template_run_hls.tcl.
You SHOULD customize the parts, files added, frequency, and so.
If you want to automatically build multiple HLS under the same folder, use the scripts/template_generate_hls.sh