├── .gitattributes ├── .gitignore ├── README.md ├── docs ├── Creating_AFI.md ├── Creating_AFI_AWSEducate.md ├── Gemfile ├── Graph_lab.md ├── Improving_Performance_lab.md ├── Optimization_lab.md ├── README.md ├── Vision_lab.md ├── Vitis_intro-1.md ├── Vitis_intro-2.md ├── _config.yml ├── _data │ ├── advanced_sidebar.yml │ ├── appendix_sidebar.yml │ ├── labs_sidebar.yml │ └── setup_sidebar.yml ├── _includes │ └── codeHeader.html ├── _layouts │ └── default.html ├── _sass │ ├── copy-code.scss │ ├── jekyll-theme-dinky.scss │ └── rouge-github.scss ├── assets │ ├── css │ │ └── style.scss │ ├── images │ │ ├── TLogoW.png │ │ ├── favicon.ico │ │ ├── mask-small.png │ │ ├── pynq.png │ │ ├── xilinx-logo-xup.png │ │ └── youtube.png │ └── js │ │ ├── copy_code.js │ │ └── scale.fix.js ├── debug_lab.md ├── images │ ├── Fig-build.png │ ├── Fig-hw_button.png │ ├── Fig-run.png │ ├── Vitis_IDE.png │ ├── Vitis_intro │ │ ├── add_host_sources.png │ │ ├── add_hw_function.png │ │ ├── add_sources.png │ │ ├── args_sw_emu.png │ │ ├── cmdline_hw_profile_data_transfer.png │ │ ├── hardware.png │ │ ├── hw_application_timeline.png │ │ ├── hw_arguments_settings.png │ │ ├── hw_binary_container_settings.png │ │ ├── hw_emu_application_timeline.png │ │ ├── hw_emu_application_timeline_trace.png │ │ ├── hw_emu_krnl_profile_settings.png │ │ ├── hw_emu_profile_API_calls.png │ │ ├── hw_emu_profile_host_data_transfers.png │ │ ├── hw_emu_profile_kernel_compute_units.png │ │ ├── hw_emu_profile_kernel_internals.png │ │ ├── hw_emu_profile_kernel_transfer.png │ │ ├── hw_emu_run.png │ │ ├── hw_emu_settings_invoke.png │ │ ├── hw_emu_setup.png │ │ ├── hw_krnl_profile_settings.png │ │ ├── hw_profile_API_calls.png │ │ ├── hw_profile_data_transfer.png │ │ ├── hw_profile_kernel_compute_units.png │ │ ├── hw_profile_kernel_data_transfer.png │ │ ├── hw_settings_invoke.png │ │ ├── hw_trace_settings.png │ │ ├── import_sources.png │ │ ├── initial_project.png │ │ ├── new_application.png │ │ ├── open_kernel_settings.png │ │ ├── profile_summary.png │ │ ├── project_dashboard.png │ │ ├── project_name.png │ │ ├── project_wizard.png │ │ ├── rebuild_hostcode.png │ │ ├── run_as.png │ │ ├── select_hw_function.png │ │ ├── select_platform.png │ │ ├── sw_emu_application_timeline.png │ │ ├── sw_emu_build.png │ │ ├── sw_emu_enable_timeline_trace.png │ │ ├── sw_emu_host_data_transfer.png │ │ ├── sw_emu_kernel_compute_units.png │ │ ├── sw_emu_run.png │ │ ├── sw_emu_run_configuration.png │ │ ├── sw_emu_run_profile.png │ │ ├── template.png │ │ └── workspace.png │ ├── connecting_lab │ │ ├── Fig-pending.png │ │ ├── Fig-refresh.png │ │ ├── FigConnectingLab-1.png │ │ ├── FigConnectingLab-10.png │ │ ├── FigConnectingLab-11.png │ │ ├── FigConnectingLab-12.png │ │ ├── FigConnectingLab-15.png │ │ ├── FigConnectingLab-17.png │ │ ├── FigConnectingLab-3.png │ │ ├── FigConnectingLab-4-2.png │ │ ├── FigConnectingLab-5.png │ │ ├── FigConnectingLab-6.png │ │ ├── FigConnectingLab-7.png │ │ ├── FigConnectingLab-9.png │ │ ├── copy_button.png │ │ ├── instance_running.png │ │ ├── nice_dcv.png │ │ ├── nice_dcv_desktop.png │ │ ├── noVNC_connect.png │ │ ├── noVNC_desktop.png │ │ └── vnc.png │ ├── debug_lab │ │ ├── AddingCode.png │ │ ├── add_virtual_cable.png │ │ ├── captured_activities.png │ │ ├── command_queue.png │ │ ├── command_queue_after_1st.png │ │ ├── command_queue_after_2nd.png │ │ ├── enable_chipscope.png │ │ ├── hardware_manager.png │ │ ├── hw_manager_open_target.png │ │ ├── memory_buffers.png │ │ ├── rtl_kernel_exe_properties.png │ │ ├── run_first_part.png │ │ ├── select_executable.png │ │ ├── selecting_Show_View.png │ │ ├── selecting_command_que_and_memory_buffers_views.png │ │ ├── set_breakpoint.png │ │ ├── set_virtual_cable_port.png │ │ ├── trigger_button.png │ │ ├── trigger_immediate.png │ │ ├── trigger_setup.png │ │ ├── trigger_value.png │ │ ├── trigger_wait.png │ │ ├── triggered_waveform.png │ │ └── turn_off_autobuild.png │ ├── graph_lab │ │ ├── hw_api_calls.png │ │ ├── hw_application_timeline.png │ │ ├── hw_emu_application_timeline.png │ │ ├── hw_emu_host_data_transfer.png │ │ ├── hw_emu_kernel_compute_units.png │ │ ├── hw_emu_kernel_data_transfer.png │ │ ├── hw_emu_kernel_internals.png │ │ ├── hw_emu_system_diagram.png │ │ ├── hw_emu_vivado_sim.png │ │ ├── hw_emu_waveform.png │ │ ├── hw_host_data_transfer.png │ │ ├── hw_kernel_compute_units.png │ │ ├── hw_kernel_data_transfer.png │ │ ├── sw_emu_application_timeline.png │ │ ├── sw_emu_host_data_transfer.png │ │ └── sw_emu_kernel_compute_units.png │ ├── improving_performance │ │ ├── Using_multiple_banks.png │ │ ├── add_kernel.png │ │ ├── add_sources.png │ │ ├── hw_interfaces.png │ │ ├── hw_wide_interfaces.png │ │ ├── launch_vitis_hls.png │ │ ├── link_settings.png │ │ ├── multibank_controller_timeline.png │ │ ├── multibank_system_diagram.png │ │ ├── open_vadd_kernel.png │ │ ├── open_vitis_hls.png │ │ ├── perf_estimate_0.png │ │ ├── perf_estimate_1.png │ │ ├── perf_estimate_2.png │ │ ├── platform_diagram.png │ │ ├── single_controller_multiple_adapters_timeline.png │ │ ├── single_controller_timeline.png │ │ └── system_diagram.png │ ├── optimization_lab │ │ ├── 2waveform_settings.png │ │ ├── application_timeline_after_host_optimization.png │ │ ├── application_timeline_before_host_optimization.png │ │ ├── compute_unit_settings.png │ │ ├── hls_synthesis_report.png │ │ ├── hls_synthesis_report_dataflow.png │ │ ├── hw_application_timeline.png │ │ ├── hw_emu_dataflow_profile_kernel.png │ │ ├── hw_emu_profile_kernel_cu.png │ │ ├── hw_emu_waveform_1.png │ │ ├── hw_emu_waveform_2.png │ │ ├── hw_profile_host_data_transfer.png │ │ ├── hw_profile_kernel_compute_units.png │ │ ├── hw_profile_kernel_data_transfer.png │ │ ├── outline_view.png │ │ ├── waveform.png │ │ └── waveform_settings.png │ ├── pdf.png │ ├── rtlkernel_lab │ │ ├── hw_application_timeline.png │ │ ├── hw_emu_application_timeline.png │ │ ├── hw_emu_kernel_config.png │ │ ├── hw_emu_run_configuration.png │ │ ├── hw_emu_selection.png │ │ ├── hw_profile_host_data_transfer.png │ │ ├── hw_profile_kernel_compute_units.png │ │ ├── hw_profile_kernel_data_transfer.png │ │ ├── hw_run_output.png │ │ ├── kernelxo_refresh.png │ │ ├── project_with_rtl.png │ │ ├── rtl_schematic.png │ │ ├── vivado_axi_blocks.png │ │ ├── vivado_control_block.png │ │ ├── vivado_elaborated_3_blocks.png │ │ ├── vivado_elaborated_sch.png │ │ ├── vivado_hierarchy.png │ │ ├── vivado_project.png │ │ ├── wizard_arguments.png │ │ ├── wizard_entry_page.png │ │ ├── wizard_general_settings.png │ │ ├── wizard_scalar_arg.png │ │ ├── wizard_streaming_int.png │ │ └── wizard_summary.png │ ├── streaming_lab │ │ ├── hardware_functions.png │ │ ├── hw_emu_timeline.png │ │ ├── import_cfg.png │ │ ├── kernels_connections.png │ │ ├── linking.png │ │ ├── program_args_sw_emu.png │ │ ├── standard_fir.png │ │ ├── system_diagram.png │ │ └── transposed_direct_fir.png │ ├── vitis_flow.png │ └── zoom_full.png ├── jekyll-theme-dinky.gemspec ├── presentations.md ├── pynq_labs.md ├── report_issues.md ├── resources.md ├── rtl_kernel_lab.md ├── setup_aws.md ├── setup_local_computer.md ├── setup_xup_aws_workshop.md └── streaming_lab.md ├── solutions ├── debug_lab │ └── debug_system.ide.zip ├── graph_lab │ ├── 21_09_08-015725_afi_id.txt │ ├── 21_09_08-015725_agfi_id.txt │ ├── data │ │ ├── data-csr-indicesweights.mtx │ │ ├── data-csr-offset.mtx │ │ └── data-golden.sssp.mtx │ ├── host.exe │ ├── shortestPath_top.awsxclbin │ └── xrt.ini ├── optimization_lab │ ├── 21_08_03-022222_afi_id.txt │ ├── 21_08_03-022222_agfi_id.txt │ ├── binary_container_1.awsxclbin │ ├── optimization_lab │ └── xrt.ini ├── rtlkernel_lab │ ├── 21_07_20-220502_afi_id.txt │ ├── 21_07_20-220502_agfi_id.txt │ ├── binary_container_1.awsxclbin │ ├── rtl_kernel │ └── xrt.ini ├── streaming_lab │ ├── 21_07_19-211759_afi_id.txt │ ├── 21_07_19-211759_agfi_id.txt │ └── binary_container_1.awsxclbin ├── vision_lab │ ├── 21_07_22-215100_afi_id.txt │ ├── 21_07_22-215100_agfi_id.txt │ ├── src │ │ └── data │ │ │ ├── README.md │ │ │ ├── fish_wallpaper.jpg │ │ │ └── fish_wallpaper_small.jpg │ └── vision_example.awsxclbin └── vitis_intro_lab │ ├── 21_08_02-195528_afi_id.txt │ ├── 21_08_02-195528_agfi_id.txt │ ├── binary_container_1.awsxclbin │ └── xrt.ini └── sources ├── common ├── xcl2.cpp └── xcl2.hpp ├── graph_lab ├── graph.patch └── xrt.ini ├── optimization_lab ├── idct.cpp └── krnl_idct.cpp ├── streaming_lab ├── host.cpp ├── krnl_fir.cpp ├── krnl_mm2s.cpp ├── krnl_s2mm.cpp ├── linking.cfg ├── xcl2.cpp └── xcl2.hpp ├── vadd_lab ├── krnl_vadd.cpp ├── vadd.cpp ├── xcl2.cpp └── xcl2.hpp ├── vision_lab ├── src │ ├── connectivity_aws.ini │ ├── data │ │ ├── README.md │ │ ├── fish_wallpaper.jpg │ │ └── fish_wallpaper_small.jpg │ ├── hw │ │ ├── resize_blur.cpp │ │ └── resize_rgb.cpp │ ├── pynq │ │ ├── vision.ipynb │ │ └── vision_emulation.ipynb │ ├── sw │ │ ├── event_timer.cpp │ │ ├── event_timer.hpp │ │ ├── line_exception.hpp │ │ ├── opencv_example.cpp │ │ ├── xcl2.cpp │ │ ├── xcl2.hpp │ │ ├── xilinx_ocl_helper.cpp │ │ └── xilinx_ocl_helper.hpp │ └── vision_config.ini └── xrt.ini └── xrt.ini /.gitattributes: -------------------------------------------------------------------------------- 1 | # By default everything gets normalized and gets LF line endings on checkout. 2 | * text eol=lf 3 | 4 | # These will always have CRLF line endings on checkout. 5 | *.vcxproj text eol=crlf 6 | *.props text eol=crlf 7 | *.project text eol=crlf 8 | *.cproject text eol=crlf 9 | *.inf text eol=crlf 10 | 11 | # These are binary so should never be modified by git. 12 | *.png binary 13 | *.jpg binary 14 | *.jpe binary 15 | *.jpeg binary 16 | *.JPG binary 17 | *.PNG binary 18 | *.ttf binary 19 | *.eot binary 20 | *.woff binary 21 | *.inv binary 22 | *.dxf binary 23 | *.mp4 binary 24 | *.wav binary -crlf 25 | *.mp3 binary 26 | *.hdf binary 27 | *.bat binary 28 | *.pdm binary 29 | *.doctree binary 30 | *.elf binary -crlf 31 | *.bin binary -crlf 32 | *.bit binary -crlf 33 | *.a binary -crlf 34 | *.bsp binary 35 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | _site 2 | .sass-cache 3 | Gemfile.lock 4 | *.gem 5 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Xilinx University Program Vitis Tutorial 2 | 3 | View this repository on GitHub pages: [https://xilinx.github.io/xup_compute_acceleration/](https://xilinx.github.io/xup_compute_acceleration/) 4 | 5 | ## Tools Versions 6 | 7 | This version of the tutorial has been verified for the following environments 8 | 9 | 10 | | Environment | Vitis | XRT | Shell | Notes | 11 | |-------------|-------|-----|-------|-------| 12 | | AWS F1 | 2021.1 | 2.11.0 | xilinx_aws-vu9p-f1_shell-v04261818_201920_2| AMI 1.10.1(AL2) | 13 | 14 | 15 | ## Report an Issue 16 | 17 | [Follow the instructions to report an issue](docs/report_issues.md) 18 | 19 | ## Contact details 20 | 21 | You can contact us by email [xup@xilinx.com](mailto:xup@xilinx.com) 22 | 23 | --------------------------------------- 24 | -------------------------------------------------------------------------------- /docs/Creating_AFI.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | --- 4 | 5 | # Creating an Amazon FPGA Image (AFI) 6 | 7 | This document guides you through the steps to create an AWS Amazon FPGA Image (AFI) which can run on AWS EC2 F1 instance to verify that the design works in hardware. It assumes that a full system (Vitis project) is built which consists of an *host* application (executable file) and an FPGA binary file (.xclbin). 8 | 9 | ### Create an AFI 10 | 11 | #### AWSEducate users follow [these steps](Creating_AFI_AWSEducate.md) to create an AFI 12 | 13 | 14 | To execute the application on F1, the following files are needed: 15 | 16 | - Host application (executable file) 17 | - Amazon FPGA Image (awsxclbin) 18 | 19 | The awsxclbin is an Amazon specific version of the FPGA binary file (xclbin) produced by the Vitis software. 20 | 21 | The awsxclbin can be created by running the *create\_vitis\_afi.sh* script which is included in the [aws-fpga GitHub repository](https://github.com/aws/aws-fpga/tree/master/Vitis#2-create-an-amazon-fpga-image-afi). 22 | 23 | The script can be found in the following location in the aws-fpga repository: 24 | 25 | ```sh 26 | $VITIS_DIR/tools/create_vitis_afi.sh 27 | ``` 28 | 29 | 1. Before running the commands below, make sure the Vitis setup script has been sourced (the following command assumes the aws-fpga Git repository is cloned to the user home area) 30 | 31 | ```sh 32 | source ~/aws-fpga/vitis_setup.sh 33 | ``` 34 | 35 | 1. Set up S3 bucket region 36 | 37 | For instance: 38 | 39 | ```sh 40 | aws configure set region us-east-1 41 | ``` 42 | 43 | Note: the region may change for your instance. This command will create/update the `~/.aws/config` file 44 | 45 | 1. Create an AFI by running the `create_vitis_afi.sh` script and wait for the completion of the AFI creation process 46 | 47 | ```sh 48 | $VITIS_DIR/tools/create_vitis_afi.sh -xclbin=.xclbin -s3_bucket= -s3_dcp_key= -s3_logs_key= 49 | ``` 50 | 51 | In the above command, set your *xclbin* file as ``; the Amazon S3 ``, ``, and `` with the names you had given when running CLI script. You can choose any valid folder name for the dcp and logs folder. The Amazon S3 bucket name should match an S3 bucket you have set up. 52 | 53 | Learn more about setting up S3 buckets [here](https://github.com/aws/aws-fpga/blob/master/Vitis/docs/Setup_AWS_CLI_and_S3_Bucket.md) 54 | 55 | The `create_vitis_afi.sh` script does the following: 56 | 57 | - Starts a background process to create the AFI 58 | - Generates a `*_afi_id.txt` which contains the FPGA Image Identifier (or AFI ID) and Global FPGA Image Identifier (or AGFI ID) of the generated AFIs 59 | - Creates the `*.awsxclbin` AWS FPGA binary file which is passed to the host application to determine which AFI should be loaded to the FPGA. 60 | - Uploads the `*.xclbin` to the AWS cloud for processing. 61 | 62 | ## Check the AFI status 63 | 64 | The AFI will become available after some time in the AWS cloud and can then be used to program the FPGA in an AWS EC2 F1 instance. To check the AFI status, the AFI ID is required. 65 | 66 | * In the directory the `create_vitis_afi.sh` script was run, enter the following command to find the AFI ID 67 | 68 | ```sh 69 | cat *afi_id.txt 70 | ``` 71 | 72 | * Enter the `describe-fpga-images` API command to check the status of the AFI generation process: 73 | 74 | ```sh 75 | aws ec2 describe-fpga-images --fpga-image-ids 76 | ``` 77 | 78 | * For example, 79 | 80 | ```sh 81 | aws ec2 describe-fpga-images --fpga-image-ids afi-0b9167434a1c74ba9 82 | ``` 83 | 84 | Or you can use a handy shortcut to pass the AFI id directly to the command. Read the file, get the second row, remove `"` and `,` and finally remove everything before the colon included 85 | 86 | ```sh 87 | aws ec2 describe-fpga-images --fpga-image-ids $(cat *afi_id.txt | sed -n '2p' | tr -d '",' | sed 's/.*://') 88 | ``` 89 | 90 | Note: When AFI creation is in progress, the *State* will be `pending`. When the AFI creation is finished, the output should show `available`: 91 | 92 | ```sh 93 | ... 94 | "State": { 95 | "Code": "available" 96 | }, 97 | 98 | ... 99 | ``` 100 | 101 | Wait until the AFI becomes available before proceeding to execute on the F1 instance. 102 | 103 | ## Regenerate .awsxclbin 104 | 105 | You can regenerate the `.awsxclbin` file as long as you have access to `*agfi_id.txt` and `*.xclbin` files 106 | 107 | 1. Edit these variable with the corresponding names 108 | 109 | ```sh 110 | export xclbin= 111 | export agfi_id=<*_agfi_id.txt> 112 | export awsxclbin= 113 | ``` 114 | 115 | 1. Generate `.awsxclbin` file 116 | 117 | ```sh 118 | xclbinutil -i $xclbin --remove-section PARTITION_METADATA --remove-section SYSTEM_METADATA --replace-section BITSTREAM:RAW:${agfi_id} -o ${awsxclbin}.awsxclbin 119 | ``` 120 | 121 | --------------------------------------- 122 | -------------------------------------------------------------------------------- /docs/Creating_AFI_AWSEducate.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | --- 4 | 5 | # Creating an Amazon FPGA Image (AFI) using AWSEducate 6 | 7 | This document guides you through the steps to create an AWS Amazon FPGA Image (AFI), when using AWSEducate instance, which can run on AWS EC2 F1 instance to verify that the design works in hardware. It assumes that a full system (Vitis project) is built which consists of an *host* application (executable file) and an FPGA binary file (.xclbin). 8 | 9 | ### Create an AFI 10 | 11 | 1. Setup CLI and Create S3 bucket 12 | 13 | - Create an empty file called *credentials* using the following commands 14 | 15 | ``` 16 | cd 17 | mkdir .aws 18 | cd .aws 19 | gedit credentials 20 | ``` 21 | 22 | - Go to the Vocareum window and click on **Account Details** 23 | - Click on the **Show** button 24 | - Copy the content into the *credentials* file, save the file, and exit 25 | - Create a S3 bucket which will be used for registering xclbin (Note: touch command below is necessary to have non-empty folders. The files will be copied into these sub-folders 26 | 27 | ``` 28 | aws s3 mb s3:// --region us-east-1 29 | aws s3 mb s3:/// 30 | touch FILES_GO_HERE.txt 31 | aws s3 cp FILES_GO_HERE.txt s3://// 32 | aws s3 mb s3:/// 33 | touch FILES_GO_HERE.txt 34 | aws s3 cp FILES_GO_HERE.txt s3://// 35 | ``` 36 | 37 | 1. Configure aws by executing following command and providing credentials 38 | 39 | Note that anytime you want to create AFI, the credentials file content must be updated. You must rerun the command every time before you run the create_visit_afi.sh script if this is a new session 40 | 41 | ``` 42 | aws configure 43 | AWS Access Key ID [****************J5NS]: 44 | AWS Secret Access Key [****************N4bG]: 45 | Default region name [None]: us-east-1 46 | Default output format [None]: json 47 | ``` 48 | 49 | 2. Submit the xclbin to generate AFI (with extension awsxclbin) using the following command 50 | 51 | ``` 52 | $VITIS_DIR/tools/create_vitis_afi.sh -xclbin= -s3_bucket= -s3_dcp_key= -s3_logs_key= 53 | ``` 54 | 55 | The bucket-name, dcp-folder-name, and logs-folder-name should match the one used while creating them 56 | 3. Once submitted successfully, an *time_stamp*\_afi\_id.txt file will be created. Open the file and make a note of the afi-id. Execute the following command to see the status of the AFI: 57 | 58 | `aws ec2 describe-fpga-images --fpga-image-ids ` 59 | 60 | Wait for about 30 minutes before the status changes from *pending* to **available**. You can log out and login back to check the status 61 | 62 | 63 | ## Regenerate .awsxclbin 64 | 65 | You can regenerate the `.awsxclbin` file as long as you have access to `*agfi_id.txt` and `*.xclbin` files 66 | 67 | 1. Edit these variable with the corresponding names 68 | 69 | ```sh 70 | export xclbin= 71 | export agfi_id=<*_agfi_id.txt> 72 | export awsxclbin= 73 | ``` 74 | 75 | 1. Generate `.awsxclbin` file 76 | 77 | ```sh 78 | xclbinutil -i $xclbin --remove-section PARTITION_METADATA --remove-section SYSTEM_METADATA --replace-section BITSTREAM:RAW:${agfi_id} -o ${awsxclbin}.awsxclbin 79 | ``` 80 | 81 | --------------------------------------- 82 | -------------------------------------------------------------------------------- /docs/Gemfile: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | source 'https://rubygems.org' 4 | 5 | gemspec 6 | -------------------------------------------------------------------------------- /docs/README.md: -------------------------------------------------------------------------------- 1 | 4 | 5 | # Xilinx University Program Vitis Tutorial 6 | 7 | ## Introduction 8 | 9 | Welcome to the XUP Vitis-based Compute Acceleration tutorial. These labs will provide hands-on experience using the [Vitis unified software platform](https://www.xilinx.com/products/design-tools/vitis.html) with Xilinx FPGA hardware. You will learn how to develop applications using the Vitis development environment that supports OpenCL/C/C++ and RTL kernels. 10 | 11 | The tutorial instructions target the following hardware and software: 12 | 13 | * Vitis 2021.1 14 | * AWS EC2 F1 f1.2xlarge (cloud) 15 | 16 | This tutorial shows you how to use Vitis with AWS EC2 F1. Sources and precompiled solutions are provided for AWS EC2 F1 x2.large. You may be able to use the Vitis tutorial instructions with other cloud providers, and other hardware. 17 | 18 | 19 | ## Run Tutorial 20 | 21 | You can run this tutorial in different ways. 22 | 23 | 1. If you have an Alveo board, you can run all parts of the tutorial on a local machine. 24 | 25 | 1. You can use the Vitis software in the cloud, with hardware in the cloud (AWS F1). 26 | * For running your design in AWS you will need to [create an AFI](Creating_AFI.md) 27 | 28 | 1. You can use the Vitis software on a local machine for building designs, and only switch to the cloud to deploy in hardware, make sure you build for the correct shell. 29 | 30 | Once you have decided how you want to run the tutorial, follow the appropriate instructions below. 31 | 32 | ### XUP AWS Tutorial 33 | 34 | If you are attending an instructor-led XUP AWS tutorial, preconfigured AWS F1 instances will be provided for you. Use the following instructions to [connect to your assigned AWS XUP tutorial instance](./setup_xup_aws_workshop.md) 35 | 36 | ### AWS EC2 F1 37 | 38 | An [FPGA Developer AMI](https://aws.amazon.com/marketplace/pp/B06VVYBLZZ) (Amazon Machine Image) is available with the Xilinx Vitis software preinstalled. This can be used to target AWS EC2 F1 hardware. An AMI is like a Virtual Machine image. You can use this AMI and the following instructions to [set up and connect to an AWS instance](./setup_aws.md) 39 | 40 | You can also install [Vitis unified software platform](https://www.xilinx.com/support/download/index.html/content/xilinx/en/downloadNav/vitis.html) on your local machine, build design offline, and use AWS F1 hardware for testing. See the Amazon guide to use [AWS EC2 FPGA Development Kit](https://github.com/aws/aws-fpga) for details on setting up your machine. 41 | 42 | ### Local computer 43 | 44 | To use your own computer, [install and set up Vitis and install the Alveo U200 packages](./setup_local_computer.md) 45 | 46 | ### Clone repository 47 | 48 | You also need to clone this repository to get a copy of the source code, the lab steps consider that this repository is cloned directly in the home directory (\~). 49 | 50 | ```sh 51 | git clone git@github.com:Xilinx/xup_compute_acceleration.git ~ 52 | ``` 53 | 54 | ## Tutorial overview 55 | 56 | The complete set of labs includes the following modules; it is recommended to complete each lab before proceeding to the next 57 | 58 | 1. [**Introduction to Vitis Part 1**](Vitis_intro-1.md): 59 | This lab shows you how to use the Vitis GUI to create a new project using a simple vector addition example. You will run CPU emulation (`sw_emu`) to verify functional correctness of the example design. 60 | 61 | 1. [**Introduction to Vitis Part 2**](Vitis_intro-2.md): 62 | In this lab you will continue with the previous example and run hardware emulation (`hw_emu`) to verify the functionality of the generated hardware design and profile the whole application. You will then use *AWS F1* or *on-premise* hardware to validate the design using a pre-generated host application and FPGA binary. 63 | 64 | 1. [**Improving Performance**](Improving_Performance_lab.md): 65 | This lab shows how bandwidth can be improved, and thus system performance, by using wider data path and transferring data in parallel using multiple memory banks. 66 | 67 | 1. [**Optimization**](Optimization_lab.md): 68 | This lab guides you through the steps to analyze various generated reports and then apply optimization techniques, such as `DATAFLOW` on the host program and `PIPELINING` on kernel side to improve throughput and data transfer rate. 69 | 70 | 1. [**Vision Lab**](Vision_lab.md): 71 | In this lab you will create a Vitis design using the command line. The design uses two kernels from the [Vitis Accelerated Libraries](https://xilinx.github.io/Vitis_Libraries/), **image resize** and **image resize & blur**. You will run software emulation and test the kernels in hardware. 72 | 73 | 1. [**PYNQ Labs**](pynq_labs.md): 74 | In this series of labs you will learn how to use PYNQ for easier user of Xilinx compute acceleration platforms. 75 | 76 | ### Advanced labs 77 | 78 | These labs are intended for hardware designers who may want to use RTL to build kernels, and learn how to use lower level hardware debug features in Vitis. 79 | 80 | 1. [**RTL-Kernel**](rtl_kernel_lab.md): 81 | This lab guides you through the steps involved in using a RTL Kernel wizard to wrap a user RTL-based IP so the generated IP can be used in a Vitis project and application development. 82 | 83 | 1. [**Hardware Debugging**](debug_lab.md): 84 | This lab will show you how to carry out host application debug, and debug of the hardware kernel. 85 | 86 | 1. [**Streaming**](streaming_lab.md): 87 | This lab will show you how to incorporate kernels having streaming interfaces. 88 | 89 | --------------------------------------- 90 | -------------------------------------------------------------------------------- /docs/Vitis_intro-1.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | --- 4 | 5 | # Introduction to Vitis Part 1 6 | 7 | ## Introduction 8 | 9 | This lab guides you through the steps involved in creating a Vitis project using Graphical User Interface (GUI). After creating the project, you will run software emulation to verify the functionality of the design. 10 | 11 | ### References 12 | 13 | For more details on the Vitis IDE see the Vitis documentation for [Creating a Vitis IDE Project](https://docs.xilinx.com/r/2021.1-English/ug1393-vitis-application-acceleration/Creating-a-Vitis-IDE-Project). 14 | 15 | 16 | ### Description of example application 17 | 18 | This lab uses an example application available in Vitis. It consists of a host application and kernel (written in C++/OpenCL). The kernel is a simple vector addition. The elements of 2 vectors (A & B) are added together, and the result returned in a third array (C). The host application initializes the two input arrays, send data to the kernel, and reads back the result. 19 | 20 | You will compile and test a software only version of the application. The *vector add* kernel will then be implemented as a hardware kernel. You will first build and run a *Software Emulation* version of the design, followed by a *Hardware Emulation* version which will run a simulation of the hardware model of the kernel along with the host application. You will then test the design with the hardware kernel running in the FPGA in the next part of the lab. 21 | 22 | ## Objectives 23 | 24 | After completing this lab (part 1 and part 2), you will learn how to: 25 | 26 | * Create a project using the Vitis GUI 27 | - Run *Software Emulation* to verify the functionality of a design 28 | - Run Hardware Emulation to verify the functionality of the generated hardware design 29 | - Build the system and test it in hardware 30 | - Perform profile and application timeline analysis in hardware emulation 31 | 32 | ## Steps 33 | 34 | ### Create a Vitis Project 35 | 36 | 1. If you have not run [lab setup](setup_xup_aws_workshop.md#lab-setup), run it now 37 | 38 | 1. In a terminal, start the Vitis GUI by running 39 | 40 | ```sh 41 | vitis 42 | ``` 43 | 1. Set the Vitis *workspace* to a new empty folder, such as `/home//workspace` and click **Launch** 44 | 45 | ![](./images/Vitis_intro/workspace.png) 46 | 47 | 1. The Vitis IDE Welcome page will be displayed 48 | 49 | ![](./images/Vitis_IDE.png) 50 | 51 | 1. Create a new application project 52 | 53 | Click **Create Application Project** from Welcome page, or **File > New > Application Project** to create a new application 54 | 55 | ![](./images/Vitis_intro/new_application.png) 56 | 57 | 1. Click **Next >** in the first window 58 | 59 | ![New Application Project Name](./images/Vitis_intro/project_wizard.png) 60 | 61 | 1. Select `xilinx_aws-vu9p-f1_shell-v04261818_201920_2` platform and click **Next >** 62 | 63 | If you do not see this platform, check you followed the [lab set up instructions](setup_xup_aws_workshop.md#lab-setup) to set the `PLATFORM_REPO_PATHS` variable. You can select the platform by clicking the `+` button and browsing to `~/aws-fpga/Vitis/aws_platform/` and selecting `xilinx_aws-vu9p-f1_shell-v04261818_201920_2` 64 | 65 | ![New Application Project Platform](./images/Vitis_intro/select_platform.png) 66 | 67 | 1. Name the project `vadd` and click **Next >** 68 | 69 | ![New Application Project Name](./images/Vitis_intro/project_name.png) 70 | 71 | 1. Select `Empty Application` in the *Templates* window and click **Finish** 72 | 73 | ![](./images/Vitis_intro/template.png) 74 | 75 | The project is generated. Observe the top-level folder is called vadd\_system, under which three sub-folders **(vadd\_kernels, vadd\_system\_hw\_link, vadd)** are generated. The **vadd\_kernels** folder will hold all the kernel related files, the **vadd\_system\_hw\_link** will hold all linked kernel related files, and the **vadd** folder will hold all the host application related files. 76 | 77 | ![](./images/Vitis_intro/initial_project.png) 78 | 79 | Since the _Empty_ project template was selected, the **vadd** and **vadd_kernels** will have empty **src** folders 80 | 81 | 1. In the `Explorer` view, expand and right-click on **vadd\_system > vadd > src** and select **Import Sources...** 82 | 83 | ![](./images/Vitis_intro/add_host_sources.png) 84 | 85 | 1. In the *Import Sources* window, click *Browse* and navigate to `~/xup_compute_acceleration/sources/vadd_lab/` and click **Open** 86 | 87 | 1. Select the **vadd.cpp, xcl2.cpp, and xcl2.hpp** files as they are part of the host code and click **Finish** 88 | 89 | ![](./images/Vitis_intro/import_sources.png) 90 | 91 | Expand the `src` folder in the `Explorer` view to verify that the three files were added. 92 | 93 | 1. Similarly, import the hardware kernel code (**krnl\_vadd.cpp**) under the **vadd\_system > vadd\_kernels > src** folder 94 | 95 | 1. In the *Explorer* view, double-click on the **vadd\_kernels.prj** under the **vadd\_system > vadd\_kernels** folder to open the corresponding *Hardware Kernel Project Settings* 96 | 97 | ![](./images/Vitis_intro/open_kernel_settings.png) 98 | 99 | 1. Click the **Add Hardware function** button (![](./images/Fig-hw_button.png)) on the *Hardware Functions* panel's ribbon 100 | 101 | ![](./images/Vitis_intro/add_hw_function.png) 102 | 103 | 1. Select **krnl_vadd(int \*, int \*, int \*, unsigned int) - krnl_vadd.cpp** in the *Add Hardware Functions* window and click **OK** 104 | 105 | ![](./images/Vitis_intro/select_hw_function.png) 106 | 107 | 1. Verify that *krnl_vadd* is added as a *Hardware Function* 108 | 109 | ![](./images/Vitis_intro/project_dashboard.png) 110 | 111 | ### Build and Run Software Emulation 112 | 113 | 1. Select the **vadd_system** tab in the project settings view 114 | 115 | 1. Check the *Active build configuration* is set to **Emulation-SW** on the upper right corner of *System Project Settings* view 116 | 117 | 1. In the *Explore* view, select **vadd_system** and build the design by clicking the hammer button (![](./images/Fig-build.png)) on top buttons bar, or right click `vadd_system` and select **Build Project** 118 | 119 | ![](./images/Vitis_intro/sw_emu_build.png) 120 | 121 | This step compiles each of the kernels, links them, and compiles the host application 122 | 123 | 1. Run Software Emulation 124 | 125 | To launch software emulation, select `vadd_system` either in the **Assistant** view or in the **Explorer** view and then click on the run button ![](./images/Fig-run.png) 126 | 127 | 1. Select the **Launch SW Emulator** option and click **OK** 128 | 129 | Observe the application has run and the output is displayed in the *Console* view 130 | 131 | ```console 132 | Found Platform 133 | Platform Name: Xilinx 134 | INFO: Reading /home/centos/workspace/vadd_system/Emulation-SW/binary_container_1.xclbin 135 | Loading: '/home/centos/workspace/vadd_system/Emulation-SW/binary_container_1.xclbin' 136 | Trying to program device[0]: xilinx_aws-vu9p-f1_shell-v04261818_201920_2 137 | Device[0]: program successful! 138 | Running Vector add with 32768 elements 139 | Launching Hardware Kernel... 140 | Getting Hardware Results... 141 | TEST PASSED 142 | ``` 143 | 144 | You can leave the project open as you will continue from this step in the second part of this lab 145 | 146 | ## Conclusion 147 | 148 | In this lab, you used Vitis to create a vector add project using the provided source code. You then ran the design using the software emulation flow. 149 | 150 | --------------------------------------- 151 | 152 | -------------------------------------------------------------------------------- /docs/_config.yml: -------------------------------------------------------------------------------- 1 | title: XUP Vitis Tutorial 2 | description: Hands-on experience using the Vitis unified software platform with Xilinx FPGA hardware. 3 | show_downloads: true 4 | google_analytics: UA-176717363-1 5 | theme: jekyll-theme-dinky -------------------------------------------------------------------------------- /docs/_data/advanced_sidebar.yml: -------------------------------------------------------------------------------- 1 | docs_list_title: advanced_sidebar 2 | docs: 3 | 4 | - title: RTL Kernel 5 | url: rtl_kernel_lab.html 6 | 7 | - title: Hardware Debugging 8 | url: debug_lab.html 9 | 10 | - title: Streaming 11 | url: streaming_lab.html -------------------------------------------------------------------------------- /docs/_data/appendix_sidebar.yml: -------------------------------------------------------------------------------- 1 | docs_list_title: appendix_sidebar 2 | docs: 3 | 4 | - title: Create an AFI 5 | url: Creating_AFI.html 6 | 7 | - title: Resources 8 | url: resources.html 9 | 10 | - title: Report an Issue 11 | url: report_issues.html -------------------------------------------------------------------------------- /docs/_data/labs_sidebar.yml: -------------------------------------------------------------------------------- 1 | docs_list_title: labs_sidebar 2 | docs: 3 | 4 | - title: Vitis Intro 1 5 | url: Vitis_intro-1.html 6 | 7 | - title: Vitis Intro 2 8 | url: Vitis_intro-2.html 9 | 10 | - title: Improving Performance 11 | url: Improving_Performance_lab.html 12 | 13 | - title: Optimization 14 | url: Optimization_lab.html 15 | 16 | - title: Vision Lab 17 | url: Vision_lab.html 18 | 19 | - title: Graph Lab 20 | url: Graph_lab.html -------------------------------------------------------------------------------- /docs/_data/setup_sidebar.yml: -------------------------------------------------------------------------------- 1 | docs_list_title: setup_sidebar 2 | docs: 3 | 4 | - title: XUP Workshop 5 | url: setup_xup_aws_workshop.html 6 | 7 | - title: AWS F1 8 | url: setup_aws.html 9 | 10 | - title: Local Computer 11 | url: setup_local_computer.html 12 | 13 | -------------------------------------------------------------------------------- /docs/_includes/codeHeader.html: -------------------------------------------------------------------------------- 1 |
2 | 3 |
-------------------------------------------------------------------------------- /docs/_layouts/default.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | {% seo %} 8 | 9 | 10 | 11 | 12 | 15 | 16 | 17 | 18 | 57 | 58 |
59 |
60 | {{ content }} 61 |
62 | 63 | 66 | 67 |
68 | 69 | {% if site.google_analytics %} 70 | 85 | {% endif %} 86 | 87 | 88 | 89 | -------------------------------------------------------------------------------- /docs/_sass/copy-code.scss: -------------------------------------------------------------------------------- 1 | // initial sample from https://www.aleksandrhovhannisyan.com/blog/how-to-add-a-copy-to-clipboard-button-to-your-jekyll-blog/ 2 | // Modifications from https://github.com/gojimmypi/gojimmypi.github.io/blob/master/_sass/partials/components/_codeheader.scss 3 | 4 | .code-header { 5 | display: flex; 6 | justify-content: flex-end; 7 | } 8 | 9 | .copy-code-button { 10 | display: grid; 11 | grid-auto-flow: column; 12 | align-items: center; 13 | grid-column-gap: 4px; 14 | border: 5px; 15 | cursor: pointer; 16 | font-size: .85rem; 17 | padding: 4px 8px; 18 | 19 | &::before { 20 | content: "Copy"; 21 | } 22 | 23 | &::after { 24 | content: "📋"; 25 | display: block; 26 | } 27 | // This class will be toggled via JavaScript 28 | &.copied { 29 | &::before { 30 | content: "Copied!"; 31 | } 32 | 33 | &::after { 34 | content: "✔️"; 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /docs/_sass/rouge-github.scss: -------------------------------------------------------------------------------- 1 | .highlight table td { padding: 5px; } 2 | .highlight table pre { margin: 0; } 3 | .highlight .cm { 4 | color: #999988; 5 | font-style: italic; 6 | } 7 | .highlight .cp { 8 | color: #999999; 9 | font-weight: bold; 10 | } 11 | .highlight .c1 { 12 | color: #999988; 13 | font-style: italic; 14 | } 15 | .highlight .cs { 16 | color: #999999; 17 | font-weight: bold; 18 | font-style: italic; 19 | } 20 | .highlight .c, .highlight .cd { 21 | color: #999988; 22 | font-style: italic; 23 | } 24 | .highlight .err { 25 | color: #a61717; 26 | background-color: #e3d2d2; 27 | } 28 | .highlight .gd { 29 | color: #000000; 30 | background-color: #ffdddd; 31 | } 32 | .highlight .ge { 33 | color: #000000; 34 | font-style: italic; 35 | } 36 | .highlight .gr { 37 | color: #aa0000; 38 | } 39 | .highlight .gh { 40 | color: #999999; 41 | } 42 | .highlight .gi { 43 | color: #000000; 44 | background-color: #ddffdd; 45 | } 46 | .highlight .go { 47 | color: #888888; 48 | } 49 | .highlight .gp { 50 | color: #555555; 51 | } 52 | .highlight .gs { 53 | font-weight: bold; 54 | } 55 | .highlight .gu { 56 | color: #aaaaaa; 57 | } 58 | .highlight .gt { 59 | color: #aa0000; 60 | } 61 | .highlight .kc { 62 | color: #000000; 63 | font-weight: bold; 64 | } 65 | .highlight .kd { 66 | color: #000000; 67 | font-weight: bold; 68 | } 69 | .highlight .kn { 70 | color: #000000; 71 | font-weight: bold; 72 | } 73 | .highlight .kp { 74 | color: #000000; 75 | font-weight: bold; 76 | } 77 | .highlight .kr { 78 | color: #000000; 79 | font-weight: bold; 80 | } 81 | .highlight .kt { 82 | color: #445588; 83 | font-weight: bold; 84 | } 85 | .highlight .k, .highlight .kv { 86 | color: #000000; 87 | font-weight: bold; 88 | } 89 | .highlight .mf { 90 | color: #009999; 91 | } 92 | .highlight .mh { 93 | color: #009999; 94 | } 95 | .highlight .il { 96 | color: #009999; 97 | } 98 | .highlight .mi { 99 | color: #009999; 100 | } 101 | .highlight .mo { 102 | color: #009999; 103 | } 104 | .highlight .m, .highlight .mb, .highlight .mx { 105 | color: #009999; 106 | } 107 | .highlight .sb { 108 | color: #d14; 109 | } 110 | .highlight .sc { 111 | color: #d14; 112 | } 113 | .highlight .sd { 114 | color: #d14; 115 | } 116 | .highlight .s2 { 117 | color: #d14; 118 | } 119 | .highlight .se { 120 | color: #d14; 121 | } 122 | .highlight .sh { 123 | color: #d14; 124 | } 125 | .highlight .si { 126 | color: #d14; 127 | } 128 | .highlight .sx { 129 | color: #d14; 130 | } 131 | .highlight .sr { 132 | color: #009926; 133 | } 134 | .highlight .s1 { 135 | color: #d14; 136 | } 137 | .highlight .ss { 138 | color: #990073; 139 | } 140 | .highlight .s { 141 | color: #d14; 142 | } 143 | .highlight .na { 144 | color: #008080; 145 | } 146 | .highlight .bp { 147 | color: #999999; 148 | } 149 | .highlight .nb { 150 | color: #0086B3; 151 | } 152 | .highlight .nc { 153 | color: #445588; 154 | font-weight: bold; 155 | } 156 | .highlight .no { 157 | color: #008080; 158 | } 159 | .highlight .nd { 160 | color: #3c5d5d; 161 | font-weight: bold; 162 | } 163 | .highlight .ni { 164 | color: #800080; 165 | } 166 | .highlight .ne { 167 | color: #990000; 168 | font-weight: bold; 169 | } 170 | .highlight .nf { 171 | color: #990000; 172 | font-weight: bold; 173 | } 174 | .highlight .nl { 175 | color: #990000; 176 | font-weight: bold; 177 | } 178 | .highlight .nn { 179 | color: #555555; 180 | } 181 | .highlight .nt { 182 | color: #000080; 183 | } 184 | .highlight .vc { 185 | color: #008080; 186 | } 187 | .highlight .vg { 188 | color: #008080; 189 | } 190 | .highlight .vi { 191 | color: #008080; 192 | } 193 | .highlight .nv { 194 | color: #008080; 195 | } 196 | .highlight .ow { 197 | color: #000000; 198 | font-weight: bold; 199 | } 200 | .highlight .o { 201 | color: #000000; 202 | font-weight: bold; 203 | } 204 | .highlight .w { 205 | color: #bbbbbb; 206 | } 207 | .highlight { 208 | background-color: #f8f8f8; 209 | } 210 | -------------------------------------------------------------------------------- /docs/assets/css/style.scss: -------------------------------------------------------------------------------- 1 | --- --- @import 'jekyll-theme-dinky'; 2 | table img { 3 | margin: 0px; 4 | border: 0px; 5 | vertical-align: text-bottom; 6 | padding: 0px; 7 | } 8 | 9 | td { 10 | font-size: 18px; 11 | } -------------------------------------------------------------------------------- /docs/assets/images/TLogoW.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/assets/images/TLogoW.png -------------------------------------------------------------------------------- /docs/assets/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/assets/images/favicon.ico -------------------------------------------------------------------------------- /docs/assets/images/mask-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/assets/images/mask-small.png -------------------------------------------------------------------------------- /docs/assets/images/pynq.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/assets/images/pynq.png -------------------------------------------------------------------------------- /docs/assets/images/xilinx-logo-xup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/assets/images/xilinx-logo-xup.png -------------------------------------------------------------------------------- /docs/assets/images/youtube.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/assets/images/youtube.png -------------------------------------------------------------------------------- /docs/assets/js/copy_code.js: -------------------------------------------------------------------------------- 1 | // This assumes that you're using Rouge; if not, update the selector 2 | const codeBlocks = document.querySelectorAll('.code-header + .highlighter-rouge'); 3 | const copyCodeButtons = document.querySelectorAll('.copy-code-button'); 4 | 5 | copyCodeButtons.forEach((copyCodeButton, index) => { 6 | const code = codeBlocks[index].innerText; 7 | 8 | copyCodeButton.addEventListener('click', () => { 9 | // Copy the code to the user's clipboard 10 | if (code == "" || code == null) { 11 | // use text from innerText 12 | window.navigator.clipboard.writeText(codeAlt); 13 | } 14 | else { 15 | // use text from textContent 16 | window.navigator.clipboard.writeText(code); 17 | } 18 | copyCodeButton.classList.add('copied'); 19 | 20 | // After 2 seconds, reset the button to its initial UI 21 | setTimeout(() => {copyCodeButton.classList.remove('copied');}, 2000); 22 | }); 23 | }); -------------------------------------------------------------------------------- /docs/assets/js/scale.fix.js: -------------------------------------------------------------------------------- 1 | fixScale = function(doc) { 2 | 3 | var addEvent = 'addEventListener', 4 | type = 'gesturestart', 5 | qsa = 'querySelectorAll', 6 | scales = [1, 1], 7 | meta = qsa in doc ? doc[qsa]('meta[name=viewport]') : []; 8 | 9 | function fix() { 10 | meta.content = 'width=device-width,minimum-scale=' + scales[0] + ',maximum-scale=' + scales[1]; 11 | doc.removeEventListener(type, fix, true); 12 | } 13 | 14 | if ((meta = meta[meta.length - 1]) && addEvent in doc) { 15 | fix(); 16 | scales = [.25, 1.6]; 17 | doc[addEvent](type, fix, true); 18 | } 19 | 20 | }; -------------------------------------------------------------------------------- /docs/images/Fig-build.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/Fig-build.png -------------------------------------------------------------------------------- /docs/images/Fig-hw_button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/Fig-hw_button.png -------------------------------------------------------------------------------- /docs/images/Fig-run.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/Fig-run.png -------------------------------------------------------------------------------- /docs/images/Vitis_IDE.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/Vitis_IDE.png -------------------------------------------------------------------------------- /docs/images/Vitis_intro/add_host_sources.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/Vitis_intro/add_host_sources.png -------------------------------------------------------------------------------- /docs/images/Vitis_intro/add_hw_function.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/Vitis_intro/add_hw_function.png -------------------------------------------------------------------------------- /docs/images/Vitis_intro/add_sources.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/Vitis_intro/add_sources.png -------------------------------------------------------------------------------- /docs/images/Vitis_intro/args_sw_emu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/Vitis_intro/args_sw_emu.png -------------------------------------------------------------------------------- /docs/images/Vitis_intro/cmdline_hw_profile_data_transfer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/Vitis_intro/cmdline_hw_profile_data_transfer.png -------------------------------------------------------------------------------- /docs/images/Vitis_intro/hardware.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/Vitis_intro/hardware.png -------------------------------------------------------------------------------- /docs/images/Vitis_intro/hw_application_timeline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/Vitis_intro/hw_application_timeline.png -------------------------------------------------------------------------------- /docs/images/Vitis_intro/hw_arguments_settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/Vitis_intro/hw_arguments_settings.png -------------------------------------------------------------------------------- /docs/images/Vitis_intro/hw_binary_container_settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/Vitis_intro/hw_binary_container_settings.png -------------------------------------------------------------------------------- /docs/images/Vitis_intro/hw_emu_application_timeline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/Vitis_intro/hw_emu_application_timeline.png -------------------------------------------------------------------------------- /docs/images/Vitis_intro/hw_emu_application_timeline_trace.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/Vitis_intro/hw_emu_application_timeline_trace.png -------------------------------------------------------------------------------- /docs/images/Vitis_intro/hw_emu_krnl_profile_settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/Vitis_intro/hw_emu_krnl_profile_settings.png -------------------------------------------------------------------------------- /docs/images/Vitis_intro/hw_emu_profile_API_calls.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/Vitis_intro/hw_emu_profile_API_calls.png -------------------------------------------------------------------------------- /docs/images/Vitis_intro/hw_emu_profile_host_data_transfers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/Vitis_intro/hw_emu_profile_host_data_transfers.png -------------------------------------------------------------------------------- /docs/images/Vitis_intro/hw_emu_profile_kernel_compute_units.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/Vitis_intro/hw_emu_profile_kernel_compute_units.png -------------------------------------------------------------------------------- /docs/images/Vitis_intro/hw_emu_profile_kernel_internals.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/Vitis_intro/hw_emu_profile_kernel_internals.png -------------------------------------------------------------------------------- /docs/images/Vitis_intro/hw_emu_profile_kernel_transfer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/Vitis_intro/hw_emu_profile_kernel_transfer.png -------------------------------------------------------------------------------- /docs/images/Vitis_intro/hw_emu_run.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/Vitis_intro/hw_emu_run.png -------------------------------------------------------------------------------- /docs/images/Vitis_intro/hw_emu_settings_invoke.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/Vitis_intro/hw_emu_settings_invoke.png -------------------------------------------------------------------------------- /docs/images/Vitis_intro/hw_emu_setup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/Vitis_intro/hw_emu_setup.png -------------------------------------------------------------------------------- /docs/images/Vitis_intro/hw_krnl_profile_settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/Vitis_intro/hw_krnl_profile_settings.png -------------------------------------------------------------------------------- /docs/images/Vitis_intro/hw_profile_API_calls.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/Vitis_intro/hw_profile_API_calls.png -------------------------------------------------------------------------------- /docs/images/Vitis_intro/hw_profile_data_transfer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/Vitis_intro/hw_profile_data_transfer.png -------------------------------------------------------------------------------- /docs/images/Vitis_intro/hw_profile_kernel_compute_units.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/Vitis_intro/hw_profile_kernel_compute_units.png -------------------------------------------------------------------------------- /docs/images/Vitis_intro/hw_profile_kernel_data_transfer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/Vitis_intro/hw_profile_kernel_data_transfer.png -------------------------------------------------------------------------------- /docs/images/Vitis_intro/hw_settings_invoke.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/Vitis_intro/hw_settings_invoke.png -------------------------------------------------------------------------------- /docs/images/Vitis_intro/hw_trace_settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/Vitis_intro/hw_trace_settings.png -------------------------------------------------------------------------------- /docs/images/Vitis_intro/import_sources.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/Vitis_intro/import_sources.png -------------------------------------------------------------------------------- /docs/images/Vitis_intro/initial_project.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/Vitis_intro/initial_project.png -------------------------------------------------------------------------------- /docs/images/Vitis_intro/new_application.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/Vitis_intro/new_application.png -------------------------------------------------------------------------------- /docs/images/Vitis_intro/open_kernel_settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/Vitis_intro/open_kernel_settings.png -------------------------------------------------------------------------------- /docs/images/Vitis_intro/profile_summary.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/Vitis_intro/profile_summary.png -------------------------------------------------------------------------------- /docs/images/Vitis_intro/project_dashboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/Vitis_intro/project_dashboard.png -------------------------------------------------------------------------------- /docs/images/Vitis_intro/project_name.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/Vitis_intro/project_name.png -------------------------------------------------------------------------------- /docs/images/Vitis_intro/project_wizard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/Vitis_intro/project_wizard.png -------------------------------------------------------------------------------- /docs/images/Vitis_intro/rebuild_hostcode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/Vitis_intro/rebuild_hostcode.png -------------------------------------------------------------------------------- /docs/images/Vitis_intro/run_as.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/Vitis_intro/run_as.png -------------------------------------------------------------------------------- /docs/images/Vitis_intro/select_hw_function.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/Vitis_intro/select_hw_function.png -------------------------------------------------------------------------------- /docs/images/Vitis_intro/select_platform.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/Vitis_intro/select_platform.png -------------------------------------------------------------------------------- /docs/images/Vitis_intro/sw_emu_application_timeline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/Vitis_intro/sw_emu_application_timeline.png -------------------------------------------------------------------------------- /docs/images/Vitis_intro/sw_emu_build.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/Vitis_intro/sw_emu_build.png -------------------------------------------------------------------------------- /docs/images/Vitis_intro/sw_emu_enable_timeline_trace.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/Vitis_intro/sw_emu_enable_timeline_trace.png -------------------------------------------------------------------------------- /docs/images/Vitis_intro/sw_emu_host_data_transfer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/Vitis_intro/sw_emu_host_data_transfer.png -------------------------------------------------------------------------------- /docs/images/Vitis_intro/sw_emu_kernel_compute_units.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/Vitis_intro/sw_emu_kernel_compute_units.png -------------------------------------------------------------------------------- /docs/images/Vitis_intro/sw_emu_run.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/Vitis_intro/sw_emu_run.png -------------------------------------------------------------------------------- /docs/images/Vitis_intro/sw_emu_run_configuration.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/Vitis_intro/sw_emu_run_configuration.png -------------------------------------------------------------------------------- /docs/images/Vitis_intro/sw_emu_run_profile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/Vitis_intro/sw_emu_run_profile.png -------------------------------------------------------------------------------- /docs/images/Vitis_intro/template.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/Vitis_intro/template.png -------------------------------------------------------------------------------- /docs/images/Vitis_intro/workspace.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/Vitis_intro/workspace.png -------------------------------------------------------------------------------- /docs/images/connecting_lab/Fig-pending.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/connecting_lab/Fig-pending.png -------------------------------------------------------------------------------- /docs/images/connecting_lab/Fig-refresh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/connecting_lab/Fig-refresh.png -------------------------------------------------------------------------------- /docs/images/connecting_lab/FigConnectingLab-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/connecting_lab/FigConnectingLab-1.png -------------------------------------------------------------------------------- /docs/images/connecting_lab/FigConnectingLab-10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/connecting_lab/FigConnectingLab-10.png -------------------------------------------------------------------------------- /docs/images/connecting_lab/FigConnectingLab-11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/connecting_lab/FigConnectingLab-11.png -------------------------------------------------------------------------------- /docs/images/connecting_lab/FigConnectingLab-12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/connecting_lab/FigConnectingLab-12.png -------------------------------------------------------------------------------- /docs/images/connecting_lab/FigConnectingLab-15.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/connecting_lab/FigConnectingLab-15.png -------------------------------------------------------------------------------- /docs/images/connecting_lab/FigConnectingLab-17.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/connecting_lab/FigConnectingLab-17.png -------------------------------------------------------------------------------- /docs/images/connecting_lab/FigConnectingLab-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/connecting_lab/FigConnectingLab-3.png -------------------------------------------------------------------------------- /docs/images/connecting_lab/FigConnectingLab-4-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/connecting_lab/FigConnectingLab-4-2.png -------------------------------------------------------------------------------- /docs/images/connecting_lab/FigConnectingLab-5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/connecting_lab/FigConnectingLab-5.png -------------------------------------------------------------------------------- /docs/images/connecting_lab/FigConnectingLab-6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/connecting_lab/FigConnectingLab-6.png -------------------------------------------------------------------------------- /docs/images/connecting_lab/FigConnectingLab-7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/connecting_lab/FigConnectingLab-7.png -------------------------------------------------------------------------------- /docs/images/connecting_lab/FigConnectingLab-9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/connecting_lab/FigConnectingLab-9.png -------------------------------------------------------------------------------- /docs/images/connecting_lab/copy_button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/connecting_lab/copy_button.png -------------------------------------------------------------------------------- /docs/images/connecting_lab/instance_running.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/connecting_lab/instance_running.png -------------------------------------------------------------------------------- /docs/images/connecting_lab/nice_dcv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/connecting_lab/nice_dcv.png -------------------------------------------------------------------------------- /docs/images/connecting_lab/nice_dcv_desktop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/connecting_lab/nice_dcv_desktop.png -------------------------------------------------------------------------------- /docs/images/connecting_lab/noVNC_connect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/connecting_lab/noVNC_connect.png -------------------------------------------------------------------------------- /docs/images/connecting_lab/noVNC_desktop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/connecting_lab/noVNC_desktop.png -------------------------------------------------------------------------------- /docs/images/connecting_lab/vnc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/connecting_lab/vnc.png -------------------------------------------------------------------------------- /docs/images/debug_lab/AddingCode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/debug_lab/AddingCode.png -------------------------------------------------------------------------------- /docs/images/debug_lab/add_virtual_cable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/debug_lab/add_virtual_cable.png -------------------------------------------------------------------------------- /docs/images/debug_lab/captured_activities.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/debug_lab/captured_activities.png -------------------------------------------------------------------------------- /docs/images/debug_lab/command_queue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/debug_lab/command_queue.png -------------------------------------------------------------------------------- /docs/images/debug_lab/command_queue_after_1st.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/debug_lab/command_queue_after_1st.png -------------------------------------------------------------------------------- /docs/images/debug_lab/command_queue_after_2nd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/debug_lab/command_queue_after_2nd.png -------------------------------------------------------------------------------- /docs/images/debug_lab/enable_chipscope.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/debug_lab/enable_chipscope.png -------------------------------------------------------------------------------- /docs/images/debug_lab/hardware_manager.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/debug_lab/hardware_manager.png -------------------------------------------------------------------------------- /docs/images/debug_lab/hw_manager_open_target.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/debug_lab/hw_manager_open_target.png -------------------------------------------------------------------------------- /docs/images/debug_lab/memory_buffers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/debug_lab/memory_buffers.png -------------------------------------------------------------------------------- /docs/images/debug_lab/rtl_kernel_exe_properties.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/debug_lab/rtl_kernel_exe_properties.png -------------------------------------------------------------------------------- /docs/images/debug_lab/run_first_part.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/debug_lab/run_first_part.png -------------------------------------------------------------------------------- /docs/images/debug_lab/select_executable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/debug_lab/select_executable.png -------------------------------------------------------------------------------- /docs/images/debug_lab/selecting_Show_View.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/debug_lab/selecting_Show_View.png -------------------------------------------------------------------------------- /docs/images/debug_lab/selecting_command_que_and_memory_buffers_views.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/debug_lab/selecting_command_que_and_memory_buffers_views.png -------------------------------------------------------------------------------- /docs/images/debug_lab/set_breakpoint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/debug_lab/set_breakpoint.png -------------------------------------------------------------------------------- /docs/images/debug_lab/set_virtual_cable_port.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/debug_lab/set_virtual_cable_port.png -------------------------------------------------------------------------------- /docs/images/debug_lab/trigger_button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/debug_lab/trigger_button.png -------------------------------------------------------------------------------- /docs/images/debug_lab/trigger_immediate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/debug_lab/trigger_immediate.png -------------------------------------------------------------------------------- /docs/images/debug_lab/trigger_setup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/debug_lab/trigger_setup.png -------------------------------------------------------------------------------- /docs/images/debug_lab/trigger_value.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/debug_lab/trigger_value.png -------------------------------------------------------------------------------- /docs/images/debug_lab/trigger_wait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/debug_lab/trigger_wait.png -------------------------------------------------------------------------------- /docs/images/debug_lab/triggered_waveform.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/debug_lab/triggered_waveform.png -------------------------------------------------------------------------------- /docs/images/debug_lab/turn_off_autobuild.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/debug_lab/turn_off_autobuild.png -------------------------------------------------------------------------------- /docs/images/graph_lab/hw_api_calls.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/graph_lab/hw_api_calls.png -------------------------------------------------------------------------------- /docs/images/graph_lab/hw_application_timeline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/graph_lab/hw_application_timeline.png -------------------------------------------------------------------------------- /docs/images/graph_lab/hw_emu_application_timeline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/graph_lab/hw_emu_application_timeline.png -------------------------------------------------------------------------------- /docs/images/graph_lab/hw_emu_host_data_transfer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/graph_lab/hw_emu_host_data_transfer.png -------------------------------------------------------------------------------- /docs/images/graph_lab/hw_emu_kernel_compute_units.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/graph_lab/hw_emu_kernel_compute_units.png -------------------------------------------------------------------------------- /docs/images/graph_lab/hw_emu_kernel_data_transfer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/graph_lab/hw_emu_kernel_data_transfer.png -------------------------------------------------------------------------------- /docs/images/graph_lab/hw_emu_kernel_internals.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/graph_lab/hw_emu_kernel_internals.png -------------------------------------------------------------------------------- /docs/images/graph_lab/hw_emu_system_diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/graph_lab/hw_emu_system_diagram.png -------------------------------------------------------------------------------- /docs/images/graph_lab/hw_emu_vivado_sim.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/graph_lab/hw_emu_vivado_sim.png -------------------------------------------------------------------------------- /docs/images/graph_lab/hw_emu_waveform.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/graph_lab/hw_emu_waveform.png -------------------------------------------------------------------------------- /docs/images/graph_lab/hw_host_data_transfer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/graph_lab/hw_host_data_transfer.png -------------------------------------------------------------------------------- /docs/images/graph_lab/hw_kernel_compute_units.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/graph_lab/hw_kernel_compute_units.png -------------------------------------------------------------------------------- /docs/images/graph_lab/hw_kernel_data_transfer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/graph_lab/hw_kernel_data_transfer.png -------------------------------------------------------------------------------- /docs/images/graph_lab/sw_emu_application_timeline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/graph_lab/sw_emu_application_timeline.png -------------------------------------------------------------------------------- /docs/images/graph_lab/sw_emu_host_data_transfer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/graph_lab/sw_emu_host_data_transfer.png -------------------------------------------------------------------------------- /docs/images/graph_lab/sw_emu_kernel_compute_units.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/graph_lab/sw_emu_kernel_compute_units.png -------------------------------------------------------------------------------- /docs/images/improving_performance/Using_multiple_banks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/improving_performance/Using_multiple_banks.png -------------------------------------------------------------------------------- /docs/images/improving_performance/add_kernel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/improving_performance/add_kernel.png -------------------------------------------------------------------------------- /docs/images/improving_performance/add_sources.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/improving_performance/add_sources.png -------------------------------------------------------------------------------- /docs/images/improving_performance/hw_interfaces.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/improving_performance/hw_interfaces.png -------------------------------------------------------------------------------- /docs/images/improving_performance/hw_wide_interfaces.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/improving_performance/hw_wide_interfaces.png -------------------------------------------------------------------------------- /docs/images/improving_performance/launch_vitis_hls.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/improving_performance/launch_vitis_hls.png -------------------------------------------------------------------------------- /docs/images/improving_performance/link_settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/improving_performance/link_settings.png -------------------------------------------------------------------------------- /docs/images/improving_performance/multibank_controller_timeline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/improving_performance/multibank_controller_timeline.png -------------------------------------------------------------------------------- /docs/images/improving_performance/multibank_system_diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/improving_performance/multibank_system_diagram.png -------------------------------------------------------------------------------- /docs/images/improving_performance/open_vadd_kernel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/improving_performance/open_vadd_kernel.png -------------------------------------------------------------------------------- /docs/images/improving_performance/open_vitis_hls.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/improving_performance/open_vitis_hls.png -------------------------------------------------------------------------------- /docs/images/improving_performance/perf_estimate_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/improving_performance/perf_estimate_0.png -------------------------------------------------------------------------------- /docs/images/improving_performance/perf_estimate_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/improving_performance/perf_estimate_1.png -------------------------------------------------------------------------------- /docs/images/improving_performance/perf_estimate_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/improving_performance/perf_estimate_2.png -------------------------------------------------------------------------------- /docs/images/improving_performance/platform_diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/improving_performance/platform_diagram.png -------------------------------------------------------------------------------- /docs/images/improving_performance/single_controller_multiple_adapters_timeline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/improving_performance/single_controller_multiple_adapters_timeline.png -------------------------------------------------------------------------------- /docs/images/improving_performance/single_controller_timeline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/improving_performance/single_controller_timeline.png -------------------------------------------------------------------------------- /docs/images/improving_performance/system_diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/improving_performance/system_diagram.png -------------------------------------------------------------------------------- /docs/images/optimization_lab/2waveform_settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/optimization_lab/2waveform_settings.png -------------------------------------------------------------------------------- /docs/images/optimization_lab/application_timeline_after_host_optimization.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/optimization_lab/application_timeline_after_host_optimization.png -------------------------------------------------------------------------------- /docs/images/optimization_lab/application_timeline_before_host_optimization.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/optimization_lab/application_timeline_before_host_optimization.png -------------------------------------------------------------------------------- /docs/images/optimization_lab/compute_unit_settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/optimization_lab/compute_unit_settings.png -------------------------------------------------------------------------------- /docs/images/optimization_lab/hls_synthesis_report.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/optimization_lab/hls_synthesis_report.png -------------------------------------------------------------------------------- /docs/images/optimization_lab/hls_synthesis_report_dataflow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/optimization_lab/hls_synthesis_report_dataflow.png -------------------------------------------------------------------------------- /docs/images/optimization_lab/hw_application_timeline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/optimization_lab/hw_application_timeline.png -------------------------------------------------------------------------------- /docs/images/optimization_lab/hw_emu_dataflow_profile_kernel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/optimization_lab/hw_emu_dataflow_profile_kernel.png -------------------------------------------------------------------------------- /docs/images/optimization_lab/hw_emu_profile_kernel_cu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/optimization_lab/hw_emu_profile_kernel_cu.png -------------------------------------------------------------------------------- /docs/images/optimization_lab/hw_emu_waveform_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/optimization_lab/hw_emu_waveform_1.png -------------------------------------------------------------------------------- /docs/images/optimization_lab/hw_emu_waveform_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/optimization_lab/hw_emu_waveform_2.png -------------------------------------------------------------------------------- /docs/images/optimization_lab/hw_profile_host_data_transfer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/optimization_lab/hw_profile_host_data_transfer.png -------------------------------------------------------------------------------- /docs/images/optimization_lab/hw_profile_kernel_compute_units.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/optimization_lab/hw_profile_kernel_compute_units.png -------------------------------------------------------------------------------- /docs/images/optimization_lab/hw_profile_kernel_data_transfer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/optimization_lab/hw_profile_kernel_data_transfer.png -------------------------------------------------------------------------------- /docs/images/optimization_lab/outline_view.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/optimization_lab/outline_view.png -------------------------------------------------------------------------------- /docs/images/optimization_lab/waveform.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/optimization_lab/waveform.png -------------------------------------------------------------------------------- /docs/images/optimization_lab/waveform_settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/optimization_lab/waveform_settings.png -------------------------------------------------------------------------------- /docs/images/pdf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/pdf.png -------------------------------------------------------------------------------- /docs/images/rtlkernel_lab/hw_application_timeline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/rtlkernel_lab/hw_application_timeline.png -------------------------------------------------------------------------------- /docs/images/rtlkernel_lab/hw_emu_application_timeline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/rtlkernel_lab/hw_emu_application_timeline.png -------------------------------------------------------------------------------- /docs/images/rtlkernel_lab/hw_emu_kernel_config.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/rtlkernel_lab/hw_emu_kernel_config.png -------------------------------------------------------------------------------- /docs/images/rtlkernel_lab/hw_emu_run_configuration.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/rtlkernel_lab/hw_emu_run_configuration.png -------------------------------------------------------------------------------- /docs/images/rtlkernel_lab/hw_emu_selection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/rtlkernel_lab/hw_emu_selection.png -------------------------------------------------------------------------------- /docs/images/rtlkernel_lab/hw_profile_host_data_transfer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/rtlkernel_lab/hw_profile_host_data_transfer.png -------------------------------------------------------------------------------- /docs/images/rtlkernel_lab/hw_profile_kernel_compute_units.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/rtlkernel_lab/hw_profile_kernel_compute_units.png -------------------------------------------------------------------------------- /docs/images/rtlkernel_lab/hw_profile_kernel_data_transfer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/rtlkernel_lab/hw_profile_kernel_data_transfer.png -------------------------------------------------------------------------------- /docs/images/rtlkernel_lab/hw_run_output.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/rtlkernel_lab/hw_run_output.png -------------------------------------------------------------------------------- /docs/images/rtlkernel_lab/kernelxo_refresh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/rtlkernel_lab/kernelxo_refresh.png -------------------------------------------------------------------------------- /docs/images/rtlkernel_lab/project_with_rtl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/rtlkernel_lab/project_with_rtl.png -------------------------------------------------------------------------------- /docs/images/rtlkernel_lab/rtl_schematic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/rtlkernel_lab/rtl_schematic.png -------------------------------------------------------------------------------- /docs/images/rtlkernel_lab/vivado_axi_blocks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/rtlkernel_lab/vivado_axi_blocks.png -------------------------------------------------------------------------------- /docs/images/rtlkernel_lab/vivado_control_block.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/rtlkernel_lab/vivado_control_block.png -------------------------------------------------------------------------------- /docs/images/rtlkernel_lab/vivado_elaborated_3_blocks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/rtlkernel_lab/vivado_elaborated_3_blocks.png -------------------------------------------------------------------------------- /docs/images/rtlkernel_lab/vivado_elaborated_sch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/rtlkernel_lab/vivado_elaborated_sch.png -------------------------------------------------------------------------------- /docs/images/rtlkernel_lab/vivado_hierarchy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/rtlkernel_lab/vivado_hierarchy.png -------------------------------------------------------------------------------- /docs/images/rtlkernel_lab/vivado_project.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/rtlkernel_lab/vivado_project.png -------------------------------------------------------------------------------- /docs/images/rtlkernel_lab/wizard_arguments.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/rtlkernel_lab/wizard_arguments.png -------------------------------------------------------------------------------- /docs/images/rtlkernel_lab/wizard_entry_page.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/rtlkernel_lab/wizard_entry_page.png -------------------------------------------------------------------------------- /docs/images/rtlkernel_lab/wizard_general_settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/rtlkernel_lab/wizard_general_settings.png -------------------------------------------------------------------------------- /docs/images/rtlkernel_lab/wizard_scalar_arg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/rtlkernel_lab/wizard_scalar_arg.png -------------------------------------------------------------------------------- /docs/images/rtlkernel_lab/wizard_streaming_int.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/rtlkernel_lab/wizard_streaming_int.png -------------------------------------------------------------------------------- /docs/images/rtlkernel_lab/wizard_summary.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/rtlkernel_lab/wizard_summary.png -------------------------------------------------------------------------------- /docs/images/streaming_lab/hardware_functions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/streaming_lab/hardware_functions.png -------------------------------------------------------------------------------- /docs/images/streaming_lab/hw_emu_timeline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/streaming_lab/hw_emu_timeline.png -------------------------------------------------------------------------------- /docs/images/streaming_lab/import_cfg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/streaming_lab/import_cfg.png -------------------------------------------------------------------------------- /docs/images/streaming_lab/kernels_connections.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/streaming_lab/kernels_connections.png -------------------------------------------------------------------------------- /docs/images/streaming_lab/linking.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/streaming_lab/linking.png -------------------------------------------------------------------------------- /docs/images/streaming_lab/program_args_sw_emu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/streaming_lab/program_args_sw_emu.png -------------------------------------------------------------------------------- /docs/images/streaming_lab/standard_fir.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/streaming_lab/standard_fir.png -------------------------------------------------------------------------------- /docs/images/streaming_lab/system_diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/streaming_lab/system_diagram.png -------------------------------------------------------------------------------- /docs/images/streaming_lab/transposed_direct_fir.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/streaming_lab/transposed_direct_fir.png -------------------------------------------------------------------------------- /docs/images/vitis_flow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/vitis_flow.png -------------------------------------------------------------------------------- /docs/images/zoom_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/docs/images/zoom_full.png -------------------------------------------------------------------------------- /docs/jekyll-theme-dinky.gemspec: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | Gem::Specification.new do |s| 4 | s.name = 'jekyll-theme-dinky' 5 | s.version = '0.1.1' 6 | s.license = 'CC0-1.0' 7 | s.authors = ['Diana Mounter', 'GitHub, Inc.'] 8 | s.email = ['opensource+jekyll-theme-dinky@github.com'] 9 | s.homepage = 'https://github.com/pages-themes/dinky' 10 | s.summary = 'Dinky is a Jekyll theme for GitHub Pages' 11 | 12 | s.files = `git ls-files -z`.split("\x0").select do |f| 13 | f.match(%r{^((_includes|_layouts|_sass|assets)/|(LICENSE|README)((\.(txt|md|markdown)|$)))}i) 14 | end 15 | 16 | s.platform = Gem::Platform::RUBY 17 | s.add_runtime_dependency 'jekyll', '> 3.5', '< 5.0' 18 | s.add_runtime_dependency 'jekyll-seo-tag', '~> 2.0' 19 | s.add_development_dependency 'html-proofer', '~> 3.0' 20 | s.add_development_dependency 'rubocop', '~> 0.50' 21 | s.add_development_dependency 'w3c_validators', '~> 1.3' 22 | end 23 | -------------------------------------------------------------------------------- /docs/presentations.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | --- 4 | 5 | # Presentations 6 | 7 | ## Vitis 8 | 9 | | Title | YouTube Link | PDF Link | 10 | | --- | --- | ---- | 11 | | Xilinx Platforms Introduction | [![alt text](assets/images/youtube.png) Xilinx Platforms Introduction](https://youtu.be/sb9qcgOcTDY) | [![alt text](images/pdf.png)](https://www.amd.com/content/dam/amd/en/documents/university/workshops/vitis/2019_2/amd_platforms_introduction.pdf) | 12 | | Intro to Vitis for Acceleration Platforms | [![alt text](assets/images/youtube.png) Intro to Vitis for Acceleration Platforms](https://youtu.be/t6CvKG0NzcM) | [![alt text](images/pdf.png)](https://www.amd.com/content/dam/amd/en/documents/university/workshops/vitis/2019_2/vitis_introduction.pdf) | 13 | | Vitis Tool Flow | [![alt text](assets/images/youtube.png) Vitis Tool Flow](https://youtu.be/ObfOSltWWEM) | [![alt text](images/pdf.png)](https://www.amd.com/content/dam/amd/en/documents/university/workshops/vitis/2019_2/vitis_toolflow.pdf) | 14 | | Open CL Execution Model | [![alt text](assets/images/youtube.png) Open CL Execution Model](https://youtu.be/z1Yk6jctJeY) | [![alt text](images/pdf.png)](https://www.amd.com/content/dam/amd/en/documents/university/workshops/vitis/2019_2/vitis_opencl_execution_model.pdf) | 15 | | Vitis Design Analysis | [![alt text](assets/images/youtube.png) Vitis Design Analysis](https://youtu.be/N941PGe9q_c) | [![alt text](images/pdf.png)](https://www.amd.com/content/dam/amd/en/documents/university/workshops/vitis/2019_2/vitis_design_analysis.pdf) | 16 | | Vitis Design Methodology | [![alt text](assets/images/youtube.png) Vitis Design Methodology](https://youtu.be/W-O66ASW_ls) | [![alt text](images/pdf.png)](https://www.amd.com/content/dam/amd/en/documents/university/workshops/vitis/2019_2/vitis_design_methodology.pdf) | 17 | | Host Code Optimization | [![alt text](assets/images/youtube.png) Host Code Optimization](https://youtu.be/6SqQ-tgMREg) | [![alt text](images/pdf.png)](https://www.amd.com/content/dam/amd/en/documents/university/workshops/vitis/2019_2/vitis_host_code_optimization.pdf) | 18 | | Kernel Optimization | [![alt text](assets/images/youtube.png) Kernel Optimization](https://youtu.be/BD7nXF0umpo) | [![alt text](images/pdf.png)](https://www.amd.com/content/dam/amd/en/documents/university/workshops/vitis/2019_2/vitis_kernel_optimizations.pdf) | 19 | | Vitis Accelerated Libraries | [![alt text](assets/images/youtube.png) Vitis Accelerated Libraries](https://youtu.be/bqttBaih_Ao) | [![alt text](images/pdf.png)](https://www.amd.com/content/dam/amd/en/documents/university/workshops/vitis/2019_2/vitis_accelerated_libraries.pdf) | 20 | | Vitis hardware debug | | [![alt text](images/pdf.png)](https://www.amd.com/content/dam/amd/en/documents/university/workshops/vitis/2019_2/vitis_hardware_debug.pdf)| 21 | | Vitis RTL kernels Accelerated Libraries | | [![alt text](images/pdf.png)](https://www.amd.com/content/dam/amd/en/documents/university/workshops/vitis/2019_2/vitis_rtl_kernels.pdf) | 22 | 23 | # PYNQ 24 | 25 | PYNQ introduction, and short lab companion videos that cover topics that are not addressed in the main presentation. We recommend watching the lab while doing the PYNQ labs. 26 | 27 | | Title | YouTube Link | 28 | | --- | --- | 29 | | PYNQ for Compute Acceleration | [![alt text](assets/images/youtube.png) PYNQ for Compute Acceleration](https://youtu.be/WgA_FgO_rAo) | 30 | | Lab: Using Multiple Devices | [![alt text](assets/images/youtube.png) Lab: Using Multiple Devices](https://youtu.be/tk2XDW-Hpco)| 31 | | Lab: Hardware Emulation | [![alt text](assets/images/youtube.png) Lab: Hardware Emulation](https://youtu.be/ylVEo0d83iM)| 32 | | Lab: Packaging Your Designs | [![alt text](assets/images/youtube.png) Lab: Packaging Your Designs](https://youtu.be/S2oSliWHpsA)| 33 | 34 | ## Overview of the Vitis flow 35 | 36 | ![alt tag](./images/vitis_flow.png) 37 | 38 | 39 | 1. Vitis is the development environment used to create host applications and hardware accelerators. It includes host CPU and FPGA compilers as well as profiling and debugging tools 40 | 2. In Vitis, the host application can be written in C or C++ and uses the OpenCL API or the [XRT](https://github.com/Xilinx/XRT) (Xilinx Runtime Library) to interact with the accelerated hardware functions running on the FPGA. The accelerated hardware functions (also referred to as 'hardware kernels', or just 'kernels') can be written in C, C++, OpenCL or RTL 41 | 42 | --------------------------------------- 43 | -------------------------------------------------------------------------------- /docs/pynq_labs.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | --- 4 | 5 | # PYNQ for Compute Acceleration 6 | 7 | ## What is PYNQ? 8 | 9 | PYNQ is an open-source project from Xilinx© that makes it easier to use Xilinx platforms. 10 | 11 | Using the Python language and libraries, designers can exploit the benefits of programmable logic and microprocessors to build more capable and exciting electronic systems. 12 | 13 | PYNQ can be used with Zynq, Zynq UltraScale+, Zynq RFSoC, Alveo accelerator boards and AWS-F1 to create high performance applications with: 14 | 15 | - Parallel hardware execution 16 | - High frame-rate video processing 17 | - Hardware accelerated algorithms 18 | - Real-time signal processing 19 | - High bandwidth I/O 20 | - Low latency control 21 | 22 | [PYNQ for Compute Acceleration ![alt text](assets/images/youtube.png)](https://youtu.be/WgA_FgO_rAo) 23 | 24 | For more information visit [pynq.io](http://www.pynq.io/) or [ReadTheDocs](https://pynq.readthedocs.io/) 25 | 26 | ## Hands-on Labs with PYNQ 27 | 28 | Before starting the the PYNQ labs **open a new terminal** and source the AWS runtime 29 | 30 | ```sh 31 | cd ~ 32 | source ~/aws-fpga/vitis_runtime_setup.sh 33 | ``` 34 | 35 | The PYNQ for the Compute Acceleration labs are entirely run within a JupyterLab environment. For details on how to get started visit the [PYNQ Compute Acceleration Labs](https://pypi.org/project/pynq-compute-labs/) package on PyPI and follow the instructions in the project description. 36 | 37 | Note, you should **skip** *Installing the Runtime* section and start directly with *Installing Anaconda* section as you already installed the runtime, but make sure it is sourced. 38 | 39 | We recommend watching the short companion videos that cover topics that are not addressed on the main presentation while doing the labs. 40 | 41 | * [Using Multiple Devices ![alt text](assets/images/youtube.png)](https://youtu.be/tk2XDW-Hpco) 42 | 43 | * [Hardware Emulation ![alt text](assets/images/youtube.png)](https://youtu.be/ylVEo0d83iM) 44 | 45 | * [Packaging Your Designs ![alt text](assets/images/youtube.png)](https://youtu.be/S2oSliWHpsA) 46 | 47 | --------------------------------------- 48 | -------------------------------------------------------------------------------- /docs/report_issues.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | --- 4 | 5 | # Report an Issue 6 | 7 | This page covers the basics to report an issue either to your instructor or using the built-in GitHub Issues tracker 8 | 9 | When reporting an issue provide the following information. 10 | 11 | - A brief description of the issue and how to reproduce it 12 | 13 | - Section in lab or page you found the issue 14 | 15 | - How you are running the tutorial? Cloud (AWS) or on-premises 16 | 17 | - Screenshots or code snippets if appropriate 18 | - Check how to [create and highlight code](https://docs.github.com/en/github/writing-on-github/creating-and-highlighting-code-blocks) 19 | 20 | - Tools and OS versions if the issue is in a lab 21 | 22 | - `vitis -version` 23 | - `xbutil version` 24 | - `lsb_release -a` 25 | 26 | 27 | Report the issue to your instructor or open a [new issue](https://github.com/Xilinx/xup_compute_acceleration/issues). 28 | It is always a good idea to check previous issues to in case that it has been already resolved. 29 | 30 | --------------------------------------- 31 | -------------------------------------------------------------------------------- /docs/resources.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | --- 4 | 5 | # Additional Material 6 | 7 | 1. [Download Vitis Unified Software](https://www.xilinx.com/support/download/index.html/content/xilinx/en/downloadNav/vitis.html) 8 | 9 | 1. [Vitis Unified Software Documentation](https://docs.xilinx.com/v/u/en-US/ug1416-vitis-documentation) 10 | 11 | 1. [Vitis Community Forum](https://support.xilinx.com/s/topic/0TO2E000000YKYAWA4/vitis-acceleration-acceleration?language=en_US) 12 | 13 | 1. [Vitis Unified Software Platform Documentation: Application Acceleration Development](https://docs.xilinx.com/r/en-US/ug1393-vitis-application-acceleration) 14 | 15 | 1. Check out the Get Moving with Alveo articles, start here [Get Moving with Alveo: Acceleration Basics](https://developer.xilinx.com/en/articles/acceleration-basics.html), find the other articles in the series [here](https://developer.xilinx.com/en/articles.html) 16 | 17 | 1. Check out [Design Principles for Software Programmers](https://docs.xilinx.com/r/en-US/ug1399-vitis-hls/Design-Principles-for-Software-Programmers) 18 | 19 | 1. Check out [Designing Efficient Kernels](https://docs.xilinx.com/r/en-US/ug1399-vitis-hls/Designing-Efficient-Kernels) 20 | 21 | 1. [Adaptive Computing Developer YouTube channel](https://www.youtube.com/channel/UCkzIS3hJplxSbVRxRQJW4Ow) 22 | 23 | 1. [Parallel Programming for FPGAs Book](https://arxiv.org/pdf/1805.03648.pdf), by Ryan Kastner, Janarbek Matai, and Stephen Neuendorffer. [Source code on GitHub](https://github.com/KastnerRG/pp4fpgas) 24 | 25 | 1. [The ZYNQ Book](http://www.zynqbook.com/), the earlier chapters of the book cover basic concepts, such as pipeline and dataflow. 26 | 27 | 1. [Migrating from CUDA to Vitis](https://www.xilinx.com/developer/articles/migrating-from-cuda-to-vitis.html) 28 | 29 | 1. Xilinx Run Time ([XRT](https://github.com/Xilinx/XRT)) 30 | 31 | 1. [PYNQ Project](http://www.pynq.io/) 32 | 33 | 34 | ## Hands-on 35 | 36 | This list cover examples and tutorials hosted on [Xilinx GitHub](https://github.com/Xilinx) 37 | 38 | 1. [Vitis In Depth Tutorial](https://github.com/Xilinx/Vitis-In-Depth-Tutorial) 39 | 40 | 1. [Vitis AWS F1 Developer Labs](https://github.com/Xilinx/Vitis-AWS-F1-Developer-Labs) 41 | 42 | 1. [Vitis Tutorials](https://github.com/Xilinx/Vitis-Tutorials) 43 | 44 | 1. [Vitis Accel Examples](https://github.com/Xilinx/Vitis_Accel_Examples) 45 | 46 | 1. [Vitis AI Tutorials](https://github.com/Xilinx/Vitis-AI-Tutorials) 47 | 48 | ## Vitis HLS Migration 49 | 50 | Since Vitis 2020.1 Vitis HLS is the default high-level Synthesis tool, and Vivado HLS is deprecated in Vitis 2020.2. 51 | 52 | Please review the Vitis HLS migration guide [here](https://www.xilinx.com/html_docs/xilinx2020_2/vitis_doc/migrating_to_vitis_hls.html#orj1568775346815) 53 | 54 | ## Application Migration Between Alveo U200 and AWS F1 55 | 56 | To understand the differences between the AWS F1 and Alveo U200 platforms and how to migrate your application between these platforms, review [Alveo to AWS Migration guide](https://github.com/aws/aws-fpga/blob/master/Vitis/docs/Alveo_to_AWS_F1_Migration.md) 57 | 58 | --------------------------------------- 59 | 60 | -------------------------------------------------------------------------------- /docs/setup_aws.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | --- 4 | 5 | # Connecting to AWS 6 | 7 | To get started with AWS, you will need an Amazon account. You will also need AWS credit to run the tutorial. If you are a professor or a student, you may be eligible to free credit by registering with [AWS educate](https://aws.amazon.com/education/awseducate/). 8 | 9 | ## Set up an AWS instance 10 | 11 | Use [this guide](https://docs.aws.amazon.com/efs/latest/ug/gs-step-one-create-ec2-resources.html) to setup and AWS instance. Make sure to use the [FPGA Developer AMI version 1.9.0](https://aws.amazon.com/marketplace/pp/B06VVYBLZZ/ref=portal_asin_url) which includes Xilinx Vitis 2020.1 tools that this tutorial is based on. 12 | 13 | ### Login into the AWS and starting an F1 instance 14 | 15 | 1. Once you have an account, log in to the EC2 AWS Console: 16 | 17 | https://console.aws.amazon.com/ec2 18 | 19 | This should bring you to the EC2 dashboard (Elastic Compute). 20 | 21 | In the EC2 dashboard, select Launch Instance. From here you should be able to start your instance. 22 | 23 | ## Additional setup 24 | 25 | You may want to do some additional setup to allow you to VNC to your instance. You can also follow the instructions in [Setup XUP AWS Workshop](setup_xup_aws_workshop.md) to connect to your instance. 26 | 27 | ### VNC server setup 28 | 29 | When setting up an instance for the first time, you need to install vncserver software. 30 | 31 | #### Install VNC server 32 | In a terminal, execute the following commands 33 | 34 | ```sh 35 | sudo yum install -y tigervnc-server 36 | sudo yum groupinstall -y "Server with GUI" 37 | ``` 38 | 39 | When launching vncserver, you will be prompted to set up a password that you will need later. 40 | 41 | ### Start vncserver 42 | 43 | Each time you start an instance, you will need to start vncserver 44 | 45 | ```sh 46 | vncserver -geometry 1920x1080 47 | ``` 48 | 49 | 1. You can choose your preferred geometry (screen size) 50 | 51 | 1. You should see a status message in the terminal once *vncserver* has started. 52 | 53 | 1. Take note of the number after the “:” 54 | 55 | 1. In this case, 1. This is the port the VNC viewer will connect to on the VNC server and needs to be specified as a two digit number below: 01. 56 | 57 | 1. Connect to AWS instance from VNC viewer. 58 | 59 | 1. From VNC viewer, specify the IP address of your AWS instance, followed by the VNC port number (as identified above), in this case :1 60 | 61 | 1. When prompted, enter the VNC server password set up earlier. 62 | 63 | 1. You should then be connected to the AWS instance. 64 | 65 | 66 | ### Verify XRT and Vitis tools 67 | 68 | Open a terminal and verify that Xilinx Vitis tools have been preinstalled and are on the path: 69 | 70 | ```sh 71 | which vitis 72 | ``` 73 | 74 | Note that the XRT tools are installed (/opt/xilinx/xrt) but are not included on the path by default. 75 | 76 | ```sh 77 | sudo chmod 777 /opt/xilinx/xrt/setup.sh 78 | #Source XRT every time a new terminal is open 79 | echo "source /opt/xilinx/xrt/setup.sh" >> ~/.bashrc 80 | #Reload .bashrc in the current terminal 81 | source ~/.bashrc 82 | ``` 83 | 84 | ### Clone AWS-FPGA repository and set variables 85 | 86 | 1. Open a terminal 87 | 88 | 1. If you are using the Xilinx provided instances then execute the following to clone the *aws-fpga* repository and setup the Xilinx tools. `aws-fpga` includes the AWS F1 tools, Hardware Development Kit (HDK) and documentation 89 | 90 | ```sh 91 | cd ~ 92 | git clone https://github.com/aws/aws-fpga -b v1.4.21 93 | echo "export PLATFORM_REPO_PATHS=~/aws-fpga/Vitis/aws_platform/xilinx_aws-vu9p-f1_shell-v04261818_201920_2/" >> ~/.bashrc 94 | echo "source /opt/xilinx/xrt/setup.sh" >> ~/.bashrc 95 | echo "source $XILINX_VITIS/settings64.sh" >> ~/.bashrc 96 | git clone https://github.com/Xilinx/xup_compute_acceleration.git 97 | source ~/.bashrc 98 | source ~/aws-fpga/vitis_setup.sh 99 | source ~/aws-fpga/vitis_runtime_setup.sh 100 | ``` 101 | 102 | The previous commands will: 103 | - Clone the AWS F1 tools 104 | - Setup the platform directory 105 | - Clone this repository to get source code 106 | - Source XRT 107 | - Source AWS F1 tools 108 | 109 | 1. If you are using the AWSEducate instances then execute the following to clone the *xup\_compute\_acceleration* repository. No additional variables need to be set as the provided AMI has all necessary files including `aws-fpga` repository cloning, the AWS F1 tools, Hardware Development Kit (HDK) and documentation 110 | 111 | ```sh 112 | git clone https://github.com/Xilinx/xup_compute_acceleration.git 113 | ``` 114 | 115 | The previous command will: 116 | - Clone this repository to get source code and solutions 117 | 118 | For more details see: https://github.com/aws/aws-fpga/blob/master/Vitis/README.md 119 | 120 | --------------------------------------- 121 | -------------------------------------------------------------------------------- /docs/setup_local_computer.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | --- 4 | 5 | # Setup Vitis on your own computer 6 | 7 | To run (or build) these labs on your own computer, install Vitis. For non-commercial/academic use, Vitis licenses are free. 8 | 9 | [Download Vitis](https://www.xilinx.com/support/download/index.html/content/xilinx/en/downloadNav/vitis.html) and install the tools. Make sure you install the version targeted in this tutorial. 10 | 11 | [Download XRT and the U200 package](https://www.xilinx.com/products/boards-and-kits/alveo/u200.html#gettingStarted) for your computer, and install both packages. 12 | 13 | ## Setup the tools 14 | 15 | Add the following to your environment setup. 16 | 17 | ```sh 18 | source /opt/xilinx/xrt/setup.(c)sh 19 | source $XILINX_VITIS/settings64.(c)sh 20 | export PLATFORM_REPO_PATHS=$ALVEO_PLATFORM_INSTALLATION_DIRECTORY 21 | ``` 22 | 23 | --------------------------------------- 24 | -------------------------------------------------------------------------------- /solutions/debug_lab/debug_system.ide.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/solutions/debug_lab/debug_system.ide.zip -------------------------------------------------------------------------------- /solutions/graph_lab/21_09_08-015725_afi_id.txt: -------------------------------------------------------------------------------- 1 | { 2 | "FpgaImageId": "afi-0a29858743e9ea428", 3 | "FpgaImageGlobalId": "agfi-0935e554261ed5cdb" 4 | } 5 | -------------------------------------------------------------------------------- /solutions/graph_lab/21_09_08-015725_agfi_id.txt: -------------------------------------------------------------------------------- 1 | agfi-0935e554261ed5cdb -------------------------------------------------------------------------------- /solutions/graph_lab/data/data-csr-offset.mtx: -------------------------------------------------------------------------------- 1 | 93 93 2 | 0 3 | 5 4 | 10 5 | 15 6 | 20 7 | 25 8 | 30 9 | 35 10 | 40 11 | 45 12 | 50 13 | 55 14 | 60 15 | 65 16 | 70 17 | 75 18 | 80 19 | 87 20 | 94 21 | 101 22 | 108 23 | 115 24 | 122 25 | 129 26 | 136 27 | 143 28 | 150 29 | 157 30 | 164 31 | 171 32 | 178 33 | 185 34 | 192 35 | 200 36 | 209 37 | 218 38 | 226 39 | 234 40 | 243 41 | 252 42 | 260 43 | 268 44 | 277 45 | 286 46 | 294 47 | 302 48 | 311 49 | 320 50 | 328 51 | 338 52 | 348 53 | 358 54 | 368 55 | 378 56 | 388 57 | 398 58 | 408 59 | 419 60 | 430 61 | 441 62 | 452 63 | 461 64 | 470 65 | 479 66 | 488 67 | 496 68 | 504 69 | 512 70 | 520 71 | 528 72 | 536 73 | 544 74 | 552 75 | 563 76 | 574 77 | 585 78 | 594 79 | 603 80 | 614 81 | 625 82 | 636 83 | 648 84 | 660 85 | 672 86 | 684 87 | 696 88 | 708 89 | 720 90 | 732 91 | 742 92 | 752 93 | 762 94 | 772 95 | 785 96 | -------------------------------------------------------------------------------- /solutions/graph_lab/data/data-golden.sssp.mtx: -------------------------------------------------------------------------------- 1 | Vertex_ID,Distance,Pred 2 | 18,3,49 3 | 41,3,69 4 | 77,2,83 5 | 21,3,61 6 | 2,4,17 7 | 82,1,93 8 | 69,2,89 9 | 85,1,93 10 | 81,1,93 11 | 63,2,85 12 | 22,3,51 13 | 40,3,68 14 | 57,2,81 15 | 33,3,49 16 | 36,3,58 17 | 16,4,31 18 | 89,1,93 19 | 90,1,93 20 | 4,4,18 21 | 88,1,93 22 | 25,3,63 23 | 79,2,85 24 | 52,2,85 25 | 60,2,83 26 | 46,3,56 27 | 58,2,81 28 | 32,3,63 29 | 83,1,93 30 | 27,3,54 31 | 53,2,88 32 | 68,2,82 33 | 15,4,27 34 | 14,4,26 35 | 84,1,93 36 | 49,2,88 37 | 45,3,77 38 | 61,2,85 39 | 72,2,84 40 | 76,2,82 41 | 56,2,85 42 | 34,3,49 43 | 44,3,76 44 | 37,3,51 45 | 19,3,62 46 | 92,1,93 47 | 7,4,20 48 | 64,2,88 49 | 23,3,61 50 | 87,1,93 51 | 12,4,25 52 | 91,1,93 53 | 70,2,90 54 | 78,2,89 55 | 42,3,69 56 | 47,3,56 57 | 66,2,81 58 | 20,3,64 59 | 80,2,90 60 | 71,2,84 61 | 59,2,82 62 | 30,3,62 63 | 5,4,19 64 | 11,4,23 65 | 38,3,51 66 | 54,2,86 67 | 93,0,93 68 | 62,2,87 69 | 75,2,81 70 | 24,3,63 71 | 43,3,53 72 | 74,2,81 73 | 17,3,63 74 | 8,4,21 75 | 6,4,22 76 | 86,1,93 77 | 67,2,82 78 | 1,4,17 79 | 39,3,51 80 | 26,3,53 81 | 50,2,86 82 | 9,4,21 83 | 28,3,64 84 | 13,4,25 85 | 55,2,87 86 | 65,2,81 87 | 51,2,87 88 | 48,3,56 89 | 3,4,18 90 | 31,3,56 91 | 29,3,61 92 | 73,2,81 93 | 10,4,22 94 | 35,3,49 95 | -------------------------------------------------------------------------------- /solutions/graph_lab/host.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/solutions/graph_lab/host.exe -------------------------------------------------------------------------------- /solutions/graph_lab/shortestPath_top.awsxclbin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/solutions/graph_lab/shortestPath_top.awsxclbin -------------------------------------------------------------------------------- /solutions/graph_lab/xrt.ini: -------------------------------------------------------------------------------- 1 | [Debug] 2 | opencl_summary=true 3 | power_profile=false 4 | opencl_trace=true 5 | lop_trace=false 6 | xrt_trace=false 7 | data_transfer_trace=coarse 8 | stall_trace=off 9 | app_debug=true 10 | [Emulation] 11 | debug_mode=gui 12 | 13 | -------------------------------------------------------------------------------- /solutions/optimization_lab/21_08_03-022222_afi_id.txt: -------------------------------------------------------------------------------- 1 | { 2 | "FpgaImageId": "afi-0a9ab3da42703f157", 3 | "FpgaImageGlobalId": "agfi-0b8f600efd81ed4d8" 4 | } 5 | -------------------------------------------------------------------------------- /solutions/optimization_lab/21_08_03-022222_agfi_id.txt: -------------------------------------------------------------------------------- 1 | agfi-0b8f600efd81ed4d8 -------------------------------------------------------------------------------- /solutions/optimization_lab/binary_container_1.awsxclbin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/solutions/optimization_lab/binary_container_1.awsxclbin -------------------------------------------------------------------------------- /solutions/optimization_lab/optimization_lab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/solutions/optimization_lab/optimization_lab -------------------------------------------------------------------------------- /solutions/optimization_lab/xrt.ini: -------------------------------------------------------------------------------- 1 | [Debug] 2 | opencl_summary=true 3 | power_profile=false 4 | opencl_trace=true 5 | lop_trace=false 6 | xrt_trace=false 7 | data_transfer_trace=coarse 8 | stall_trace=off 9 | app_debug=true 10 | 11 | -------------------------------------------------------------------------------- /solutions/rtlkernel_lab/21_07_20-220502_afi_id.txt: -------------------------------------------------------------------------------- 1 | { 2 | "FpgaImageId": "afi-0368bb9ddb13f9f5d", 3 | "FpgaImageGlobalId": "agfi-03d199027f291ea0b" 4 | } 5 | -------------------------------------------------------------------------------- /solutions/rtlkernel_lab/21_07_20-220502_agfi_id.txt: -------------------------------------------------------------------------------- 1 | agfi-03d199027f291ea0b -------------------------------------------------------------------------------- /solutions/rtlkernel_lab/binary_container_1.awsxclbin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/solutions/rtlkernel_lab/binary_container_1.awsxclbin -------------------------------------------------------------------------------- /solutions/rtlkernel_lab/rtl_kernel: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/solutions/rtlkernel_lab/rtl_kernel -------------------------------------------------------------------------------- /solutions/rtlkernel_lab/xrt.ini: -------------------------------------------------------------------------------- 1 | [Debug] 2 | opencl_summary=true 3 | power_profile=false 4 | opencl_trace=true 5 | lop_trace=false 6 | xrt_trace=false 7 | data_transfer_trace=coarse 8 | stall_trace=off 9 | app_debug=true 10 | 11 | -------------------------------------------------------------------------------- /solutions/streaming_lab/21_07_19-211759_afi_id.txt: -------------------------------------------------------------------------------- 1 | { 2 | "FpgaImageId": "afi-0160968442facc59b", 3 | "FpgaImageGlobalId": "agfi-09eca9b2ee9002da0" 4 | } 5 | -------------------------------------------------------------------------------- /solutions/streaming_lab/21_07_19-211759_agfi_id.txt: -------------------------------------------------------------------------------- 1 | agfi-09eca9b2ee9002da0 -------------------------------------------------------------------------------- /solutions/streaming_lab/binary_container_1.awsxclbin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/solutions/streaming_lab/binary_container_1.awsxclbin -------------------------------------------------------------------------------- /solutions/vision_lab/21_07_22-215100_afi_id.txt: -------------------------------------------------------------------------------- 1 | { 2 | "FpgaImageId": "afi-0609503124177e0ce", 3 | "FpgaImageGlobalId": "agfi-0212dc439b22e9889" 4 | } 5 | -------------------------------------------------------------------------------- /solutions/vision_lab/21_07_22-215100_agfi_id.txt: -------------------------------------------------------------------------------- 1 | agfi-0212dc439b22e9889 -------------------------------------------------------------------------------- /solutions/vision_lab/src/data/README.md: -------------------------------------------------------------------------------- 1 | # Image License 2 | 3 | The images in this folder have a [Pixabay License](https://pixabay.com/service/license/) 4 | 5 | The original image was downloaded from [here](https://pixabay.com/photos/nose-doctor-fish-fish-aquarium-zoo-2206103/) 6 | 7 | --------------------------------------- 8 |

Copyright© 2020 Xilinx

-------------------------------------------------------------------------------- /solutions/vision_lab/src/data/fish_wallpaper.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/solutions/vision_lab/src/data/fish_wallpaper.jpg -------------------------------------------------------------------------------- /solutions/vision_lab/src/data/fish_wallpaper_small.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/solutions/vision_lab/src/data/fish_wallpaper_small.jpg -------------------------------------------------------------------------------- /solutions/vision_lab/vision_example.awsxclbin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/solutions/vision_lab/vision_example.awsxclbin -------------------------------------------------------------------------------- /solutions/vitis_intro_lab/21_08_02-195528_afi_id.txt: -------------------------------------------------------------------------------- 1 | { 2 | "FpgaImageId": "afi-06ed13aa766b43d90", 3 | "FpgaImageGlobalId": "agfi-0b7756c19a2fe4c13" 4 | } 5 | -------------------------------------------------------------------------------- /solutions/vitis_intro_lab/21_08_02-195528_agfi_id.txt: -------------------------------------------------------------------------------- 1 | agfi-0b7756c19a2fe4c13 -------------------------------------------------------------------------------- /solutions/vitis_intro_lab/binary_container_1.awsxclbin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/solutions/vitis_intro_lab/binary_container_1.awsxclbin -------------------------------------------------------------------------------- /solutions/vitis_intro_lab/xrt.ini: -------------------------------------------------------------------------------- 1 | [Debug] 2 | opencl_summary=true 3 | power_profile=false 4 | opencl_trace=true 5 | lop_trace=false 6 | xrt_trace=false 7 | data_transfer_trace=coarse 8 | stall_trace=off 9 | app_debug=true 10 | 11 | -------------------------------------------------------------------------------- /sources/common/xcl2.cpp: -------------------------------------------------------------------------------- 1 | /********** 2 | Copyright (c) 2020, Xilinx, Inc. 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without modification, 6 | are permitted provided that the following conditions are met: 7 | 8 | 1. Redistributions of source code must retain the above copyright notice, 9 | this list of conditions and the following disclaimer. 10 | 11 | 2. Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | 15 | 3. Neither the name of the copyright holder nor the names of its contributors 16 | may be used to endorse or promote products derived from this software 17 | without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 20 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 21 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | ARE DISCLAIMED. 23 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 24 | INDIRECT, 25 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | LIMITED TO, 27 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 28 | BUSINESS INTERRUPTION) 29 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30 | LIABILITY, 31 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 32 | THIS SOFTWARE, 33 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | **********/ 35 | 36 | #include "xcl2.hpp" 37 | #include 38 | #include 39 | #if defined(_WINDOWS) 40 | #include 41 | #else 42 | #include 43 | #endif 44 | 45 | namespace xcl { 46 | std::vector get_devices(const std::string &vendor_name) { 47 | size_t i; 48 | cl_int err; 49 | std::vector platforms; 50 | OCL_CHECK(err, err = cl::Platform::get(&platforms)); 51 | cl::Platform platform; 52 | for (i = 0; i < platforms.size(); i++) { 53 | platform = platforms[i]; 54 | OCL_CHECK(err, std::string platformName = 55 | platform.getInfo(&err)); 56 | if (platformName == vendor_name) { 57 | std::cout << "Found Platform" << std::endl; 58 | std::cout << "Platform Name: " << platformName.c_str() << std::endl; 59 | break; 60 | } 61 | } 62 | if (i == platforms.size()) { 63 | std::cout << "Error: Failed to find Xilinx platform" << std::endl; 64 | exit(EXIT_FAILURE); 65 | } 66 | // Getting ACCELERATOR Devices and selecting 1st such device 67 | std::vector devices; 68 | OCL_CHECK(err, 69 | err = platform.getDevices(CL_DEVICE_TYPE_ACCELERATOR, &devices)); 70 | return devices; 71 | } 72 | 73 | std::vector get_xil_devices() { return get_devices("Xilinx"); } 74 | 75 | std::vector 76 | read_binary_file(const std::string &xclbin_file_name) { 77 | std::cout << "INFO: Reading " << xclbin_file_name << std::endl; 78 | FILE *fp; 79 | if ((fp = fopen(xclbin_file_name.c_str(), "r")) == NULL) { 80 | printf("ERROR: %s xclbin not available please build\n", 81 | xclbin_file_name.c_str()); 82 | exit(EXIT_FAILURE); 83 | } 84 | // Loading XCL Bin into char buffer 85 | std::cout << "Loading: '" << xclbin_file_name.c_str() << "'\n"; 86 | std::ifstream bin_file(xclbin_file_name.c_str(), std::ifstream::binary); 87 | bin_file.seekg(0, bin_file.end); 88 | auto nb = bin_file.tellg(); 89 | bin_file.seekg(0, bin_file.beg); 90 | std::vector buf; 91 | buf.resize(nb); 92 | bin_file.read(reinterpret_cast(buf.data()), nb); 93 | return buf; 94 | } 95 | 96 | bool is_emulation() { 97 | bool ret = false; 98 | char *xcl_mode = getenv("XCL_EMULATION_MODE"); 99 | if (xcl_mode != NULL) { 100 | ret = true; 101 | } 102 | return ret; 103 | } 104 | 105 | bool is_hw_emulation() { 106 | bool ret = false; 107 | char *xcl_mode = getenv("XCL_EMULATION_MODE"); 108 | if ((xcl_mode != NULL) && !strcmp(xcl_mode, "hw_emu")) { 109 | ret = true; 110 | } 111 | return ret; 112 | } 113 | 114 | bool is_xpr_device(const char *device_name) { 115 | const char *output = strstr(device_name, "xpr"); 116 | 117 | if (output == NULL) { 118 | return false; 119 | } else { 120 | return true; 121 | } 122 | } 123 | }; // namespace xcl -------------------------------------------------------------------------------- /sources/common/xcl2.hpp: -------------------------------------------------------------------------------- 1 | /********** 2 | Copyright (c) 2018, Xilinx, Inc. 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without modification, 6 | are permitted provided that the following conditions are met: 7 | 8 | 1. Redistributions of source code must retain the above copyright notice, 9 | this list of conditions and the following disclaimer. 10 | 11 | 2. Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | 15 | 3. Neither the name of the copyright holder nor the names of its contributors 16 | may be used to endorse or promote products derived from this software 17 | without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 20 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 21 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | ARE DISCLAIMED. 23 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 24 | INDIRECT, 25 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | LIMITED TO, 27 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 28 | BUSINESS INTERRUPTION) 29 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30 | LIABILITY, 31 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 32 | THIS SOFTWARE, 33 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | **********/ 35 | 36 | #pragma once 37 | 38 | #define CL_HPP_CL_1_2_DEFAULT_BUILD 39 | #define CL_HPP_TARGET_OPENCL_VERSION 120 40 | #define CL_HPP_MINIMUM_OPENCL_VERSION 120 41 | #define CL_HPP_ENABLE_PROGRAM_CONSTRUCTION_FROM_ARRAY_COMPATIBILITY 1 42 | #define CL_USE_DEPRECATED_OPENCL_1_2_APIS 43 | 44 | // OCL_CHECK doesn't work if call has templatized function call 45 | #define OCL_CHECK(error, call) \ 46 | call; \ 47 | if (error != CL_SUCCESS) { \ 48 | printf("%s:%d Error calling " #call ", error code is: %d\n", __FILE__, \ 49 | __LINE__, error); \ 50 | exit(EXIT_FAILURE); \ 51 | } 52 | 53 | #include 54 | #include 55 | #include 56 | #include 57 | // When creating a buffer with user pointer (CL_MEM_USE_HOST_PTR), under the 58 | // hood 59 | // User ptr is used if and only if it is properly aligned (page aligned). When 60 | // not 61 | // aligned, runtime has no choice but to create its own host side buffer that 62 | // backs 63 | // user ptr. This in turn implies that all operations that move data to and from 64 | // device incur an extra memcpy to move data to/from runtime's own host buffer 65 | // from/to user pointer. So it is recommended to use this allocator if user wish 66 | // to 67 | // Create Buffer/Memory Object with CL_MEM_USE_HOST_PTR to align user buffer to 68 | // the 69 | // page boundary. It will ensure that user buffer will be used when user create 70 | // Buffer/Mem Object with CL_MEM_USE_HOST_PTR. 71 | template struct aligned_allocator { 72 | using value_type = T; 73 | 74 | aligned_allocator() {} 75 | 76 | aligned_allocator(const aligned_allocator &) {} 77 | 78 | template aligned_allocator(const aligned_allocator &) {} 79 | 80 | T *allocate(std::size_t num) { 81 | void *ptr = nullptr; 82 | 83 | #if defined(_WINDOWS) 84 | { 85 | ptr = _aligned_malloc(num * sizeof(T), 4096); 86 | if (ptr == NULL) { 87 | std::cout << "Failed to allocate memory" << std::endl; 88 | exit(EXIT_FAILURE); 89 | } 90 | } 91 | #else 92 | { 93 | if (posix_memalign(&ptr, 4096, num * sizeof(T))) 94 | throw std::bad_alloc(); 95 | } 96 | #endif 97 | return reinterpret_cast(ptr); 98 | } 99 | void deallocate(T *p, std::size_t num) { 100 | #if defined(_WINDOWS) 101 | _aligned_free(p); 102 | #else 103 | free(p); 104 | #endif 105 | } 106 | }; 107 | 108 | namespace xcl { 109 | std::vector get_xil_devices(); 110 | std::vector get_devices(const std::string &vendor_name); 111 | std::vector 112 | read_binary_file(const std::string &xclbin_file_name); 113 | bool is_emulation(); 114 | bool is_hw_emulation(); 115 | bool is_xpr_device(const char *device_name); 116 | class Stream { 117 | public: 118 | static decltype(&clCreateStream) createStream; 119 | static decltype(&clReleaseStream) releaseStream; 120 | static decltype(&clReadStream) readStream; 121 | static decltype(&clWriteStream) writeStream; 122 | static decltype(&clPollStreams) pollStreams; 123 | static void init(const cl_platform_id &platform) { 124 | void *bar = 125 | clGetExtensionFunctionAddressForPlatform(platform, "clCreateStream"); 126 | createStream = (decltype(&clCreateStream))bar; 127 | bar = clGetExtensionFunctionAddressForPlatform(platform, "clReleaseStream"); 128 | releaseStream = (decltype(&clReleaseStream))bar; 129 | bar = clGetExtensionFunctionAddressForPlatform(platform, "clReadStream"); 130 | readStream = (decltype(&clReadStream))bar; 131 | bar = clGetExtensionFunctionAddressForPlatform(platform, "clWriteStream"); 132 | writeStream = (decltype(&clWriteStream))bar; 133 | bar = clGetExtensionFunctionAddressForPlatform(platform, "clPollStreams"); 134 | pollStreams = (decltype(&clPollStreams))bar; 135 | } 136 | }; 137 | class P2P { 138 | public: 139 | static decltype(&xclGetMemObjectFd) getMemObjectFd; 140 | static decltype(&xclGetMemObjectFromFd) getMemObjectFromFd; 141 | static void init(const cl_platform_id &platform) { 142 | void *bar = 143 | clGetExtensionFunctionAddressForPlatform(platform, "xclGetMemObjectFd"); 144 | getMemObjectFd = (decltype(&xclGetMemObjectFd))bar; 145 | bar = clGetExtensionFunctionAddressForPlatform(platform, "xclGetMemObjectFromFd"); 146 | getMemObjectFromFd = (decltype(&xclGetMemObjectFromFd))bar; 147 | } 148 | }; 149 | class Ext { 150 | public: 151 | static decltype(&xclGetComputeUnitInfo) getComputeUnitInfo; 152 | static void init(const cl_platform_id &platform) { 153 | void *bar = 154 | clGetExtensionFunctionAddressForPlatform(platform, "xclGetComputeUnitInfo"); 155 | getComputeUnitInfo = (decltype(&xclGetComputeUnitInfo))bar; 156 | } 157 | }; 158 | } -------------------------------------------------------------------------------- /sources/graph_lab/graph.patch: -------------------------------------------------------------------------------- 1 | --- Makefile 2 | +++ Makefile 3 | @@ -43,7 +43,7 @@ help:: 4 | TARGET ?= sw_emu 5 | 6 | # ################### Setting up default value of DEVICE ############################## 7 | -DEVICE ?= xilinx_u50_gen3x16_xdma_201920_3 8 | +DEVICE ?= xilinx_aws-vu9p-f1_shell-v04261818_201920_2 9 | 10 | # ###################### Setting up default value of HOST_ARCH ####################### 11 | HOST_ARCH ?= x86 12 | @@ -53,11 +53,6 @@ ifeq ($(findstring zc, $(DEVICE)), zc) 13 | $(error [ERROR]: This project is not supported for $(DEVICE).) 14 | endif 15 | 16 | -# #################### Checking if DEVICE in whitelist ############################ 17 | -ifneq ($(findstring u50, $(DEVICE)), u50) 18 | -$(warning [WARNING]: This project has not been tested for $(DEVICE). It may or may not work.) 19 | -endif 20 | - 21 | # ######################## Setting up Project Variables ################################# 22 | MK_PATH := $(abspath $(lastword $(MAKEFILE_LIST))) 23 | XF_PROJ_ROOT ?= $(shell bash -c 'export MK_PATH=$(MK_PATH); echo $${MK_PATH%/L2/*}') 24 | @@ -107,9 +102,6 @@ CXXFLAGS += -I$(CUR_DIR)/src/ 25 | ifeq ($(HOST_ARCH), x86) 26 | LDFLAGS += -L$(XILINX_HLS)/lnx64/tools/fpo_v7_0 -Wl,--as-needed -lgmp -lmpfr -lIp_floating_point_v7_0_bitacc_cmodel 27 | endif 28 | -ifneq (,$(shell echo $(XPLATFORM) | awk '/u50/')) 29 | -CXXFLAGS += -D USE_HBM 30 | -endif 31 | 32 | # ################### Setting package and image directory ####################### 33 | 34 | @@ -121,9 +113,7 @@ HOST_ARGS := -xclbin $(BUILD_DIR)/shortestPath_top.xclbin -o $(XFLIB_DIR)/L2/te 35 | VPP_FLAGS += -t $(TARGET) --platform $(XPLATFORM) --save-temps --optimize 2 36 | VPP_FLAGS += --hls.jobs 8 37 | VPP_LDFLAGS += --vivado.synth.jobs 8 --vivado.impl.jobs 8 38 | -ifneq (,$(shell echo $(XPLATFORM) | awk '/u50/')) 39 | VPP_FLAGS += --config $(CUR_DIR)/conn_u50.cfg 40 | -endif 41 | 42 | VPP_FLAGS += -I$(XFLIB_DIR)/L2/include 43 | VPP_FLAGS += -I$(XFLIB_DIR)/../database/L1/include/hw 44 | 45 | --- conn_u50.cfg 46 | +++ conn_u50.cfg 47 | @@ -1,9 +1,9 @@ 48 | [connectivity] 49 | -sp=shortestPath_top.m_axi_gmem0:HBM[0] 50 | -sp=shortestPath_top.m_axi_gmem1:HBM[2] 51 | -sp=shortestPath_top.m_axi_gmem2:HBM[4] 52 | -sp=shortestPath_top.m_axi_gmem3:HBM[0] 53 | -sp=shortestPath_top.m_axi_gmem4:HBM[2] 54 | -sp=shortestPath_top.m_axi_gmem5:HBM[4] 55 | -slr=shortestPath_top:SLR0 56 | +sp=shortestPath_top.m_axi_gmem0:DDR[0] 57 | +sp=shortestPath_top.m_axi_gmem1:DDR[0] 58 | +sp=shortestPath_top.m_axi_gmem2:DDR[0] 59 | +sp=shortestPath_top.m_axi_gmem3:DDR[0] 60 | +sp=shortestPath_top.m_axi_gmem4:DDR[0] 61 | +sp=shortestPath_top.m_axi_gmem5:DDR[0] 62 | +slr=shortestPath_top:SLR1 63 | nk=shortestPath_top:1:shortestPath_top 64 | 65 | --- utils.mk 66 | +++ utils.mk 67 | @@ -19,7 +19,7 @@ 68 | #+------------------------------------------------------------------------------- 69 | 70 | REPORT := no 71 | -PROFILE := no 72 | +PROFILE := yes 73 | DEBUG := no 74 | 75 | #'estimate' for estimate report generation 76 | @@ -31,7 +31,7 @@ endif 77 | 78 | #Generates profile summary report 79 | ifeq ($(PROFILE), yes) 80 | -VPP_LDFLAGS += --profile_kernel data:all:all:all 81 | +VPP_LDFLAGS += -g --profile_kernel data:all:all:all 82 | endif 83 | 84 | #Generates debug summary report 85 | @@ -148,7 +148,7 @@ ifeq ($(filter $(TARGET),sw_emu hw_emu hw),) 86 | $(error TARGET is not sw_emu, hw_emu or hw) 87 | endif 88 | 89 | -ifneq (,$(wildcard $(DEVICE))) 90 | +ifeq (,$(wildcard $(DEVICE))) 91 | # Use DEVICE as a file path 92 | XPLATFORM := $(DEVICE) 93 | else 94 | -------------------------------------------------------------------------------- /sources/graph_lab/xrt.ini: -------------------------------------------------------------------------------- 1 | [Debug] 2 | opencl_summary=true 3 | power_profile=false 4 | opencl_trace=true 5 | lop_trace=false 6 | xrt_trace=false 7 | data_transfer_trace=coarse 8 | stall_trace=off 9 | app_debug=true 10 | [Emulation] 11 | debug_mode=gui -------------------------------------------------------------------------------- /sources/streaming_lab/krnl_fir.cpp: -------------------------------------------------------------------------------- 1 | /********** 2 | Copyright (c) 2020, Xilinx, Inc. 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without modification, 6 | are permitted provided that the following conditions are met: 7 | 8 | 1. Redistributions of source code must retain the above copyright notice, 9 | this list of conditions and the following disclaimer. 10 | 11 | 2. Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | 15 | 3. Neither the name of the copyright holder nor the names of its contributors 16 | may be used to endorse or promote products derived from this software 17 | without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 20 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 21 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 22 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 23 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 24 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | **********/ 29 | 30 | /* 31 | * x(k) -------------------------------------- ------------ 32 | * | | | | 33 | * | | | | 34 | * c(0)->(x) c(1)->(x) c(2)->(x) ... c(n-1)->(x) 35 | * | | | | 36 | * | | | | 37 | * y(k) <--(+)<--|z-1|<--(+)<--|z-1|<--(+)<-- <--|z-1|<--- 38 | * 39 | * 40 | * prod 0 1 2 n-1 41 | * state 0 1 n-2 42 | * 43 | * 44 | * 45 | * 46 | * Sampling frequency 44,100 Hz 47 | * 48 | * Bands: 49 | * ------------------------------------------- 50 | * | from | to | gain | ripple/att| 51 | * |----------|-----------|------|-----------| 52 | * | 0 Hz | 500 Hz | 0 | -40 dB | 53 | * | 1,500 Hz | 5,500 Hz | 1 | 0.9 dB | 54 | * | 6,500 Hz | 22,050 Hz | 0 | -40dB | 55 | * ------------------------------------------- 56 | */ 57 | 58 | #include "ap_axi_sdata.h" 59 | #include "ap_int.h" 60 | #include "hls_stream.h" 61 | 62 | typedef ap_axis<32, 0, 0, 0> axis; 63 | 64 | #define TAP_NUM 73 65 | 66 | ap_int<16> coe[TAP_NUM] = { 67 | -137, -73, 139, 210, 384, 339, 263, 69, -15, 0, 177, 352, 424, 275, 68 | -20, -318, -420, -273, 21, 211, 86, -387, -991, -1380, -1294, -772, 69 | -175, -6, -582, -1761, -2918, -3223, -2086, 449, 3620, 6243, 7258, 70 | 6243, 3620, 449, -2086, -3223, -2918, -1761, -582, -6, -175, -772, 71 | -1294, -1380, -991, -387, 86, 211, 21, -273, -420, -318, -20, 275, 72 | 424, 352, 177, 0, -15, 69, 263, 339, 384, 210, 139, -73, -137 73 | }; 74 | 75 | 76 | /** 77 | * @brief FIR filter. Implemented using the transposed form 78 | * The coefficients are static. 79 | * 80 | * NOTE: This is not the most efficient way to implement a FIR filter 81 | * on an Xilinx FPGA. However, it is the simples version that reduces 82 | * the long critical path to a multiply accumulate. 83 | * For efficient implementation review UG073 and PG149 84 | * 85 | * @param[in] x Sample (k) 86 | * @param[out] y Output (k) 87 | */ 88 | 89 | extern "C" { 90 | void krnl_fir(hls::stream &x, hls::stream &y) { 91 | #pragma HLS PIPELINE II=1 92 | #pragma HLS INTERFACE ap_ctrl_none port=return 93 | 94 | ap_int<48> prod[TAP_NUM]; 95 | #pragma HLS ARRAY_PARTITION variable=prod dim=1 complete 96 | static ap_int<48> state[TAP_NUM-1] = { 97 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 98 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 99 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; 100 | #pragma HLS ARRAY_PARTITION variable=state dim=1 complete 101 | 102 | #ifndef __SYNTHESIS__ 103 | while(1) 104 | #else 105 | if (!x.empty()) 106 | #endif 107 | { 108 | axis x_k = x.read(); 109 | /*Multiply input x_k with coefficients*/ 110 | for (unsigned int i = 0; i < TAP_NUM; i++){ 111 | prod[i] = coe[i] * x_k.data; 112 | } 113 | 114 | /*Compute output*/ 115 | ap_int<48> y_k = prod[0] + state[0]; 116 | 117 | /*Compute addition and update the state. If the AXI4-Stream channel 118 | has tlast asserted reset the state*/ 119 | if(!x_k.last){ 120 | for (unsigned int i = 0; i < TAP_NUM-2; i++){ 121 | state[i] = state[i+1] + prod[i+1]; 122 | } 123 | state[TAP_NUM-2] = prod[TAP_NUM-1]; 124 | } 125 | else { 126 | for (unsigned int i = 0; i < TAP_NUM-1; i++){ 127 | state[i] = 0; 128 | } 129 | } 130 | 131 | /* generate output stream */ 132 | axis out; 133 | out.data = y_k(47,16); 134 | out.last = x_k.last; 135 | y.write(out); 136 | } 137 | } 138 | } -------------------------------------------------------------------------------- /sources/streaming_lab/krnl_mm2s.cpp: -------------------------------------------------------------------------------- 1 | /********** 2 | Copyright (c) 2020, Xilinx, Inc. 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without modification, 6 | are permitted provided that the following conditions are met: 7 | 8 | 1. Redistributions of source code must retain the above copyright notice, 9 | this list of conditions and the following disclaimer. 10 | 11 | 2. Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | 15 | 3. Neither the name of the copyright holder nor the names of its contributors 16 | may be used to endorse or promote products derived from this software 17 | without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 20 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 21 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | ARE DISCLAIMED. 23 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 24 | INDIRECT, 25 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | LIMITED TO, 27 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 28 | BUSINESS INTERRUPTION) 29 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30 | LIABILITY, 31 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 32 | THIS SOFTWARE, 33 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | **********/ 35 | 36 | 37 | /* */ 38 | 39 | #include "ap_axi_sdata.h" 40 | #include "ap_int.h" 41 | #include "hls_stream.h" 42 | 43 | #define DWIDTH 32 44 | 45 | typedef ap_axis axis; 46 | 47 | 48 | /** 49 | * @brief This is a data mover kernel which reads data from global memory(DDR/HBM) via 50 | * memory mapped interface and writes to a stream interface to another kernel 51 | * 52 | * @param[in] in Memory mapped interface 53 | * @param[out] m2s Output stream interface 54 | * @param[in] samples The number of samples (transactions) 55 | */ 56 | 57 | extern "C" { 58 | void krnl_mm2s(ap_uint *in, 59 | hls::stream &m2s, 60 | unsigned int samples 61 | ) { 62 | 63 | axis v; 64 | data_mover: 65 | // Auto-pipeline is going to apply pipeline to this loop 66 | for (unsigned int i = 0; i < samples; i++) { 67 | v.data = in[i]; 68 | // assert last when last piece of data 69 | v.last = (i == (samples-1)) ? 1 : 0; 70 | // Write to stream interface 71 | m2s.write(v); 72 | } 73 | } 74 | } -------------------------------------------------------------------------------- /sources/streaming_lab/krnl_s2mm.cpp: -------------------------------------------------------------------------------- 1 | /********** 2 | Copyright (c) 2020, Xilinx, Inc. 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without modification, 6 | are permitted provided that the following conditions are met: 7 | 8 | 1. Redistributions of source code must retain the above copyright notice, 9 | this list of conditions and the following disclaimer. 10 | 11 | 2. Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | 15 | 3. Neither the name of the copyright holder nor the names of its contributors 16 | may be used to endorse or promote products derived from this software 17 | without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 20 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 21 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | ARE DISCLAIMED. 23 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 24 | INDIRECT, 25 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | LIMITED TO, 27 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 28 | BUSINESS INTERRUPTION) 29 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30 | LIABILITY, 31 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 32 | THIS SOFTWARE, 33 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | **********/ 35 | 36 | 37 | /* */ 38 | 39 | #include "ap_axi_sdata.h" 40 | #include "ap_int.h" 41 | #include "hls_stream.h" 42 | 43 | #define DWIDTH 32 44 | 45 | typedef ap_axiu axis; 46 | 47 | 48 | /** 49 | * @brief This is a stream to memory mapped data mover kernel which takes input from a 50 | * stream and writes data to global memory via memory mapped interface 51 | * 52 | * @param[out] out Memory mapped interface 53 | * @param[in] s2m Input stream interface 54 | * @param[in] samples The number of samples (transactions) 55 | */ 56 | 57 | extern "C" { 58 | void krnl_s2mm(ap_uint *out, 59 | hls::stream &s2m, 60 | unsigned int samples 61 | ) { 62 | 63 | axis v; 64 | data_mover: 65 | // Auto-pipeline is going to apply pipeline to this loop 66 | for (unsigned int i = 0; i < samples; i++) { 67 | // Read from stream and write to memory 68 | v = s2m.read(); 69 | out[i] = v.data; 70 | } 71 | } 72 | } -------------------------------------------------------------------------------- /sources/streaming_lab/linking.cfg: -------------------------------------------------------------------------------- 1 | profile_kernel=data:krnl_mm2s:all:all 2 | profile_kernel=data:krnl_s2mm:all:all 3 | profile_kernel=data:krnl_mm2s:krnl_mm2s_1:in:all 4 | profile_kernel=data:krnl_s2mm:krnl_s2mm_1:out:all 5 | 6 | [connectivity] 7 | #Connect mm2s to fir input 8 | stream_connect=krnl_mm2s_1.m2s:krnl_fir_1.x 9 | 10 | #Connect fir to s2mm 11 | stream_connect=krnl_fir_1.y:krnl_s2mm_1.s2m 12 | 13 | # Assign SRL 14 | slr=krnl_mm2s_1:SLR1 15 | slr=krnl_s2mm_1:SLR1 16 | slr=krnl_fir_1:SLR1 17 | 18 | # Assign memory bank 19 | sp=krnl_mm2s_1.in:DDR[0] 20 | sp=krnl_s2mm_1.out:DDR[2] -------------------------------------------------------------------------------- /sources/streaming_lab/xcl2.cpp: -------------------------------------------------------------------------------- 1 | /********** 2 | Copyright (c) 2020, Xilinx, Inc. 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without modification, 6 | are permitted provided that the following conditions are met: 7 | 8 | 1. Redistributions of source code must retain the above copyright notice, 9 | this list of conditions and the following disclaimer. 10 | 11 | 2. Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | 15 | 3. Neither the name of the copyright holder nor the names of its contributors 16 | may be used to endorse or promote products derived from this software 17 | without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 20 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 21 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | ARE DISCLAIMED. 23 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 24 | INDIRECT, 25 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | LIMITED TO, 27 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 28 | BUSINESS INTERRUPTION) 29 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30 | LIABILITY, 31 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 32 | THIS SOFTWARE, 33 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | **********/ 35 | 36 | #include "xcl2.hpp" 37 | #include 38 | #include 39 | #if defined(_WINDOWS) 40 | #include 41 | #else 42 | #include 43 | #endif 44 | 45 | namespace xcl { 46 | std::vector get_devices(const std::string &vendor_name) { 47 | size_t i; 48 | cl_int err; 49 | std::vector platforms; 50 | OCL_CHECK(err, err = cl::Platform::get(&platforms)); 51 | cl::Platform platform; 52 | for (i = 0; i < platforms.size(); i++) { 53 | platform = platforms[i]; 54 | OCL_CHECK(err, std::string platformName = 55 | platform.getInfo(&err)); 56 | if (platformName == vendor_name) { 57 | std::cout << "Found Platform" << std::endl; 58 | std::cout << "Platform Name: " << platformName.c_str() << std::endl; 59 | break; 60 | } 61 | } 62 | if (i == platforms.size()) { 63 | std::cout << "Error: Failed to find Xilinx platform" << std::endl; 64 | exit(EXIT_FAILURE); 65 | } 66 | // Getting ACCELERATOR Devices and selecting 1st such device 67 | std::vector devices; 68 | OCL_CHECK(err, 69 | err = platform.getDevices(CL_DEVICE_TYPE_ACCELERATOR, &devices)); 70 | return devices; 71 | } 72 | 73 | std::vector get_xil_devices() { return get_devices("Xilinx"); } 74 | 75 | std::vector 76 | read_binary_file(const std::string &xclbin_file_name) { 77 | std::cout << "INFO: Reading " << xclbin_file_name << std::endl; 78 | FILE *fp; 79 | if ((fp = fopen(xclbin_file_name.c_str(), "r")) == NULL) { 80 | printf("ERROR: %s xclbin not available please build\n", 81 | xclbin_file_name.c_str()); 82 | exit(EXIT_FAILURE); 83 | } 84 | // Loading XCL Bin into char buffer 85 | std::cout << "Loading: '" << xclbin_file_name.c_str() << "'\n"; 86 | std::ifstream bin_file(xclbin_file_name.c_str(), std::ifstream::binary); 87 | bin_file.seekg(0, bin_file.end); 88 | auto nb = bin_file.tellg(); 89 | bin_file.seekg(0, bin_file.beg); 90 | std::vector buf; 91 | buf.resize(nb); 92 | bin_file.read(reinterpret_cast(buf.data()), nb); 93 | return buf; 94 | } 95 | 96 | bool is_emulation() { 97 | bool ret = false; 98 | char *xcl_mode = getenv("XCL_EMULATION_MODE"); 99 | if (xcl_mode != NULL) { 100 | ret = true; 101 | } 102 | return ret; 103 | } 104 | 105 | bool is_hw_emulation() { 106 | bool ret = false; 107 | char *xcl_mode = getenv("XCL_EMULATION_MODE"); 108 | if ((xcl_mode != NULL) && !strcmp(xcl_mode, "hw_emu")) { 109 | ret = true; 110 | } 111 | return ret; 112 | } 113 | 114 | bool is_xpr_device(const char *device_name) { 115 | const char *output = strstr(device_name, "xpr"); 116 | 117 | if (output == NULL) { 118 | return false; 119 | } else { 120 | return true; 121 | } 122 | } 123 | }; // namespace xcl -------------------------------------------------------------------------------- /sources/streaming_lab/xcl2.hpp: -------------------------------------------------------------------------------- 1 | /********** 2 | Copyright (c) 2018, Xilinx, Inc. 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without modification, 6 | are permitted provided that the following conditions are met: 7 | 8 | 1. Redistributions of source code must retain the above copyright notice, 9 | this list of conditions and the following disclaimer. 10 | 11 | 2. Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | 15 | 3. Neither the name of the copyright holder nor the names of its contributors 16 | may be used to endorse or promote products derived from this software 17 | without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 20 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 21 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | ARE DISCLAIMED. 23 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 24 | INDIRECT, 25 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | LIMITED TO, 27 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 28 | BUSINESS INTERRUPTION) 29 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30 | LIABILITY, 31 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 32 | THIS SOFTWARE, 33 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | **********/ 35 | 36 | #pragma once 37 | 38 | #define CL_HPP_CL_1_2_DEFAULT_BUILD 39 | #define CL_HPP_TARGET_OPENCL_VERSION 120 40 | #define CL_HPP_MINIMUM_OPENCL_VERSION 120 41 | #define CL_HPP_ENABLE_PROGRAM_CONSTRUCTION_FROM_ARRAY_COMPATIBILITY 1 42 | #define CL_USE_DEPRECATED_OPENCL_1_2_APIS 43 | 44 | // OCL_CHECK doesn't work if call has templatized function call 45 | #define OCL_CHECK(error, call) \ 46 | call; \ 47 | if (error != CL_SUCCESS) { \ 48 | printf("%s:%d Error calling " #call ", error code is: %d\n", __FILE__, \ 49 | __LINE__, error); \ 50 | exit(EXIT_FAILURE); \ 51 | } 52 | 53 | #include 54 | #include 55 | #include 56 | #include 57 | // When creating a buffer with user pointer (CL_MEM_USE_HOST_PTR), under the 58 | // hood 59 | // User ptr is used if and only if it is properly aligned (page aligned). When 60 | // not 61 | // aligned, runtime has no choice but to create its own host side buffer that 62 | // backs 63 | // user ptr. This in turn implies that all operations that move data to and from 64 | // device incur an extra memcpy to move data to/from runtime's own host buffer 65 | // from/to user pointer. So it is recommended to use this allocator if user wish 66 | // to 67 | // Create Buffer/Memory Object with CL_MEM_USE_HOST_PTR to align user buffer to 68 | // the 69 | // page boundary. It will ensure that user buffer will be used when user create 70 | // Buffer/Mem Object with CL_MEM_USE_HOST_PTR. 71 | template struct aligned_allocator { 72 | using value_type = T; 73 | 74 | aligned_allocator() {} 75 | 76 | aligned_allocator(const aligned_allocator &) {} 77 | 78 | template aligned_allocator(const aligned_allocator &) {} 79 | 80 | T *allocate(std::size_t num) { 81 | void *ptr = nullptr; 82 | 83 | #if defined(_WINDOWS) 84 | { 85 | ptr = _aligned_malloc(num * sizeof(T), 4096); 86 | if (ptr == NULL) { 87 | std::cout << "Failed to allocate memory" << std::endl; 88 | exit(EXIT_FAILURE); 89 | } 90 | } 91 | #else 92 | { 93 | if (posix_memalign(&ptr, 4096, num * sizeof(T))) 94 | throw std::bad_alloc(); 95 | } 96 | #endif 97 | return reinterpret_cast(ptr); 98 | } 99 | void deallocate(T *p, std::size_t num) { 100 | #if defined(_WINDOWS) 101 | _aligned_free(p); 102 | #else 103 | free(p); 104 | #endif 105 | } 106 | }; 107 | 108 | namespace xcl { 109 | std::vector get_xil_devices(); 110 | std::vector get_devices(const std::string &vendor_name); 111 | std::vector 112 | read_binary_file(const std::string &xclbin_file_name); 113 | bool is_emulation(); 114 | bool is_hw_emulation(); 115 | bool is_xpr_device(const char *device_name); 116 | class Stream { 117 | public: 118 | static decltype(&clCreateStream) createStream; 119 | static decltype(&clReleaseStream) releaseStream; 120 | static decltype(&clReadStream) readStream; 121 | static decltype(&clWriteStream) writeStream; 122 | static decltype(&clPollStreams) pollStreams; 123 | static void init(const cl_platform_id &platform) { 124 | void *bar = 125 | clGetExtensionFunctionAddressForPlatform(platform, "clCreateStream"); 126 | createStream = (decltype(&clCreateStream))bar; 127 | bar = clGetExtensionFunctionAddressForPlatform(platform, "clReleaseStream"); 128 | releaseStream = (decltype(&clReleaseStream))bar; 129 | bar = clGetExtensionFunctionAddressForPlatform(platform, "clReadStream"); 130 | readStream = (decltype(&clReadStream))bar; 131 | bar = clGetExtensionFunctionAddressForPlatform(platform, "clWriteStream"); 132 | writeStream = (decltype(&clWriteStream))bar; 133 | bar = clGetExtensionFunctionAddressForPlatform(platform, "clPollStreams"); 134 | pollStreams = (decltype(&clPollStreams))bar; 135 | } 136 | }; 137 | class P2P { 138 | public: 139 | static decltype(&xclGetMemObjectFd) getMemObjectFd; 140 | static decltype(&xclGetMemObjectFromFd) getMemObjectFromFd; 141 | static void init(const cl_platform_id &platform) { 142 | void *bar = 143 | clGetExtensionFunctionAddressForPlatform(platform, "xclGetMemObjectFd"); 144 | getMemObjectFd = (decltype(&xclGetMemObjectFd))bar; 145 | bar = clGetExtensionFunctionAddressForPlatform(platform, "xclGetMemObjectFromFd"); 146 | getMemObjectFromFd = (decltype(&xclGetMemObjectFromFd))bar; 147 | } 148 | }; 149 | class Ext { 150 | public: 151 | static decltype(&xclGetComputeUnitInfo) getComputeUnitInfo; 152 | static void init(const cl_platform_id &platform) { 153 | void *bar = 154 | clGetExtensionFunctionAddressForPlatform(platform, "xclGetComputeUnitInfo"); 155 | getComputeUnitInfo = (decltype(&xclGetComputeUnitInfo))bar; 156 | } 157 | }; 158 | } -------------------------------------------------------------------------------- /sources/vadd_lab/krnl_vadd.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | Copyright (c) 2021, Xilinx, Inc. 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without modification, 6 | are permitted provided that the following conditions are met: 7 | 8 | 1. Redistributions of source code must retain the above copyright notice, 9 | this list of conditions and the following disclaimer. 10 | 11 | 2. Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | 15 | 3. Neither the name of the copyright holder nor the names of its contributors 16 | may be used to endorse or promote products derived from this software 17 | without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 20 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 21 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 22 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 23 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 24 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | 30 | /* 31 | Vector Addition Kernel Implementation 32 | Arguments: 33 | in1 (input) --> Input Vector1 34 | in2 (input) --> Input Vector2 35 | out (output) --> Output Vector 36 | elements (input) --> Number the elements in the Vector 37 | */ 38 | 39 | extern "C" { 40 | void krnl_vadd(const int* in1, // Read-Only Vector 1 41 | const int* in2, // Read-Only Vector 2 42 | int* out, // Output Result 43 | int elements // Number of elements 44 | ) { 45 | //#pragma HLS INTERFACE mode=m_axi bundle=gmem0 port=in1 46 | //#pragma HLS INTERFACE mode=m_axi bundle=gmem1 port=in2 47 | //#pragma HLS INTERFACE mode=m_axi bundle=gmem2 port=out 48 | 49 | // Simple vector addition kernel. 50 | vadd1: 51 | for (int i = 0; i < elements; i++) { 52 | //for (int i = 0; i < (elements/16)*16; i++) { 53 | #pragma HLS LOOP_TRIPCOUNT avg=4096 max=4096 min=4096 54 | //#pragma HLS UNROLL factor=16 55 | out[i] = in1[i] + in2[i]; 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /sources/vadd_lab/xcl2.cpp: -------------------------------------------------------------------------------- 1 | /********** 2 | Copyright (c) 2020, Xilinx, Inc. 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without modification, 6 | are permitted provided that the following conditions are met: 7 | 8 | 1. Redistributions of source code must retain the above copyright notice, 9 | this list of conditions and the following disclaimer. 10 | 11 | 2. Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | 15 | 3. Neither the name of the copyright holder nor the names of its contributors 16 | may be used to endorse or promote products derived from this software 17 | without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 20 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 21 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | ARE DISCLAIMED. 23 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 24 | INDIRECT, 25 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | LIMITED TO, 27 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 28 | BUSINESS INTERRUPTION) 29 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30 | LIABILITY, 31 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 32 | THIS SOFTWARE, 33 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | **********/ 35 | 36 | #include "xcl2.hpp" 37 | #include 38 | #include 39 | #if defined(_WINDOWS) 40 | #include 41 | #else 42 | #include 43 | #endif 44 | 45 | namespace xcl { 46 | std::vector get_devices(const std::string &vendor_name) { 47 | size_t i; 48 | cl_int err; 49 | std::vector platforms; 50 | OCL_CHECK(err, err = cl::Platform::get(&platforms)); 51 | cl::Platform platform; 52 | for (i = 0; i < platforms.size(); i++) { 53 | platform = platforms[i]; 54 | OCL_CHECK(err, std::string platformName = 55 | platform.getInfo(&err)); 56 | if (platformName == vendor_name) { 57 | std::cout << "Found Platform" << std::endl; 58 | std::cout << "Platform Name: " << platformName.c_str() << std::endl; 59 | break; 60 | } 61 | } 62 | if (i == platforms.size()) { 63 | std::cout << "Error: Failed to find Xilinx platform" << std::endl; 64 | exit(EXIT_FAILURE); 65 | } 66 | // Getting ACCELERATOR Devices and selecting 1st such device 67 | std::vector devices; 68 | OCL_CHECK(err, 69 | err = platform.getDevices(CL_DEVICE_TYPE_ACCELERATOR, &devices)); 70 | return devices; 71 | } 72 | 73 | std::vector get_xil_devices() { return get_devices("Xilinx"); } 74 | 75 | std::vector 76 | read_binary_file(const std::string &xclbin_file_name) { 77 | std::cout << "INFO: Reading " << xclbin_file_name << std::endl; 78 | FILE *fp; 79 | if ((fp = fopen(xclbin_file_name.c_str(), "r")) == NULL) { 80 | printf("ERROR: %s xclbin not available please build\n", 81 | xclbin_file_name.c_str()); 82 | exit(EXIT_FAILURE); 83 | } 84 | // Loading XCL Bin into char buffer 85 | std::cout << "Loading: '" << xclbin_file_name.c_str() << "'\n"; 86 | std::ifstream bin_file(xclbin_file_name.c_str(), std::ifstream::binary); 87 | bin_file.seekg(0, bin_file.end); 88 | auto nb = bin_file.tellg(); 89 | bin_file.seekg(0, bin_file.beg); 90 | std::vector buf; 91 | buf.resize(nb); 92 | bin_file.read(reinterpret_cast(buf.data()), nb); 93 | return buf; 94 | } 95 | 96 | bool is_emulation() { 97 | bool ret = false; 98 | char *xcl_mode = getenv("XCL_EMULATION_MODE"); 99 | if (xcl_mode != NULL) { 100 | ret = true; 101 | } 102 | return ret; 103 | } 104 | 105 | bool is_hw_emulation() { 106 | bool ret = false; 107 | char *xcl_mode = getenv("XCL_EMULATION_MODE"); 108 | if ((xcl_mode != NULL) && !strcmp(xcl_mode, "hw_emu")) { 109 | ret = true; 110 | } 111 | return ret; 112 | } 113 | 114 | bool is_xpr_device(const char *device_name) { 115 | const char *output = strstr(device_name, "xpr"); 116 | 117 | if (output == NULL) { 118 | return false; 119 | } else { 120 | return true; 121 | } 122 | } 123 | }; // namespace xcl -------------------------------------------------------------------------------- /sources/vadd_lab/xcl2.hpp: -------------------------------------------------------------------------------- 1 | /********** 2 | Copyright (c) 2018, Xilinx, Inc. 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without modification, 6 | are permitted provided that the following conditions are met: 7 | 8 | 1. Redistributions of source code must retain the above copyright notice, 9 | this list of conditions and the following disclaimer. 10 | 11 | 2. Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | 15 | 3. Neither the name of the copyright holder nor the names of its contributors 16 | may be used to endorse or promote products derived from this software 17 | without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 20 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 21 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | ARE DISCLAIMED. 23 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 24 | INDIRECT, 25 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | LIMITED TO, 27 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 28 | BUSINESS INTERRUPTION) 29 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30 | LIABILITY, 31 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 32 | THIS SOFTWARE, 33 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | **********/ 35 | 36 | #pragma once 37 | 38 | #define CL_HPP_CL_1_2_DEFAULT_BUILD 39 | #define CL_HPP_TARGET_OPENCL_VERSION 120 40 | #define CL_HPP_MINIMUM_OPENCL_VERSION 120 41 | #define CL_HPP_ENABLE_PROGRAM_CONSTRUCTION_FROM_ARRAY_COMPATIBILITY 1 42 | #define CL_USE_DEPRECATED_OPENCL_1_2_APIS 43 | 44 | // OCL_CHECK doesn't work if call has templatized function call 45 | #define OCL_CHECK(error, call) \ 46 | call; \ 47 | if (error != CL_SUCCESS) { \ 48 | printf("%s:%d Error calling " #call ", error code is: %d\n", __FILE__, \ 49 | __LINE__, error); \ 50 | exit(EXIT_FAILURE); \ 51 | } 52 | 53 | #include 54 | #include 55 | #include 56 | #include 57 | // When creating a buffer with user pointer (CL_MEM_USE_HOST_PTR), under the 58 | // hood 59 | // User ptr is used if and only if it is properly aligned (page aligned). When 60 | // not 61 | // aligned, runtime has no choice but to create its own host side buffer that 62 | // backs 63 | // user ptr. This in turn implies that all operations that move data to and from 64 | // device incur an extra memcpy to move data to/from runtime's own host buffer 65 | // from/to user pointer. So it is recommended to use this allocator if user wish 66 | // to 67 | // Create Buffer/Memory Object with CL_MEM_USE_HOST_PTR to align user buffer to 68 | // the 69 | // page boundary. It will ensure that user buffer will be used when user create 70 | // Buffer/Mem Object with CL_MEM_USE_HOST_PTR. 71 | template struct aligned_allocator { 72 | using value_type = T; 73 | 74 | aligned_allocator() {} 75 | 76 | aligned_allocator(const aligned_allocator &) {} 77 | 78 | template aligned_allocator(const aligned_allocator &) {} 79 | 80 | T *allocate(std::size_t num) { 81 | void *ptr = nullptr; 82 | 83 | #if defined(_WINDOWS) 84 | { 85 | ptr = _aligned_malloc(num * sizeof(T), 4096); 86 | if (ptr == NULL) { 87 | std::cout << "Failed to allocate memory" << std::endl; 88 | exit(EXIT_FAILURE); 89 | } 90 | } 91 | #else 92 | { 93 | if (posix_memalign(&ptr, 4096, num * sizeof(T))) 94 | throw std::bad_alloc(); 95 | } 96 | #endif 97 | return reinterpret_cast(ptr); 98 | } 99 | void deallocate(T *p, std::size_t num) { 100 | #if defined(_WINDOWS) 101 | _aligned_free(p); 102 | #else 103 | free(p); 104 | #endif 105 | } 106 | }; 107 | 108 | namespace xcl { 109 | std::vector get_xil_devices(); 110 | std::vector get_devices(const std::string &vendor_name); 111 | std::vector 112 | read_binary_file(const std::string &xclbin_file_name); 113 | bool is_emulation(); 114 | bool is_hw_emulation(); 115 | bool is_xpr_device(const char *device_name); 116 | class Stream { 117 | public: 118 | static decltype(&clCreateStream) createStream; 119 | static decltype(&clReleaseStream) releaseStream; 120 | static decltype(&clReadStream) readStream; 121 | static decltype(&clWriteStream) writeStream; 122 | static decltype(&clPollStreams) pollStreams; 123 | static void init(const cl_platform_id &platform) { 124 | void *bar = 125 | clGetExtensionFunctionAddressForPlatform(platform, "clCreateStream"); 126 | createStream = (decltype(&clCreateStream))bar; 127 | bar = clGetExtensionFunctionAddressForPlatform(platform, "clReleaseStream"); 128 | releaseStream = (decltype(&clReleaseStream))bar; 129 | bar = clGetExtensionFunctionAddressForPlatform(platform, "clReadStream"); 130 | readStream = (decltype(&clReadStream))bar; 131 | bar = clGetExtensionFunctionAddressForPlatform(platform, "clWriteStream"); 132 | writeStream = (decltype(&clWriteStream))bar; 133 | bar = clGetExtensionFunctionAddressForPlatform(platform, "clPollStreams"); 134 | pollStreams = (decltype(&clPollStreams))bar; 135 | } 136 | }; 137 | class P2P { 138 | public: 139 | static decltype(&xclGetMemObjectFd) getMemObjectFd; 140 | static decltype(&xclGetMemObjectFromFd) getMemObjectFromFd; 141 | static void init(const cl_platform_id &platform) { 142 | void *bar = 143 | clGetExtensionFunctionAddressForPlatform(platform, "xclGetMemObjectFd"); 144 | getMemObjectFd = (decltype(&xclGetMemObjectFd))bar; 145 | bar = clGetExtensionFunctionAddressForPlatform(platform, "xclGetMemObjectFromFd"); 146 | getMemObjectFromFd = (decltype(&xclGetMemObjectFromFd))bar; 147 | } 148 | }; 149 | class Ext { 150 | public: 151 | static decltype(&xclGetComputeUnitInfo) getComputeUnitInfo; 152 | static void init(const cl_platform_id &platform) { 153 | void *bar = 154 | clGetExtensionFunctionAddressForPlatform(platform, "xclGetComputeUnitInfo"); 155 | getComputeUnitInfo = (decltype(&xclGetComputeUnitInfo))bar; 156 | } 157 | }; 158 | } -------------------------------------------------------------------------------- /sources/vision_lab/src/connectivity_aws.ini: -------------------------------------------------------------------------------- 1 | profile_kernel=data:resize_accel_rgb:resize_accel_rgb_1:image_in:all 2 | profile_kernel=data:resize_accel_rgb:resize_accel_rgb_1:image_out:all 3 | profile_kernel=data:resize_blur_rgb:resize_blur_rgb_1:image_in:all 4 | profile_kernel=data:resize_blur_rgb:resize_blur_rgb_1:image_out:all 5 | trace_memory=FIFO:64K 6 | 7 | [connectivity] 8 | sp=resize_accel_rgb_1.m_axi_image_in_gmem:DDR[0] 9 | sp=resize_accel_rgb_1.m_axi_image_out_gmem:DDR[0] 10 | slr=resize_accel_rgb_1:SLR1 11 | 12 | sp=resize_blur_rgb_1.m_axi_image_in_gmem:DDR[0] 13 | sp=resize_blur_rgb_1.m_axi_image_out_gmem:DDR[0] 14 | slr=resize_blur_rgb_1:SLR1 15 | 16 | -------------------------------------------------------------------------------- /sources/vision_lab/src/data/README.md: -------------------------------------------------------------------------------- 1 | # Image License 2 | 3 | The images in this folder have a [Pixabay License](https://pixabay.com/service/license/) 4 | 5 | The original image was downloaded from [here](https://pixabay.com/photos/nose-doctor-fish-fish-aquarium-zoo-2206103/) 6 | 7 | --------------------------------------- 8 |

Copyright© 2020 Xilinx

-------------------------------------------------------------------------------- /sources/vision_lab/src/data/fish_wallpaper.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/sources/vision_lab/src/data/fish_wallpaper.jpg -------------------------------------------------------------------------------- /sources/vision_lab/src/data/fish_wallpaper_small.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xilinx/xup_compute_acceleration/569955f50bb7ad972adaf60e48085323ff4e0aec/sources/vision_lab/src/data/fish_wallpaper_small.jpg -------------------------------------------------------------------------------- /sources/vision_lab/src/hw/resize_blur.cpp: -------------------------------------------------------------------------------- 1 | /********** 2 | Copyright (c) 2019, Xilinx, Inc. 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without modification, 6 | are permitted provided that the following conditions are met: 7 | 8 | 1. Redistributions of source code must retain the above copyright notice, 9 | this list of conditions and the following disclaimer. 10 | 11 | 2. Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | 15 | 3. Neither the name of the copyright holder nor the names of its contributors 16 | may be used to endorse or promote products derived from this software 17 | without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 20 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 21 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 22 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 23 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 24 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | **********/ 29 | 30 | 31 | #include "ap_int.h" 32 | #include "common/xf_common.hpp" 33 | #include "common/xf_utility.hpp" 34 | #include "imgproc/xf_gaussian_filter.hpp" 35 | #include "imgproc/xf_resize.hpp" 36 | 37 | 38 | #define AXI_WIDTH 512 39 | #define TYPE XF_8UC3 40 | #define NPC XF_NPPC8 41 | 42 | #define PRAGMA_SUB(x) _Pragma(#x) 43 | #define DYN_PRAGMA(x) PRAGMA_SUB(x) 44 | 45 | #define MAX_IN_WIDTH 3840 46 | #define MAX_IN_HEIGHT 2160 47 | #define MAX_OUT_WIDTH 3840 48 | #define MAX_OUT_HEIGHT 2160 49 | 50 | #define STREAM_DEPTH 8 51 | #define MAX_DOWN_SCALE 7 52 | #define FILTER_WIDTH 7 53 | 54 | extern "C" 55 | { 56 | void resize_blur_rgb(ap_uint *image_in, 57 | ap_uint *image_out, 58 | int width_in, 59 | int height_in, 60 | int width_out, 61 | int height_out, 62 | float sigma) 63 | { 64 | #pragma HLS INTERFACE m_axi port = image_in offset = slave bundle = image_in_gmem 65 | #pragma HLS INTERFACE m_axi port = image_out offset = slave bundle = image_out_gmem 66 | #pragma HLS INTERFACE s_axilite port = image_in bundle = control 67 | #pragma HLS INTERFACE s_axilite port = image_out bundle = control 68 | #pragma HLS INTERFACE s_axilite port = width_in bundle = control 69 | #pragma HLS INTERFACE s_axilite port = height_in bundle = control 70 | #pragma HLS INTERFACE s_axilite port = width_out bundle = control 71 | #pragma HLS INTERFACE s_axilite port = height_out bundle = control 72 | #pragma HLS INTERFACE s_axilite port = sigma bundle = control 73 | #pragma HLS INTERFACE s_axilite port = return bundle = control 74 | 75 | xf::cv::Mat in_mat(height_in, width_in); 76 | 77 | xf::cv::Mat resized_mat(height_out, width_out); 78 | 79 | xf::cv::Mat out_mat(height_out, width_out); 80 | 81 | #pragma HLS DATAFLOW 82 | 83 | xf::cv::Array2xfMat(image_in, in_mat); 88 | xf::cv::resize(in_mat, resized_mat); 96 | xf::cv::GaussianBlur(resized_mat, out_mat, sigma); 102 | xf::cv::xfMat2Array(out_mat, image_out); 107 | } 108 | } 109 | -------------------------------------------------------------------------------- /sources/vision_lab/src/hw/resize_rgb.cpp: -------------------------------------------------------------------------------- 1 | /********** 2 | Copyright (c) 2019, Xilinx, Inc. 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without modification, 6 | are permitted provided that the following conditions are met: 7 | 8 | 1. Redistributions of source code must retain the above copyright notice, 9 | this list of conditions and the following disclaimer. 10 | 11 | 2. Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | 15 | 3. Neither the name of the copyright holder nor the names of its contributors 16 | may be used to endorse or promote products derived from this software 17 | without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 20 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 21 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 22 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 23 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 24 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | **********/ 29 | 30 | 31 | #include "ap_int.h" 32 | #include "common/xf_common.hpp" 33 | #include "common/xf_utility.hpp" 34 | #include "hls_stream.h" 35 | #include "imgproc/xf_resize.hpp" 36 | 37 | 38 | #define AXI_WIDTH 512 39 | #define NPC XF_NPPC8 40 | #define TYPE XF_8UC3 41 | #define MAX_DOWN_SCALE 7 42 | 43 | #define PRAGMA_SUB(x) _Pragma(#x) 44 | #define DYN_PRAGMA(x) PRAGMA_SUB(x) 45 | 46 | #define MAX_IN_WIDTH 3840 47 | #define MAX_IN_HEIGHT 2160 48 | #define MAX_OUT_WIDTH 3840 49 | #define MAX_OUT_HEIGHT 2160 50 | 51 | #define STREAM_DEPTH 8 52 | #define MAX_DOWN_SCALE 7 53 | 54 | extern "C" 55 | { 56 | void resize_accel_rgb(ap_uint *image_in, 57 | ap_uint *image_out, 58 | int width_in, 59 | int height_in, 60 | int width_out, 61 | int height_out) 62 | { 63 | #pragma HLS INTERFACE m_axi port = image_in offset = slave bundle = image_in_gmem 64 | #pragma HLS INTERFACE m_axi port = image_out offset = slave bundle = image_out_gmem 65 | #pragma HLS INTERFACE s_axilite port = image_in bundle = control 66 | #pragma HLS INTERFACE s_axilite port = image_out bundle = control 67 | #pragma HLS INTERFACE s_axilite port = width_in bundle = control 68 | #pragma HLS INTERFACE s_axilite port = height_in bundle = control 69 | #pragma HLS INTERFACE s_axilite port = width_out bundle = control 70 | #pragma HLS INTERFACE s_axilite port = height_out bundle = control 71 | #pragma HLS INTERFACE s_axilite port = return bundle = control 72 | 73 | xf::cv::Mat in_mat(height_in, width_in); 74 | 75 | xf::cv::Mat out_mat(height_out, width_out); 76 | 77 | #pragma HLS DATAFLOW 78 | 79 | xf::cv::Array2xfMat(image_in, in_mat); 80 | xf::cv::resize(in_mat, out_mat); 88 | xf::cv::xfMat2Array(out_mat, image_out); 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /sources/vision_lab/src/pynq/vision.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "# Vision Lab with PYNQ\n", 8 | "\n", 9 | "This notebook shows you how to run the vision example with PYNQ\n", 10 | "\n", 11 | "Let us start by loading a testing image" 12 | ] 13 | }, 14 | { 15 | "cell_type": "code", 16 | "execution_count": null, 17 | "metadata": {}, 18 | "outputs": [], 19 | "source": [ 20 | "import os\n", 21 | "home = os.path.expanduser('~') + \"/\"\n", 22 | "\n", 23 | "from PIL import Image\n", 24 | "image = Image.open(home + \"xup_compute_acceleration/sources/vision_lab/src/data/fish_wallpaper.jpg\")\n", 25 | "img_width, img_height = image.size\n", 26 | "image.size" 27 | ] 28 | }, 29 | { 30 | "cell_type": "markdown", 31 | "metadata": {}, 32 | "source": [ 33 | "## Donwload the accelerator" 34 | ] 35 | }, 36 | { 37 | "cell_type": "code", 38 | "execution_count": null, 39 | "metadata": {}, 40 | "outputs": [], 41 | "source": [ 42 | "import pynq\n", 43 | "ol = pynq.Overlay(home + \"xup_compute_acceleration/solutions/vision_lab/vision_example.awsxclbin\")" 44 | ] 45 | }, 46 | { 47 | "cell_type": "markdown", 48 | "metadata": {}, 49 | "source": [ 50 | "Show the available accelerators on the xclbin file" 51 | ] 52 | }, 53 | { 54 | "cell_type": "code", 55 | "execution_count": null, 56 | "metadata": {}, 57 | "outputs": [], 58 | "source": [ 59 | "ol.ip_dict" 60 | ] 61 | }, 62 | { 63 | "cell_type": "markdown", 64 | "metadata": {}, 65 | "source": [ 66 | "## Resize kernel" 67 | ] 68 | }, 69 | { 70 | "cell_type": "markdown", 71 | "metadata": {}, 72 | "source": [ 73 | "Grab a handler to the resize accelerator and display its signature" 74 | ] 75 | }, 76 | { 77 | "cell_type": "code", 78 | "execution_count": null, 79 | "metadata": {}, 80 | "outputs": [], 81 | "source": [ 82 | "resize = ol.resize_accel_rgb_1\n", 83 | "resize.signature" 84 | ] 85 | }, 86 | { 87 | "cell_type": "markdown", 88 | "metadata": {}, 89 | "source": [ 90 | "Define the resize value and compute the size of the resulting image" 91 | ] 92 | }, 93 | { 94 | "cell_type": "code", 95 | "execution_count": null, 96 | "metadata": {}, 97 | "outputs": [], 98 | "source": [ 99 | "scale = 5\n", 100 | "img_out_height, img_out_width = img_height//scale, img_width//scale" 101 | ] 102 | }, 103 | { 104 | "cell_type": "markdown", 105 | "metadata": {}, 106 | "source": [ 107 | "Compute the size of the input and output images, in bytes, and allocate buffers for them" 108 | ] 109 | }, 110 | { 111 | "cell_type": "code", 112 | "execution_count": null, 113 | "metadata": {}, 114 | "outputs": [], 115 | "source": [ 116 | "import numpy as np\n", 117 | "size_in = img_height * img_width * 3\n", 118 | "size_out = img_out_height * img_out_width * 3\n", 119 | "\n", 120 | "in_buf = pynq.allocate(size_in, dtype=np.uint8)\n", 121 | "out_buf = pynq.allocate(size_out, dtype=np.uint8)" 122 | ] 123 | }, 124 | { 125 | "cell_type": "markdown", 126 | "metadata": {}, 127 | "source": [ 128 | "Copy the input image into the accelerator global memory" 129 | ] 130 | }, 131 | { 132 | "cell_type": "code", 133 | "execution_count": null, 134 | "metadata": {}, 135 | "outputs": [], 136 | "source": [ 137 | "in_buf[:] = np.reshape(np.array(image), size_in)\n", 138 | "in_buf.sync_to_device()" 139 | ] 140 | }, 141 | { 142 | "cell_type": "markdown", 143 | "metadata": {}, 144 | "source": [ 145 | "Run the kernel and wait for its completion" 146 | ] 147 | }, 148 | { 149 | "cell_type": "code", 150 | "execution_count": null, 151 | "metadata": {}, 152 | "outputs": [], 153 | "source": [ 154 | "krnl = resize.start(in_buf, out_buf, img_width, img_height, img_out_width, img_out_height)\n", 155 | "krnl.wait()\n", 156 | "out_buf.sync_from_device()" 157 | ] 158 | }, 159 | { 160 | "cell_type": "markdown", 161 | "metadata": {}, 162 | "source": [ 163 | "Display output image" 164 | ] 165 | }, 166 | { 167 | "cell_type": "code", 168 | "execution_count": null, 169 | "metadata": {}, 170 | "outputs": [], 171 | "source": [ 172 | "result_image = np.reshape(out_buf,(img_out_height, img_out_width, 3))\n", 173 | "\n", 174 | "resize_img = Image.fromarray(result_image, \"RGB\")\n", 175 | "\n", 176 | "print(f\"Output image size {resize_img.size}\")\n", 177 | "resize_img" 178 | ] 179 | }, 180 | { 181 | "cell_type": "markdown", 182 | "metadata": {}, 183 | "source": [ 184 | "## Resize and blur kernel\n", 185 | "\n", 186 | "Grab a handler to the resize and blur kernel" 187 | ] 188 | }, 189 | { 190 | "cell_type": "code", 191 | "execution_count": null, 192 | "metadata": {}, 193 | "outputs": [], 194 | "source": [ 195 | "resize_blur = ol.resize_blur_rgb_1\n", 196 | "resize_blur.signature" 197 | ] 198 | }, 199 | { 200 | "cell_type": "markdown", 201 | "metadata": {}, 202 | "source": [ 203 | "Define the resize value and compute the size of the resulting image" 204 | ] 205 | }, 206 | { 207 | "cell_type": "code", 208 | "execution_count": null, 209 | "metadata": {}, 210 | "outputs": [], 211 | "source": [ 212 | "scale = 3\n", 213 | "img_out_height, img_out_width = img_height//scale, img_width//scale\n", 214 | "\n", 215 | "size_out = img_out_height * img_out_width * 3" 216 | ] 217 | }, 218 | { 219 | "cell_type": "markdown", 220 | "metadata": {}, 221 | "source": [ 222 | "Allocate output image buffer, we can reuse the input image buffer as both kernel access to the same memory bank. You can use the `.args` attribute of the kernel objects to verify this. For instance, `resize_blur.args` " 223 | ] 224 | }, 225 | { 226 | "cell_type": "code", 227 | "execution_count": null, 228 | "metadata": {}, 229 | "outputs": [], 230 | "source": [ 231 | "out_buf = pynq.allocate(size_out, dtype=np.uint8)" 232 | ] 233 | }, 234 | { 235 | "cell_type": "markdown", 236 | "metadata": {}, 237 | "source": [ 238 | "Run the kernel and wait for its completion" 239 | ] 240 | }, 241 | { 242 | "cell_type": "code", 243 | "execution_count": null, 244 | "metadata": {}, 245 | "outputs": [], 246 | "source": [ 247 | "krnl = resize_blur.start(in_buf, out_buf, img_width, img_height, img_out_width, img_out_height, 20.3)\n", 248 | "krnl.wait()\n", 249 | "out_buf.sync_from_device()" 250 | ] 251 | }, 252 | { 253 | "cell_type": "markdown", 254 | "metadata": {}, 255 | "source": [ 256 | "Display output image" 257 | ] 258 | }, 259 | { 260 | "cell_type": "code", 261 | "execution_count": null, 262 | "metadata": {}, 263 | "outputs": [], 264 | "source": [ 265 | "result_image = np.reshape(out_buf,(img_out_height, img_out_width, 3))\n", 266 | "\n", 267 | "resize_blur_img = Image.fromarray(result_image, \"RGB\")\n", 268 | "print(f\"Output image size {resize_blur_img.size}\")\n", 269 | "resize_blur_img" 270 | ] 271 | }, 272 | { 273 | "cell_type": "markdown", 274 | "metadata": {}, 275 | "source": [ 276 | "## Release accelerator and memory" 277 | ] 278 | }, 279 | { 280 | "cell_type": "code", 281 | "execution_count": null, 282 | "metadata": {}, 283 | "outputs": [], 284 | "source": [ 285 | "del in_buf\n", 286 | "del out_buf\n", 287 | "ol.free()" 288 | ] 289 | }, 290 | { 291 | "cell_type": "markdown", 292 | "metadata": {}, 293 | "source": [ 294 | "----\n", 295 | "Copyright © 2021 Xilinx, Inc\n", 296 | "\n", 297 | "SPDX-License-Identifier: BSD-3-Clause" 298 | ] 299 | } 300 | ], 301 | "metadata": { 302 | "kernelspec": { 303 | "display_name": "Python 3", 304 | "language": "python", 305 | "name": "python3" 306 | }, 307 | "language_info": { 308 | "codemirror_mode": { 309 | "name": "ipython", 310 | "version": 3 311 | }, 312 | "file_extension": ".py", 313 | "mimetype": "text/x-python", 314 | "name": "python", 315 | "nbconvert_exporter": "python", 316 | "pygments_lexer": "ipython3", 317 | "version": "3.7.3" 318 | } 319 | }, 320 | "nbformat": 4, 321 | "nbformat_minor": 4 322 | } 323 | -------------------------------------------------------------------------------- /sources/vision_lab/src/sw/event_timer.cpp: -------------------------------------------------------------------------------- 1 | /********** 2 | Copyright (c) 2019, Xilinx, Inc. 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without modification, 6 | are permitted provided that the following conditions are met: 7 | 8 | 1. Redistributions of source code must retain the above copyright notice, 9 | this list of conditions and the following disclaimer. 10 | 11 | 2. Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | 15 | 3. Neither the name of the copyright holder nor the names of its contributors 16 | may be used to endorse or promote products derived from this software 17 | without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 20 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 21 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 22 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 23 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 24 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | **********/ 29 | 30 | 31 | #include "event_timer.hpp" 32 | 33 | #include 34 | #include 35 | 36 | EventTimer::EventTimer() 37 | { 38 | unfinished = false; 39 | event_count = 0; 40 | max_string_length = 0; 41 | } 42 | 43 | float EventTimer::ms_difference(EventTimer::timepoint start, 44 | EventTimer::timepoint end) 45 | { 46 | std::chrono::duration duration = end - start; 47 | return duration.count(); 48 | } 49 | 50 | int EventTimer::add(std::string description) 51 | { 52 | // If previously pending event was unfinished, adding a new event 53 | // will terminate it if this function is called 54 | if (unfinished) 55 | finish(); 56 | 57 | unfinished = true; 58 | 59 | event_names.push_back(description); 60 | int length = description.length(); 61 | if (length > max_string_length) 62 | max_string_length = length; 63 | start_times.push_back(std::chrono::high_resolution_clock::now()); 64 | return event_count++; 65 | } 66 | 67 | void EventTimer::finish(void) 68 | { 69 | end_times.push_back(std::chrono::high_resolution_clock::now()); 70 | if (!unfinished) { 71 | end_times.pop_back(); 72 | return; 73 | } 74 | unfinished = false; 75 | } 76 | 77 | void EventTimer::clear(void) 78 | { 79 | start_times.clear(); 80 | end_times.clear(); 81 | event_names.clear(); 82 | event_count = 0; 83 | unfinished = false; 84 | } 85 | 86 | void EventTimer::print(int id) 87 | { 88 | std::ios_base::fmtflags flags(std::cout.flags()); 89 | if (id >= 0) { 90 | if ((unsigned)id > event_names.size()) 91 | return; 92 | std::cout << event_names[id] << " : " << std::fixed << std::setprecision(3) 93 | << ms_difference(start_times[id], end_times[id]) << std::endl; 94 | } 95 | else { 96 | int printable_events = unfinished ? event_count - 1 : event_count; 97 | for (int i = 0; i < printable_events; i++) { 98 | std::cout << std::left << std::setw(max_string_length) << event_names[i] << " : "; 99 | std::cout << std::right << std::setw(8) << std::fixed << std::setprecision(3) 100 | << ms_difference(start_times[i], end_times[i]) << " ms" 101 | << std::endl; 102 | } 103 | } 104 | std::cout.flags(flags); 105 | } 106 | -------------------------------------------------------------------------------- /sources/vision_lab/src/sw/event_timer.hpp: -------------------------------------------------------------------------------- 1 | /********** 2 | Copyright (c) 2019, Xilinx, Inc. 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without modification, 6 | are permitted provided that the following conditions are met: 7 | 8 | 1. Redistributions of source code must retain the above copyright notice, 9 | this list of conditions and the following disclaimer. 10 | 11 | 2. Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | 15 | 3. Neither the name of the copyright holder nor the names of its contributors 16 | may be used to endorse or promote products derived from this software 17 | without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 20 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 21 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 22 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 23 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 24 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | **********/ 29 | 30 | 31 | #ifndef EVENT_TIMER_HPP__ 32 | #define EVENT_TIMER_HPP__ 33 | 34 | #include 35 | #include 36 | #include 37 | 38 | class EventTimer 39 | { 40 | typedef std::chrono::high_resolution_clock::time_point timepoint; 41 | 42 | private: 43 | std::vector start_times; 44 | std::vector end_times; 45 | std::vector event_names; 46 | 47 | bool unfinished; 48 | unsigned int event_count; 49 | int max_string_length; 50 | 51 | float ms_difference(EventTimer::timepoint start, EventTimer::timepoint end); 52 | 53 | public: 54 | EventTimer(void); 55 | int add(std::string description); 56 | void finish(void); 57 | void clear(void); 58 | 59 | void print(int id = -1); 60 | }; 61 | 62 | #endif // EVENT_TIMER_HPP__ 63 | -------------------------------------------------------------------------------- /sources/vision_lab/src/sw/line_exception.hpp: -------------------------------------------------------------------------------- 1 | /********** 2 | Copyright (c) 2019, Xilinx, Inc. 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without modification, 6 | are permitted provided that the following conditions are met: 7 | 8 | 1. Redistributions of source code must retain the above copyright notice, 9 | this list of conditions and the following disclaimer. 10 | 11 | 2. Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | 15 | 3. Neither the name of the copyright holder nor the names of its contributors 16 | may be used to endorse or promote products derived from this software 17 | without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 20 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 21 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 22 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 23 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 24 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | **********/ 29 | 30 | #ifndef LINE_EXCEPTION__ 31 | #define LINE_EXCEPTION__ 32 | 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | 40 | class LineException : public std::runtime_error 41 | { 42 | std::string message; 43 | int exception_errno; 44 | 45 | public: 46 | LineException(const std::string &arg, int errno_in, const char *file, int line) : std::runtime_error(arg) 47 | { 48 | std::ostringstream output; 49 | const char *filename = NULL; 50 | filename = strrchr(file, '/'); 51 | 52 | output << "("; 53 | if (filename) { 54 | output << (filename + 1); 55 | } 56 | else { 57 | output << file; 58 | } 59 | output << ":" << line << ") " << arg; 60 | if (errno != 0) { 61 | output << std::endl 62 | << " (" << std::strerror(errno) << ")" << std::endl; 63 | } 64 | message = output.str(); 65 | exception_errno = errno_in; 66 | } 67 | ~LineException() throw() {} 68 | const char *what() const throw() 69 | { 70 | return message.c_str(); 71 | } 72 | const int le_errno() 73 | { 74 | return exception_errno; 75 | } 76 | }; 77 | 78 | #define throw_lineexception(arg) throw LineException(arg, 0, __FILE__, __LINE__); 79 | #define throw_lineexception_errno(arg, errno_in) throw LineException(arg, errno_in, __FILE__, __LINE__); 80 | 81 | #endif 82 | -------------------------------------------------------------------------------- /sources/vision_lab/src/sw/xcl2.hpp: -------------------------------------------------------------------------------- 1 | /********** 2 | Copyright (c) 2019, Xilinx, Inc. 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without modification, 6 | are permitted provided that the following conditions are met: 7 | 8 | 1. Redistributions of source code must retain the above copyright notice, 9 | this list of conditions and the following disclaimer. 10 | 11 | 2. Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | 15 | 3. Neither the name of the copyright holder nor the names of its contributors 16 | may be used to endorse or promote products derived from this software 17 | without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 20 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 21 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 22 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 23 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 24 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | **********/ 29 | 30 | 31 | #pragma once 32 | 33 | #define CL_HPP_ENABLE_EXCEPTIONS 34 | #define CL_HPP_CL_1_2_DEFAULT_BUILD 35 | #define CL_HPP_TARGET_OPENCL_VERSION 120 36 | #define CL_HPP_MINIMUM_OPENCL_VERSION 120 37 | #define CL_HPP_ENABLE_PROGRAM_CONSTRUCTION_FROM_ARRAY_COMPATIBILITY 1 38 | 39 | #include //"/opt/intel/opencl-1.2-4.4.0.117/include/CL/cl.h" 40 | #include 41 | #include 42 | 43 | // When creating a buffer with user pointer (CL_MEM_USE_HOST_PTR), under the hood 44 | // User ptr is used if and only if it is properly aligned (page aligned). When not 45 | // aligned, runtime has no choice but to create its own host side buffer that backs 46 | // user ptr. This in turn implies that all operations that move data to and from 47 | // device incur an extra memcpy to move data to/from runtime's own host buffer 48 | // from/to user pointer. So it is recommended to use this allocator if user wish to 49 | // Create Buffer/Memory Object with CL_MEM_USE_HOST_PTR to align user buffer to the 50 | // page boundary. It will ensure that user buffer will be used when user create 51 | // Buffer/Mem Object with CL_MEM_USE_HOST_PTR. 52 | template 53 | struct aligned_allocator 54 | { 55 | using value_type = T; 56 | T *allocate(std::size_t num) 57 | { 58 | void *ptr = nullptr; 59 | if (posix_memalign(&ptr, 4096, num * sizeof(T))) 60 | throw std::bad_alloc(); 61 | return reinterpret_cast(ptr); 62 | } 63 | void deallocate(T *p, std::size_t num) 64 | { 65 | free(p); 66 | } 67 | }; 68 | 69 | namespace xcl { 70 | std::vector get_xil_devices(); 71 | std::vector get_devices(const std::string &vendor_name); 72 | /* find_xclbin_file 73 | * 74 | * 75 | * Description: 76 | * Find precompiled program (as commonly created by the Xilinx OpenCL 77 | * flow). Using search path below. 78 | * 79 | * Search Path: 80 | * $XCL_BINDIR/...xclbin 81 | * $XCL_BINDIR/...xclbin 82 | * $XCL_BINDIR/binary_container_1.xclbin 83 | * $XCL_BINDIR/.xclbin 84 | * xclbin/...xclbin 85 | * xclbin/...xclbin 86 | * xclbin/binary_container_1.xclbin 87 | * xclbin/.xclbin 88 | * ../...xclbin 89 | * ../...xclbin 90 | * ../binary_container_1.xclbin 91 | * ../.xclbin 92 | * ./...xclbin 93 | * ./...xclbin 94 | * ./binary_container_1.xclbin 95 | * ./.xclbin 96 | * 97 | * Inputs: 98 | * _device_name - Targeted Device name 99 | * xclbin_name - base name of the xclbin to import. 100 | * 101 | * Returns: 102 | * An opencl program Binaries object that was created from xclbin_name file. 103 | */ 104 | std::string find_binary_file(const std::string &_device_name, const std::string &xclbin_name); 105 | cl::Program::Binaries import_binary_file(std::string xclbin_file_name); 106 | bool is_emulation(); 107 | bool is_hw_emulation(); 108 | bool is_xpr_device(const char *device_name); 109 | 110 | } // namespace xcl 111 | -------------------------------------------------------------------------------- /sources/vision_lab/src/sw/xilinx_ocl_helper.cpp: -------------------------------------------------------------------------------- 1 | /********** 2 | Copyright (c) 2019, Xilinx, Inc. 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without modification, 6 | are permitted provided that the following conditions are met: 7 | 8 | 1. Redistributions of source code must retain the above copyright notice, 9 | this list of conditions and the following disclaimer. 10 | 11 | 2. Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | 15 | 3. Neither the name of the copyright holder nor the names of its contributors 16 | may be used to endorse or promote products derived from this software 17 | without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 20 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 21 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 22 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 23 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 24 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | **********/ 29 | 30 | #include "xilinx_ocl_helper.hpp" 31 | 32 | #include 33 | 34 | namespace xilinx { 35 | namespace example_utils { 36 | std::vector XilinxOclHelper::find_xilinx_devices() 37 | { 38 | size_t i; 39 | std::vector platforms; 40 | cl::Platform::get(&platforms); 41 | 42 | cl::Platform platform; 43 | for (i = 0; i < platforms.size(); i++) { 44 | platform = platforms[i]; 45 | std::string platform_name = platform.getInfo(); 46 | if (platform_name == "Xilinx") { 47 | break; 48 | } 49 | } 50 | if (i == platforms.size()) { 51 | throw_lineexception("Unable to find Xilinx OpenCL devices"); 52 | } 53 | 54 | // Get ACCELERATOR devices 55 | std::vector devices; 56 | platform.getDevices(CL_DEVICE_TYPE_ACCELERATOR, &devices); 57 | return devices; 58 | } 59 | 60 | void XilinxOclHelper::initialize(std::string xclbin_file_name) 61 | { 62 | // Find Xilinx OpenCL devices 63 | std::vector devices = find_xilinx_devices(); 64 | 65 | // Initialize our OpenCL context 66 | device = devices[0]; 67 | context = cl::Context(device); 68 | 69 | // Load the XCLBIN 70 | if (access(xclbin_file_name.c_str(), R_OK) != 0) { 71 | throw_lineexception("Specified XCLBIN not found"); 72 | } 73 | 74 | std::ifstream xclbin(xclbin_file_name.c_str(), std::ifstream::binary); 75 | xclbin.seekg(0, xclbin.end); 76 | unsigned int nb = xclbin.tellg(); 77 | xclbin.seekg(0, xclbin.beg); 78 | char *buf = new char[nb]; 79 | xclbin.read(buf, nb); 80 | cl::Program::Binaries bins; 81 | bins.push_back({buf, nb}); 82 | 83 | // TODO: Don't automatically assume that device 0 is the correct one 84 | devices.resize(1); 85 | 86 | // Program the device 87 | program = cl::Program(context, devices, bins); 88 | 89 | is_initialized = true; 90 | } 91 | 92 | cl::Kernel XilinxOclHelper::get_kernel(std::string kernel_name) 93 | { 94 | if (!is_initialized) { 95 | throw_lineexception("Attempted to get kernel without initializing OCL"); 96 | } 97 | 98 | cl::Kernel krnl(program, kernel_name.c_str()); 99 | return krnl; 100 | } 101 | 102 | cl::CommandQueue XilinxOclHelper::get_command_queue(bool in_order, bool enable_profiling) 103 | { 104 | if (!is_initialized) { 105 | throw_lineexception("Attempted to get command queue without initializing OCL"); 106 | } 107 | 108 | cl_command_queue_properties props = 0; 109 | 110 | if (!in_order) { 111 | props |= CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE; 112 | } 113 | if (enable_profiling) { 114 | props |= CL_QUEUE_PROFILING_ENABLE; 115 | } 116 | 117 | cl::CommandQueue q(context, device, props); 118 | return q; 119 | } 120 | 121 | cl::Buffer XilinxOclHelper::create_buffer(size_t size, cl_mem_flags flags) 122 | { 123 | if (!is_initialized) { 124 | throw_lineexception("Attempted to create buffer before initialization"); 125 | } 126 | 127 | cl::Buffer buf(context, flags, size, NULL, NULL); 128 | return buf; 129 | } 130 | 131 | cl::Buffer XilinxOclHelper::create_buffer_in_bank(int bank, size_t size, cl_mem_flags flags) 132 | { 133 | if (!is_initialized) { 134 | throw_lineexception("Attempted to create buffer before initialization"); 135 | } 136 | 137 | cl_mem_ext_ptr_t bank_ext; 138 | bank_ext.flags = bank | XCL_MEM_TOPOLOGY; 139 | bank_ext.obj = NULL; 140 | bank_ext.param = 0; 141 | 142 | cl::Buffer buf(context, flags | CL_MEM_EXT_PTR_XILINX, size, &bank_ext, NULL); 143 | return buf; 144 | } 145 | 146 | int XilinxOclHelper::get_fd_for_buffer(cl::Buffer buf) 147 | { 148 | int fd; 149 | xclGetMemObjectFd(buf(), &fd); 150 | return fd; 151 | } 152 | 153 | cl::Buffer XilinxOclHelper::get_buffer_from_fd(int fd) 154 | { 155 | cl::Buffer buffer; 156 | xclGetMemObjectFromFd(context(), device(), 0, fd, &buffer()); 157 | return buffer; 158 | } 159 | 160 | const cl::Context &XilinxOclHelper::get_context() 161 | { 162 | return context; 163 | } 164 | 165 | XilinxOclHelper::XilinxOclHelper() 166 | { 167 | } 168 | 169 | XilinxOclHelper::~XilinxOclHelper() 170 | { 171 | } 172 | 173 | } // namespace example_utils 174 | } // namespace xilinx 175 | -------------------------------------------------------------------------------- /sources/vision_lab/src/sw/xilinx_ocl_helper.hpp: -------------------------------------------------------------------------------- 1 | /********** 2 | Copyright (c) 2019, Xilinx, Inc. 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without modification, 6 | are permitted provided that the following conditions are met: 7 | 8 | 1. Redistributions of source code must retain the above copyright notice, 9 | this list of conditions and the following disclaimer. 10 | 11 | 2. Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | 15 | 3. Neither the name of the copyright holder nor the names of its contributors 16 | may be used to endorse or promote products derived from this software 17 | without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 20 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 21 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 22 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 23 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 24 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | **********/ 29 | 30 | #ifndef XILINX_OCL_H_ 31 | #define XILINX_OCL_H 32 | 33 | #pragma once 34 | 35 | #define CL_HPP_ENABLE_EXCEPTIONS 36 | #define CL_HPP_CL_1_2_DEFAULT_BUILD 37 | #define CL_HPP_TARGET_OPENCL_VERSION 120 38 | #define CL_HPP_MINIMUM_OPENCL_VERSION 120 39 | #define CL_HPP_ENABLE_PROGRAM_CONSTRUCTION_FROM_ARRAY_COMPATIBILITY 1 40 | 41 | #include "line_exception.hpp" 42 | 43 | #include 44 | #include 45 | #include 46 | #include 47 | #include 48 | 49 | // When creating a buffer with user pointer (CL_MEM_USE_HOST_PTR), under the hood 50 | // User ptr is used if and only if it is properly aligned (page aligned). When not 51 | // aligned, runtime has no choice but to create its own host side buffer that backs 52 | // user ptr. This in turn implies that all operations that move data to and from 53 | // device incur an extra memcpy to move data to/from runtime's own host buffer 54 | // from/to user pointer. So it is recommended to use this allocator if user wish to 55 | // Create Buffer/Memory Object with CL_MEM_USE_HOST_PTR to align user buffer to the 56 | // page boundary. It will ensure that user buffer will be used when user create 57 | // Buffer/Mem Object with CL_MEM_USE_HOST_PTR. 58 | template 59 | struct aligned_allocator 60 | { 61 | using value_type = T; 62 | T *allocate(std::size_t num) 63 | { 64 | void *ptr = nullptr; 65 | if (posix_memalign(&ptr, 4096, num * sizeof(T))) 66 | throw std::bad_alloc(); 67 | return reinterpret_cast(ptr); 68 | } 69 | void deallocate(T *p, std::size_t num) 70 | { 71 | free(p); 72 | } 73 | }; 74 | 75 | namespace xilinx { 76 | namespace example_utils { 77 | class XilinxOclHelper 78 | { 79 | private: 80 | bool is_initialized = false; 81 | cl::Device device; 82 | cl::Context context; 83 | cl::Program program; 84 | 85 | std::vector find_xilinx_devices(); 86 | 87 | public: 88 | XilinxOclHelper(); 89 | ~XilinxOclHelper(); 90 | 91 | void initialize(std::string xclbin_file_name); 92 | 93 | cl::CommandQueue get_command_queue(bool in_order = false, 94 | bool enable_profiling = false); 95 | cl::Kernel get_kernel(std::string kernel_name); 96 | cl::Buffer create_buffer(size_t size, cl_mem_flags flags); 97 | cl::Buffer create_buffer_in_bank(int bank, size_t size, cl_mem_flags flags); 98 | int get_fd_for_buffer(cl::Buffer buf); 99 | cl::Buffer get_buffer_from_fd(int fd); 100 | const cl::Context &get_context(); 101 | }; 102 | } // namespace example_utils 103 | } // namespace xilinx 104 | #endif 105 | -------------------------------------------------------------------------------- /sources/vision_lab/src/vision_config.ini: -------------------------------------------------------------------------------- 1 | [advanced] 2 | prop=kernel.resize_accel_rgb.kernel_flags=-D__SDSVHLS__ -DHLS_NO_XIL_FPO_LIB 3 | prop=kernel.resize_blur_rgb.kernel_flags=-D__SDSVHLS__ -DHLS_NO_XIL_FPO_LIB 4 | prop=solution.kernel_compiler_margin=5 5 | -------------------------------------------------------------------------------- /sources/vision_lab/xrt.ini: -------------------------------------------------------------------------------- 1 | [Debug] 2 | opencl_summary=true 3 | opencl_device_counter=true 4 | opencl_trace=true 5 | data_transfer_trace=off 6 | stall_trace=off 7 | trace_buffer_size=1M 8 | app_debug=false 9 | -------------------------------------------------------------------------------- /sources/xrt.ini: -------------------------------------------------------------------------------- 1 | [Debug] 2 | opencl_summary=true 3 | power_profile=false 4 | opencl_trace=true 5 | lop_trace=false 6 | xrt_trace=false 7 | data_transfer_trace=coarse 8 | stall_trace=off 9 | app_debug=true 10 | 11 | --------------------------------------------------------------------------------