Full Code of UCLA-VAST/AutoSA for AI

master b61a1b4132d6 cached
587 files
8.9 MB
2.4M tokens
3993 symbols
1 requests
Download .txt
Showing preview only (9,475K chars total). Download the full file or copy to clipboard to get everything.
Repository: UCLA-VAST/AutoSA
Branch: master
Commit: b61a1b4132d6
Files: 587
Total size: 8.9 MB

Directory structure:
gitextract_nqdxn4c0/

├── .dockerignore
├── .gitignore
├── .gitmodules
├── ChangeLog
├── Dockerfile
├── LICENSE
├── README.md
├── autosa_config/
│   ├── autosa_config.json
│   ├── hw_info.json
│   ├── hw_info_libs/
│   │   ├── hw_info.json.ku3
│   │   ├── hw_info.json.u200
│   │   └── hw_info.json.u250
│   ├── module_group.json
│   ├── optimizer_settings.json
│   └── optimizer_settings_libs/
│       ├── gemm3_fp32.json
│       ├── gemm3_int16.json
│       ├── gemm3_int16_32.json
│       ├── gemm3_int8.json
│       ├── gemm3_int8_64.json
│       ├── gemm4_fp32.json
│       ├── mm_small.json
│       ├── mttkrp_fp32.json
│       ├── ttm_fp32.json
│       └── ttmc_fp32.json
├── autosa_scripts/
│   ├── autosa.py
│   ├── codegen.py
│   ├── hls_scripts/
│   │   ├── hls_script.tcl
│   │   └── hls_script_synth.tcl
│   ├── intel_opencl_scripts/
│   │   ├── Makefile
│   │   ├── common/
│   │   │   ├── inc/
│   │   │   │   └── AOCLUtils/
│   │   │   │       ├── aocl_utils.h
│   │   │   │       ├── opencl.h
│   │   │   │       ├── options.h
│   │   │   │       └── scoped_ptrs.h
│   │   │   ├── readme.css
│   │   │   └── src/
│   │   │       └── AOCLUtils/
│   │   │           ├── opencl.cpp
│   │   │           └── options.cpp
│   │   └── compile_design.sh
│   ├── latency_model.py
│   ├── module_group.py
│   ├── odyssey/
│   │   ├── RL_utils.py
│   │   ├── analyze.py
│   │   ├── clean_up.sh
│   │   ├── cst/
│   │   │   ├── hw_cst.json
│   │   │   ├── single_test.json
│   │   │   ├── u250.json
│   │   │   └── vu9p.json
│   │   ├── design.py
│   │   ├── designs/
│   │   │   └── kernel3.json
│   │   ├── designs_lib/
│   │   │   ├── cnn/
│   │   │   │   ├── kernel0_0.json
│   │   │   │   ├── kernel0_1.json
│   │   │   │   ├── kernel0_2.json
│   │   │   │   ├── kernel1_0.json
│   │   │   │   ├── kernel1_1.json
│   │   │   │   ├── kernel1_2.json
│   │   │   │   ├── kernel2_0.json
│   │   │   │   ├── kernel2_1.json
│   │   │   │   ├── kernel2_2.json
│   │   │   │   ├── kernel3_0.json
│   │   │   │   ├── kernel3_1.json
│   │   │   │   ├── kernel3_2.json
│   │   │   │   ├── kernel4_0.json
│   │   │   │   ├── kernel4_1.json
│   │   │   │   ├── kernel4_2.json
│   │   │   │   ├── kernel5_0.json
│   │   │   │   ├── kernel5_1.json
│   │   │   │   ├── kernel5_2.json
│   │   │   │   ├── kernel6_0.json
│   │   │   │   ├── kernel6_1.json
│   │   │   │   ├── kernel6_2.json
│   │   │   │   ├── kernel7_0.json
│   │   │   │   ├── kernel7_1.json
│   │   │   │   ├── kernel7_2.json
│   │   │   │   ├── kernel8_0.json
│   │   │   │   ├── kernel8_1.json
│   │   │   │   ├── kernel8_2.json
│   │   │   │   ├── kernel9_0.json
│   │   │   │   ├── kernel9_1.json
│   │   │   │   └── kernel9_2.json
│   │   │   └── gemm/
│   │   │       ├── kernel0_0.json
│   │   │       ├── kernel0_1.json
│   │   │       ├── kernel0_2.json
│   │   │       ├── kernel1_0.json
│   │   │       ├── kernel1_1.json
│   │   │       ├── kernel1_2.json
│   │   │       ├── kernel2_0.json
│   │   │       ├── kernel2_1.json
│   │   │       ├── kernel2_2.json
│   │   │       ├── kernel3_0.json
│   │   │       ├── kernel3_1.json
│   │   │       ├── kernel3_2.json
│   │   │       ├── kernel4_0.json
│   │   │       ├── kernel4_1.json
│   │   │       ├── kernel4_2.json
│   │   │       ├── kernel5_0.json
│   │   │       ├── kernel5_1.json
│   │   │       └── kernel5_2.json
│   │   ├── explorer.py
│   │   ├── main.py
│   │   ├── requirements.txt
│   │   ├── scripts/
│   │   │   ├── compute_network_info.py
│   │   │   ├── grid_search_xgb_params.py
│   │   │   ├── img2col.py
│   │   │   ├── run_arch1.sh
│   │   │   ├── run_arch1_free.sh
│   │   │   ├── run_arch1_ml_cmp.sh
│   │   │   ├── run_arch2.sh
│   │   │   ├── run_arch3.sh
│   │   │   ├── run_arch4.sh
│   │   │   ├── run_dataflow_cmp_cnn.sh
│   │   │   ├── run_dataflow_cmp_mm.sh
│   │   │   ├── run_dataflow_cmp_mm_energy.sh
│   │   │   ├── run_img2col_single.sh
│   │   │   ├── run_method_cmp.sh
│   │   │   ├── run_metric_cmp.sh
│   │   │   ├── run_mutation_cmp.sh
│   │   │   └── split_cnn_layers.py
│   │   ├── search_task.py
│   │   ├── solver.py
│   │   ├── tuners.py
│   │   ├── unit_test.py
│   │   ├── utils.py
│   │   └── workload/
│   │       ├── conv.json
│   │       ├── mm.json
│   │       ├── mm64.json
│   │       ├── mobilenetv2.json
│   │       ├── mobilenetv2_1.json
│   │       ├── mobilenetv2_10.json
│   │       ├── mobilenetv2_11.json
│   │       ├── mobilenetv2_12.json
│   │       ├── mobilenetv2_13.json
│   │       ├── mobilenetv2_14.json
│   │       ├── mobilenetv2_15.json
│   │       ├── mobilenetv2_16.json
│   │       ├── mobilenetv2_17.json
│   │       ├── mobilenetv2_18.json
│   │       ├── mobilenetv2_19.json
│   │       ├── mobilenetv2_2.json
│   │       ├── mobilenetv2_20.json
│   │       ├── mobilenetv2_21.json
│   │       ├── mobilenetv2_22.json
│   │       ├── mobilenetv2_23.json
│   │       ├── mobilenetv2_24.json
│   │       ├── mobilenetv2_25.json
│   │       ├── mobilenetv2_26.json
│   │       ├── mobilenetv2_27.json
│   │       ├── mobilenetv2_28.json
│   │       ├── mobilenetv2_29.json
│   │       ├── mobilenetv2_3.json
│   │       ├── mobilenetv2_30.json
│   │       ├── mobilenetv2_31.json
│   │       ├── mobilenetv2_32.json
│   │       ├── mobilenetv2_33.json
│   │       ├── mobilenetv2_34.json
│   │       ├── mobilenetv2_35.json
│   │       ├── mobilenetv2_36.json
│   │       ├── mobilenetv2_4.json
│   │       ├── mobilenetv2_47.json
│   │       ├── mobilenetv2_5.json
│   │       ├── mobilenetv2_6.json
│   │       ├── mobilenetv2_7.json
│   │       ├── mobilenetv2_8.json
│   │       ├── mobilenetv2_9.json
│   │       ├── mobilenetv2_complete.json
│   │       ├── mobilenetv2_conv3_1_0.json
│   │       ├── mobilenetv2_first.json
│   │       ├── mobilenetv2_first1.json
│   │       ├── mobilenetv2_first2.json
│   │       ├── mobilenetv2_half.json
│   │       ├── mobilenetv2_img2col.json
│   │       ├── mobilenetv2_no_first.json
│   │       ├── mobilenetv2_original.json
│   │       ├── mobilenetv2_test.json
│   │       ├── mobilenetv2_test_single.json
│   │       ├── resnet152.json
│   │       ├── resnet50.json
│   │       ├── resnet50_1.json
│   │       ├── resnet50_10.json
│   │       ├── resnet50_11.json
│   │       ├── resnet50_12.json
│   │       ├── resnet50_13.json
│   │       ├── resnet50_14.json
│   │       ├── resnet50_15.json
│   │       ├── resnet50_16.json
│   │       ├── resnet50_17.json
│   │       ├── resnet50_18.json
│   │       ├── resnet50_19.json
│   │       ├── resnet50_2.json
│   │       ├── resnet50_20.json
│   │       ├── resnet50_21.json
│   │       ├── resnet50_22.json
│   │       ├── resnet50_23.json
│   │       ├── resnet50_24.json
│   │       ├── resnet50_25.json
│   │       ├── resnet50_26.json
│   │       ├── resnet50_27.json
│   │       ├── resnet50_28.json
│   │       ├── resnet50_29.json
│   │       ├── resnet50_3.json
│   │       ├── resnet50_30.json
│   │       ├── resnet50_31.json
│   │       ├── resnet50_32.json
│   │       ├── resnet50_33.json
│   │       ├── resnet50_34.json
│   │       ├── resnet50_35.json
│   │       ├── resnet50_36.json
│   │       ├── resnet50_37.json
│   │       ├── resnet50_38.json
│   │       ├── resnet50_39.json
│   │       ├── resnet50_4.json
│   │       ├── resnet50_40.json
│   │       ├── resnet50_41.json
│   │       ├── resnet50_42.json
│   │       ├── resnet50_43.json
│   │       ├── resnet50_44.json
│   │       ├── resnet50_45.json
│   │       ├── resnet50_46.json
│   │       ├── resnet50_47.json
│   │       ├── resnet50_48.json
│   │       ├── resnet50_49.json
│   │       ├── resnet50_5.json
│   │       ├── resnet50_6.json
│   │       ├── resnet50_7.json
│   │       ├── resnet50_8.json
│   │       ├── resnet50_9.json
│   │       ├── resnet50_batch4.json
│   │       ├── resnet50_conv5_1.json
│   │       ├── resnet50_img2col.json
│   │       ├── resnet50_last.json
│   │       ├── resnet50_last2.json
│   │       ├── resnet50_original.json
│   │       ├── vgg16-2-img2col.json
│   │       ├── vgg16-3.json
│   │       ├── vgg16-4.json
│   │       ├── vgg16.json
│   │       ├── vgg16_1.json
│   │       ├── vgg16_10.json
│   │       ├── vgg16_11.json
│   │       ├── vgg16_12.json
│   │       ├── vgg16_13.json
│   │       ├── vgg16_2.json
│   │       ├── vgg16_3.json
│   │       ├── vgg16_4.json
│   │       ├── vgg16_5.json
│   │       ├── vgg16_6.json
│   │       ├── vgg16_7.json
│   │       ├── vgg16_8.json
│   │       ├── vgg16_9.json
│   │       └── vgg16_img2col.json
│   ├── optimizer.py
│   ├── optimizer_prune.py
│   ├── pe_group.py
│   ├── ppcg_changes/
│   │   ├── isl/
│   │   │   ├── ast_type.h
│   │   │   ├── files.txt
│   │   │   ├── isl_patch.sh
│   │   │   ├── isl_schedule.c
│   │   │   ├── isl_schedule_band.c
│   │   │   ├── isl_schedule_band.h
│   │   │   ├── isl_schedule_node.c
│   │   │   ├── isl_schedule_tree.c
│   │   │   ├── isl_schedule_tree.h
│   │   │   ├── schedule.h
│   │   │   ├── schedule_node.h
│   │   │   └── vec.h
│   │   └── ppcg/
│   │       └── files.txt
│   ├── resource_model.py
│   ├── tapa_scripts/
│   │   └── CMakeLists.txt
│   ├── tuner/
│   │   ├── constraint.py
│   │   ├── cst/
│   │   │   └── hw_cst.json
│   │   ├── design.py
│   │   ├── main.py
│   │   ├── search_task.py
│   │   ├── task/
│   │   │   ├── cnn.json
│   │   │   ├── mm.json
│   │   │   └── mm2.json
│   │   ├── tuner.py
│   │   ├── unit_test.py
│   │   └── utils.py
│   ├── tuning_scripts/
│   │   ├── cnn.sh
│   │   ├── gemm.sh
│   │   └── model_validate.sh
│   └── vitis_scripts/
│       ├── Makefile
│       └── connectivity.cfg
├── autosa_tests/
│   ├── cnn/
│   │   ├── Makefile
│   │   ├── README.md
│   │   ├── connectivity.cfg
│   │   ├── hls_script.tcl
│   │   ├── kernel.c
│   │   ├── kernel.h
│   │   ├── param_names.json
│   │   └── simd_info.json
│   ├── dnn_ops/
│   │   ├── dc_simd_info.json
│   │   ├── fc_simd_info.json
│   │   ├── hls_script.tcl
│   │   ├── kernel.c
│   │   ├── kernel.h
│   │   └── pc_simd_info.json
│   ├── large/
│   │   ├── cnn/
│   │   │   ├── Makefile
│   │   │   ├── README.md
│   │   │   ├── connectivity.cfg
│   │   │   ├── hls_script.tcl
│   │   │   ├── kernel.c
│   │   │   ├── kernel.h
│   │   │   ├── simd_info.json
│   │   │   ├── step1-run-hls.tcl
│   │   │   ├── step2-autobridge.py
│   │   │   ├── step3-pack-xo.tcl
│   │   │   └── step4-run-vitis.sh
│   │   ├── mm/
│   │   │   ├── Makefile
│   │   │   ├── README.md
│   │   │   ├── connectivity.cfg
│   │   │   ├── hls_script.tcl
│   │   │   ├── kernel.c
│   │   │   ├── kernel.h
│   │   │   ├── simd_info.json
│   │   │   ├── step1-run-hls.tcl
│   │   │   ├── step2-autobridge.py
│   │   │   ├── step3-pack-xo.tcl
│   │   │   └── step4-run-vitis.sh
│   │   ├── mm_block_sparse/
│   │   │   ├── Makefile
│   │   │   ├── README.md
│   │   │   ├── connectivity.cfg
│   │   │   ├── hls_script.tcl
│   │   │   ├── kernel.c
│   │   │   ├── kernel.h
│   │   │   └── simd_info.json
│   │   ├── mm_int16/
│   │   │   ├── Makefile
│   │   │   ├── README.md
│   │   │   ├── code.c
│   │   │   ├── connectivity.cfg
│   │   │   ├── hls_script.tcl
│   │   │   ├── kernel.c
│   │   │   ├── kernel.h
│   │   │   ├── simd_info.json
│   │   │   ├── step1-run-hls.tcl
│   │   │   ├── step2-autobridge.py
│   │   │   ├── step3-pack-xo.tcl
│   │   │   ├── step4-run-vitis.sh
│   │   │   └── unroll.py
│   │   ├── mm_int8/
│   │   │   ├── Makefile
│   │   │   ├── README.md
│   │   │   ├── code.c
│   │   │   ├── connectivity.cfg
│   │   │   ├── hls_script.tcl
│   │   │   ├── kernel.c
│   │   │   ├── kernel.h
│   │   │   ├── kernel_kernel_opt.cpp
│   │   │   ├── simd_info.json
│   │   │   ├── step1-run-hls.tcl
│   │   │   ├── step2-autobridge.py
│   │   │   ├── step3-pack-xo.tcl
│   │   │   ├── step4-run-vitis.sh
│   │   │   └── unroll.py
│   │   ├── mm_intel/
│   │   │   ├── Makefile
│   │   │   ├── README.md
│   │   │   ├── kernel.c
│   │   │   ├── kernel.h
│   │   │   └── simd_info.json
│   │   ├── mttkrp/
│   │   │   ├── Makefile
│   │   │   ├── README.md
│   │   │   ├── connectivity.cfg
│   │   │   ├── kernel.c
│   │   │   ├── kernel.h
│   │   │   ├── simd_info.json
│   │   │   ├── step1-run-hls.tcl
│   │   │   ├── step2-autobridge.py
│   │   │   ├── step3-pack-xo.tcl
│   │   │   └── step4-run-vitis.sh
│   │   ├── ttm/
│   │   │   ├── Makefile
│   │   │   ├── README.md
│   │   │   ├── connectivity.cfg
│   │   │   ├── kernel.c
│   │   │   ├── kernel.h
│   │   │   └── simd_info.json
│   │   └── ttmc/
│   │       ├── Makefile
│   │       ├── README.md
│   │       ├── connectivity.cfg
│   │       ├── kernel.c
│   │       ├── kernel.h
│   │       ├── simd_info.json
│   │       ├── step1-run-hls.tcl
│   │       ├── step2-autobridge.py
│   │       ├── step3-pack-xo.tcl
│   │       └── step4-run-vitis.sh
│   ├── lu/
│   │   ├── Makefile
│   │   ├── README.md
│   │   ├── add_batch.py
│   │   ├── hls_script.tcl
│   │   ├── kernel.c
│   │   ├── kernel.h
│   │   └── simd_info.json
│   ├── mm/
│   │   ├── Makefile
│   │   ├── README.md
│   │   ├── connectivity.cfg
│   │   ├── hls_script.tcl
│   │   ├── kernel.c
│   │   ├── kernel.h
│   │   ├── param_names.json
│   │   └── simd_info.json
│   ├── mm_block_sparse/
│   │   ├── Makefile
│   │   ├── README.md
│   │   ├── connectivity.cfg
│   │   ├── hls_script.tcl
│   │   ├── kernel.c
│   │   ├── kernel.h
│   │   └── simd_info.json
│   ├── mm_catapult/
│   │   ├── README.md
│   │   ├── directives.tcl
│   │   ├── kernel.c
│   │   ├── kernel.h
│   │   ├── kernel_kernel_hw.h
│   │   └── simd_info.json
│   ├── mm_getting_started/
│   │   ├── Makefile
│   │   ├── connectivity.cfg
│   │   ├── hls_script.tcl
│   │   ├── kernel.c
│   │   ├── kernel.h
│   │   └── simd_info.json
│   ├── mm_hbm/
│   │   ├── Makefile
│   │   ├── README.md
│   │   ├── connectivity.cfg
│   │   ├── hls_script.tcl
│   │   ├── kernel.c
│   │   ├── kernel.h
│   │   └── simd_info.json
│   ├── mm_hcl/
│   │   ├── README.md
│   │   ├── hls_script.tcl
│   │   ├── kernel.c
│   │   ├── kernel.h
│   │   └── simd_info.json
│   ├── mm_hcl_intel/
│   │   ├── Makefile
│   │   ├── README.md
│   │   ├── kernel.c
│   │   ├── kernel.h
│   │   ├── kernel2.c
│   │   └── simd_info.json
│   ├── mm_int16/
│   │   ├── Makefile
│   │   ├── README.md
│   │   ├── connectivity.cfg
│   │   ├── hls_script.tcl
│   │   ├── kernel.c
│   │   ├── kernel.h
│   │   └── simd_info.json
│   └── mm_intel/
│       ├── Makefile
│       ├── README.md
│       ├── kernel.c
│       ├── kernel.h
│       └── simd_info.json
├── clean.sh
├── docs/
│   ├── Makefile
│   ├── conf.py
│   ├── docker_image.rst
│   ├── examples/
│   │   ├── cnn.rst
│   │   ├── cnn_large.rst
│   │   ├── dnn_ops.rst
│   │   ├── index.rst
│   │   ├── lu.rst
│   │   ├── mm.rst
│   │   ├── mm_block_sparse.rst
│   │   ├── mm_hbm.rst
│   │   ├── mm_int16.rst
│   │   ├── mm_int16_large.rst
│   │   ├── mm_int8_large.rst
│   │   ├── mm_large.rst
│   │   ├── mttkrp_large.rst
│   │   └── ttmc_large.rst
│   ├── index.rst
│   ├── install_from_source.rst
│   ├── installation.rst
│   ├── make.bat
│   └── tutorials/
│       ├── auto_bridge.rst
│       ├── auto_tuning_exhaustive.rst
│       ├── auto_tuning_genetic.rst
│       ├── catapult_backend.rst
│       ├── getting_started.rst
│       ├── hcl_integrate.rst
│       ├── host_serialize.rst
│       ├── index.rst
│       ├── intel_backend.rst
│       ├── matrix_multiplication.rst
│       ├── optimize_array.rst
│       ├── structural_sparsity.rst
│       └── theory_background.rst
├── install.sh
├── ltmain.sh
├── requirements.txt
└── src/
    ├── ChangeLog
    ├── LICENSE
    ├── Makefile.am
    ├── README
    ├── autogen.sh
    ├── autosa_catapult_hls_c.cpp
    ├── autosa_catapult_hls_c.h
    ├── autosa_codegen.cpp
    ├── autosa_codegen.h
    ├── autosa_comm.cpp
    ├── autosa_comm.h
    ├── autosa_common.cpp
    ├── autosa_common.h
    ├── autosa_cpu.cpp
    ├── autosa_cpu.h
    ├── autosa_intel_opencl.cpp
    ├── autosa_intel_opencl.h
    ├── autosa_print.cpp
    ├── autosa_print.h
    ├── autosa_schedule_tree.cpp
    ├── autosa_schedule_tree.h
    ├── autosa_t2s.cpp
    ├── autosa_tapa_cpp.cpp
    ├── autosa_tapa_cpp.h
    ├── autosa_trans.cpp
    ├── autosa_trans.h
    ├── autosa_tuning.cpp
    ├── autosa_tuning.h
    ├── autosa_utils.cpp
    ├── autosa_utils.h
    ├── autosa_xilinx_hls_c.cpp
    ├── autosa_xilinx_hls_c.h
    ├── configure.ac
    ├── cpu.c
    ├── cpu.h
    ├── examples/
    │   └── chemv.c
    ├── get_submodules.sh
    ├── grouping.c
    ├── grouping.h
    ├── hybrid.c
    ├── hybrid.h
    ├── json.hpp
    ├── m4/
    │   ├── ax_check_opencl.m4
    │   ├── ax_check_openmp.m4
    │   ├── ax_detect_git_head.m4
    │   └── ax_submodule.m4
    ├── main.cpp
    ├── ocl_utilities.c
    ├── ocl_utilities.h
    ├── opencl_test.sh.in
    ├── polybench_test.sh.in
    ├── ppcg.c
    ├── ppcg.h
    ├── ppcg_files/
    │   ├── cuda.c
    │   ├── cuda.h
    │   ├── cuda_common.c
    │   ├── cuda_common.h
    │   ├── gpu.c
    │   ├── gpu.h
    │   ├── gpu_array_tile.c
    │   ├── gpu_array_tile.h
    │   ├── gpu_group.c
    │   ├── gpu_group.h
    │   ├── gpu_hybrid.c
    │   ├── gpu_hybrid.h
    │   ├── gpu_print.c
    │   ├── gpu_print.h
    │   ├── gpu_tree.c
    │   ├── gpu_tree.h
    │   ├── opencl.c
    │   └── opencl.h
    ├── ppcg_options.c
    ├── ppcg_options.h
    ├── print.c
    ├── print.h
    ├── schedule.c
    ├── schedule.h
    ├── tests/
    │   ├── call.c
    │   ├── call2.c
    │   ├── call2_opencl_functions.cl
    │   ├── call3.c
    │   ├── call3_opencl_functions.cl
    │   ├── call4.c
    │   ├── call5.c
    │   ├── call_opencl_functions.cl
    │   ├── dead.c
    │   ├── iterator.c
    │   ├── live_out.c
    │   ├── local.c
    │   ├── loop.c
    │   ├── not_accessed.c
    │   ├── not_accessed_opencl_functions.cl
    │   ├── scalar.c
    │   ├── shared_sink.c
    │   ├── struct.c
    │   ├── struct2.c
    │   ├── struct3.c
    │   ├── struct4.c
    │   └── struct5.c
    ├── util.c
    ├── util.h
    └── version.c

================================================
FILE CONTENTS
================================================

================================================
FILE: .dockerignore
================================================
src/.deps/
src/.libs/
src/Makefile
src/Makefile.in
src/aclocal.m4
src/autom4te.cache/
src/compile
src/config.guess
src/config.log
src/config.status
src/config.sub
src/configure
src/depcomp
src/gitversion.h
src/install-sh
src/libtool
src/ltmain.sh
src/m4/libtool.m4
src/m4/ltoptions.m4
src/m4/ltsugar.m4
src/m4/ltversion.m4
src/m4/lt~obsolete.m4
src/missing
src/ppcg
src/test-driver
src/build
src/opencl_test.sh
src/polybench_test.sh
src/.nfs*
src/*.o
src/.vscode
src/autosa
src/tags

autosa
autosa.tmp
.nfs*


================================================
FILE: .gitignore
================================================
src/.deps/
src/.libs/
src/Makefile
src/Makefile.in
src/aclocal.m4
src/autom4te.cache/
src/compile
src/config.guess
src/config.log
src/config.status
src/config.sub
src/configure
src/depcomp
src/gitversion.h
src/install-sh
src/libtool
src/ltmain.sh
src/m4/libtool.m4
src/m4/ltoptions.m4
src/m4/ltsugar.m4
src/m4/ltversion.m4
src/m4/lt~obsolete.m4
src/missing
src/ppcg
src/test-driver
src/build
src/opencl_test.sh
src/polybench_test.sh
src/.nfs*
src/*.o
src/.vscode
src/autosa
src/tags

autosa
autosa.tmp
.nfs*
.vscode
.libs
autosa_scripts/__pycache__
docs/_build
autosa_scripts/tuner/__pycache__
autosa_scripts/tuner/outdir

autosa_scripts/odyssey/db/*
autosa_scripts/odyssey/outdir/*
autosa_scripts/odyssey/__pycache__
autosa_scripts/odyssey/tmp/*
autosa_scripts/odyssey/solver/*
autosa_scripts/odyssey/designs/register


================================================
FILE: .gitmodules
================================================
[submodule "src/isl"]
	path = src/isl
	url = git://repo.or.cz/isl.git
[submodule "src/pet"]
	path = src/pet
	url = git://repo.or.cz/pet.git
[submodule "src/cJSON"]
	path = src/cJSON
	url = https://github.com/DaveGamble/cJSON.git
[submodule "src/barvinok"]
	path = src/barvinok
	url = https://repo.or.cz/barvinok.git


================================================
FILE: ChangeLog
================================================
version: 0.01
2020-5-10 Jie Wang <jiewang@cs.ucla.edu>
changes:
  - initial release of AutoSA


================================================
FILE: Dockerfile
================================================
# Get the base Ubuntu image from Docker Hub
FROM ubuntu:latest
LABEL maintainer="jiewang@cs.ucla.edu"
ENV DEBIAN_FRONTEND=noninteractive 

# Update apps on the base image
RUN apt-get -y update && apt-get install -y

# Install the prerequisites
RUN apt-get -y install apt-utils automake autoconf libtool libtool-bin pkg-config libgmp3-dev libyaml-dev python3.6 python3-pip git wget cmake vim gdb  
RUN apt-get -y install libllvm-9-ocaml-dev libllvm9 llvm-9 llvm-9-dev llvm-9-doc llvm-9-examples llvm-9-runtime clang-9 clang-tools-9 clang-9-doc libclang-common-9-dev libclang-9-dev libclang1-9 clang-format-9 python-clang-9 clangd-9
RUN ln -s /usr/bin/llvm-config-9 /usr/bin/llvm-config

# Install NTL for barvinok
RUN mkdir /ntl
WORKDIR /ntl
RUN wget https://www.shoup.net/ntl/ntl-11.4.3.tar.gz
RUN gunzip ntl-11.4.3.tar.gz
RUN tar xf ntl-11.4.3.tar
WORKDIR /ntl/ntl-11.4.3/src
RUN ./configure NTL_GMP_LIP=on
RUN make -j4
RUN make install

# Copy the current folder to the Docker image
COPY . /usr/src/docker_autosa

# Specify the working directory
WORKDIR /usr/src/docker_autosa

# Install AutoSA
RUN ./install.sh


================================================
FILE: LICENSE
================================================
MIT License (MIT)

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.


================================================
FILE: README.md
================================================
<div align="center">
  <img src=".github/autosa_logo.png", width="200">
</div>

# AutoSA: Polyhedral-Based Systolic Array Auto-Compilation

[Documentation](https://autosa.readthedocs.io/en/latest/) |
[Installation](https://autosa.readthedocs.io/en/latest/installation.html) |
[Tutorials](https://autosa.readthedocs.io/en/latest/tutorials/index.html) |
[Examples](https://autosa.readthedocs.io/en/latest/examples/index.html)

This repository includes the code for AutoSA. AutoSA is an end-to-end systolic array compiler based on the polyhedral model. It takes algorithms in high-level programming languages (C) as inputs, performs polyhedral transformation and other architecture optimizations to map algorithms to systolic array architecture. The generated designs are in HLS C.

## Quick Start
We offer a Docker image for quick start.
```bash
docker pull whbldhwj/autosa:latest
```

Let's try one small example. The input code can be found at `${AUTOSA_ROOT}/autosa_tests/mm/kernel.c`. The code region to be transformed to systolic array is annotated using a pair of pragmas `scop` and `endscop`.

1. Generating HLS C Code.

Run the following command to compile generate a systolic array.
```c
./autosa ./autosa_tests/mm/kernel.c \
--config=./autosa_config/autosa_config.json \
--target=autosa_hls_c \
--output-dir=./autosa.tmp/output \
--sa-sizes="{kernel[]->space_time[3];kernel[]->array_part[16,16,16];kernel[]->latency[8,8];kernel[]->simd[2]}" \
--simd-info=./autosa_tests/mm/simd_info.json \
--host-serialize
```
The generated code can be found in `${AUTOSA_ROOT}/autosa.tmp/output/src/`.
For detailed explaination of each AutoSA compilation option, please run
```c
./autosa --help
```
or refer to [AutoSA Compilation Options](https://autosa.readthedocs.io/en/latest/tutorials/getting_started.html#autosa-compilation-options).

2. Generating FPGA Bitstream

To generate the final bitsteam, set up your local Vitis development kit first.
Then execute the makefile to build the design.
```
cp ${AUTOSA_ROOT}/autosa_tests/mm/Makefile autosa.tmp/output/
cp ${AUTOSA_ROOT}/autosa_tests/mm/connectivity.cfg autosa.tmp/output/
cd ${AUTOSA_ROOT}/autosa.tmp/output
make all
```
**Makefile Options Descriptions**

* `MODE := hw_emu`: Set the build configuration mode to HW Emulation, other modes: sw_emu|hw
* `PLATFORM := xilinx_u250_xdma_201830_2`: Select the target platform
* `KERNEL_SRC := src/kernel_kernel.cpp`: List the kernel source files
* `HOST_SRC := src/kernel_host.cpp`: List the host source files

The `connectivity.cfg` describes the DRAM port mapping. For more details about how to change the DRAM port mapping, please refer to the Xilinx tutorials.

3. Verifying Designs Using Xilinx HLS

AutoSA also supports generate HLS projects. Add the flag
```
--hls
```
to the command when compiling the program.

```c
./autosa ./autosa_tests/mm/kernel.c \
--config=./autosa_config/autosa_config.json \
--target=autosa_hls_c \
--output-dir=./autosa.tmp/output \
--sa-sizes="{kernel[]->space_time[3];kernel[]->array_part[16,16,16];kernel[]->latency[8,8];kernel[]->simd[2]}" \
--simd-info=./autosa_tests/mm/simd_info.json \
--host-serialize \
--hls
```

AutoSA will generate an HLS host file `${AUTOSA_ROOT}/autosa.tmp/output/src/kernel_host.cpp` instead of the OpenCL host file generated in the previous step. To build the HLS project, run the following commands.
```
cp ${AUTOSA_ROOT}/autosa_scripts/hls_scripts/hls_script.tcl autosa.tmp/output/
cd ${AUTOSA_ROOT}/autosa.tmp/output
vivado_hls -f hls_script.tcl
```

For more detailed instructions on using AutoSA, please refer to the [AutoSA Documentation](https://autosa.readthedocs.io/en/latest/).

## Send Us Failure Cases and Feedback!
AutoSA is open source for research purposes, and we would like to continously improve it! Please let us know if...

1. you find any bug in the AutoSA code.
2. you find any application that fails the compilation flow of AutoSA.
3. you know how to further help improve any part of the compiler.
4. etc.

## Authors and Contributors
AutoSA is currently maintained by [Jie Wang](http://cadlab.cs.ucla.edu/~jaywang/).
Besides, we gratefully acknowledge the authors of [PPCG](https://github.com/Meinersbur/ppcg) for developing and actively maintaining PPCG as an open-source project.

## Papers
More implementation details of AutoSA are covered in [our paper](http://cadlab.cs.ucla.edu/~jaywang/papers/fpga21-autosa.pdf). If you find this project useful in your research, please consider citing:

    @inproceedings{wang2021autosa,
      title={AutoSA: A Polyhedral Compiler for High-Performance Systolic Arrays on FPGA},
      author={Wang, Jie and Guo, Licheng and Cong, Jason},
      booktitle={Proceedings of the 2021 ACM/SIGDA International Symposium on Field-Programmable Gate Arrays},
      year={2021}
    }


================================================
FILE: autosa_config/autosa_config.json
================================================
{
    "space_time": {
        "mode": "manual"
    },
    "array_part": {
        "enable": 1,
        "mode": "manual"
    },
    "array_part_L2": {
        "enable": 1,
        "mode": "manual"
    },
    "latency": {
        "enable": 1,
        "mode": "manual"
    },
    "simd": {
        "enable": 1,
        "mode": "manual"
    },
    "hbm": {
        "mode": "manual"
    }
}


================================================
FILE: autosa_config/hw_info.json
================================================
{
  "BRAM18K": 5376,
  "DSP": 12288,
  "FF": 3456000,
  "LUT": 1728000,
  "URAM": 1280
}


================================================
FILE: autosa_config/hw_info_libs/hw_info.json.ku3
================================================
{
  "BRAM": 2160,
  "DSP": 2760,
  "FF": 663360,
  "LUT": 331680,
  "URAM": 0
}


================================================
FILE: autosa_config/hw_info_libs/hw_info.json.u200
================================================
{
  "BRAM": 4320,
  "DSP": 6840,
  "FF": 2364480,
  "LUT": 1182240,
  "URAM": 960
}


================================================
FILE: autosa_config/hw_info_libs/hw_info.json.u250
================================================
{
  "BRAM18K": 5376,
  "DSP": 12288,
  "FF": 3456000,
  "LUT": 1728000,
  "URAM": 1280
}


================================================
FILE: autosa_config/module_group.json
================================================
{
  "x": 8,
  "y": 1
}


================================================
FILE: autosa_config/optimizer_settings.json
================================================
{
    "training": {
        "sample": {
            "space_time": {
                "mode": "exhaustive",
                "n": -1
            },
            "array_part": {
                "mode": "random",
                "n": 2,
                "loop_limit": -1
            },
            "latency_hiding": {
                "mode": "random",
                "n": 2,
                "loop_limit": 64
            },
            "SIMD_vectorization": {
                "mode": "random",
                "n": 2,
                "loop_limit": 4
            }
        },
        "pruning": {
            "array_part": {
                "enable": 1,
                "PE_num": [
                    8,
                    32
                ]
            },
            "array_part_L2": {
                "enable": 1
            },
            "latency_hiding": {
                "enable": 1,
                "reg_size": [
                    32,
                    256
                ]
            },
            "SIMD_vectorization": {
                "enable": 1,
                "PE_num": [
                    8,
                    32
                ],
                "PE_ratio": 2
            }
        },
        "multiprocess": {
            "n_job": 1
        }
    },
    "synth": {
        "multiprocess": {
            "n_job": 16
        },
        "sample": {
            "n": 16
        }
    },
    "search": {
        "metric": "latency",
        "cycle_period": 5,
        "mode": "customized",
        "n_random": 5,
        "log": {
            "n_record": 10
        },
        "resource_target": ["BRAM18K", "DSP"],
        "time_out": -1,
        "update_time_interval": 2,        
        "pruning": {
            "random_start": {
                "enable": 1,
                "n_trial": 3,
                "n_random": 3
            },
            "resource": {                
                "range": {
                    "FF": [
                        0.25,
                        0.7
                    ],
                    "LUT": [
                        0.3,
                        0.75
                    ],
                    "DSP": [
                        0.6,
                        0.75
                    ],
                    "BRAM18K": [
                        0.3,
                        0.7
                    ],
                    "URAM": [
                        0,
                        0.6
                    ]
                }
            },
            "array_part": {
                "enable": 1,
                "PE_num": [
                    190,
                    210
                ]
            },
            "array_part_L2": {
                "enable": 1
            },
            "latency_hiding": {
                "enable": 1,
                "reg_size": [
                    64,
                    1280
                ]
            },
            "SIMD_vectorization": {
                "enable": 1,
                "PE_num": [
                    190,
                    210
                ],
                "PE_ratio": 3
            }
        },
        "multiprocess": {
            "n_job": 32
        },
        "sample": {
            "space_time": {
                "mode": "exhaustive",
                "n": -1
            },
            "array_part": {
                "mode": "exhaustive",
                "n": -1,
                "loop_limit": -1
            },
            "latency_hiding": {
                "mode": "exhaustive",
                "n": -1,
                "loop_limit": 64
            },
            "SIMD_vectorization": {
                "mode": "exhaustive",
                "n": -1,
                "loop_limit": 8
            }
        }
    }
}


================================================
FILE: autosa_config/optimizer_settings_libs/gemm3_fp32.json
================================================
{
    "training": {
        "sample": {
            "space_time": {
                "mode": "exhaustive",
                "n": -1
            },
            "array_part": {
                "mode": "random",
                "n": 2,
                "loop_limit": -1
            },
            "latency_hiding": {
                "mode": "random",
                "n": 2,
                "loop_limit": 64
            },
            "SIMD_vectorization": {
                "mode": "random",
                "n": 2,
                "loop_limit": 8
            }
        },
        "pruning": {
            "array_part": {
                "enable": 1,
                "PE_num": [
                    8,
                    32
                ]
            },
            "array_part_L2": {
                "enable": 1
            },
            "latency_hiding": {
                "enable": 1,
                "reg_size": [
                    16,
                    256
                ]
            },
            "SIMD_vectorization": {
                "enable": 1,
                "PE_num": [
                    8,
                    32
                ],
                "PE_ratio": 2
            }
        },
        "multiprocess": {
            "n_job": 1
        }
    },
    "synth": {
        "multiprocess": {
            "n_job": 16
        },
        "sample": {
            "n": 16
        }
    },
    "search": {
        "metric": "latency",
        "cycle_period": 5,
        "mode": "customized",
        "n_random": 5,
        "log": {
            "n_record": 10
        },
        "resource_target": ["BRAM18K", "DSP"],
        "time_out": -1,
        "update_time_interval": 2,        
        "pruning": {
            "random_start": {
                "enable": 1,
                "n_trial": 3,
                "n_random": 3
            },
            "resource": {                
                "range": {
                    "FF": [
                        0.25,
                        0.7
                    ],
                    "LUT": [
                        0.3,
                        0.75
                    ],
                    "DSP": [
                        0.6,
                        0.75
                    ],
                    "BRAM18K": [
                        0.3,
                        0.7
                    ],
                    "URAM": [
                        0,
                        0.6
                    ]
                }
            },
            "array_part": {
                "enable": 1,
                "PE_num": [
                    190,
                    210
                ]
            },
            "array_part_L2": {
                "enable": 1
            },
            "latency_hiding": {
                "enable": 1,
                "reg_size": [
                    64,
                    1280
                ]
            },
            "SIMD_vectorization": {
                "enable": 1,
                "PE_num": [
                    190,
                    210
                ],
                "PE_ratio": 3
            }
        },
        "multiprocess": {
            "n_job": 32
        },
        "sample": {
            "space_time": {
                "mode": "exhaustive",
                "n": -1
            },
            "array_part": {
                "mode": "exhaustive",
                "n": -1,
                "loop_limit": -1
            },
            "latency_hiding": {
                "mode": "exhaustive",
                "n": -1,
                "loop_limit": 64
            },
            "SIMD_vectorization": {
                "mode": "exhaustive",
                "n": -1,
                "loop_limit": 8
            }
        }
    }
}

================================================
FILE: autosa_config/optimizer_settings_libs/gemm3_int16.json
================================================
{
    "training": {
        "sample": {
            "space_time": {
                "mode": "exhaustive",
                "n": -1
            },
            "array_part": {
                "mode": "random",
                "n": 2,
                "loop_limit": -1
            },
            "latency_hiding": {
                "mode": "random",
                "n": 2,
                "loop_limit": 64
            },
            "SIMD_vectorization": {
                "mode": "random",
                "n": 2,
                "loop_limit": 16
            }
        },
        "pruning": {
            "array_part": {
                "enable": 1,
                "PE_num": [
                    8,
                    32
                ]
            },
            "array_part_L2": {
                "enable": 1
            },
            "latency_hiding": {
                "enable": 1,
                "reg_size": [
                    64,
                    256
                ]
            },
            "SIMD_vectorization": {
                "enable": 1,
                "PE_num": [
                    8,
                    32
                ],
                "PE_ratio": 2
            }
        },
        "multiprocess": {
            "n_job": 1
        }
    },
    "synth": {
        "multiprocess": {
            "n_job": 16
        },
        "sample": {
            "n": 16
        }
    },
    "search": {
        "metric": "latency",
        "cycle_period": 5,
        "mode": "customized",
        "n_random": 5,
        "log": {
            "n_record": 10
        },
        "resource_target": ["BRAM18K", "DSP"],
        "time_out": -1,
        "update_time_interval": 2,        
        "pruning": {
            "random_start": {
                "enable": 1,
                "n_trial": 3,
                "n_random": 3
            },
            "resource": {                
                "range": {
                    "FF": [
                        0.3,
                        0.7
                    ],
                    "LUT": [
                        0.3,
                        0.7
                    ],
                    "DSP": [
                        0.6,
                        0.75
                    ],
                    "BRAM18K": [
                        0.2,
                        0.7
                    ],
                    "URAM": [
                        0,
                        0.6
                    ]
                }
            },
            "array_part": {
                "enable": 1,
                "PE_num": [
                    480,
                    640
                ]
            },
            "array_part_L2": {
                "enable": 1
            },
            "latency_hiding": {
                "enable": 1,
                "reg_size": [
                    64,
                    1280
                ]
            },
            "SIMD_vectorization": {
                "enable": 1,
                "PE_num": [
                    480,
                    640
                ],
                "PE_ratio": 3
            }
        },
        "multiprocess": {
            "n_job": 32
        },
        "sample": {
            "space_time": {
                "mode": "exhaustive",
                "n": -1
            },
            "array_part": {
                "mode": "exhaustive",
                "n": -1,
                "loop_limit": -1
            },
            "latency_hiding": {
                "mode": "exhaustive",
                "n": -1,
                "loop_limit": 64
            },
            "SIMD_vectorization": {
                "mode": "exhaustive",
                "n": -1,
                "loop_limit": 16
            }
        }
    }
}

================================================
FILE: autosa_config/optimizer_settings_libs/gemm3_int16_32.json
================================================
{
    "training": {
        "sample": {
            "space_time": {
                "mode": "exhaustive",
                "n": -1
            },
            "array_part": {
                "mode": "random",
                "n": 2,
                "loop_limit": -1
            },
            "latency_hiding": {
                "mode": "random",
                "n": 2,
                "loop_limit": 64
            },
            "SIMD_vectorization": {
                "mode": "random",
                "n": 2,
                "loop_limit": 8
            }
        },
        "pruning": {
            "array_part": {
                "enable": 1,
                "PE_num": [
                    8,
                    32
                ]
            },
            "array_part_L2": {
                "enable": 1
            },
            "latency_hiding": {
                "enable": 1,
                "reg_size": [
                    16,
                    256
                ]
            },
            "SIMD_vectorization": {
                "enable": 1,
                "PE_num": [
                    8,
                    32
                ],
                "PE_ratio": 2
            }
        },
        "multiprocess": {
            "n_job": 1
        }
    },
    "synth": {
        "multiprocess": {
            "n_job": 16
        },
        "sample": {
            "n": 16
        }
    },
    "search": {
        "metric": "latency",
        "cycle_period": 5,
        "mode": "customized",
        "n_random": 5,
        "log": {
            "n_record": 10
        },
        "resource_target": ["DSP"],
        "time_out": -1,
        "update_time_interval": 2,        
        "pruning": {
            "random_start": {
                "enable": 1,
                "n_trial": 3,
                "n_random": 3
            },
            "resource": {                
                "range": {
                    "FF": [
                        0.25,
                        0.7
                    ],
                    "LUT": [
                        0.3,
                        0.75
                    ],
                    "DSP": [
                        0.5,
                        0.7
                    ],
                    "BRAM18K": [
                        0.3,
                        0.7
                    ],
                    "URAM": [
                        0,
                        0.6
                    ]
                }
            },
            "array_part": {
                "enable": 1,
                "PE_num": [
                    200,
                    300
                ]
            },
            "array_part_L2": {
                "enable": 1
            },
            "latency_hiding": {
                "enable": 1,
                "reg_size": [
                    64,
                    1024
                ]
            },
            "SIMD_vectorization": {
                "enable": 1,
                "PE_num": [
                    200,
                    300
                ],
                "PE_ratio": 3
            }
        },
        "multiprocess": {
            "n_job": 32
        },
        "sample": {
            "space_time": {
                "mode": "exhaustive",
                "n": -1
            },
            "array_part": {
                "mode": "exhaustive",
                "n": -1,
                "loop_limit": -1
            },
            "latency_hiding": {
                "mode": "exhaustive",
                "n": -1,
                "loop_limit": 64
            },
            "SIMD_vectorization": {
                "mode": "exhaustive",
                "n": -1,
                "loop_limit": 32
            }
        }
    }
}

================================================
FILE: autosa_config/optimizer_settings_libs/gemm3_int8.json
================================================
{
    "training": {
        "sample": {
            "space_time": {
                "mode": "exhaustive",
                "n": -1
            },
            "array_part": {
                "mode": "random",
                "n": 2,
                "loop_limit": -1
            },
            "latency_hiding": {
                "mode": "random",
                "n": 2,
                "loop_limit": 64
            },
            "SIMD_vectorization": {
                "mode": "random",
                "n": 2,
                "loop_limit": 8
            }
        },
        "pruning": {
            "array_part": {
                "enable": 1,
                "PE_num": [
                    8,
                    32
                ]
            },
            "array_part_L2": {
                "enable": 1
            },
            "latency_hiding": {
                "enable": 1,
                "reg_size": [
                    16,
                    256
                ]
            },
            "SIMD_vectorization": {
                "enable": 1,
                "PE_num": [
                    8,
                    32
                ],
                "PE_ratio": 2
            }
        },
        "multiprocess": {
            "n_job": 1
        }
    },
    "synth": {
        "multiprocess": {
            "n_job": 16
        },
        "sample": {
            "n": 16
        }
    },
    "search": {
        "metric": "latency",
        "cycle_period": 5,
        "mode": "customized",
        "n_random": 5,
        "log": {
            "n_record": 10
        },
        "resource_target": ["BRAM18K", "DSP"],
        "time_out": -1,
        "update_time_interval": 2,        
        "pruning": {
            "random_start": {
                "enable": 1,
                "n_trial": 3,
                "n_random": 3
            },
            "resource": {                
                "range": {
                    "FF": [
                        0.25,
                        0.7
                    ],
                    "LUT": [
                        0.3,
                        0.75
                    ],
                    "DSP": [
                        0.5,
                        0.7
                    ],
                    "BRAM18K": [
                        0.3,
                        0.75
                    ],
                    "URAM": [
                        0,
                        0.6
                    ]
                }
            },
            "array_part": {
                "enable": 1,
                "PE_num": [
                    350,
                    450
                ]
            },
            "array_part_L2": {
                "enable": 1
            },
            "latency_hiding": {
                "enable": 1,
                "reg_size": [
                    400,
                    1500
                ]
            },
            "SIMD_vectorization": {
                "enable": 1,
                "PE_num": [
                    350,
                    450
                ],
                "PE_ratio": 3
            }
        },
        "multiprocess": {
            "n_job": 32
        },
        "sample": {
            "space_time": {
                "mode": "exhaustive",
                "n": -1
            },
            "array_part": {
                "mode": "exhaustive",
                "n": -1,
                "loop_limit": -1
            },
            "latency_hiding": {
                "mode": "exhaustive",
                "n": -1,
                "loop_limit": 64
            },
            "SIMD_vectorization": {
                "mode": "exhaustive",
                "n": -1,
                "loop_limit": 32
            }
        }
    }
}

================================================
FILE: autosa_config/optimizer_settings_libs/gemm3_int8_64.json
================================================
{
    "training": {
        "sample": {
            "space_time": {
                "mode": "exhaustive",
                "n": -1
            },
            "array_part": {
                "mode": "random",
                "n": 2,
                "loop_limit": -1
            },
            "latency_hiding": {
                "mode": "random",
                "n": 2,
                "loop_limit": 64
            },
            "SIMD_vectorization": {
                "mode": "random",
                "n": 2,
                "loop_limit": 8
            }
        },
        "pruning": {
            "array_part": {
                "enable": 1,
                "PE_num": [
                    8,
                    32
                ]
            },
            "array_part_L2": {
                "enable": 1
            },
            "latency_hiding": {
                "enable": 1,
                "reg_size": [
                    16,
                    256
                ]
            },
            "SIMD_vectorization": {
                "enable": 1,
                "PE_num": [
                    8,
                    32
                ],
                "PE_ratio": 2
            }
        },
        "multiprocess": {
            "n_job": 1
        }
    },
    "synth": {
        "multiprocess": {
            "n_job": 16
        },
        "sample": {
            "n": 16
        }
    },
    "search": {
        "metric": "latency",
        "cycle_period": 5,
        "mode": "customized",
        "n_random": 5,
        "log": {
            "n_record": 10
        },
        "resource_target": ["DSP"],
        "time_out": -1,
        "update_time_interval": 2,        
        "pruning": {
            "random_start": {
                "enable": 1,
                "n_trial": 3,
                "n_random": 3
            },
            "resource": {                
                "range": {
                    "FF": [
                        0.25,
                        0.7
                    ],
                    "LUT": [
                        0.3,
                        0.75
                    ],
                    "DSP": [
                        0.5,
                        0.7
                    ],
                    "BRAM18K": [
                        0.3,
                        0.75
                    ],
                    "URAM": [
                        0,
                        0.6
                    ]
                }
            },
            "array_part": {
                "enable": 1,
                "PE_num": [
                    150,
                    200
                ]
            },
            "array_part_L2": {
                "enable": 1
            },
            "latency_hiding": {
                "enable": 1,
                "reg_size": [
                    256,
                    1000
                ]
            },
            "SIMD_vectorization": {
                "enable": 1,
                "PE_num": [
                    150,
                    200
                ],
                "PE_ratio": 3
            }
        },
        "multiprocess": {
            "n_job": 32
        },
        "sample": {
            "space_time": {
                "mode": "exhaustive",
                "n": -1
            },
            "array_part": {
                "mode": "exhaustive",
                "n": -1,
                "loop_limit": -1
            },
            "latency_hiding": {
                "mode": "exhaustive",
                "n": -1,
                "loop_limit": 64
            },
            "SIMD_vectorization": {
                "mode": "exhaustive",
                "n": -1,
                "loop_limit": 64
            }
        }
    }
}

================================================
FILE: autosa_config/optimizer_settings_libs/gemm4_fp32.json
================================================
{
    "training": {
        "sample": {
            "space_time": {
                "mode": "exhaustive",
                "n": -1
            },
            "array_part": {
                "mode": "random",
                "n": 2,
                "loop_limit": -1
            },
            "latency_hiding": {
                "mode": "random",
                "n": 2,
                "loop_limit": 64
            },
            "SIMD_vectorization": {
                "mode": "random",
                "n": 2,
                "loop_limit": 8
            }
        },
        "pruning": {
            "array_part": {
                "enable": 1,
                "PE_num": [
                    8,
                    32
                ]
            },
            "array_part_L2": {
                "enable": 1
            },
            "latency_hiding": {
                "enable": 1,
                "reg_size": [
                    64,
                    256
                ]
            },
            "SIMD_vectorization": {
                "enable": 1,
                "PE_num": [
                    8,
                    32
                ],
                "PE_ratio": 2
            }
        },
        "multiprocess": {
            "n_job": 1
        }
    },
    "synth": {
        "multiprocess": {
            "n_job": 16
        },
        "sample": {
            "n": 16
        }
    },
    "search": {
        "metric": "latency",
        "cycle_period": 5,
        "mode": "customized",
        "n_random": 5,
        "log": {
            "n_record": 10
        },
        "resource_target": ["BRAM18K", "DSP"],
        "time_out": -1,
        "update_time_interval": 2,        
        "pruning": {
            "random_start": {
                "enable": 1,
                "n_trial": 3,
                "n_random": 3
            },
            "resource": {                
                "range": {
                    "FF": [
                        0.25,
                        0.7
                    ],
                    "LUT": [
                        0.3,
                        0.75
                    ],
                    "DSP": [
                        0.5,
                        0.7
                    ],
                    "BRAM18K": [
                        0.3,
                        0.7
                    ],
                    "URAM": [
                        0,
                        0.6
                    ]
                }
            },
            "array_part": {
                "enable": 1,
                "PE_num": [
                    200,
                    210
                ]
            },
            "array_part_L2": {
                "enable": 1
            },
            "latency_hiding": {
                "enable": 1,
                "reg_size": [
                    64,
                    512
                ]
            },
            "SIMD_vectorization": {
                "enable": 1,
                "PE_num": [
                    200,
                    210
                ],
                "PE_ratio": 3
            }
        },
        "multiprocess": {
            "n_job": 32
        },
        "sample": {
            "space_time": {
                "mode": "exhaustive",
                "n": -1
            },
            "array_part": {
                "mode": "exhaustive",
                "n": -1,
                "loop_limit": -1
            },
            "latency_hiding": {
                "mode": "exhaustive",
                "n": -1,
                "loop_limit": 32
            },
            "SIMD_vectorization": {
                "mode": "exhaustive",
                "n": -1,
                "loop_limit": 8
            }
        }
    }
}

================================================
FILE: autosa_config/optimizer_settings_libs/mm_small.json
================================================
{
    "training": {
        "sample": {
            "space_time": {
                "mode": "exhaustive",
                "n": -1
            },
            "array_part": {
                "mode": "random",
                "n": 2,
                "loop_limit": -1
            },
            "latency_hiding": {
                "mode": "random",
                "n": 2,
                "loop_limit": 64
            },
            "SIMD_vectorization": {
                "mode": "random",
                "n": 2,
                "loop_limit": 4
            }
        },
        "pruning": {
            "array_part": {
                "enable": 1,
                "PE_num": [
                    8,
                    32
                ]
            },
            "array_part_L2": {
                "enable": 1
            },
            "latency_hiding": {
                "enable": 1,
                "reg_size": [
                    32,
                    256
                ]
            },
            "SIMD_vectorization": {
                "enable": 1,
                "PE_num": [
                    8,
                    32
                ],
                "PE_ratio": 2
            }
        },
        "multiprocess": {
            "n_job": 1
        }
    },
    "synth": {
        "multiprocess": {
            "n_job": 16
        },
        "sample": {
            "n": 16
        }
    },
    "search": {
        "metric": "latency",
        "cycle_period": 5,
        "mode": "customized",
        "n_random": 5,
        "log": {
            "n_record": 10
        },
        "resource_target": ["BRAM18K", "DSP"],
        "time_out": -1,
        "update_time_interval": 2,        
        "pruning": {
            "random_start": {
                "enable": 1,
                "n_trial": 3,
                "n_random": 3
            },
            "resource": {                
                "range": {
                    "FF": [
                        0.25,
                        0.7
                    ],
                    "LUT": [
                        0.3,
                        0.75
                    ],
                    "DSP": [
                        0.0,
                        0.5
                    ],
                    "BRAM18K": [
                        0.0,
                        0.5
                    ],
                    "URAM": [
                        0,
                        0.6
                    ]
                }
            },
            "array_part": {
                "enable": 1,
                "PE_num": [
                    32,
                    128
                ]
            },
            "array_part_L2": {
                "enable": 1
            },
            "latency_hiding": {
                "enable": 1,
                "reg_size": [
                    32,
                    512
                ]
            },
            "SIMD_vectorization": {
                "enable": 1,
                "PE_num": [
                    32,
                    128
                ],
                "PE_ratio": 3
            }
        },
        "multiprocess": {
            "n_job": 32
        },
        "sample": {
            "space_time": {
                "mode": "exhaustive",
                "n": -1
            },
            "array_part": {
                "mode": "exhaustive",
                "n": -1,
                "loop_limit": -1
            },
            "latency_hiding": {
                "mode": "exhaustive",
                "n": -1,
                "loop_limit": 64
            },
            "SIMD_vectorization": {
                "mode": "exhaustive",
                "n": -1,
                "loop_limit": 8
            }
        }
    }
}


================================================
FILE: autosa_config/optimizer_settings_libs/mttkrp_fp32.json
================================================
{
    "training": {
        "sample": {
            "space_time": {
                "mode": "exhaustive",
                "n": -1
            },
            "array_part": {
                "mode": "random",
                "n": 2,
                "loop_limit": -1
            },
            "latency_hiding": {
                "mode": "random",
                "n": 2,
                "loop_limit": 64
            },
            "SIMD_vectorization": {
                "mode": "random",
                "n": 2,
                "loop_limit": 8
            }
        },
        "pruning": {
            "array_part": {
                "enable": 1,
                "PE_num": [
                    8,
                    32
                ]
            },
            "array_part_L2": {
                "enable": 1
            },
            "latency_hiding": {
                "enable": 1,
                "reg_size": [
                    80,
                    256
                ]
            },
            "SIMD_vectorization": {
                "enable": 1,
                "PE_num": [
                    8,
                    32
                ],
                "PE_ratio": 2
            }
        },
        "multiprocess": {
            "n_job": 1
        }
    },
    "synth": {
        "multiprocess": {
            "n_job": 16
        },
        "sample": {
            "n": 16
        }
    },
    "search": {
        "metric": "latency",
        "cycle_period": 5,
        "mode": "customized",
        "n_random": 5,
        "log": {
            "n_record": 10
        },
        "resource_target": ["BRAM18K", "DSP"],
        "time_out": -1,
        "update_time_interval": 2,        
        "pruning": {
            "random_start": {
                "enable": 1,
                "n_trial": 3,
                "n_random": 3
            },
            "resource": {                
                "range": {
                    "FF": [
                        0.25,
                        0.7
                    ],
                    "LUT": [
                        0.3,
                        0.75
                    ],
                    "DSP": [
                        0.6,
                        0.7
                    ],
                    "BRAM18K": [
                        0.2,
                        0.5
                    ],
                    "URAM": [
                        0,
                        0.6
                    ]
                }
            },
            "array_part": {
                "enable": 1,
                "PE_num": [
                    120,
                    130
                ]
            },
            "array_part_L2": {
                "enable": 1
            },
            "latency_hiding": {
                "enable": 1,
                "reg_size": [
                    70,
                    512
                ]
            },
            "SIMD_vectorization": {
                "enable": 1,
                "PE_num": [
                    120,
                    130
                ],
                "PE_ratio": 3
            }
        },
        "multiprocess": {
            "n_job": 32
        },
        "sample": {
            "space_time": {
                "mode": "exhaustive",
                "n": -1
            },
            "array_part": {
                "mode": "exhaustive",
                "n": -1,
                "loop_limit": -1
            },
            "latency_hiding": {
                "mode": "exhaustive",
                "n": -1,
                "loop_limit": 64
            },
            "SIMD_vectorization": {
                "mode": "exhaustive",
                "n": -1,
                "loop_limit": 8
            }
        }
    }
}

================================================
FILE: autosa_config/optimizer_settings_libs/ttm_fp32.json
================================================
{
    "training": {
        "sample": {
            "space_time": {
                "mode": "exhaustive",
                "n": -1
            },
            "array_part": {
                "mode": "random",
                "n": 2,
                "loop_limit": -1
            },
            "latency_hiding": {
                "mode": "random",
                "n": 2,
                "loop_limit": 64
            },
            "SIMD_vectorization": {
                "mode": "random",
                "n": 2,
                "loop_limit": 8
            }
        },
        "pruning": {
            "array_part": {
                "enable": 1,
                "PE_num": [
                    8,
                    32
                ]
            },
            "array_part_L2": {
                "enable": 1
            },
            "latency_hiding": {
                "enable": 1,
                "reg_size": [
                    64,
                    256
                ]
            },
            "SIMD_vectorization": {
                "enable": 1,
                "PE_num": [
                    8,
                    32
                ],
                "PE_ratio": 2
            }
        },
        "multiprocess": {
            "n_job": 1
        }
    },
    "synth": {
        "multiprocess": {
            "n_job": 16
        },
        "sample": {
            "n": 16
        }
    },
    "search": {
        "metric": "latency",
        "cycle_period": 5,
        "mode": "customized",
        "n_random": 5,
        "log": {
            "n_record": 10
        },
        "resource_target": ["BRAM18K", "DSP"],
        "time_out": 3,
        "update_time_interval": 2,        
        "pruning": {
            "random_start": {
                "enable": 1,
                "n_trial": 3,
                "n_random": 3
            },
            "resource": {                
                "range": {
                    "FF": [
                        0.25,
                        0.7
                    ],
                    "LUT": [
                        0.3,
                        0.75
                    ],
                    "DSP": [
                        0.6,
                        0.7
                    ],
                    "BRAM18K": [
                        0.1,
                        0.5
                    ],
                    "URAM": [
                        0,
                        0.6
                    ]
                }
            },
            "array_part": {
                "enable": 1,
                "PE_num": [
                    190,
                    200
                ]
            },
            "array_part_L2": {
                "enable": 1
            },
            "latency_hiding": {
                "enable": 1,
                "reg_size": [
                    64,
                    640
                ]
            },
            "SIMD_vectorization": {
                "enable": 1,
                "PE_num": [
                    190,
                    200
                ],
                "PE_ratio": 3
            }
        },
        "multiprocess": {
            "n_job": 32
        },
        "sample": {
            "space_time": {
                "mode": "exhaustive",
                "n": -1
            },
            "array_part": {
                "mode": "exhaustive",
                "n": -1,
                "loop_limit": -1
            },
            "latency_hiding": {
                "mode": "exhaustive",
                "n": -1,
                "loop_limit": 64
            },
            "SIMD_vectorization": {
                "mode": "exhaustive",
                "n": -1,
                "loop_limit": 8
            }
        }
    }
}

================================================
FILE: autosa_config/optimizer_settings_libs/ttmc_fp32.json
================================================
{
    "training": {
        "sample": {
            "space_time": {
                "mode": "exhaustive",
                "n": -1
            },
            "array_part": {
                "mode": "random",
                "n": 2,
                "loop_limit": -1
            },
            "latency_hiding": {
                "mode": "random",
                "n": 2,
                "loop_limit": 64
            },
            "SIMD_vectorization": {
                "mode": "random",
                "n": 2,
                "loop_limit": 8
            }
        },
        "pruning": {
            "array_part": {
                "enable": 1,
                "PE_num": [
                    8,
                    32
                ]
            },
            "array_part_L2": {
                "enable": 1
            },
            "latency_hiding": {
                "enable": 1,
                "reg_size": [
                    80,
                    256
                ]
            },
            "SIMD_vectorization": {
                "enable": 1,
                "PE_num": [
                    8,
                    32
                ],
                "PE_ratio": 2
            }
        },
        "multiprocess": {
            "n_job": 1
        }
    },
    "synth": {
        "multiprocess": {
            "n_job": 16
        },
        "sample": {
            "n": 16
        }
    },
    "search": {
        "metric": "latency",
        "cycle_period": 5,
        "mode": "customized",
        "n_random": 5,
        "log": {
            "n_record": 10
        },
        "resource_target": ["BRAM18K", "DSP"],
        "time_out": 5,
        "update_time_interval": 2,        
        "pruning": {
            "random_start": {
                "enable": 1,
                "n_trial": 3,
                "n_random": 3
            },
            "resource": {                
                "range": {
                    "FF": [
                        0.25,
                        0.7
                    ],
                    "LUT": [
                        0.3,
                        0.75
                    ],
                    "DSP": [
                        0.6,
                        0.7
                    ],
                    "BRAM18K": [
                        0.1,
                        0.5
                    ],
                    "URAM": [
                        0,
                        0.6
                    ]
                }
            },
            "array_part": {
                "enable": 1,
                "PE_num": [
                    120,
                    140
                ]
            },
            "array_part_L2": {
                "enable": 1
            },
            "latency_hiding": {
                "enable": 1,
                "reg_size": [
                    64,
                    640
                ]
            },
            "SIMD_vectorization": {
                "enable": 1,
                "PE_num": [
                    120,
                    140
                ],
                "PE_ratio": 3
            }
        },
        "multiprocess": {
            "n_job": 32
        },
        "sample": {
            "space_time": {
                "mode": "exhaustive",
                "n": -1
            },
            "array_part": {
                "mode": "exhaustive",
                "n": -1,
                "loop_limit": -1
            },
            "latency_hiding": {
                "mode": "exhaustive",
                "n": -1,
                "loop_limit": 64
            },
            "SIMD_vectorization": {
                "mode": "exhaustive",
                "n": -1,
                "loop_limit": 8
            }
        }
    }
}

================================================
FILE: autosa_scripts/autosa.py
================================================
#!/usr/bin/env python3
import sys
import subprocess
import os
import time

def exec_sys_cmd(cmd):
    p = subprocess.Popen(cmd, shell=True)
    ret = p.wait()
    return ret

if __name__ == "__main__":
    # Some default values
    output_dir = './autosa.tmp/output'
    target = 'autosa_hls_c'
    src_file_prefix = 'kernel'
    xilinx_host = 'opencl'
    tuning = False
    isl_flag = '--isl-schedule-whole-component' # This flag forces ISL to perform loop fusion as much as possible
    hcl = False

    # Parse and update the arguments
    n_arg = len(sys.argv)
    argv = sys.argv
    tuning_idx = -1
    insert_isl_flag = True
    assign_loop_permute = False
    explore_loop_permute = False
    for i in range(n_arg):
        arg = argv[i]            
        if 'output-dir' in arg:
            output_dir = arg.split('=')[-1]
        if 'target' in arg:
            target = arg.split('=')[-1]
        if 'tuning-method' in arg:            
            tuning = True
            tuning_idx = i
        if 'isl-schedule-whole-component' in arg:
            insert_isl_flag = False
        if 'loop-permute-order' in arg:
            assign_loop_permute = True
        if 'explore-loop-permute' in arg:
            explore_loop_permute = True
    if n_arg > 1:
        src_file = argv[1]
        src_file_prefix = os.path.basename(src_file).split('.')[0]
    if n_arg > 1 and target == 'autosa_hls_c':
        # Check whether to generate HLS or OpenCL host for Xilinx FPGAs
        for arg in argv:
            if '--hls' in arg:
                xilinx_host = 'hls'
            if '--hcl' in arg:
                hcl = True    
    if n_arg > 1 and target == 'autosa_opencl':
        for arg in argv:
            if '--hcl' in arg:
                hcl = True    
   
    # Cache the AutoSA command
    autosa_cmd = ' '.join(argv)
    exec_sys_cmd(f'echo "{autosa_cmd}" > {output_dir}/src/cmd')

    argv[0] = './src/autosa'
    if insert_isl_flag:
        argv.append(isl_flag)

    # Check if the output directory exists
    if not os.path.isdir(output_dir):
        raise RuntimeError('Output directory is not specified.')

    # Execute the AutoSA        
    #start_time = time.perf_counter()
    complete = False
    permute_idx = 0
    while not complete:
        if permute_idx > 0:
            argv.append(f'--autosa-loop-permute-order={permute_idx}')
        process = subprocess.run(argv)
        if process.returncode != 0:
            print("[AutoSA] Error: Exit abnormally!")
            sys.exit(process.returncode)
        else:        
            if not os.path.exists(output_dir + '/src/completed'):
                sys.exit(process.returncode)    
        exec_sys_cmd(f'rm {output_dir}/src/completed')                   
        #runtime = time.perf_counter() - start_time
        #print(f'runtime: {runtime}')

        # Generate the top module
        print("[AutoSA] Post-processing the generated code...")
        #start_time = time.perf_counter()
        if not os.path.exists(f'{output_dir}/src/{src_file_prefix}_top_gen.cpp'):
            raise RuntimeError(f'{output_dir}/src/{src_file_prefix}_top_gen.cpp not exists.')
        cmd = 'g++ -o ' + output_dir + '/src/top_gen ' + output_dir + \
              '/src/' + src_file_prefix + '_top_gen.cpp ' + \
              '-I./src/isl/include -L./src/isl/.libs -lisl'
        exec_sys_cmd(cmd)
        my_env = os.environ.copy()
        cwd = os.getcwd()
        if 'LD_LIBRARY_PATH' in my_env:
            my_env['LD_LIBRARY_PATH'] += os.pathsep + cwd + '/src/isl/.libs'
        else:
            my_env['LD_LIBRARY_PATH'] = os.pathsep + cwd + '/src/isl/.libs'
        cmd = output_dir + '/src/top_gen'
        process = subprocess.run(cmd.split(), env=my_env)
        #runtime = time.perf_counter() - start_time
        #print(f'runtime: {runtime}')

        complete = True     
        if tuning and explore_loop_permute:   
            for filename in os.listdir(f'{output_dir}'):
                if filename.startswith("permute"):
                    if filename.endswith("done"):
                        complete = True                    
                    else:
                        permute_idx = int(filename.split("_")[-1])                        
                        if assign_loop_permute:
                            complete = True
                        else:
                            complete = False                        

                    os.remove(f'{output_dir}/{filename}')
                    break            

    if not tuning:
        # Generate the final code    
        if target == 'autosa_hls_c' or target == 'autosa_tapa':
            cmd = './autosa_scripts/codegen.py -c ' + output_dir + \
                  '/src/top.cpp -d ' + output_dir + '/src/' + src_file_prefix + \
                  '_kernel_modules.cpp -t ' + target + ' -o ' + output_dir + '/src/' + \
                  src_file_prefix + '_kernel.cpp'
            if hcl:
                cmd += ' --hcl'
        elif target == 'autosa_opencl':
            cmd = './autosa_scripts/codegen.py -c ' + output_dir + \
                  '/src/top.cpp -d ' + output_dir + '/src/' + src_file_prefix + \
                  '_kernel_modules.cl -t ' + target + ' -o ' + output_dir + '/src/' + \
                  src_file_prefix + '_kernel.cl'
            if hcl:
                cmd += ' --hcl'
        elif target == 'autosa_catapult_c':
            cmd = './autosa_scripts/codegen.py -c ' + output_dir + \
                  '/src/top.cpp -d ' + output_dir + '/src/' + src_file_prefix + \
                  '_kernel_modules.cpp -t ' + target + ' -o ' + output_dir + '/src/' + \
                  src_file_prefix + '_kernel_hw.h' + ' --tb ' + output_dir + '/src/' + \
                  src_file_prefix + '_host.cpp'
        if target == 'autosa_hls_c':
            cmd += ' --host '
            cmd += xilinx_host
                    
        exec_sys_cmd(cmd)            

        # Copy the input code to the output directory           
        exec_sys_cmd(f'cp {argv[1]} {output_dir}/src/')
        headers = src_file.split('.')
        headers[-1] = 'h'
        headers = ".".join(headers)
        if os.path.exists(headers):
            exec_sys_cmd(f'cp {headers} {output_dir}/src/')        

        # Clean up the temp files        
        if target == 'autosa_hls_c' and xilinx_host == 'opencl':
            exec_sys_cmd(f'rm {output_dir}/src/{src_file_prefix}_kernel.h')            
        exec_sys_cmd(f'rm {output_dir}/src/top_gen')
        exec_sys_cmd(f'rm {output_dir}/src/top.cpp')
        exec_sys_cmd(f'rm {output_dir}/src/{src_file_prefix}_top_gen.cpp')    
        exec_sys_cmd(f'rm {output_dir}/src/{src_file_prefix}_top_gen.h')    
        if target == 'autosa_hls_c' or target == 'autosa_catapult_c':
            exec_sys_cmd(f'rm {output_dir}/src/{src_file_prefix}_kernel_modules.cpp')
        elif target == 'autosa_opencl':
            exec_sys_cmd(f'rm {output_dir}/src/{src_file_prefix}_kernel_modules.cl')        


================================================
FILE: autosa_scripts/codegen.py
================================================
#!/usr/bin/env python3

import sympy
import sys
import argparse
import re
import numpy as np
import os

def delete_arg_from_arg_list(line, arg, content):
    """ Delete the argument from the argument list

    Parameters
    ----------
    line: list
        codeline containing the argument list
    arg: list
        argument to be deleted
    line_id: int
        the current line id
    content: list
        the printed content before current line
    """
    line = line.strip()
    # print(line)
    if line[-1] != ',':
        # print('test\n')
        # print(line)
        # print(content[-1])
        comma_pos = content[-1].find(',')
        content[-1] = content[-1][:comma_pos] + '\n'

    """
    line = re.sub(r'( )(' + re.escape(arg) + r')(,)',
                  '', line)
    line = re.sub(r'( )(' + re.escape(arg) + r')(\))',
                  r'\g<3>', line)
    line = re.sub(r'(\()(' + re.escape(arg) + r')(, )',
                  r'\g<1>', line)
    line = re.sub(r'(\()(' + re.escape(arg) + r')(\))',
                  r'\g<1>\g<3>', line)
    """

def print_module_def(
        f,
        arg_map,
        module_def,
        inline_module_defs,
        def_args,
        call_args_type):
    """ Print out module definitions for Intel OpenCL

    This function prints out the module definition with all arguments in the code
    replaced by the calling arguments.
    We will first extract the module ids and fifos from the module definition
    argument lists. These arguments are deleted from the argument lists as we will
    plug in the exact module ids and fifos from a call of this modules.
    As an example, the original module
      void A_IO_L3_in(int idx, fifo_type fifo)
    will be modified to
      void A_IO_L3_in_[arg_map[idx]]()

    Parameters
    ----------
    f:
        file handle
    arg_map:
        maps from module definition args to module call args
    module_def:
        a list storing the module definition texts
    inline_module_defs:
        a dict containing all the inline module definitions
    def_args:
        a list storing the module definition arguments
    call_args_type:
        a list storing the type of each module call arg
    """
    # Print inline module definitions
    if inline_module_defs:
        # Each inline module should be only printed once.
        # We assume the module ids and fifos are unchanged in multiple inline module
        # calls. Therefore, only the first encounter will be handled.
        inline_module_handled = []
        for inline_module in inline_module_defs:
            # Search for the inline modules
            for line_id in range(len(module_def)):
                line = module_def[line_id]
                if line.find(inline_module + '(') != -1:
                    # The current line contains the inline module call
                    if inline_module in inline_module_handled:
                        # Replace the module call
                        line_indent = line.find(inline_module)
                        line = ' ' * line_indent + inline_module
                        for i in range(len(def_args)):
                            def_arg = def_args[i]
                            arg_type = call_args_type[i]
                            if arg_type == 'module id':
                                line += '_'
                                line += arg_map[def_arg]
                        line += '(\n'
                        module_def[line_id] = line
                        continue
                    else:
                        inline_module_handled.append(inline_module)
                    # Print the inline module definition
                    inline_module_call_args = []
                    inline_module_call_args_type = []
                    inline_module_def_args = []
                    inline_module_arg_map = {}
                    inline_module_name = inline_module
                    inline_module_def = inline_module_defs[inline_module_name]
                    # Extract the arg list in module definition
                    for inline_module_line in inline_module_def:
                        if inline_module_line.find('void') != -1:
                            m = re.search(r'\((.+?)\)', inline_module_line)
                            if m:
                                def_args_old = m.group(1)
                    def_args_old = def_args_old.split(', ')
                    for arg in def_args_old:
                        arg = arg.split()[-1]
                        inline_module_def_args.append(arg)
                    # Extract the arg list in module call
                    next_line_id = line_id + 1
                    next_line = module_def[next_line_id]
                    while next_line.find(');') == -1:
                        m = re.search(r'/\*(.+?)\*/', next_line)
                        if m:
                            arg_type = m.group(1).strip()
                            inline_module_call_args_type.append(arg_type)
                            m = re.search(r'\*/ (.+)', next_line)
                            if m:
                                call_arg = m.group(1).split(',')[0]
                                inline_module_call_args.append(call_arg)
                        next_line_id += 1
                        next_line = module_def[next_line_id]
                    # Build a mapping between the def_arg to call_arg
                    #print(inline_module_def_args)
                    #print(inline_module_call_args)
                    for i in range(len(inline_module_def_args)):
                        def_arg = inline_module_def_args[i]
                        call_arg = inline_module_call_args[i]
                        inline_module_arg_map[def_arg] = call_arg
                    # Replace the module ids and fifos from the upper module
                    for def_arg in inline_module_arg_map:
                        call_arg = inline_module_arg_map[def_arg]
                        if call_arg in arg_map:
                            inline_module_arg_map[def_arg] = arg_map[call_arg]
                    print_module_def(
                        f,
                        inline_module_arg_map,
                        inline_module_def.copy(),
                        None,
                        inline_module_def_args,
                        inline_module_call_args_type)
                    # Replace the inline module call with the new inline module
                    # name
                    line_indent = line.find(inline_module)
                    line = ' ' * line_indent + inline_module
                    for i in range(len(def_args)):
                        def_arg = def_args[i]
                        arg_type = call_args_type[i]
                        if arg_type == 'module id':
                            line += '_'
                            line += arg_map[def_arg]
                    line += '(\n'
                    module_def[line_id] = line

    # Extract module ids and fifos from def_args
    module_id_args = []
    fifo_args = []
    # print(def_args)
    # print(call_args_type)
    for i in range(len(def_args)):
        def_arg = def_args[i]
        arg_type = call_args_type[i]
        if arg_type == 'module id':
            module_id_args.append(def_arg)
        if arg_type == 'fifo':
            fifo_args.append(def_arg)

    # Start printing
    print_content = []
    print_content.append('/* Module Definition */\n')
    line_id = 0
    for line in module_def:
        if line.find('void') != -1:
            # This line is kernel argument.
            # All module id and fifo arguments are deleted
            m = re.search(r'(.+?)\(', line)
            if m:
                prefix = m.group(1)
            arg_start_pos = line.find('(')
            arg_end_pos = line.rfind(')')
            def_args = line[arg_start_pos + 1 : arg_end_pos]
            #m = re.search(r'\((.+?)\)', line)
            #if m:
            #    def_args = m.group(1)
            def_args = def_args.split(', ')
            new_def_args = []
            for i in range(len(def_args)):
                if call_args_type[i] != 'module id' and call_args_type[i] != 'fifo':
                    new_def_args.append(def_args[i])
            # f.write(prefix + '(')
            # Print the module_name
            print_content.append(prefix)
            for module_id in module_id_args:
                print_content.append('_' + arg_map[module_id])
            print_content.append('(')
            first = True
            for arg in new_def_args:
                if not first:
                    print_content.append(', ')
                print_content.append(arg)
                first = False
            #print_content.append(')\n')
            print_content.append(line[arg_end_pos:])
        else:
            # module ids
            for module_id in module_id_args:
                if line.find(module_id) != -1:
                    # Test if it is inside an argument list
                    m = re.search(
                        r'/\* module id \*/ ' +
                        re.escape(module_id),
                        line)
                    if m:
                        # Delete if from the argument list
                        delete_arg_from_arg_list(
                            line, module_id, print_content)
                        line = None
                        break
                    else:
                        # Plug in module ids
                        line = re.sub(
                            r'([^a-zA-Z_])(' +
                            re.escape(module_id) +
                            r')([^a-zA-Z0-9_])',
                            r'\g<1>' +
                            re.escape(
                                arg_map[module_id]) +
                            r'\g<3>',
                            line)
            # fifos
            if line:
                for fifo in fifo_args:
                    if line.find(fifo) != -1:
                        # Test if it is inside a read/write API call
                        if line.find('read_channel_intel') != - \
                                1 or line.find('write_channel_intel') != -1:
                            # Plug in fifos
                            line = re.sub(
                                r'([^a-zA-Z_])(' +
                                re.escape(fifo) +
                                r')([^a-zA-Z0-9_])',
                                r'\g<1>' +
                                re.escape(
                                    arg_map[fifo]) +
                                r'\g<3>',
                                line)
                        else:
                            # Test if it is inside an argument list
                            m = re.search(
                                r'/\* fifo \*/ ' + re.escape(fifo), line)
                            if m:
                                # Delete it from the argument list
                                delete_arg_from_arg_list(
                                    line, fifo, print_content)
                                line = None
                                break
            if line is not None:
                print_content.append(line)
        line_id += 1
    print_content.append('/* Module Definition */\n\n')

    f.writelines(print_content)


def generate_intel_kernel(
        kernel,
        headers,
        module_defs,
        module_calls,
        fifo_decls):
    """ Generate the final Intel code

    This function plugs in the module definitions into each module call and replace
    index ids and fifo arguments.

    Parameters
    ----------
    kernel:
        the output file
    headers:
        list containing the headers to be printed
    module_defs:
        dict containing the module definitions
    module_calls:
        list containing the module calls
    fifo_decls:
        list containing the fifo declarations
    """
    inline_module_defs = {}
    with open(kernel, 'w') as f:
        # Print out headers
        for header in headers:
            f.write(header)
        f.write('\n')

        f.write('#pragma OPENCL EXTENSION cl_intel_channels : enable\n\n')

        # Print out channels
        f.write('/* Channel Declaration */\n')
        for fifo_decl in fifo_decls:
            f.write(fifo_decl + '\n')
        f.write('/* Channel Declaration */\n\n')

        # Extract the inline modules
        # These modules are those that exist in the module_defs but not in the
        # module_calls.
        for module_name in module_defs:
            inline_module = 1
            for module_call in module_calls:
                line = module_call[0]
                m = re.search(r'(.+?)\(', line)
                if m:
                    cur_module_name = m.group(1)
                if module_name == cur_module_name:
                    inline_module = 0
                    break
            if inline_module:
                inline_module_defs[module_name] = module_defs[module_name]

        # print out module definitions
        for module_call in module_calls:
            # f.write('/* Module Definition */\n')
            def_args = []
            call_args = []
            call_args_type = []
            arg_map = {}
            # Extract the module name
            line = module_call[0]
            m = re.search(r'(.+?)\(', line)
            if m:
                module_name = m.group(1)
            module_def = module_defs[module_name]
            # extract the arg list in module definition
            for line in module_def:
                if line.find('void') != -1:
                    arg_start_pos = line.find('(')
                    arg_end_pos = line.rfind(')')
                    def_args_old = line[arg_start_pos + 1 : arg_end_pos]
                    #m = re.search(r'\((.+?)\)', line)
                    #if m:
                    #    def_args_old = m.group(1)
            def_args_old = def_args_old.split(', ')
            for arg in def_args_old:
                arg = arg.split()[-1]
                def_args.append(arg)

            # extract the arg list in module call
            for line in module_call:
                m = re.search(r'/\*(.+?)\*/', line)
                if m:
                    arg_type = m.group(1).strip()
                    call_args_type.append(arg_type)
                    n = re.search(r'\*/ (.+)', line)
                    if n:
                        call_arg = n.group(1).strip(',')
                        call_args.append(call_arg)

            # build a mapping between the def_arg to call_arg
            for i in range(len(def_args)):
                call_arg_type = call_args_type[i]
                if call_arg_type == 'module id' or call_arg_type == 'fifo':
                    def_arg = def_args[i]
                    call_arg = call_args[i]
                    arg_map[def_arg] = call_arg

            # print out the module definition with call args plugged in
            print_module_def(
                f,
                arg_map,
                module_def.copy(),
                inline_module_defs,
                def_args,
                call_args_type)
            # f.write('/* Module Definition */\n\n')

def contains_pipeline_for(pos, lines):
    """ Examine if there is any for loop with hls_pipeline annotation inside the current for loop

    """
    n_l_bracket = 0
    n_r_bracket = 0
    code_len = len(lines)
    init_state = 1
    while pos < code_len and n_r_bracket <= n_l_bracket:
        if lines[pos].find('{') != -1:
            n_l_bracket += 1
        if lines[pos].find('}') != -1:
            n_r_bracket += 1
        if lines[pos].find('for') != -1:
            if init_state:
                init_state = 0
            else:
                if lines[pos + 1].find('hls_pipeline') != -1:
                    return 1
        if n_l_bracket == n_r_bracket and not init_state:
            break
        pos += 1
    return 0


def insert_xlnx_pragmas(lines):
    """ Insert HLS pragmas for Xilinx program

    Replace the comments of "// hls_pipeline" and "// hls_unroll" with
    HLS pragmas
    For "// hls pipeline", find the previous for loop before hitting any "}".
    Insert "#pragma HLS PIPELINE II=1" below the for loop.
    For "// hls unroll", find the previous for loop before hitting the "simd" mark.
    Insert "#pragma HLS UNROLL" below the for loop.
    For "// hls_dependence.x", the position is the same with hls_pipeline.
    Insert "#pragma HLS DEPENDENCE variable=x inter false".

    Parameters
    ----------
    lines:
        contains the codelines of the program
    """
    # Handle hls_dependence
    handle_dep_pragma = 1

    code_len = len(lines)
    pos = 0
    while pos < code_len:
        line = lines[pos]
        if line.find("// hls_pipeline") != - \
                1 or line.find("// hls_dependence") != -1:
            is_pipeline = 0
            is_dep = 0
            if line.find('// hls_pipeline') != -1:
                is_pipeline = 1
            else:
                is_dep = 1
            # Find if there is any other hls_pipeline/hls_dependence annotation
            # below
            n_l_bracket = 0
            n_r_bracket = 0
            next_pos = pos + 1
            find_pipeline = 0
            init_state = 1
            while next_pos < code_len and n_r_bracket <= n_l_bracket:
                if is_pipeline and lines[next_pos].find('hls_pipeline') != -1:
                    find_pipeline = 1
                    break
                if is_dep and lines[next_pos].find(
                        'hls_dependence') != -1 and handle_dep_pragma:
                    find_pipeline = 1
                    break
                if lines[next_pos].find('{') != -1:
                    n_l_bracket += 1
                    init_state = 0
                if lines[next_pos].find('}') != -1:
                    n_r_bracket += 1
                if n_l_bracket == n_r_bracket and not init_state:
                    break
                next_pos += 1
            if find_pipeline:
                pos += 1
                continue

            # Find the for loop above before hitting any "}"
            prev_pos = pos - 1
            find_for = 0
            n_l_bracket = 0
            n_r_bracket = 0
            while prev_pos >= 0:
                if lines[prev_pos].find('while') != -1:
                    break
                if lines[prev_pos].find('{') != -1:
                    n_l_bracket += 1
                if lines[prev_pos].find('}') != -1:
                    n_r_bracket += 1
                if lines[prev_pos].find('for') != -1:
                    if n_l_bracket > n_r_bracket:
                        # check if the pragma is already inserted
                        if is_pipeline and lines[prev_pos +
                                                 1].find('#pragma HLS PIPELINE II=1\n') == -1:
                            find_for = 1
                        if is_dep and lines[prev_pos + 2].find(
                                '#pragma HLS DEPENDENCE') == -1 and handle_dep_pragma:
                            find_for = 1
                        # check if there is any other for loop with
                        # hls_pipeline annotation inside
                        if contains_pipeline_for(prev_pos, lines):
                            find_for = 0
                        break
                prev_pos -= 1
            if find_for == 1:
                # insert the pragma right after the for loop
                indent = lines[prev_pos].find('for')
                if line.find("hls_pipeline") != -1:
                    new_line = ' ' * indent + "#pragma HLS PIPELINE II=1\n"
                else:
                    line_cp = line
                    var_name = line_cp.strip().split('.')[-1]
                    new_line = ' ' * indent + "#pragma HLS DEPENDENCE variable=" + \
                        var_name + " inter false\n"
                lines.insert(prev_pos + 1, new_line)
                del lines[pos + 1]
        elif line.find("// hls_unroll") != -1:
            # Find the for loop above before hitting any "simd"
            prev_pos = pos - 1
            find_for = 0
            while prev_pos >= 0 and lines[prev_pos].find('simd') == -1:
                if lines[prev_pos].find('for') != -1:
                    find_for = 1
                    break
                prev_pos -= 1
            if find_for == 1:
                # insert the pragma right after the for loop
                indent = lines[prev_pos].find('for')
                new_line = ' ' * indent + "#pragma HLS UNROLL\n"
                lines.insert(prev_pos + 1, new_line)
                del lines[pos + 1]
        pos = pos + 1

    return lines

def insert_catapult_pragmas(lines):
    """ Insert Catapult HLS pragmas for Catapult program

    Replace the comments of "// hls_unroll" with HLS pragmas    
    For "// hls unroll", find the next for loop right below the mark.
    Insert "#pragma unroll yes" before the for loop.    

    Parameters
    ----------
    lines:
        contains the codelines of the program
    """
    # Handle hls_dependence
    handle_dep_pragma = 1

    code_len = len(lines)
    pos = 0
    while pos < code_len:
        line = lines[pos]    
        if line.find("// hls_unroll") != -1:
            # Find the for loop below
            next_pos = pos + 1
            find_for = 0
            if lines[next_pos].find('for') != -1:                            
                # insert the pragma right before the for loop
                indent = lines[next_pos].find('for')
                new_line = ' ' * indent + "#pragma unroll yes\n"
                lines.insert(next_pos, new_line)
                del lines[pos]
        pos = pos + 1

    return lines

def float_to_int(matchobj):
    str_expr = matchobj.group(0)
    if float(str_expr) == int(float(str_expr)):
        return str(int(float(str_expr)))
    else:
        return str_expr


def index_simplify(matchobj):
    str_expr = matchobj.group(0)
    if str_expr == '[arb]' or str_expr == '[!arb]' or str_expr == '[index[n]':
        return str_expr
    if '++' in str_expr:
        return str_expr
    expr = sympy.sympify(str_expr[1: len(str_expr) - 1])
    """
    This will sometimes cause bugs due to the different semantics in C
    E.g., x = 9, (x+3)/4 != x/4+3/4.
    We could use cxxcode, but it will generate floating expressions which are
    expensive on FPGA.
    At present, we check if there is floor or ceil in the expression.
    If so, we abort and use the original expression. Otherwise, we replace it
    with the simplified one.
    """
    expr = sympy.simplify(expr)
    new_str_expr = sympy.printing.ccode(expr)
#  # We will try to replace floats with integers if values won't change
#  new_str_expr = re.sub('\d+\.\d+', float_to_int, new_str_expr)

    if 'floor' in new_str_expr or 'ceil' in new_str_expr or '.0' in new_str_expr:
        return str_expr
    else:
        return '[' + new_str_expr + ']'


def mod_simplify(matchobj):
    str_expr = matchobj.group(0)
    str_expr = str_expr[1: len(str_expr) - 3]
    expr = sympy.sympify(str_expr)
    expr = sympy.simplify(expr)
    str_expr = str(expr)

    return '(' + str_expr + ') %'


def simplify_expressions(lines):
    """ Simplify the index expressions in the program

    Use Sympy to simplify all the array index expressions in the program.

    Parameters
    ----------
    lines:
        contains the codelines of the program
    """
    code_len = len(lines)
    # Simplify array index expressions
    for pos in range(code_len):
        line = lines[pos]
        line = re.sub(r'\[(.+?)\]', index_simplify, line)
        lines[pos] = line

    # Simplify mod expressions
    for pos in range(code_len):
        line = lines[pos]
        line = re.sub(r'\((.+?)\) %', mod_simplify, line)
        lines[pos] = line

    return lines

def shrink_bit_width(lines, target):
    """ Calculate the bitwidth of the iterator and shrink it to the proper size

    We will examine the for loops. Examine the upper bound of the loop. If the
    upper bound is a number, we will compute the bitwidth of the iterator.
    For Intel target, we will also look for iterator definitions marked with
    "/* UB: [...] */". The shallow bitwidth is calculated and replace the previous
    data type.

    Parameters
    ----------
    lines:
        contains the codelines of the program
    target:
        xilinx|intel
    """
    code_len = len(lines)
    for pos in range(code_len):
        line = lines[pos]
        if line.find('for') != -1:
            # Parse the loop upper bound
            m = re.search('<=(.+?);', line)
            if m:
                ub = m.group(1).strip()
                if ub.isnumeric():
                    # Replace it with shallow bit width
                    bitwidth = int(np.ceil(np.log2(float(ub) + 1))) + 1
                    if target == 'xilinx':
                        new_iter_t = 'ap_uint<' + str(bitwidth) + '>'
                    elif target == 'intel':
                        new_iter_t = 'uint' + str(bitwidth) + '_t'
                    elif target == 'catapult':
                        new_iter_t = 'ac_int<' + str(bitwidth) + ', false>'
                    line = re.sub('int', new_iter_t, line)
                    lines[pos] = line
            m = re.search('<(.+?);', line)
            if m:
                ub = m.group(1).strip()
                if ub.isnumeric():
                    #print(pos)
                    # Replace it with shallow bit width                    
                    bitwidth = int(np.ceil(np.log2(float(ub)))) + 1
                    if target == 'xilinx':
                        new_iter_t = 'ap_uint<' + str(bitwidth) + '>'
                    elif target == 'intel':
                        new_iter_t = 'uint' + str(bitwidth) + '_t'
                    elif target == 'catapult':
                        new_iter_t = 'ac_int<' + str(bitwidth) + ', false>'
                    line = re.sub('int', new_iter_t, line)
                    lines[pos] = line

    for pos in range(code_len):
        line = lines[pos]
        m = re.search(r'/\* UB: (.+?) \*/', line)
        if m:
            ub = m.group(1).strip()
            if ub.isnumeric():
                # Replace it with shallow bit width
                bitwidth = int(np.ceil(np.log2(float(ub) + 1))) + 1
                if target == 'xilinx':
                    new_iter_t = 'ap_uint<' + str(bitwidth) + '>'
                elif target == 'intel':
                    new_iter_t = 'uint' + str(bitwidth) + '_t'
                elif target == 'catapult':
                    new_iter_t = 'ac_int<' + str(bitwidth) + ', false>'
                #line = re.sub('int', new_iter_t, line)
                line = re.sub(
                    r'(int)' +
                    r'\s' +
                    r'([a-zA-Z])',
                    new_iter_t +
                    r' \g<2>',
                    line)
                lines[pos] = line

    return lines


def lift_split_buffers(lines):
    """ Lift the split buffers in the program

    For each module, if we find any split buffers with the name "data_split",
    we will lift them out of the for loops and put them in the variable declaration
    section at the beginning of the module.

    Parameters
    ----------
    lines:
        contains the codelines of the program
    """
    code_len = len(lines)
    for pos in range(code_len):
        line = lines[pos]
        if line.find('variable=data_split') != -1:
            # Search for the variable declaration section
            decl_pos = -1
            prev_pos = pos - 1
            while prev_pos >= 0:
                prev_line = lines[prev_pos]
                if prev_line.find('Variable Declaration') != -1:
                    decl_pos = prev_pos
                    break
                prev_pos -= 1
            # Move the two code lines at [pos - 1] and [pos] to [decl_pos] and
            # [decl_pos + 1]
            indent = lines[decl_pos].find('/*')
            line1 = ' ' * indent + lines[pos - 1].lstrip()
            line2 = ' ' * indent + lines[pos].lstrip()
            del lines[pos - 1]
            del lines[pos - 1]
            lines.insert(decl_pos, line1)
            lines.insert(decl_pos + 1, line2)

    return lines

def build_dummy_module_def(group_name, fifo_type, module_in, PE_ids):
    """ Build the definition of the dummy module

    Parameters
    ----------
    group_name: str
    fifo_type: str
    module_in: int
    PE_ids: list
    """
    dir_str = 'out' if module_in == 0 else 'in'
    index_str = ['idx', 'idy', 'idz']
    fifo_name = f'fifo_{group_name}_{dir_str}'

    lines = []
    lines.append('/* Module Definition */\n')
    lines.append(f'void {group_name}_PE_dummy_{dir_str}(')
    for pos in range(len(PE_ids)):
        lines.append(f'int {index_str[pos]}, ')
    lines.append(f'hls::stream<{fifo_type}> &{fifo_name}){{\n')
    if module_in == 0:
        lines.append(f'  if (!{fifo_name}.full())\n')
        lines.append(f'    {fifo_name}.write(0);\n')
    else:
        lines.append(f'  {fifo_type} fifo_data = {fifo_name}.read();\n')
    lines.append(f'}}\n')
    lines.append(f'/* Module Definition */\n')

    return lines

def build_dummy_module_call(group_name, fifo_name, module_in, PE_ids):
    """ Build the call of the dummy module

    Parameters
    ----------
    group_name: str
    fifo_name: str
    module_in: int
    PE_ids: list
    """
    dir_str = 'out' if module_in == 0 else 'in'

    lines = []
    lines.append('\n')
    lines.append('  /* Module Call */\n')
    lines.append(f'  {group_name}_PE_dummy_{dir_str}(\n')
    for id in PE_ids:
        lines.append(f'    /* module id */ {id},\n')
    lines.append(f'    /* fifo */ {fifo_name}\n')
    lines.append(f'  );\n')
    lines.append(f'  /* Module Call */\n')

    return lines

def insert_dummy_modules(def_lines, call_lines):
    """ Insert the missing dummy modules

    Collect the FIFO information of PEs (fifo_name, fifo_type).
    Delete those FIFOs that are connected to other modules.
    Insert dummy modules for the rest of FIFOs.

    Parameters
    ----------
    def_lines: list
        Contains the codelines of the module definitions
    call_lines: list
        Contains the codelines of the module calls
    """
    PE_fifos = []
    for line in def_lines:
        if line.find('void PE_wrapper') != -1:
            # Parse the argument list
            m = re.search(r'\((.+?)\)', line)
            args = m.group(1).strip().split(',')
            for arg in args:
                if arg.find('fifo') != -1:
                    m = re.search(r'stream<(.+?)>', arg)
                    fifo_type = m.group(1)
                    fifo_name = arg.split('&')[-1]
                    PE_fifos.append({'type': fifo_type, 'name': fifo_name})
    #print(PE_fifos)
    # Collect all used fifos
    used_fifos = {}
    kernel_start = 0
    for line in call_lines:
        if line.find('void kernel0') != -1:
            kernel_start = 1
        if kernel_start:
            if line.find('* fifo *') != -1:
                fifo = line.strip().split('*')[2][2:]
                if fifo[-1] == ',':
                    fifo = fifo[:-1]
                # Only process PE level fifos
                if fifo.find('PE') == -1:
                    continue
                if fifo not in used_fifos:
                    used_fifos[fifo] = -1
                else:
                    del used_fifos[fifo]
    #print(used_fifos)
    # Locate the fifo position
    inside_module = False
    inside_PE = False
    fifo_pos = 0
    PE_call_start = -1
    PE_call_end = -1
    line_id = 0
    for line in call_lines:
        if line.find('Module Call') != -1:
            inside_module = not inside_module
            if inside_PE:
                PE_call_end = line_id
            inside_PE = False
        if inside_module:
            if line.find('PE_wrapper') != -1:
                inside_PE = True
                fifo_pos = 0
                if PE_call_start == -1:
                    PE_call_start = line_id - 1
            if inside_PE:
                if line.find('fifo') != -1:
                    for used_fifo in used_fifos:
                        if line.find(used_fifo) != -1:
                            used_fifos[used_fifo] = fifo_pos
                    fifo_pos += 1
        line_id += 1
    #print(used_fifos)
    # Insert the dummy module definitions
    offset_line = 0
    for used_fifo in used_fifos:
        fifo_info = PE_fifos[used_fifos[used_fifo]]
        # Extract the module direction
        if fifo_info['name'].endswith('in'):
            module_in = 0
        else:
            module_in = 1
        # Extract the group name
        if fifo_info['name'].endswith('in'):
            group_name = fifo_info['name'][5:-3]
        else:
            group_name = fifo_info['name'][5:-4]
        # Extract the PE ids
        PE_ids = used_fifo[len(f'fifo_{group_name}_PE_'):].split('_')
        #print(used_fifo, module_in, group_name, PE_ids)

        # Build the dummy module definition
        module_def = build_dummy_module_def(group_name, fifo_info['type'], module_in, PE_ids)
        #print(module_def)
        def_lines += module_def
        def_lines.append('\n')

        # Build the dummy module call
        module_call = build_dummy_module_call(group_name, used_fifo, module_in, PE_ids) # TODO
        if module_in == 0:
            for i in range(len(module_call)):
                call_lines.insert(PE_call_start - 1 + i, module_call[i])
            offset_line += len(module_call)
        else:
            for i in range(len(module_call)):
                call_lines.insert(PE_call_end + 1 + offset_line + i, module_call[i])

    #print(PE_call_start, PE_call_end)

    return def_lines, call_lines

def modify_tb(lines):
    """ Modify the test bench for Catapult HLS
    
    Replace the int main with CCS_MAIN.

    Paramters
    ---------
    lines: list
        contains the codelines of the test bench
    """
    for pos in range(len(lines)):
        line = lines[pos]
        if line.find('int main') != -1:
            line = line.replace('int main', 'CCS_MAIN')
        lines[pos] = line
    return lines

def reorder_module_calls(lines, target):
    """ Reorder the module calls in the program

    For I/O module calls, we will reverse the sequence of calls for output modules.
    Starting from the first module, enlist the module calls until the boundary module
    is met.
    Reverse the list and print it.

    Parameters
    ----------
    lines: list
        contains the codelines of the program
    target: string
        xilinx|intel|catapult
    """

    code_len = len(lines)
    module_calls = []
    module_start = 0
    module_call = []
    output_io = 0
    boundary = 0
    new_module = 0
    prev_module_name = ""
    first_line = -1
    last_line = -1
    reset = 0

    for pos in range(code_len):
        line = lines[pos]
        if line.find("/* Module Call */") != -1:
            if module_start == 0:
                module_start = 1
            else:
                module_start = 0

            if module_start:
                # Examine if the module is an output I/O module
                nxt_line = lines[pos + 1]
                if nxt_line.find("IO") != -1 and nxt_line.find("out") != -1:
                    output_io = 1
                    # Examine if the module is an boundary module
                    if nxt_line.find("boundary") != -1:
                        boundary = 1
                # Extract the module name
                nxt_line = nxt_line.strip()
                if nxt_line.find('<') != -1:
                    module_name = nxt_line.split('<')[0]
                else:
                    module_name = nxt_line.split('(')[0]
                if target == 'catapult':                    
                    module_name = module_name[:module_name.find('_inst')]

                if module_name.find('wrapper'):
                    module_name = module_name[:-8]
                if boundary:
                    module_name = module_name[:-9]
                if prev_module_name == "":
                    prev_module_name = module_name
                    first_line = pos
                else:
                    if prev_module_name != module_name:
                        new_module = 1
                        prev_module_name = module_name
                        first_line = pos
                        reset = 0
                    else:
                        if reset:
                            first_line = pos
                            reset = 0
                        new_module = 0

            if not module_start:
                if output_io:
                    last_line = pos
                    module_call.append(line)
                    module_calls.append(module_call.copy())
                    module_call.clear()
                    if boundary:
                        # Pop out the previous module calls except the last one
                        if new_module:
                            module_calls = module_calls[-1:]
                        # Reverse the list
                        module_calls.reverse()
                        # Insert it back
                        left_lines = lines[last_line + 1:]
                        lines = lines[:first_line]
                        first = 1
                        for c in module_calls:
                            if not first:
                                lines.append("\n")
                            lines = lines + c
                            first = 0
                        lines = lines + left_lines
                        # Clean up
                        module_calls.clear()
                        boundary = 0
                        output_io = 0
                        reset = 1
                    if new_module:
                        # Pop out the previous module calls except the last one
                        module_calls = module_calls[-1:]


        if module_start and output_io:
            module_call.append(line)

    return lines

def xilinx_run(
        kernel_call,
        kernel_def,
        kernel='autosa.tmp/output/src/kernel_kernel.cpp',
        host='opencl',
        hcl=False):
    """ Generate the kernel file for Xilinx platform

    We will copy the content of kernel definitions before the kernel calls.

    Parameters
    ----------
    kernel_call:
        file containing kernel calls
    kernel_def:
        file containing kernel definitions
    kernel:
        output kernel file
    hcl:
        integrated with HeteroCL
    """

    # Load kernel definition file
    lines = []
    with open(kernel_def, 'r') as f:
        lines = f.readlines()
    call_lines = []
    with open(kernel_call, 'r') as f:
        call_lines = f.readlines()

    # Simplify the expressions
    lines = simplify_expressions(lines)

    # Change the loop iterator type
    lines = shrink_bit_width(lines, 'xilinx')

    # Insert the HLS pragmas
    lines = insert_xlnx_pragmas(lines)

    # Lift the split_buffers
    lines = lift_split_buffers(lines)

    ## Insert missing dummy modules
    #lines, call_lines = insert_dummy_modules(lines, call_lines)

    kernel = str(kernel)
    print("Please find the generated file: " + kernel)

    with open(kernel, 'w') as f:
        if host == 'opencl' or hcl == True:
            # Merge kernel header file
            kernel_header = kernel.split('.')
            kernel_header[-1] = 'h'
            kernel_header = ".".join(kernel_header)
            with open(kernel_header, 'r') as f2:
                header_lines = f2.readlines()
                f.writelines(header_lines)
            f.write('\n')

        f.writelines(lines)

        # Reorder module calls
        call_lines = reorder_module_calls(call_lines, 'xilinx')
        f.writelines(call_lines)

        ## Load kernel call file
        #with open(kernel_call, 'r') as f2:
        #    lines = f2.readlines()
        #    # Reorder module calls
        #    lines = reorder_module_calls(lines)
        #    f.writelines(lines)


def catapult_run(
        kernel_call,
        kernel_def,
        tb,
        kernel='autosa.tmp/output/src/kernel_kernel_hw.h',
        host='opencl'):
    """ Generate the kernel file for Catapult HLS platform

    We will copy the content of kernel definitions before the kernel calls.

    Parameters
    ----------
    kernel_call:
        file containing kernel calls
    kernel_def:
        file containing kernel definitions
    tb: 
        file containing test bench
    kernel:
        output kernel file
    """

    # Load kernel definition file
    lines = []
    with open(kernel_def, 'r') as f:
        lines = f.readlines()
    call_lines = []
    with open(kernel_call, 'r') as f:
        call_lines = f.readlines()

    # Simplify the expressions
    lines = simplify_expressions(lines)

    # Change the loop iterator type
    lines = shrink_bit_width(lines, 'catapult')

    # Insert the HLS pragmas
    lines = insert_catapult_pragmas(lines)

    # Lift the split_buffers
    lines = lift_split_buffers(lines)    

    kernel = str(kernel)
    print("Please find the generated file: " + kernel)

    with open(kernel, 'w') as f:
        #if host == 'opencl':
        #    # Merge kernel header file
        #    kernel_header = kernel.split('.')
        #    kernel_header[-1] = 'h'
        #    kernel_header = ".".join(kernel_header)
        #    with open(kernel_header, 'r') as f2:
        #        header_lines = f2.readlines()
        #        f.writelines(header_lines)
        #    f.write('\n')

        f.writelines(lines)

        # Reorder module calls
        call_lines = reorder_module_calls(call_lines, 'catapult')

        f.writelines(call_lines)      

     # Modify the test bench
    with open(tb, 'r') as f:
        tb_lines = f.readlines()    
    tb_lines = modify_tb(tb_lines)
    with open(tb, 'w') as f:
        f.writelines(tb_lines)

def insert_intel_pragmas(lines):
    """ Insert Intel OpenCL pragmas for Intel program

    Replace the comments of "// hls_unroll" with OpenCL pragmas.
    For "hls unroll", find the previous for loop before hitting the "simd" mark.
    Insert "#pragma unroll" above the for loop.
    Replace the comments of "// hls_coalesce" with OpenCL pragma "#pragma loop_coalesce".

    Parameters
    ----------
    lines:
        contains the codelines of the program
    """
    code_len = len(lines)
    pos = 0
    while pos < code_len:
        line = lines[pos]
        if line.find('// hls_unroll') != -1:
            # Find the for loop above before hitting any "simd"
            prev_pos = pos - 1
            find_for = 0
            while prev_pos >= 0 and lines[prev_pos].find('simd') == -1:
                if lines[prev_pos].find('for') != -1:
                    find_for = 1
                    break
                prev_pos -= 1
            if find_for == 1:
                # Insert the pragma right before the for loop
                indent = lines[prev_pos].find('for')
                new_line = ' ' * indent + "#pragma unroll\n"
                lines.insert(prev_pos, new_line)
                del lines[pos + 1]
#    if line.find('// hls_coalesce') != -1:
#      indent = line.find('// hls_coalesce')
#      new_line = ' ' * indent + "#pragma loop_coalesce\n"
#      del lines[pos]
#      lines.insert(pos, new_line)
        pos = pos + 1

    return lines


def intel_run(
        kernel_call,
        kernel_def,
        kernel='autosa.tmp/output/src/kernel_kernel.cpp',
        hcl=False):
    """ Generate the kernel file for Intel platform

    We will extract all the fifo declarations and module calls.
    Then plug in the module definitions into each module call.

    Parameters
    ----------
    kernel_call:
        file containing kernel calls
    kernel_def:
        file containing kernel definitions
    kernel:
        output kernel file
    hcl:
        integrated with HeteroCL
    """
    # Load kernel call file
    module_calls = []
    fifo_decls = []
    with open(kernel_call, 'r') as f:
        add = False
        while True:
            line = f.readline()
            if not line:
                break
            # Extract the fifo declaration and add to the list
            if add:
                line = line.strip()
                fifo_decls.append(line)
            if line.find('/* FIFO Declaration */') != -1:
                if add:
                    fifo_decls.pop(len(fifo_decls) - 1)
                add = not add

    with open(kernel_call, 'r') as f:
        add = False
        module_call = []
        while True:
            line = f.readline()
            if not line:
                break
            # Extract the module call and add to the list
            if add:
                line = line.strip()
                module_call.append(line)
            if line.find('/* Module Call */') != -1:
                if add:
                    module_call.pop(len(module_call) - 1)
                    module_calls.append(module_call.copy())
                    module_call.clear()
                add = not add

    module_defs = {}
    headers = []
    #print(hcl)
    with open(kernel_def, 'r') as f:
        while True:
            line = f.readline()
            if not line:
                break
            if line.find('#include') != -1:
                #line = line.strip()
                if hcl == True and line.find('_kernel.h') != -1:
                    # Replace the header include with header contents
                    #print(line)
                    file_name = re.search(r'include \"(.+?)\"', line).group(1)
                    file_path = os.path.dirname(kernel) + '/' + file_name                    
                    with open(file_path, 'r') as f2:
                        header_lines = f2.readlines()
                        headers += header_lines
                else:
                    headers.append(line)

    with open(kernel_def, 'r') as f:
        add = False
        module_def = []
        while True:
            line = f.readline()
            if not line:
                break
            # Extract the module definition and add to the dict
            if add:
                module_def.append(line)
                # Extract the module name
                if (line.find('void')) != -1:
                    m = re.search(r'void (.+?)\(', line)
                    if m:
                        module_name = m.group(1)
                        #print(module_name)
            if line.find('/* Module Definition */') != -1:
                if add:
                    module_def.pop(len(module_def) - 1)
                    module_defs[module_name] = module_def.copy()
                    module_def.clear()
                    # Post-process the module definition
                    # Simplify the expressions
                    module_defs[module_name] = simplify_expressions(
                        module_defs[module_name])
                    # Insert the OpenCL pragmas
                    module_defs[module_name] = insert_intel_pragmas(
                        module_defs[module_name])
                    # Change the loop iterator type
                    module_defs[module_name] = shrink_bit_width(
                        module_defs[module_name], 'intel')
                add = not add

    # compose the kernel file
    kernel = str(kernel)
    generate_intel_kernel(
        kernel,
        headers,
        module_defs,
        module_calls,
        fifo_decls)


def tapa_run(
        kernel_call,
        kernel_def,
        kernel='autosa.tmp/output/src/kernel_kernel.cpp'):
    """ Generate the kernel file for TAPA platform

    We will copy the content of kernel definitions before the kernel calls.

    Parameters
    ----------
    kernel_call:
        file containing kernel calls
    kernel_def:
        file containing kernel definitions
    """

    # Load kernel definition file
    lines = []
    with open(kernel_def, 'r') as f:
        lines = f.readlines()
    call_lines = []
    with open(kernel_call, 'r') as f:
        call_lines = f.readlines()

    # Simplify the expressions
    lines = simplify_expressions(lines)

    # Change the loop iterator type
    lines = shrink_bit_width(lines, 'xilinx')

    # Insert the HLS pragmas
    lines = insert_xlnx_pragmas(lines)

    # Lift the split_buffers
    lines = lift_split_buffers(lines)

    kernel = str(kernel)
    print("Please find the generated file: " + kernel)

    with open(kernel, 'w') as f:
        f.writelines(lines)
        f.writelines(call_lines)

if __name__ == "__main__":
    parser = argparse.ArgumentParser(description='==== AutoSA CodeGen ====')
    parser.add_argument(
        '-c',
        '--kernel-call',
        metavar='KERNEL_CALL',
        required=True,
        help='kernel function call')
    parser.add_argument(
        '-d',
        '--kernel-def',
        metavar='KERNEL_DEF',
        required=True,
        help='kernel function definition')
    parser.add_argument(
        '--tb',
        metavar='TB',
        required=False,
        help='test bench')    
    parser.add_argument(
        '-t',
        '--target',
        metavar='TARGET',
        required=True,
        help='hardware target: autosa_hls_c|autosa_opencl|autosa_catapult_c')
    parser.add_argument(
        '-o',
        '--output',
        metavar='OUTPUT',
        required=False,
        help='output kernel file')
    parser.add_argument(
        '--host',
        metavar='HOST',
        required=False,
        help='Xilinx host target: hls|opencl',
        default='opencl')
    parser.add_argument(
        '--hcl',        
        action='store_true',
        default=False,
        help='HeteroCL integration')

    args = parser.parse_args()

    if args.target == 'autosa_opencl':
        intel_run(args.kernel_call, args.kernel_def, args.output, args.hcl)
    elif args.target == 'autosa_hls_c':
        xilinx_run(args.kernel_call, args.kernel_def, args.output, args.host, args.hcl)
    elif args.target == 'autosa_tapa':
        tapa_run(args.kernel_call, args.kernel_def, args.output)
    elif args.target == 'autosa_catapult_c':
        catapult_run(args.kernel_call, args.kernel_def, args.tb, args.output, args.host)


================================================
FILE: autosa_scripts/hls_scripts/hls_script.tcl
================================================
############################################################
## This file is generated automatically by Vivado HLS.
## Please DO NOT edit it.
## Copyright (C) 1986-2019 Xilinx, Inc. All Rights Reserved.
############################################################
open_project hls_prj
set_top kernel0
add_files src/kernel_kernel.h
add_files src/kernel_kernel.cpp
add_files -tb src/kernel_host.cpp
open_solution "solution1"
set_part {xcu200-fsgd2104-2-e}
create_clock -period 5 -name default
config_compile -name_max_length 50
#source "./prj/solution1/directives.tcl"
csim_design
#csynth_design
#cosim_design 
#cosim_design -trace_level all
#cosim_design -setup -trace_level all
#export_design -format ip_catalog
exit


================================================
FILE: autosa_scripts/hls_scripts/hls_script_synth.tcl
================================================
############################################################
## This file is generated automatically by Vivado HLS.
## Please DO NOT edit it.
## Copyright (C) 1986-2019 Xilinx, Inc. All Rights Reserved.
############################################################
open_project hls_prj
set_top kernel0
add_files src/kernel_kernel.h
add_files src/kernel_kernel.cpp
add_files -tb src/kernel_host.cpp
open_solution "solution1"
set_part {xcu200-fsgd2104-2-e}
create_clock -period 5 -name default
config_compile -name_max_length 50
#source "./prj/solution1/directives.tcl"
#csim_design
csynth_design
#cosim_design 
#cosim_design -trace_level all
#cosim_design -setup -trace_level all
#export_design -format ip_catalog
exit


================================================
FILE: autosa_scripts/intel_opencl_scripts/Makefile
================================================
APP ?= kernel
AOCL_BOARD ?= s10mx_hbm_es
SW_EMU_AOCX ?= $(APP)_sw_emu.aocx
HW_EMU_AOCX ?= $(APP)_hw_emu.aocx
HW_AOCX ?= $(APP)_hw.aocx
AOCO ?= $(APP).aoco
AOCR ?= $(APP).aocr

# Compiler
AOC ?= aoc
CXX ?= g++
AOC_FLAGS ?= -board=$(AOCL_BOARD) -fp-relaxed -report -hyper-optimized-handshaking=off -I $(INTELFPGAOCLSDKROOT)/include/kernel_headers

TARGET ?= host
SW_EMU_TARGET ?= host_sw_emu
TARGET_DIR ?= bin
AOCL_UTILS ?= $(INTELFPGAOCLSDKROOT)/examples_aoc/common

# Directories
INC_DIRS := src $(AOCL_UTILS)/inc
LIB_DIRS := 

# Files
INCS := $(wildcard src/*.h)
HOST_SRCS := $(wildcard src/$(APP)_host.cpp $(AOCL_UTILS)/src/AOCLUtils/*.cpp)
KERNEL_SRCS := src/$(APP)_kernel.cl

ifeq ($(VERBOSE),1)
ECHO := 
else
ECHO := @
endif

# Where is the Intel(R) FPGA SDK for OpenCL(TM) software?
ifeq ($(wildcard $(INTELFPGAOCLSDKROOT)),)
$(error Set INTELFPGAOCLSDKROOT to the root directory of the Intel(R) FPGA SDK for OpenCL(TM) software installation)
endif
ifeq ($(wildcard $(INTELFPGAOCLSDKROOT)/host/include/CL/opencl.h),)
$(error Set INTELFPGAOCLSDKROOT to the root directory of the Intel(R) FPGA SDK for OpenCL(TM) software installation.)
endif

# OpenCL compile and link flags.
AOCL_COMPILE_CONFIG := $(shell aocl compile-config )
AOCL_LINK_LIBS := $(shell aocl ldlibs )
AOCL_LINK_FLAGS := $(shell aocl ldflags )
# Linking with defences enabled
AOCL_LINK_FLAGS += -z noexecstack
AOCL_LINK_FLAGS += -Wl,-z,relro,-z,now
AOCL_LINK_FLAGS += -Wl,-Bsymbolic
AOCL_LINK_FLAGS += -pie
AOCL_LINK_CONFIG := $(AOCL_LINK_FLAGS) $(AOCL_LINK_LIBS)

# Compilation flags
ifeq ($(DEBUG),1)
CXXFLAGS += -g
else
CXXFLAGS += -O2
endif
CXXFLAGS += -std=gnu++0x

# Compiling with defences enabled
CXXFLAGS += -fstack-protector
CXXFLAGS += -D_FORTIFY_SOURCE=2
CXXFLAGS += -Wformat -Wformat-security
CXXFLAGS += -fPIE

# We must force GCC to never assume that it can shove in its own
# sse2/sse3 versions of strlen and strcmp because they will CRASH.
# Very hard to debug!
CXXFLAGS += -fPIC

LIBS := rt pthread

## Make it all!
#all : $(TARGET_DIR)/$(TARGET)

sw_emu : $(TARGET_DIR)/$(TARGET) $(TARGET_DIR)/$(SW_EMU_AOCX)

hls: $(TARGET_DIR)/$(AOCR)

hw : $(TARGET_DIR)/$(TARGET) $(TARGET_DIR)/$(HW_AOCX)

hw_emu: $(TARGET_DIR)/$(TARGET) $(TARGET_DIR)/$(HW_EMU_AOCX)

hw_emu_check: $(TARGET_DIR)/$(TARGET) $(TARGET_DIR)/$(HW_EMU_AOCX)
	CL_CONTEXT_MPSIM_DEVICE_INTELFPGA=1 $(TARGET_DIR)/$(TARGET) $(HW_EMU_AOCX)

sw_emu_check : $(TARGET_DIR)/$(SW_EMU_TARGET) $(TARGET_DIR)/$(SW_EMU_AOCX)
	CL_CONTEXT_EMULATOR_DEVICE_INTELFPGA=1 $(TARGET_DIR)/$(TARGET) $(SW_EMU_AOCX)

hw_check : $(TARGET_DIR)/$(TARGET) $(TARGET_DIR)/$(HW_AOCX)
	$(TARGET_DIR)/$(TARGET) $(HW_AOCX)

# Host executable target.
$(TARGET_DIR)/$(TARGET) : Makefile $(HOST_SRCS) $(INCS) $(TARGET_DIR)
	$(ECHO)$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(EXTRACXXFLAGS) -fPIC $(foreach D,$(INC_DIRS),-I$D) \
			$(AOCL_COMPILE_CONFIG) $(HOST_SRCS) $(AOCL_LINK_CONFIG) \
			$(foreach D,$(LIB_DIRS),-L$D) \
			$(foreach L,$(LIBS),-l$L) \
			-o $(TARGET_DIR)/$(TARGET)

$(TARGET_DIR)/$(SW_EMU_TARGET) : Makefile $(HOST_SRCS) $(INCS) $(TARGET_DIR)
	$(ECHO)$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(EXTRACXXFLAGS) -fPIC $(foreach D,$(INC_DIRS),-I$D) \
			$(AOCL_COMPILE_CONFIG) $(HOST_SRCS) $(AOCL_LINK_CONFIG) \
			$(foreach D,$(LIB_DIRS),-L$D) \
			$(foreach L,$(LIBS),-l$L) \
			-o $(TARGET_DIR)/$(TARGET) -DEMULATE

$(TARGET_DIR) :
	$(ECHO)mkdir $(TARGET_DIR)

$(TARGET_DIR)/$(SW_EMU_AOCX) : $(KERNEL_SRCS)
	$(AOC) $(AOC_FLAGS) -march=emulator -legacy-emulator -o $@ $^

$(TARGET_DIR)/$(HW_EMU_AOCX) : $(KERNEL_SRCS)
	$(AOC) $(AOC_FLAGS) -march=simulator -ghdl -o $@ $^

$(TARGET_DIR)/$(HW_AOCX) : $(KERNEL_SRCS)
	$(AOC) $(AOC_FLAGS) -o $@ $^

$(TARGET_DIR)/$(AOCO) : $(KERNEL_SRCS)
	$(AOC) $(AOC_FLAGS) -c -o $@ $^

$(TARGET_DIR)/$(AOCR) : $(TARGET_DIR)/$(AOCO)
	$(AOC) $(AOC_FLAGS) -rtl -o $@ $^

# Standard make targets
clean :
	$(ECHO)rm -rf $(TARGET_DIR)/*

.PHONY : all clean


================================================
FILE: autosa_scripts/intel_opencl_scripts/common/inc/AOCLUtils/aocl_utils.h
================================================
// Copyright (C) 2013-2020 Altera Corporation, San Jose, California, USA. All rights reserved.
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to
// whom the Software is furnished to do so, subject to the following conditions:
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
// 
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
// 
// This agreement shall be governed in all respects by the laws of the State of California and
// by the laws of the United States of America.

// Main include file for AOCLUtils. Includes all other utility header files.

#ifndef AOCL_UTILS_H
#define AOCL_UTILS_H

#include "AOCLUtils/opencl.h"
#include "AOCLUtils/scoped_ptrs.h"
#include "AOCLUtils/options.h"

#endif



================================================
FILE: autosa_scripts/intel_opencl_scripts/common/inc/AOCLUtils/opencl.h
================================================
// Copyright (C) 2013-2020 Altera Corporation, San Jose, California, USA. All rights reserved.
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to
// whom the Software is furnished to do so, subject to the following conditions:
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
// 
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
// 
// This agreement shall be governed in all respects by the laws of the State of California and
// by the laws of the United States of America.

// OpenCL utility functions.

#ifndef AOCL_UTILS_OPENCL_H
#define AOCL_UTILS_OPENCL_H

#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <string>

#include "CL/opencl.h"

// This is assumed to be externally provided by the application.
extern void cleanup();

namespace aocl_utils {

// Host allocation functions
void *alignedMalloc(size_t size);
void alignedFree(void *ptr);

// Error functions
void printError(cl_int error);
void _checkError(int line,
                 const char *file,
                 cl_int error,
                 const char *msg,
                 ...); // does not return
#define checkError(status, ...) _checkError(__LINE__, __FILE__, status, __VA_ARGS__)

// Sets the current working directory to the same directory that contains
// this executable. Returns true on success.
bool setCwdToExeDir();

// Find a platform that contains the search string in its name (case-insensitive match).
// Returns NULL if no match is found.
cl_platform_id findPlatform(const char *platform_name_search);

// Returns the name of the platform.
std::string getPlatformName(cl_platform_id pid);

// Returns the name of the device.
std::string getDeviceName(cl_device_id did);

// Returns an array of device ids for the given platform and the
// device type.
// Return value must be freed with delete[].
cl_device_id *getDevices(cl_platform_id pid, cl_device_type dev_type, cl_uint *num_devices);

// Create a OpenCL program from a binary file.
// The program is created for all given devices associated with the context. The same
// binary is used for all devices.
cl_program createProgramFromBinary(cl_context context, const char *binary_file_name, const cl_device_id *devices, unsigned num_devices);

// Load binary file.
// Return value must be freed with delete[].
unsigned char *loadBinaryFile(const char *file_name, size_t *size);

// Checks if a file exists.
bool fileExists(const char *file_name);

// Returns the path to the AOCX file to use for the given device.
// This is special handling for examples for the Intel(R) FPGA SDK for OpenCL(TM).
// It uses the device name to get the board name and then looks for a
// corresponding AOCX file. Specifically, it gets the device name and
// extracts the board name assuming the device name has the following format:
//  <board> : ...
//
// Then the AOCX file is <prefix>_<version>_<board>.aocx. If this
// file does not exist, then the file name defaults to <prefix>.aocx.
std::string getBoardBinaryFile(const char *prefix, cl_device_id device);

// Returns the time from a high-resolution timer in seconds. This value
// can be used with a value returned previously to measure a high-resolution
// time difference.
double getCurrentTimestamp();

// Returns the difference between the CL_PROFILING_COMMAND_END and
// CL_PROFILING_COMMAND_START values of a cl_event object.
// This requires that the command queue associated with the event be created
// with the CL_QUEUE_PROFILING_ENABLE property.
//
// The return value is in nanoseconds.
cl_ulong getStartEndTime(cl_event event);

// Returns the maximum time span for the given set of events.
// The time span starts at the earliest event start time.
// The time span ends at the latest event end time.
cl_ulong getStartEndTime(cl_event *events, unsigned num_events);

// Wait for the specified number of milliseconds.
void waitMilliseconds(unsigned ms);

// OpenCL context callback function that simply prints the error information
// to stdout (via printf).
void oclContextCallback(const char *errinfo, const void *, size_t, void *);

} // ns aocl_utils

#endif



================================================
FILE: autosa_scripts/intel_opencl_scripts/common/inc/AOCLUtils/options.h
================================================
// Copyright (C) 2013-2020 Altera Corporation, San Jose, California, USA. All rights reserved.
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to
// whom the Software is furnished to do so, subject to the following conditions:
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
// 
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
// 
// This agreement shall be governed in all respects by the laws of the State of California and
// by the laws of the United States of America.

// Declares a utility class used to parse command-line options.

#ifndef AOCL_UTILS_OPTIONS_H
#define AOCL_UTILS_OPTIONS_H

#include <map>
#include <sstream>
#include <string>
#include <vector>

namespace aocl_utils {

class Options {
public:
  typedef std::vector<std::string> StringVec;

  Options();
  Options(int num, char *argv[]);

  bool has(const std::string &name) const;
  std::string &get(const std::string &name); // will create an empty option if it does not exist
  const std::string &get(const std::string &name) const; // error if option does not exist

  void set(const std::string &name, const std::string &value) { get(name) = value; }

  // Command line options must be of the following form:
  //  [-]-name (indicates option exists)
  //  [-]-name=value
  //
  // This function assumes that the values are from main(int, char *).
  // This means that the argv[0] is skipped.
  void addFromCommandLine(int num, char *argv[]);

  // This templated function converts the option value to the given type.
  // An assert is raised if the conversion fails.
  template<typename T>
  T get(const std::string &name) const;

  template<typename T>
  void set(const std::string &name, const T &value);

  // Non-options are arguments processed in addFromCommandLine
  // that were not recognized as options.
  const StringVec &getNonOptions() const { return m_nonoptions; }
  size_t getNonOptionCount() const { return m_nonoptions.size(); }
  const std::string &getNonOption(size_t i) const { return m_nonoptions[i]; }

private:
  typedef std::map<std::string, std::string> OptionMap;

  // Displays an error message indicating that a nameless option
  // was provided.
  void errorNameless() const;

  // Displays an error message indicating that the given option
  // has the wrong type and then exits with an error code.
  void errorWrongType(const std::string &name) const;

  // Displays an error message indicating that the given option
  // does not exist and then exits with an error code.
  void errorNonExistent(const std::string &name) const;

  OptionMap m_options;
  StringVec m_nonoptions;

  Options(const Options &); // not implemented
  void operator =(const Options &); // not implemented
};

template<typename T>
T Options::get(const std::string &name) const {
  std::stringstream ss;
  ss << get(name);

  T v;
  ss >> v;
  if(ss.fail() || !ss.eof()) {
    // Failed to parse or did not consume the whole string value.
    errorWrongType(name);
  }
  return v;
}

// Specialization for bool. 
template<>
inline bool Options::get<bool>(const std::string &name) const {
  if(has(name)) {
    const std::string &v = get(name);
    if(v == "1") {
      return true;
    }
  }
  return false;
}

// Specialization for std::string. Simply returns the option string.
// Requires specialization because using stringstream to read the string
// will stop at the first whitespace character (which is wrong).
template<>
inline std::string Options::get<std::string>(const std::string &name) const {
  return get(name);
}

// This assumes the type T can be serialized to a string and back (when get
// is called).
template<typename T>
void Options::set(const std::string &name, const T &value) {
  std::stringstream ss;
  ss << value;
  set(name, ss.str());
}

} // ns aocl_utils

#endif



================================================
FILE: autosa_scripts/intel_opencl_scripts/common/inc/AOCLUtils/scoped_ptrs.h
================================================
// Copyright (C) 2013-2020 Altera Corporation, San Jose, California, USA. All rights reserved.
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to
// whom the Software is furnished to do so, subject to the following conditions:
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
// 
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
// 
// This agreement shall be governed in all respects by the laws of the State of California and
// by the laws of the United States of America.

// Scoped pointer definitions.

#ifndef AOCL_UTILS_SCOPED_PTRS_H
#define AOCL_UTILS_SCOPED_PTRS_H

namespace aocl_utils {

// Interface is essentially the combination of std::auto_ptr and boost's smart pointers,
// along with some small extensions (auto conversion to T*).

// scoped_ptr: assumes pointer was allocated with operator new; destroys with operator delete
template<typename T>
class scoped_ptr {
public:
  typedef scoped_ptr<T> this_type;

  scoped_ptr() : m_ptr(NULL) {}
  scoped_ptr(T *ptr) : m_ptr(ptr) {}
  ~scoped_ptr() { reset(); }

  T *get() const { return m_ptr; }
  operator T *() const { return m_ptr; }
  T *operator ->() const { return m_ptr; }
  T &operator *() const { return *m_ptr; }

  this_type &operator =(T *ptr) { reset(ptr); return *this; }

  void reset(T *ptr = NULL) { delete m_ptr; m_ptr = ptr; }
  T *release() { T *ptr = m_ptr; m_ptr = NULL; return ptr; }

private:
  T *m_ptr;

  // noncopyable
  scoped_ptr(const this_type &);
  this_type &operator =(const this_type &);
};

// scoped_array: assumes pointer was allocated with operator new[]; destroys with operator delete[]
// Also supports allocation/reset with a number, which is the number of
// elements of type T.
template<typename T>
class scoped_array {
public:
  typedef scoped_array<T> this_type;

  scoped_array() : m_ptr(NULL) {}
  scoped_array(T *ptr) : m_ptr(NULL) { reset(ptr); }
  explicit scoped_array(size_t n) : m_ptr(NULL) { reset(n); }
  ~scoped_array() { reset(); }

  T *get() const { return m_ptr; }
  operator T *() const { return m_ptr; }
  T *operator ->() const { return m_ptr; }
  T &operator *() const { return *m_ptr; }
  T &operator [](int index) const { return m_ptr[index]; }

  this_type &operator =(T *ptr) { reset(ptr); return *this; }

  void reset(T *ptr = NULL) { delete[] m_ptr; m_ptr = ptr; }
  void reset(size_t n) { reset(new T[n]); }
  T *release() { T *ptr = m_ptr; m_ptr = NULL; return ptr; }

private:
  T *m_ptr;

  // noncopyable
  scoped_array(const this_type &);
  this_type &operator =(const this_type &);
};

// scoped_aligned_ptr: assumes pointer was allocated with alignedMalloc; destroys with alignedFree
// Also supports allocation/reset with a number, which is the number of
// elements of type T
template<typename T>
class scoped_aligned_ptr {
public:
  typedef scoped_aligned_ptr<T> this_type;

  scoped_aligned_ptr() : m_ptr(NULL) {}
  scoped_aligned_ptr(T *ptr) : m_ptr(NULL) { reset(ptr); }
  explicit scoped_aligned_ptr(size_t n) : m_ptr(NULL) { reset(n); }
  ~scoped_aligned_ptr() { reset(); }

  T *get() const { return m_ptr; }
  operator T *() const { return m_ptr; }
  T *operator ->() const { return m_ptr; }
  T &operator *() const { return *m_ptr; }
  T &operator [](int index) const { return m_ptr[index]; }

  this_type &operator =(T *ptr) { reset(ptr); return *this; }

  void reset(T *ptr = NULL) { if(m_ptr) alignedFree(m_ptr); m_ptr = ptr; }
  void reset(size_t n) { reset((T*) alignedMalloc(sizeof(T) * n)); }
  T *release() { T *ptr = m_ptr; m_ptr = NULL; return ptr; }

private:
  T *m_ptr;

  // noncopyable
  scoped_aligned_ptr(const this_type &);
  this_type &operator =(const this_type &);
};

#if USE_SVM_API == 1
// scoped_SVM_aligned_ptr: assumes pointer was allocated with clSVMAlloc; destroys with clSVMFree
// Also supports allocation/reset with a number, which is the number of
// elements of type T
template<typename T>
class scoped_SVM_aligned_ptr {
public:
	typedef scoped_SVM_aligned_ptr<T> this_type;

	scoped_SVM_aligned_ptr() : m_ptr(NULL) {}
	scoped_SVM_aligned_ptr(T *ptr) : m_ptr(NULL) { reset(ptr); }
	explicit scoped_SVM_aligned_ptr(cl_context ctx, size_t n) : m_ptr(NULL) { reset(ctx, n); }
	~scoped_SVM_aligned_ptr() { reset(); }

	T *get() const { return m_ptr; }
	operator T *() const { return m_ptr; }
	T *operator ->() const { return m_ptr; }
	T &operator *() const { return *m_ptr; }
	T &operator [](int index) const { return m_ptr[index]; }

	this_type &operator =(T *ptr) { reset(ptr); return *this; }

	void reset(T *ptr = NULL) { if (m_ptr) clSVMFree(m_ctx, m_ptr); m_ptr = ptr; }
	void reset(cl_context ctx, size_t n) { reset((T*)clSVMAlloc(ctx, 0, sizeof(T) * n, 0)); m_ctx = ctx; }
	T *release() { T *ptr = m_ptr; m_ptr = NULL; return ptr; }

private:
	T *m_ptr;
	cl_context m_ctx;

	// noncopyable
	scoped_SVM_aligned_ptr(const this_type &);
	this_type &operator =(const this_type &);
};
#endif /* USE_SVM_API == 1 */

} // ns aocl_utils

#endif



================================================
FILE: autosa_scripts/intel_opencl_scripts/common/readme.css
================================================
/*
Copyright (C) 2013-2020 Altera Corporation, San Jose, California, USA. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy of this
software and associated documentation files (the "Software"), to deal in the Software
without restriction, including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to
whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or
substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

This agreement shall be governed in all respects by the laws of the State of California and
by the laws of the United States of America.
*/

body {
  margin: 0 1em 1em 1em;
  font-family: sans-serif;
}
ul {
  list-style-type: square;
}
pre, code, kbd, samp, tt {
  font-family: monospace, sans-serif;
  font-size: 1em;
}

h1 {
  font-size: 200%;
  color: #fff;
  background-color: #0067a6;
  margin: 0 -0.5em;
  padding: 0.25em 0.5em;
}
h1 .preheading {
  font-size: 40%;
  font-weight: normal;
}
h2 {
  font-size: 125%;
  background-color: #bae5ff;
  margin: 1.5em -0.8em 0 -0.8em;
  padding: 0.2em 0.8em;
}
h3 {
  margin-top: 1.5em;
  font-size: 100%;
  border-bottom: 1px dotted #000;
}

table {
  border: 2px solid #0067a6;
  border-collapse: collapse;
}
th {
  border-bottom: 1px solid #0067a6;
  border-left: 1px dotted #0067a6;
  border-right: 1px dotted #0067a6;
  background-color: #bae5ff;
  padding: 0.3em;
  font-size: 90%;
}
td {
  padding: 0.3em;
  border: 1px dotted #0067a6;
}

table.reqs {
  margin: 0 auto;
}
table.reqs td {
  white-space: nowrap;
  text-align: center;
}
table.reqs td:first-child,
table.reqs tr:first-child th:first-child {
  text-align: left;
}
table.reqs td.req {
  background-color: #b3ef71;
  font-size: 150%;
  padding: 0 0.3em;
}
table.reqs td.req .either {
  font-size: 50%;
}
table.reqs td.unsupported {
  white-space: normal;
  background-color: #ccc;
  max-width: 20em;
}
table.reqs a.note {
  text-decoration: none;
}
ol.req-notes > li {
  margin-bottom: 0.75em;
}

table.history {
  margin: 0 auto;
}
table.history td {
  text-align: center;
  vertical-align: top;
}
table.history .changes {
  text-align: left;
}
table.history tbody tr:first-child td {
  background-color: #b3ef71;
}
table.history ul {
  margin: 0;
  padding-left: 1em;
}

table.pkg-contents {
  margin: 0 auto;
}
table.pkg-contents th,
table.pkg-contents td {
  text-align: left;
  vertical-align: top;
}
table.pkg-contents td.path {
  font-family: monospace, sans-serif;
  font-size: 1em;
}
table.pkg-contents tr.highlight td {
  background-color: #ffc;
  font-weight: bold;
  color: #000;
}
table.pkg-contents td p:first-child {
  margin-top: 0;
}
table.pkg-contents td p:last-child {
  margin-bottom: 0;
}

table.parameters {
  margin-left: 3em;
  margin-right: 3em;
  font-family: monospace, sans-serif;
  font-size: 1em;
}
table.parameters th,
table.parameters td {
  font-family: sans-serif;
  text-align: center;
  vertical-align: top;
}
table.parameters .name,
table.parameters .desc {
  text-align: left;
}
table.parameters .name {
  white-space: nowrap;
}
table.parameters td.name,
table.parameters td.default {
  font-family: monospace, sans-serif;
  font-size: 1em;
}
table.parameters ul {
  margin-top: 0;
}
table.parameters td ul:last-child {
  margin-bottom: 0;
}

table.indent {
  margin-left: 3em;
}

.doc .title {
  background-color: #eee;
  padding: 0.35em;
  margin-bottom: 0.5em;
}
.doc .title a {
  font-weight: bold;
}
.doc .desc {
  margin-left: 2em;
  margin-right: 2em;
}

.left {
  text-align: left;
}
.center {
  text-align: center;
}
.right {
  text-align: right;
}

.mono {
  font-family: monospace, sans-serif;
  font-size: 1em;
}
.highlight {
  font-weight: bold;
  color: #0067a6;
}
.nowrap {
  white-space: nowrap;
}

.command {
  font-family: monospace, sans-serif;
  font-size: 1em;
  margin: 0 3em;
  background-color: #ffc;
  border: 1px solid #aaa;
  padding: 0.5em 1em;
}
.console-output,
.code-block {
  display: block;
  font-family: monospace, sans-serif;
  font-size: 1em;
  margin: 0 3em;
  background-color: #fff;
  border: 1px solid #aaa !important;
  padding: 1.8em 1em 0.5em 1em !important;
  position: relative;
}
.console-output .heading,
.code-block .heading {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  font-size: 80%;
  text-transform: uppercase;
  background-color: #e8e8e8;
  padding: 0.3125em 0;
  border-bottom: 1px dotted #888;
}
.console-output .heading span,
.code-block .heading span {
  padding: 0 1.25em;
}
.not-released {
  font-weight: bold;
  color: red;
}
.license,
.trademark {
  font-size: 80%;
}


================================================
FILE: autosa_scripts/intel_opencl_scripts/common/src/AOCLUtils/opencl.cpp
================================================
// Copyright (C) 2013-2020 Altera Corporation, San Jose, California, USA. All rights reserved.
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to
// whom the Software is furnished to do so, subject to the following conditions:
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
// 
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
// 
// This agreement shall be governed in all respects by the laws of the State of California and
// by the laws of the United States of America.

#include "AOCLUtils/aocl_utils.h"
#include <algorithm>
#include <stdarg.h>

#ifdef _WIN32 // Windows
#include <windows.h>
#else         // Linux
#include <stdio.h> 
#include <unistd.h> // readlink, chdir
#endif

namespace aocl_utils {

static const char *const VERSION_STR = "191";

//////////////////////////////////////////
// Host allocation functions for alignment
//////////////////////////////////////////

// This is the minimum alignment requirement to ensure DMA can be used.
const unsigned AOCL_ALIGNMENT = 64;

#ifdef _WIN32 // Windows
void *alignedMalloc(size_t size) {
  return _aligned_malloc (size, AOCL_ALIGNMENT);
}

void alignedFree(void * ptr) {
  _aligned_free(ptr);
}
#else          // Linux
void *alignedMalloc(size_t size) {
  void *result = NULL;
  int rc;
  rc = posix_memalign (&result, AOCL_ALIGNMENT, size);
  return result;
}

void alignedFree(void * ptr) {
  free (ptr);
}
#endif

///////////////////////////////
// Error functions
///////////////////////////////

// Print the error associciated with an error code
void printError(cl_int error) {
  // Print error message
  switch(error)
  {
    case -1:
      printf("CL_DEVICE_NOT_FOUND ");
      break;
    case -2:
      printf("CL_DEVICE_NOT_AVAILABLE ");
      break;
    case -3:
      printf("CL_COMPILER_NOT_AVAILABLE ");
      break;
    case -4:
      printf("CL_MEM_OBJECT_ALLOCATION_FAILURE ");
      break;
    case -5:
      printf("CL_OUT_OF_RESOURCES ");
      break;
    case -6:
      printf("CL_OUT_OF_HOST_MEMORY ");
      break;
    case -7:
      printf("CL_PROFILING_INFO_NOT_AVAILABLE ");
      break;
    case -8:
      printf("CL_MEM_COPY_OVERLAP ");
      break;
    case -9:
      printf("CL_IMAGE_FORMAT_MISMATCH ");
      break;
    case -10:
      printf("CL_IMAGE_FORMAT_NOT_SUPPORTED ");
      break;
    case -11:
      printf("CL_BUILD_PROGRAM_FAILURE ");
      break;
    case -12:
      printf("CL_MAP_FAILURE ");
      break;
    case -13:
      printf("CL_MISALIGNED_SUB_BUFFER_OFFSET ");
      break;
    case -14:
      printf("CL_EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST ");
      break;
    case -15:
      printf("CL_COMPILE_PROGRAM_FAILURE ");
      break;
    case -16:
      printf("CL_LINKER_NOT_AVAILABLE ");
      break;
    case -17:
      printf("CL_LINK_PROGRAM_FAILURE ");
      break;
    case -18:
      printf("CL_DEVICE_PARTITION_FAILED ");
      break;
    case -19:
      printf("CL_KERNEL_ARG_INFO_NOT_AVAILABLE ");
      break;

    case -30:
      printf("CL_INVALID_VALUE ");
      break;
    case -31:
      printf("CL_INVALID_DEVICE_TYPE ");
      break;
    case -32:
      printf("CL_INVALID_PLATFORM ");
      break;
    case -33:
      printf("CL_INVALID_DEVICE ");
      break;
    case -34:
      printf("CL_INVALID_CONTEXT ");
      break;
    case -35:
      printf("CL_INVALID_QUEUE_PROPERTIES ");
      break;
    case -36:
      printf("CL_INVALID_COMMAND_QUEUE ");
      break;
    case -37:
      printf("CL_INVALID_HOST_PTR ");
      break;
    case -38:
      printf("CL_INVALID_MEM_OBJECT ");
      break;
    case -39:
      printf("CL_INVALID_IMAGE_FORMAT_DESCRIPTOR ");
      break;
    case -40:
      printf("CL_INVALID_IMAGE_SIZE ");
      break;
    case -41:
      printf("CL_INVALID_SAMPLER ");
      break;
    case -42:
      printf("CL_INVALID_BINARY ");
      break;
    case -43:
      printf("CL_INVALID_BUILD_OPTIONS ");
      break;
    case -44:
      printf("CL_INVALID_PROGRAM ");
      break;
    case -45:
      printf("CL_INVALID_PROGRAM_EXECUTABLE ");
      break;
    case -46:
      printf("CL_INVALID_KERNEL_NAME ");
      break;
    case -47:
      printf("CL_INVALID_KERNEL_DEFINITION ");
      break;
    case -48:
      printf("CL_INVALID_KERNEL ");
      break;
    case -49:
      printf("CL_INVALID_ARG_INDEX ");
      break;
    case -50:
      printf("CL_INVALID_ARG_VALUE ");
      break;
    case -51:
      printf("CL_INVALID_ARG_SIZE ");
      break;
    case -52:
      printf("CL_INVALID_KERNEL_ARGS ");
      break;
    case -53:
      printf("CL_INVALID_WORK_DIMENSION ");
      break;
    case -54:
      printf("CL_INVALID_WORK_GROUP_SIZE ");
      break;
    case -55:
      printf("CL_INVALID_WORK_ITEM_SIZE ");
      break;
    case -56:
      printf("CL_INVALID_GLOBAL_OFFSET ");
      break;
    case -57:
      printf("CL_INVALID_EVENT_WAIT_LIST ");
      break;
    case -58:
      printf("CL_INVALID_EVENT ");
      break;
    case -59:
      printf("CL_INVALID_OPERATION ");
      break;
    case -60:
      printf("CL_INVALID_GL_OBJECT ");
      break;
    case -61:
      printf("CL_INVALID_BUFFER_SIZE ");
      break;
    case -62:
      printf("CL_INVALID_MIP_LEVEL ");
      break;
    case -63:
      printf("CL_INVALID_GLOBAL_WORK_SIZE ");
      break;
    case -64:
      printf("CL_INVALID_PROPERTY ");
      break;
    case -65:
      printf("CL_INVALID_IMAGE_DESCRIPTOR ");
      break;
    case -66:
      printf("CL_INVALID_COMPILER_OPTIONS ");
      break;
    case -67:
      printf("CL_INVALID_LINKER_OPTIONS ");
      break;
    case -68:
      printf("CL_INVALID_DEVICE_PARTITION_COUNT ");
      break;
    case -69:
      printf("CL_INVALID_PIPE_SIZE ");
      break;
    case -70:
      printf("CL_INVALID_DEVICE_QUEUE ");
      break;

    case -1001:
      printf("CL_PLATFORM_NOT_FOUND_KHR ");
      break;

    case -1094:
      printf("CL_INVALID_ACCELERATOR_INTEL ");
      break;
    case -1095:
      printf("CL_INVALID_ACCELERATOR_TYPE_INTEL ");
      break;
    case -1096:
      printf("CL_INVALID_ACCELERATOR_DESCRIPTOR_INTEL ");
      break;
    case -1097:
      printf("CL_ACCELERATOR_TYPE_NOT_SUPPORTED_INTEL ");
      break;
    default:
      printf("UNRECOGNIZED ERROR CODE (%d)", error);
  }
}

// Print line, file name, and error code if there is an error. Exits the
// application upon error.
void _checkError(int line,
                 const char *file,
                 cl_int error,
                 const char *msg,
                 ...) {
  // If not successful
  if(error != CL_SUCCESS) {
    // Print line and file
    printf("ERROR: ");
    printError(error);
    printf("\nLocation: %s:%d\n", file, line);

    // Print custom message.
    va_list vl;
    va_start(vl, msg);
    vprintf(msg, vl);
    printf("\n");
    va_end(vl);

    // Cleanup and bail.
    cleanup();
    exit(error);
  }
}

// Sets the current working directory to be the same as the directory
// containing the running executable.
bool setCwdToExeDir() {
#ifdef _WIN32 // Windows
  HMODULE hMod = GetModuleHandle(NULL);
  char path[MAX_PATH];
  GetModuleFileNameA(hMod, path, MAX_PATH);

#else         // Linux
  // Get path of executable.
  char path[300];
  ssize_t n = readlink("/proc/self/exe", path, sizeof(path)/sizeof(path[0]) - 1);
  if(n == -1) {
    return false;
  }
  path[n] = 0;
#endif

  // Find the last '\' or '/' and terminate the path there; it is now
  // the directory containing the executable.
  size_t i;
  for(i = strnlen(path, sizeof(path)) - 1; i > 0 && path[i] != '/' && path[i] != '\\'; --i);
  path[i] = '\0';

  // Change the current directory.
#ifdef _WIN32 // Windows
  SetCurrentDirectoryA(path);
#else         // Linux
  int rc;
  rc = chdir(path);
#endif

  return true;
}

// Searches all platforms for the first platform whose name
// contains the search string (case-insensitive).
cl_platform_id findPlatform(const char *platform_name_search) {
  cl_int status;

  std::string search = platform_name_search;
  std::transform(search.begin(), search.end(), search.begin(), tolower);

  // Get number of platforms.
  cl_uint num_platforms;
  status = clGetPlatformIDs(0, NULL, &num_platforms);
  checkError(status, "Query for number of platforms failed");

  // Get a list of all platform ids.
  scoped_array<cl_platform_id> pids(num_platforms);
  status = clGetPlatformIDs(num_platforms, pids, NULL);
  checkError(status, "Query for all platform ids failed");

  // For each platform, get name and compare against the search string.
  for(unsigned i = 0; i < num_platforms; ++i) {
    std::string name = getPlatformName(pids[i]);

    // Convert to lower case.
    std::transform(name.begin(), name.end(), name.begin(), tolower);

    if(name.find(search) != std::string::npos) {
      // Found!
      return pids[i];
    }
  }

  // No platform found.
  return NULL;
}

// Returns the platform name.
std::string getPlatformName(cl_platform_id pid) {
  cl_int status;

  size_t sz;
  status = clGetPlatformInfo(pid, CL_PLATFORM_NAME, 0, NULL, &sz);
  checkError(status, "Query for platform name size failed");

  scoped_array<char> name(sz);
  status = clGetPlatformInfo(pid, CL_PLATFORM_NAME, sz, name, NULL);
  checkError(status, "Query for platform name failed");

  return name.get();
}

// Returns the device name.
std::string getDeviceName(cl_device_id did) {
  cl_int status;

  size_t sz;
  status = clGetDeviceInfo(did, CL_DEVICE_NAME, 0, NULL, &sz);
  checkError(status, "Failed to get device name size");

  scoped_array<char> name(sz);
  status = clGetDeviceInfo(did, CL_DEVICE_NAME, sz, name, NULL);
  checkError(status, "Failed to get device name");

  return name.get();
}

// Returns the list of all devices.
cl_device_id *getDevices(cl_platform_id pid, cl_device_type dev_type, cl_uint *num_devices) {
  cl_int status;

  status = clGetDeviceIDs(pid, dev_type, 0, NULL, num_devices);
  checkError(status, "Query for number of devices failed");

  cl_device_id *dids = new cl_device_id[*num_devices];
  status = clGetDeviceIDs(pid, dev_type, *num_devices, dids, NULL);
  checkError(status, "Query for device ids");

  // For Windows, clGetDeviceIDs() always gives num_devices = 128, so we have to find the actual number of available devices
  // See Release Notes here: https://www.intel.com/content/www/us/en/programmable/documentation/ewa1412772636144.html#ewa1412773000284
#ifdef _WIN32
  unsigned num_available = 0;
  cl_bool is_available;
  for (unsigned i = 0; i < *num_devices; i++) {
    status = clGetDeviceInfo(dids[i], CL_DEVICE_AVAILABLE, sizeof(is_available), &is_available, NULL);
    checkError(status, "Failed to get device availability");
    if (is_available != CL_TRUE)
      break;
    num_available++;
  }
  *num_devices = num_available;
#endif

  return dids;
}

// Create a program for all devices associated with the context.
cl_program createProgramFromBinary(cl_context context, const char *binary_file_name, const cl_device_id *devices, unsigned num_devices) {
  // Early exit for potentially the most common way to fail: AOCX does not exist.
  if(!fileExists(binary_file_name)) {
    printf("AOCX file '%s' does not exist.\n", binary_file_name);
    checkError(CL_INVALID_PROGRAM, "Failed to load binary file");
  }

  // Load the binary.
  size_t binary_size;
  scoped_array<unsigned char> binary(loadBinaryFile(binary_file_name, &binary_size));
  if(binary == NULL) {
    checkError(CL_INVALID_PROGRAM, "Failed to load binary file");
  }

  scoped_array<size_t> binary_lengths(num_devices);
  scoped_array<unsigned char *> binaries(num_devices);
  for(unsigned i = 0; i < num_devices; ++i) {
    binary_lengths[i] = binary_size;
    binaries[i] = binary;
  }

  cl_int status;
  scoped_array<cl_int> binary_status(num_devices);

  cl_program program = clCreateProgramWithBinary(context, num_devices, devices, binary_lengths,
      (const unsigned char **) binaries.get(), binary_status, &status);
  checkError(status, "Failed to create program with binary");
  for(unsigned i = 0; i < num_devices; ++i) {
    checkError(binary_status[i], "Failed to load binary for device");
  }

  return program;
}

// Loads a file in binary form.
unsigned char *loadBinaryFile(const char *file_name, size_t *size) {
  // Open the File
  FILE* fp;
  long ftell_size;
  size_t elements_read;
#ifdef _WIN32
  if(fopen_s(&fp, file_name, "rb") != 0) {
    return NULL;
  }
#else
  fp = fopen(file_name, "rb");
  if(fp == 0) {
    return NULL;
  }
#endif

  // Get the size of the file
  fseek(fp, 0, SEEK_END);
  ftell_size = ftell(fp);
  if (ftell_size < 0) {
    fclose(fp);
    return NULL;
  }
  *size = (unsigned)ftell_size;

  // Allocate space for the binary
  unsigned char *binary = new unsigned char[*size];

  // Go back to the file start
  rewind(fp);

  // Read the file into the binary
  elements_read = fread((void*)binary, *size, 1, fp);
  if(elements_read == 0) {
    delete[] binary;
    fclose(fp);
    return NULL;
  }

  fclose(fp);
  return binary;
}

bool fileExists(const char *file_name) {
#ifdef _WIN32 // Windows
  DWORD attrib = GetFileAttributesA(file_name);
  return (attrib != INVALID_FILE_ATTRIBUTES && !(attrib & FILE_ATTRIBUTE_DIRECTORY));
#else         // Linux
  return access(file_name, R_OK) != -1;
#endif
}

std::string getBoardBinaryFile(const char *prefix, cl_device_id device) {
  // First check if <prefix>.aocx exists. Use it if it does.
  std::string file_name = std::string(prefix) + ".aocx";
  if(fileExists(file_name.c_str())) {
    return file_name;
  }

  // Now get the name of the board. For Intel(R) FPGA SDK for OpenCL(TM) boards,
  // the name of the device is presented as:
  //  <board name> : ...
  std::string device_name = getDeviceName(device);

  // Now search for the " :" in the device name.
  size_t end = device_name.find(" :");
  if(end != std::string::npos) {
    std::string board_name(device_name, 0, end);

    // Look for a AOCX with the name <prefix>_<board_name>_<version>.aocx.
    file_name = std::string(prefix) + "_" + board_name + "_" + VERSION_STR + ".aocx";
    if(fileExists(file_name.c_str())) {
      return file_name;
    }
  }

  // At this point just use <prefix>.aocx. This file doesn't exist
  // and this should trigger an error later.
  return std::string(prefix) + ".aocx";
}

// High-resolution timer.
double getCurrentTimestamp() {
#ifdef _WIN32 // Windows
  // Use the high-resolution performance counter.

  static LARGE_INTEGER ticks_per_second = {};
  if(ticks_per_second.QuadPart == 0) {
    // First call - get the frequency.
    QueryPerformanceFrequency(&ticks_per_second);
  }

  LARGE_INTEGER counter;
  QueryPerformanceCounter(&counter);

  double seconds = double(counter.QuadPart) / double(ticks_per_second.QuadPart);
  return seconds;
#else         // Linux
  timespec a;
  clock_gettime(CLOCK_MONOTONIC, &a);
  return (double(a.tv_nsec) * 1.0e-9) + double(a.tv_sec);
#endif
}

cl_ulong getStartEndTime(cl_event event) {
  cl_int status;

  cl_ulong start, end;
  status = clGetEventProfilingInfo(event, CL_PROFILING_COMMAND_START, sizeof(start), &start, NULL);
  checkError(status, "Failed to query event start time");
  status = clGetEventProfilingInfo(event, CL_PROFILING_COMMAND_END, sizeof(end), &end, NULL);
  checkError(status, "Failed to query event end time");

  return end - start;
}

cl_ulong getStartEndTime(cl_event *events, unsigned num_events) {
  cl_int status;

  cl_ulong min_start = 0;
  cl_ulong max_end = 0;
  for(unsigned i = 0; i < num_events; ++i) {
    cl_ulong start, end;
    status = clGetEventProfilingInfo(events[i], CL_PROFILING_COMMAND_START, sizeof(start), &start, NULL);
    checkError(status, "Failed to query event start time");
    status = clGetEventProfilingInfo(events[i], CL_PROFILING_COMMAND_END, sizeof(end), &end, NULL);
    checkError(status, "Failed to query event end time");

    if(i == 0) {
      min_start = start;
      max_end = end;
    }
    else {
      if(start < min_start) {
        min_start = start;
      }
      if(end > max_end) {
        max_end = end;
      }
    }
  }

  return max_end - min_start;
}

void waitMilliseconds(unsigned ms) {
#ifdef _WIN32 // Windows
  Sleep(ms);
#else         // Linux
  timespec sleeptime = {0, 0};
  sleeptime.tv_sec = ms / 1000;
  sleeptime.tv_nsec = long(ms % 1000) * 1000000L;  // convert to nanoseconds
  nanosleep(&sleeptime, NULL);
#endif
}

void oclContextCallback(const char *errinfo, const void *, size_t, void *) {
  printf("Context callback: %s\n", errinfo);
}

} // ns aocl_utils



================================================
FILE: autosa_scripts/intel_opencl_scripts/common/src/AOCLUtils/options.cpp
================================================
// Copyright (C) 2013-2020 Altera Corporation, San Jose, California, USA. All rights reserved.
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to
// whom the Software is furnished to do so, subject to the following conditions:
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
// 
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
// 
// This agreement shall be governed in all respects by the laws of the State of California and
// by the laws of the United States of America.

#include "AOCLUtils/aocl_utils.h"
#include <algorithm>
#include <iostream>
#include <stdlib.h>
#include <vector>

namespace aocl_utils {

Options::Options() {
}

Options::Options(int num, char *argv[]) {
  addFromCommandLine(num, argv);
}

bool Options::has(const std::string &name) const {
  return m_options.find(name) != m_options.end();
}

std::string &Options::get(const std::string &name) {
  return m_options[name];
}

const std::string &Options::get(const std::string &name) const {
  OptionMap::const_iterator it = m_options.find(name);
  if(it == m_options.end()) {
    errorNonExistent(name);
  }
  return it->second;
}

void Options::addFromCommandLine(int num, char *argv[]) {
  for(int i = 1; i < num; ++i) {
    const std::string arg = argv[i];

    // Look for the first '-'.
    if(arg.size() > 1 && arg[0] == '-') {
      size_t eq = arg.find('=');
      size_t name_start = 1;

      // Check if there's a second '-'.
      if(arg.size() > 2 && arg[1] == '-') {
        name_start = 2;
      }

      if(eq == std::string::npos) {
        // No '='; treat as a boolean option.
        set(arg.substr(name_start), true);
      }
      else if(eq == name_start) {
        // No name?!
        errorNameless();
      }
      else {
        set(arg.substr(name_start, eq - name_start), arg.substr(eq + 1));
      }
    }
    else {
      // Not an option.
      m_nonoptions.push_back(arg);
    }
  }
}

void Options::errorNameless() const {
  std::cerr << "No name provided for option.\n";
  exit(1);
}

void Options::errorNonExistent(const std::string &name) const {
  std::cerr << "Option '" << name << "' does not exist.\n";
  exit(1);
}

void Options::errorWrongType(const std::string &name) const {
  std::cerr << "Value for option '" << name << "' is not of the right type (value = '"
            << get(name) << "').\n";
  exit(1);
}

} // ns aocl_utils



================================================
FILE: autosa_scripts/intel_opencl_scripts/compile_design.sh
================================================
#!/bin/bash

# - A script to compile and run the host program and bitstream on Intel OpenCL platform

if [ $# != 1 ];
then
  echo "Usage: compile_design.sh [hw|emu|sim]"
  exit
fi  
mode=$1
echo $mode

echo "Compiling the bitstream..."
if [ "$mode" == "hw" ]
then 
  # Compile the bitstream
  # Change the board to your target board if necessary
  aoc src/kernel_kernel.cl -o bin/kernel_kernel.aocx -fp-relaxed -board=s10mx_hbm_es
elif [ "$mode" == "emu" ]
then
  # Compiling for emulator
  aoc -march=emulator src/kernel_kernel.cl -o bin/kernel_kernel.aocx -fp-relaxed -DEMULATE -legacy-emulator
elif [ "$mode" == "sim" ]
then
  # Compiling for simulator
  aoc -march=simulator src/kernel_kernel.cl -o bin/kernel_kernel.aocx -fp-relaxed
else
  echo "Error: Unsupported mode"
  exit
fi

#echo "Compiling the host program..."
## Compile the host program
#make

#echo "Running the program..."
#case "$mode" in
#    "hw")
#      # Run the host program
#      bin/host
#      ;;
#    "emu")
#      # Run the host program with the emulator
#      bin/host -emulator
#      ;;
#    "sim")
#      # Run the host program with the simulator
#      CL_CONTEXT_MPSIM_DEVICE_INTELFPGA=1 bin/host
#      ;;
#esac


================================================
FILE: autosa_scripts/latency_model.py
================================================
import os
import json
import re
import xml.etree.ElementTree as ET
import numpy as np
import pandas as pd
import joblib
from sklearn.linear_model import LinearRegression
from sklearn import metrics
from sklearn.model_selection import train_test_split
from scipy.stats.mstats import gmean
from statistics import mean
import shutil
import math
import argparse

def extract_latency_info(design_dir):
    """ Extract loop information of the design.

    Returns a dictionary containing the following infomation:
    - loop_infos: dict
    - module_list: list
    - array_info: dict
    - module_grouped: dict

    Parameters
    ----------
    design_dir: str
        The design directory
    """
    loop_path = f'{design_dir}/latency_est'
    loop_info_files = os.listdir(loop_path)
    loop_info_all = {}
    module_names = []

    for f_name in loop_info_files:
        if f_name == 'array_info.json':
            with open(loop_path + '/' + f_name) as f:
                array_info = json.load(f)
        else:
            with open(loop_path + '/' + f_name) as f:
                loop_info_module = json.load(f)
                module_name = loop_info_module['module_name']
                loop_info_all[module_name] = loop_info_module
                module_names.append(module_name)

    module_grouped = {}
    # Place inter_trans and intra_trans module under the outer module
    for module_name in module_names:
        # intra_trans
        if module_name.find('intra_trans') != -1:
            module_name_prefix = module_name[:-12]
            if module_name_prefix not in module_grouped:
                module_grouped[module_name_prefix] = {}
            module_grouped[module_name_prefix]['intra_trans'] = module_name

            module_name_prefix = module_name_prefix + '_boundary'
            if module_name_prefix not in module_grouped:
                module_grouped[module_name_prefix] = {}
            module_grouped[module_name_prefix]['intra_trans'] = module_name

        # inter_trans
        elif module_name.find('inter_trans') != -1:
            if module_name.find('boundary') != -1:
                module_name_prefix = module_name[:-21] + '_boundary'
            else:
                module_name_prefix = module_name[:-12]

            if module_name_prefix not in module_grouped:
                module_grouped[module_name_prefix] = {}
            module_grouped[module_name_prefix]['inter_trans'] = module_name
        else:
            if module_name not in module_grouped:
                module_grouped[module_name] = {}

    ret = {'loop_infos': loop_info_all, 'module_list': module_names, \
           'module_grouped': module_grouped, 'array_info': array_info}

    return ret

def convert_latency_infos_to_df(latency_infos):
    """ Convert the latency infos into a dataframe.

    """
    return

def is_loop_struct_leaf_empty(loop_struct):
    """ Examine if the leaf node of the loop struct is empty.

    Parameters
    ----------
    loop_struct: dict
        loop structure in JSON format
    """
    if "loop" in loop_struct:
        child = loop_struct['loop']['child']
        if child == None:
            return 1
        else:
            return is_loop_struct_leaf_empty(child)
    elif "mark" in loop_struct:
        child = loop_struct['mark']['child']
        if child == None:
            return 1
        else:
            return is_loop_struct_leaf_empty(child)
    elif "user" in loop_struct:
        child = loop_struct['user']['user_expr']
        if child == None:
            return 1
        else:
            return 0
    elif "block" in loop_struct:
        children = loop_struct['block']['child']
        if children == None:
            return 1
        else:
            for child in children:
                is_empty = is_loop_struct_leaf_empty(child)
                if is_empty == 0:
                    return 0
            return 1
    elif "if" in loop_struct:
        if_struct = loop_struct['if']
        then_block = if_struct['then']
        is_empty = is_loop_struct_leaf_empty(then_block)
        if is_empty == 0:
            return 0
        if 'else' in if_struct:
            else_block = if_struct['else']
            is_empty = is_loop_struct_leaf_empty(else_block)
            if is_empty == 0:
                return 0
            return 1
    return 1

def loop_struct_has_non_simd_loop(loop_struct, config):
    """ Examine if the leaf node of the loop struct has any non-SIMD loop.

    """
    if "loop" in loop_struct:
        if config['under_simd'] == 1:
            return 0
        else:
            return 1
    elif "mark" in loop_struct:
        mark = loop_struct['mark']
        mark_name = mark['mark_name']
        if mark_name == 'simd':
            config['under_simd'] = 1
        child = mark['child']
        if child == None:
            return 0
        else:
            return loop_struct_has_non_simd_loop(child, config)
    elif "user" in loop_struct:
        return 0
    elif "block" in loop_struct:
        children = loop_struct['block']['child']
        if children == None:
            return 0
        else:
            for child in children:
                has_non_simd_loop = loop_struct_has_non_simd_loop(child, config)
                if has_non_simd_loop == 1:
                    return 1
            return 0
    elif "if" in loop_struct:
        if_struct = loop_struct['if']
        then_block = if_struct['then']
        has_non_simd_loop = loop_struct_has_non_simd_loop(then_block, config)
        if has_non_simd_loop == 1:
            return 1
        if 'else' in if_struct:
            else_block = if_struct['else']
            has_non_simd_loop = loop_struct_has_non_simd_loop(else_block, config)
            if has_non_simd_loop == 1:
                return 1
        return 0

    return 0

def loop_struct_has_for_loop(loop_struct):
    """ Examine if the leaf node of the loop struct has any for loop.

    """
    if "loop" in loop_struct:
        return 1
    elif "mark" in loop_struct:
        child = loop_struct['mark']['child']
        if child == None:
            return 0
        else:
            return loop_struct_has_for_loop(child)
    elif "user" in loop_struct:
        child = loop_struct['user']['user_expr']
        return 0
    elif "block" in loop_struct:
        children = loop_struct['block']['child']
        if children == None:
            return 0
        else:
            for child in children:
                has_for_loop = loop_struct_has_for_loop(child)
                if has_for_loop == 1:
                    return 1
            return 0
    elif "if" in loop_struct:
        if_struct = loop_struct['if']
        then_block = if_struct['then']
        has_for_loop = loop_struct_has_for_loop(then_block)
        if has_for_loop == 1:
            return 1
        if 'else' in if_struct:
            else_block = if_struct['else']
            has_for_loop = loop_struct_has_for_loop(else_block)
            if has_for_loop == 1:
                return 1
        return 0

    return 0

def predict_module_latency_xilinx(loop_struct, config):
    """ Predict the module latency for Xilinx FPGAs.

    """
    latency = config['latency']
    if "loop" in loop_struct:
        config['under_loop'] = 1
        # Extract the loop information
        loop = loop_struct['loop']
        loop_info = loop['loop_info']
        lb = loop_info['lb']
        ub = loop_info['ub']
        iterator = loop_info['iter']
        # Check if lb/ub is real number
        if lb.isnumeric():
            lb_n = int(lb)
        else:
            lb_n = 0
            #raise NotImplementedError(f'Non-number loop lower bound ({lb}) is not supported.')
        if ub.isnumeric():
            ub_n = int(ub)
        else:
            raise NotImplementedError(f'Non-number loop upper bound ({ub}) is not supported.')
        config['context'][iterator] = {}
        config['context'][iterator]['lb'] = lb_n
        config['context'][iterator]['ub'] = ub_n
        if config['under_unroll'] == 0:
            latency = latency * (ub_n - lb_n + 1)
            config['latency'] = latency
        child = loop['child']
        # if it is an outer module, we will need to update loop_prefix at each loop level.
        if config['module_type'] == 1:
            if config['loop_prefix'] == 'Loop':
                config['loop_prefix'] = config['loop_prefix'] + str(config['loop_offset'])
            else:
                config['loop_prefix'] = config['loop_prefix'] + '.' + str(config['loop_offset'])
        # Store the current for loop
        config['last_for']['iter'] = iterator
        config['last_for']['lb'] = lb_n
        config['last_for']['ub'] = ub_n
        if config['under_coalesce'] == 1:
            config['last_for']['under_coalesce'] = 1
        else:
            config['last_for']['under_coalesce'] = 0
        predict_module_latency_xilinx(child, config)
    elif "mark" in loop_struct:
        mark = loop_struct['mark']
        mark_name = mark['mark_name']
        # If we meet the 'hls_unroll' mark, the loop below no longer counts in to the loop iteration.
        if mark_name == 'simd':
            config['under_unroll'] = 1
        if mark_name == 'access_coalesce':
            config['under_coalesce'] = 1
        if mark_name == 'access_serialize':
            config['under_serialize'] = 1
        child = mark['child']
        predict_module_latency_xilinx(child, config)
    elif "user" in loop_struct:
        user = loop_struct['user']
        user_expr = user['user_expr']
        config['under_unroll'] = 0
        config['under_coalesce'] = 0
        if config['module_type'] == 1:
            # For outer module, we directly return.
            config['under_serialize'] = 0
            if config['latency'] == 1:
                config['latency'] = 0
            return

        #if config['module_name'] == 'A_IO_L2_in':
        #    print(latency)
        # Set II and depth to 1 by default.
        II = 1
        depth = 1
        #print(latency, user_expr)
        if user_expr.find('dram') != -1:
            # This is a DRAM stmt, we will plug in the estimated model.
            # Extract the array name
            #module_name = config['module_name']
            #array_name = module_name.split('_')[0]
            #array_info = config['array_info'][array_name]

            if config['last_for']['under_coalesce'] == 1 and \
               config['under_serialize'] == 0:
                # This statement accesses the dram under a coalesced loop.
                burst_len = (config['last_for']['ub'] - config['last_for']['lb'])
                # The DRAM latency is etimated as 200ns
                dram_latency = 200 / config['cycle'] + burst_len + depth
                latency = latency / burst_len * dram_latency
            elif config['under_serialize'] == 1:
                # This statement accesses the dram with serialized data.
                latency = (latency - 1) * II + depth
            else:
                latency = latency * (200 / config['cycle'] + depth)
        else:
            latency = (latency - 1) * II + depth
        config['under_serialize'] = 0
        config['latency'] = latency
    elif "block" in loop_struct:
        block = loop_struct['block']
        block_child = block['child']

        # Check if only one child is valid and the rest only contain the empty leaf node.
        # If so, continue from the non-empty leaf node w/o further action.
        n_child = 0
        for child in block_child:
            is_empty = is_loop_struct_leaf_empty(child)
            if is_empty == 0:
                n_child += 1
                single_child = child

        if n_child == 1:
            predict_module_latency_xilinx(single_child, config)
            return

        # Check if the current block contains "simd" mark.
        # If so, continue from "simd" branch w/o any further action.
        simd_child = 0
        for child in block_child:
            if "mark" in child:
                mark_name = child['mark']['mark_name']
                if mark_name == 'simd':
                    config['under_unroll'] = 1
                    child = child['mark']['child']
                    simd_child = 1
                    break
        if simd_child == 1:
            predict_module_latency_xilinx(child, config)
            return

        # Proceed as normal.
        # Check if the child contains any non-simd loop. If yes, we will
        # update the loop prefix.
        for child in block_child:
            local_config = {}
            local_config['under_simd'] = 0
            has_non_simd_loop = loop_struct_has_non_simd_loop(child, local_config)
            if has_non_simd_loop:
                if config['module_type'] != 1 and config['under_loop'] == 1:
                    if config['loop_prefix'] == 'Loop':
                        config['loop_prefix'] = config['loop_prefix'] + str(config['loop_offset'])
                    else:
                        config['loop_prefix'] = config['loop_prefix'] + '.' + str(config['loop_offset'])
                break
        loop_prefix = config['loop_prefix']
        loop_offset = 1
        under_loop = config['under_loop']

        # If the block is under loop and all childrens are user nodes,
        # we will proceed and dive into the user nodes.
        all_user_child = 1
        for child in block_child:
            has_for_loop = loop_struct_has_for_loop(child)
            if has_for_loop:
                all_user_child = 0
                break
        latency = config['latency']
        block_latency = 0
        for child in block_child:
            config['loop_offset'] = loop_offset
            config['loop_prefix'] = loop_prefix
            if under_loop == 1:
                config['under_loop'] = 0
            has_for_loop = loop_struct_has_for_loop(child)
            if all_user_child:
                # Select the statement with the longest latency.
                config['latency'] = latency
                predict_module_latency_xilinx(child, config)
                block_latency = max(block_latency, config['latency'])
            else:
                # Accumulate the latency.
                if has_for_loop:
                    config['latency'] = 1
                    predict_module_latency_xilinx(child, config)
                    loop_offset += 1
                    block_latency += config['latency']
        if all_user_child:
            latency = block_latency
        else:
            latency = latency * max(block_latency, 1)
        config['latency'] = latency
    elif "if" in loop_struct:
        # For if then clause, we will treat it as similar as block by
        # adding up the latency of all sub blocks.
        latency = config['latency']
        block_latency = 0
        if_struct = loop_struct['if']
        then_block = if_struct['then']
        if config['module_type'] != 1 and config['under_loop'] == 1:
            if config['loop_prefix'] == 'Loop':
                config['loop_prefix'] = config['loop_prefix'] + str(config['loop_offset'])
            else:
                config['loop_prefix'] = config['loop_prefix'] + '.' + str(config['loop_offset'])
        loop_prefix = config['loop_prefix']
        loop_offset = config['loop_offset']
        has_for_loop = loop_struct_has_for_loop(then_block)
        if has_for_loop:
            config['latency'] = 1
            predict_module_latency_xilinx(then_block, config)
            block_latency = max(block_latency, config['latency'])
        if 'else' in if_struct:
            loop_offset += 1
            config['loop_offset'] = loop_offset
            else_block = if_struct['else']
            has_for_loop = loop_struct_has_for_loop(else_block)
            if has_for_loop:
                config['latency'] = 1
                predict_module_latency_xilinx(else_block, config)
                block_latency = max(block_latency, config['latency'])
        #print('1: ', latency)
        #print('2: ', block_latency)
        latency = latency * max(block_latency, 1)
        config['latency'] = latency

def predict_design_latency(latency_info, cycle=5, early_stop=-1):
    """ Predict the latency for a single design.

    We assume that the II and depth for each stmt to be one.

    Parameters
    ----------
    latency_info: dict
        A dict containing the latency info of the design.
    cycle: int
        The cycle time. (in ns)
    early_stop: int
        The baseline latency. If set -1, early stop is disabled.
    """
    latency_all = {}
    config = {}
    config['cycle'] = cycle
    module_grouped = latency_info['module_grouped']
    array_info = latency_info['array_info']
    loop_infos = latency_info['loop_infos']

    drain_latency = 0
    drain_outer = 1

    for module_name in module_grouped:
        if 'dummy' in module_name:
            # Simply skip the dummy module
            continue
        if module_name not in loop_infos:
            continue

        ## debug
        #if module_name != 'A_IO_L2_in':
        #    continue
        #print(module_name)
        ## debug

        module = module_grouped[module_name]
        #print(module)

        config['context'] = {}
        config['latency'] = 1
        config['loop_prefix'] = 'Loop'
        config['loop_offset'] = 1
        config['under_unroll'] = 0
        config['under_coalesce'] = 0
        config['under_serialize'] = 0
        config['under_loop'] = 0
        config['last_for'] = {}
        config['array_info'] = array_info
        config['module_name'] = module_name
        # 0: default 1: outer 2: inter_trans 3: intra_trans
        config['module_type'] = 0

        if 'inter_trans' in module or 'intra_trans' in module:
            # This is a filter module. We take it as double buffered by default.
            config['module_type'] = 1
            module_loop_info = loop_infos[module_name]
            predict_module_latency_xilinx(module_loop_info, config)
            outer_latency = config['latency']

            # inter module
            config['module_type'] = 2
            config['latency'] = 1
            config['loop_prefix'] = 'Loop'
            config['loop_offset'] = 1
            sub_module_name = module['inter_trans']
            config['module_name'] = sub_module_name
            module_loop_info = loop_infos[sub_module_name]
            predict_module_latency_xilinx(module_loop_info, config)
            inter_trans_latency = config['latency']

            # intra module
            config['module_type'] = 3
            config['latency'] = 1
            config['loop_prefix'] = 'Loop'
            config['loop_offset'] = 1
            sub_module_name = module['intra_trans']
            config['module_name'] = sub_module_name
            module_loop_info = loop_infos[sub_module_name]
            predict_module_latency_xilinx(module_loop_info, config)
            intra_trans_latency = config['latency']

            ## debug
            #print(outer_latency)
            #print(inter_trans_latency)
            #print(intra_trans_latency)
            ## debug

            if module_loop_info['module_prop']['double_buffer'] == 1:
                module_latency = outer_latency * max(inter_trans_latency, intra_trans_latency)
                if module_loop_info['module_prop']['in'] == 1:
                    module_latency += intra_trans_latency
                else:
                    module_latency += inter_trans_latency
            else:
                module_latency = outer_latency * (inter_trans_latency + intra_trans_latency)
            # Hack: For GEMM4
            #if 'C' in module_name:
            if 'drain' in module_name:
                drain_outer = max(1, outer_latency)

            latency_all[module_name] = module_latency
        else:
            module_loop_info = loop_infos[module_name]
            #print(config['module_name'])
            predict_module_latency_xilinx(module_loop_info, config)
            latency_all[module_name] = config['latency']
            # Hack: For GEMM4
            #if 'C' in module_name:
            if 'drain' in module_name:
                drain_latency = max(drain_latency, config['latency'])

        # If we set early stop, we are using a baseline latency to compare.
        # If any of the module latency is greater than the baseline, we
        # will return immediately.
        if early_stop != -1:
            if config['latency'] > early_stop:
                return config['latency']

    #print(latency_all)
    drain_last_tile_latency = drain_latency / drain_outer
    latency = 0
    for lat in latency_all:
        if latency_all[lat] > latency:
            latency = latency_all[lat]
    #print(latency)
    #print(drain_last_tile_latency)
    latency += drain_last_tile_latency

    return int(latency)

def unit_test_predict_design_latency(design_dir):
    """ Unit test for design latency prediction

    Paramters
    ---------
    design_dir: str
        Design directory
    """
    latency_info = extract_latency_info(design_dir)
    latency = predict_design_latency(latency_info, 5)
    print("latency: ", latency)

if __name__ == "__main__":
    parser = argparse.ArgumentParser(description="==== AutoSA Latency Model ====")
    parser.add_argument('-d', required=True, help='design directory')

    args = parser.parse_args()
    unit_test_predict_design_latency(args.d)


================================================
FILE: autosa_scripts/module_group.py
================================================
#!/usr/bin/env python3

import sympy
import sys
import argparse
import re
import json
import numpy as np


def compose_final_file(output_f, prefix_content, module_defs, top_kernel):
    with open(output_f, 'w') as f:
        f.writelines(prefix_content)
        for module_name in module_defs:
            module_def = module_defs[module_name]
            f.write('/* Module Definition */\n')
            f.writelines(module_def)
            f.write('/* Module Definition */\n\n')

        f.writelines(top_kernel['prefix_content'])
        f.write(' ' * 4 + '/* FIFO Declaration */\n')
        for fifo_name in top_kernel['fifo_decls']:
            fifo_decl = top_kernel['fifo_decls'][fifo_name]
            f.writelines(fifo_decl)
        f.write(' ' * 4 + '/* FIFO Declaration */\n\n')

        for module_call in top_kernel['module_calls']:
            f.write(' ' * 4 + '/* Module Call */\n')
            f.writelines(module_call['content'])
            f.write(' ' * 4 + '/* Module Call */\n\n')
        f.write('}\n')
        # Note: this one is for extern "C" in the OpenCL kernel
        f.write('}\n')


def extract_fifos_from_module_call(module_call):
    """

    Returns a list containing all the fifos in the module call.
    """
    fifos = []
    for line in module_call:
        if line.find('/* fifo */') != -1:
            m = re.search(r'\*/ (.+),', line)
            if m:
                fifo = m.group(1)
                fifos.append(fifo)
            else:
                m = re.search(r'\*/ (.+)', line.strip())
                if m:
                    fifo = m.group(1)
                    fifos.append(fifo)
    return fifos


def compose_group_wrapper(
        x_start,
        y_start,
        group_modules,
        module_fifo_decls,
        module_ext_fifos):
    """ Compose the module definition of the group wrapper module

    Retuns a list [module_name, module_def, module_call]
    """
    module_name = 'PE_module_group_wrapper_' + \
        str(x_start) + '_' + str(y_start)
    # Build the module definition
    module_def = []
    # Head
    module_def.append('void ' + module_name + '(\n')
    first = 1
    for fifo in module_ext_fifos:
        fifo_name = fifo['fifo_name']
        fifo_type = fifo['fifo_type']
        if not first:
            module_def.append(',\n')
        module_def.append(' ' * 4 + fifo_type + ' &' + fifo_name)
        first = 0
    module_def.append(')\n')
    module_def.append('{\n')
    module_def.append('#pragma HLS INLINE OFF\n')
    module_def.append('#pragma HLS DATAFLOW\n')

    # fifo declarations
    module_def.append(' ' * 4 + '/* FIFO Declaration */\n')
    for fifo_name in module_fifo_decls:
        fifo_decl = module_fifo_decls[fifo_name]
        module_def += fifo_decl
    module_def.append(' ' * 4 + '/* FIFO Declaration */\n\n')

    # module calls
    for module_call in group_modules:
        content = module_call['content']
        module_def.append(' ' * 4 + '/* Module Call */\n')
        module_def += content
        module_def.append(' ' * 4 + '/* Module Call */\n\n')

    module_def.append('}\n')

    # Build the module call
    module_call = []
    module_call.append(' ' * 4 + module_name + '(\n')
    # Insert the external fifos
    first = 1
    for fifo in module_ext_fifos:
        fifo_name = fifo['fifo_name']
        if not first:
            module_call.append(',\n')
        module_call.append(' ' * 8 + '/* fifo */ ' + fifo_name)
        first = 0
    module_call.append('\n')
    module_call.append(' ' * 4 + ');\n')
    return [module_name, module_def, module_call]


def create_group_wrapper(
        x_start,
        y_start,
        group_modules,
        module_defs,
        top_kernel):
    """ Create a wrapper module for all the modules in the current group

    First figure out the internal fifos in this group.
    Internal fifos are those fifos that have been used by modules inside the
    group.
    These internal fifos will be removed from the top_kernel['fifo_decls']
    and moved inside the current wrapper module.
    Next, for the external fifos, place them in the argument lists of the current
    group.
    Append the defition of this wrapper modules to module_defs.
    Append a new module call of this wrapper module to the
    top_kernel['module_calls']
    and remove the module calls of sub modules in this group from top_kernel['module_calls'].

    Args:
      x_start: the start x index of PE module ids
      y_start: the start y index of PE module ids
      group_modules: list containing all module calls in the current group
      module_defs: dict containing the module definitions
      top_kernel: dict containing the top kernel content
    """
    # print(x_start, y_start)
    internal_fifos = []
    external_fifos = []
    for module in group_modules:
        # print(module['module_name'])
        fifos = extract_fifos_from_module_call(module['content'])
        # print(fifos)
        for fifo in fifos:
            if fifo in external_fifos:
                internal_fifos.append(fifo)
                external_fifos.remove(fifo)
            else:
                external_fifos.append(fifo)

    # Remove internal fifos from the top_kernels and place them inside the current
    # wrapper.
    module_fifo_decls = {}
    for fifo in internal_fifos:
        fifo_decl = top_kernel['fifo_decls'][fifo]
        del top_kernel['fifo_decls'][fifo]
        module_fifo_decls[fifo] = fifo_decl
    module_ext_fifos = []
    for fifo in external_fifos:
        ext_fifo_item = {}
        ext_fifo_item['fifo_name'] = fifo
        # Extract the fifo type
        fifo_decl = top_kernel['fifo_decls'][fifo]
        first_line = fifo_decl[0]
        m = re.search(r'\*/ (.+?) fifo', first_line)
        if m:
            fifo_type = m.group(1)
            ext_fifo_item['fifo_type'] = fifo_type
        module_ext_fifos.append(ext_fifo_item)

    # Compose the definition and call of the wrapper module
    [module_name, module_def, module_call] = compose_group_wrapper(
        x_start, y_start, group_modules, module_fifo_decls, module_ext_fifos)
    # Insert the new definition into the module_defs
    module_defs[module_name] = module_def

    # Remove the module calls of this group from top_kernel['module_calls']
    module_offset = len(top_kernel['module_calls'])
    for module in group_modules:
        module_offset = min(module_offset,
                            top_kernel['module_calls'].index(module))
        top_kernel['module_calls'].remove(module)
    # Insert a new module call at the position 'module_offset'
    module_call_item = {'module_name': module_name, 'content': module_call}
    top_kernel['module_calls'].insert(module_offset, module_call_item)


def module_grouping(
        output_f,
        prefix_content,
        module_defs,
        top_kernel,
        group_config):
    """

    Args:
      output_f: output kernel file
      prefix_content: list containing the file content before the first module
      definition
      module_defs: dict containing the module definitions
      top_kernel: dict containing the top kernel content
      {
        'prefix_content': list containign the file content before the first fifo declaration
        'fifo_decls': dict containing the fifo declarations
        'module_calls': list containing the module calls
                        a module call is a dict containing fields:
                        module_name, module_ids, content
      }
    """
    # Examine if this file is legal to be grouped
    # Currently, we only allow module ids and fifos in the PE-level modules
    group_legal = True
    module_calls = top_kernel['module_calls']
    for module_call in module_calls:
        module_name = module_call['module_name']
        if 'PE' in module_name or 'IO_L1' in module_name:
            # This is a PE-level module
            module_call_content = module_call['content']
            for i in range(1, len(module_call_content)):
                line = module_call_content[i]
                m = re.search(r'/\* (.+?) \*/', line)
                if m:
                    arg_type = m.group(1)
                    if arg_type != 'module id' and arg_type != 'fifo':
                        group_legal = False
                        break
                    if arg_type == 'module id':
                        # Extract the module id
                        m = re.search(r'\*/ (.+?),', line)
                        if m:
                            module_id = m.group(1)
                            module_call['module_ids'].append(int(module_id))

    if not group_legal:
        print(
            '[AutoSA] Error: Unable to group modules. PE-level modules contain non-fifo' +
            ' or non-module-id arguments.\n')
        compose_final_file(output_f, prefix_content, module_defs, top_kernel)
        return

    # Extract the PE grid size
    grid_x = 0
    grid_y = 0
    pe_dim = 0
    for module_call in module_calls:
        module_name = module_call['module_name']
        if 'PE' in module_name and 'dummy' not in module_name:
            pe_dim = len(module_call['module_ids'])
            grid_x = max(module_call['module_ids'][0], grid_x)
            grid_y = max(module_call['module_ids'][1], grid_y)
    # TODO: At present, this scripts only work for 2D arrays
    grid_x += 1
    grid_y += 1
    group_modules_list = []
    for x_start in range(0, grid_x, group_config['x']):
        for y_start in range(0, grid_y, group_config['y']):
            # Grasp all the PE-level modules in the current group
            group_modules = []
            for module_call in module_calls:
                module_name = module_call['module_name']
                if 'PE' in module_name and 'dummy' not in module_name:
                    if module_call['module_ids'][0] in range(
                            x_start,
                            x_start +
                            group_config['x']) and module_call['module_ids'][1] in range(
                            y_start,
                            y_start +
                            group_config['y']):
                        group_modules.append(module_call)
                if 'IO_L1' in module_name:
                    # Extract the PE module ids from the last fifo
                    module_call_content = module_call['content']
                    last_fifo_line = module_call_content[-2]
                    m = re.search(r'\*/ (.+)', last_fifo_line.strip())
                    if m:
                        last_fifo = m.group(1)
                        last_fifo = last_fifo.split('_')
                        pe_x = int(last_fifo[-2])
                        pe_y = int(last_fifo[-1])
                        if pe_x in range(
                                x_start,
                                x_start +
                                group_config['x']) and pe_y in range(
                                y_start,
                                y_start +
                                group_config['y']):
                            group_modules.append(module_call)

            group_modules_list.append({'x_start': x_start, 'y_start': y_start,
                                       'group_modules': group_modules.copy()})

    for group in group_modules_list:
        # Create group wrapper modules
        create_group_wrapper(group['x_start'], group['y_start'],
                             group['group_modules'], module_defs, top_kernel)

    # Compose the final file
    compose_final_file(output_f, prefix_content, module_defs, top_kernel)


def run(input_f, output_f, config, host='opencl'):
    """ Module group

    This function will group the PE-level modules (PE and IO_L1)
    according to the group configuration files.
    Specifically, given the grouping constraint {x, y}, we will group all PE-level
    modules into blocks with dimensions x and y.
    We will insert new wrapper functions to wrap the original modules in the
    group.
    FIFOs connecting these modules internally will be placed inside the wrapper.

    Note: This script only supports:
          - 2D array
          - Xilinx OpenCL kernel

    Args:
      input_f: input kernel file
      output_f: output kernel file
      config: grouping configuration file
      host: Xilinx host target
    """
    # Load the group configuration file
    group_config = {}
    with open(config, 'r') as f:
        group_config = json.load(f)

    # Extract:
    # - file content before the first module definition
    # - module definitions
    # - top kernel
    #   - file content before the first fifo declaration
    #   - fifo declarations
    #   - module calls
    #   - fifo content after the last module call
    lines = []
    with open(input_f, 'r') as f:
        lines = f.readlines()

    prefix_content = []
    module_defs = {}
    top_kernel = {'prefix_content': [], 'fifo_decls': {}, 'module_calls': []}
    prefix_content_flag = 1
    module_defs_flag = 0
    top_kernel_flag = 0
    module_def_add = False
    module_def = []

    top_kernel_prefix_content_flag = 1
    top_kernel_fifo_decls_flag = 0
    top_kernel_module_calls_flag = 0
    top_kernel_fifo_decls_add = False
    top_kernel_module_calls_add = False
    module_call = []

    for line in lines:
        if prefix_content_flag:
            if line.find('Module Definition') != -1:
                prefix_content_flag = 0
                module_defs_flag = 1
            else:
                prefix_content.append(line)
        if module_defs_flag:
            if line.find('extern \"C\"') != -1:
                # TODO: only opencl is supported
                module_defs_flag = 0
                top_kernel_flag = 1
            else:
                if module_def_add:
                    module_def.append(line)
                    if (line.find('void')) != -1:
                        m = re.search(r'void (.+?)\(', line.strip())
                        if m:
                            module_name = m.group(1)
                if line.find('/* Module Definition */') != -1:
                    if module_def_add:
                        module_def.pop(len(module_def) - 1)
                        module_defs[module_name] = module_def.copy()
                        module_def.clear()
                    module_def_add = not module_def_add
        if top_kernel_flag:
            if top_kernel_prefix_content_flag:
                if line.find('/* FIFO Declaration */') != -1:
                    top_kernel_prefix_content_flag = 0
                    top_kernel_fifo_decls_flag = 1
                else:
                    top_kernel['prefix_content'].append(line)
            if top_kernel_fifo_decls_flag:
                if line.find('/* FIFO Declaration */') != -1:
                    if not top_kernel_fifo_decls_add:
                        top_kernel_fifo_decls_add = not top_kernel_fifo_decls_add
                    else:
                        top_kernel_fifo_decls_flag = 0
                        top_k
Download .txt
gitextract_nqdxn4c0/

├── .dockerignore
├── .gitignore
├── .gitmodules
├── ChangeLog
├── Dockerfile
├── LICENSE
├── README.md
├── autosa_config/
│   ├── autosa_config.json
│   ├── hw_info.json
│   ├── hw_info_libs/
│   │   ├── hw_info.json.ku3
│   │   ├── hw_info.json.u200
│   │   └── hw_info.json.u250
│   ├── module_group.json
│   ├── optimizer_settings.json
│   └── optimizer_settings_libs/
│       ├── gemm3_fp32.json
│       ├── gemm3_int16.json
│       ├── gemm3_int16_32.json
│       ├── gemm3_int8.json
│       ├── gemm3_int8_64.json
│       ├── gemm4_fp32.json
│       ├── mm_small.json
│       ├── mttkrp_fp32.json
│       ├── ttm_fp32.json
│       └── ttmc_fp32.json
├── autosa_scripts/
│   ├── autosa.py
│   ├── codegen.py
│   ├── hls_scripts/
│   │   ├── hls_script.tcl
│   │   └── hls_script_synth.tcl
│   ├── intel_opencl_scripts/
│   │   ├── Makefile
│   │   ├── common/
│   │   │   ├── inc/
│   │   │   │   └── AOCLUtils/
│   │   │   │       ├── aocl_utils.h
│   │   │   │       ├── opencl.h
│   │   │   │       ├── options.h
│   │   │   │       └── scoped_ptrs.h
│   │   │   ├── readme.css
│   │   │   └── src/
│   │   │       └── AOCLUtils/
│   │   │           ├── opencl.cpp
│   │   │           └── options.cpp
│   │   └── compile_design.sh
│   ├── latency_model.py
│   ├── module_group.py
│   ├── odyssey/
│   │   ├── RL_utils.py
│   │   ├── analyze.py
│   │   ├── clean_up.sh
│   │   ├── cst/
│   │   │   ├── hw_cst.json
│   │   │   ├── single_test.json
│   │   │   ├── u250.json
│   │   │   └── vu9p.json
│   │   ├── design.py
│   │   ├── designs/
│   │   │   └── kernel3.json
│   │   ├── designs_lib/
│   │   │   ├── cnn/
│   │   │   │   ├── kernel0_0.json
│   │   │   │   ├── kernel0_1.json
│   │   │   │   ├── kernel0_2.json
│   │   │   │   ├── kernel1_0.json
│   │   │   │   ├── kernel1_1.json
│   │   │   │   ├── kernel1_2.json
│   │   │   │   ├── kernel2_0.json
│   │   │   │   ├── kernel2_1.json
│   │   │   │   ├── kernel2_2.json
│   │   │   │   ├── kernel3_0.json
│   │   │   │   ├── kernel3_1.json
│   │   │   │   ├── kernel3_2.json
│   │   │   │   ├── kernel4_0.json
│   │   │   │   ├── kernel4_1.json
│   │   │   │   ├── kernel4_2.json
│   │   │   │   ├── kernel5_0.json
│   │   │   │   ├── kernel5_1.json
│   │   │   │   ├── kernel5_2.json
│   │   │   │   ├── kernel6_0.json
│   │   │   │   ├── kernel6_1.json
│   │   │   │   ├── kernel6_2.json
│   │   │   │   ├── kernel7_0.json
│   │   │   │   ├── kernel7_1.json
│   │   │   │   ├── kernel7_2.json
│   │   │   │   ├── kernel8_0.json
│   │   │   │   ├── kernel8_1.json
│   │   │   │   ├── kernel8_2.json
│   │   │   │   ├── kernel9_0.json
│   │   │   │   ├── kernel9_1.json
│   │   │   │   └── kernel9_2.json
│   │   │   └── gemm/
│   │   │       ├── kernel0_0.json
│   │   │       ├── kernel0_1.json
│   │   │       ├── kernel0_2.json
│   │   │       ├── kernel1_0.json
│   │   │       ├── kernel1_1.json
│   │   │       ├── kernel1_2.json
│   │   │       ├── kernel2_0.json
│   │   │       ├── kernel2_1.json
│   │   │       ├── kernel2_2.json
│   │   │       ├── kernel3_0.json
│   │   │       ├── kernel3_1.json
│   │   │       ├── kernel3_2.json
│   │   │       ├── kernel4_0.json
│   │   │       ├── kernel4_1.json
│   │   │       ├── kernel4_2.json
│   │   │       ├── kernel5_0.json
│   │   │       ├── kernel5_1.json
│   │   │       └── kernel5_2.json
│   │   ├── explorer.py
│   │   ├── main.py
│   │   ├── requirements.txt
│   │   ├── scripts/
│   │   │   ├── compute_network_info.py
│   │   │   ├── grid_search_xgb_params.py
│   │   │   ├── img2col.py
│   │   │   ├── run_arch1.sh
│   │   │   ├── run_arch1_free.sh
│   │   │   ├── run_arch1_ml_cmp.sh
│   │   │   ├── run_arch2.sh
│   │   │   ├── run_arch3.sh
│   │   │   ├── run_arch4.sh
│   │   │   ├── run_dataflow_cmp_cnn.sh
│   │   │   ├── run_dataflow_cmp_mm.sh
│   │   │   ├── run_dataflow_cmp_mm_energy.sh
│   │   │   ├── run_img2col_single.sh
│   │   │   ├── run_method_cmp.sh
│   │   │   ├── run_metric_cmp.sh
│   │   │   ├── run_mutation_cmp.sh
│   │   │   └── split_cnn_layers.py
│   │   ├── search_task.py
│   │   ├── solver.py
│   │   ├── tuners.py
│   │   ├── unit_test.py
│   │   ├── utils.py
│   │   └── workload/
│   │       ├── conv.json
│   │       ├── mm.json
│   │       ├── mm64.json
│   │       ├── mobilenetv2.json
│   │       ├── mobilenetv2_1.json
│   │       ├── mobilenetv2_10.json
│   │       ├── mobilenetv2_11.json
│   │       ├── mobilenetv2_12.json
│   │       ├── mobilenetv2_13.json
│   │       ├── mobilenetv2_14.json
│   │       ├── mobilenetv2_15.json
│   │       ├── mobilenetv2_16.json
│   │       ├── mobilenetv2_17.json
│   │       ├── mobilenetv2_18.json
│   │       ├── mobilenetv2_19.json
│   │       ├── mobilenetv2_2.json
│   │       ├── mobilenetv2_20.json
│   │       ├── mobilenetv2_21.json
│   │       ├── mobilenetv2_22.json
│   │       ├── mobilenetv2_23.json
│   │       ├── mobilenetv2_24.json
│   │       ├── mobilenetv2_25.json
│   │       ├── mobilenetv2_26.json
│   │       ├── mobilenetv2_27.json
│   │       ├── mobilenetv2_28.json
│   │       ├── mobilenetv2_29.json
│   │       ├── mobilenetv2_3.json
│   │       ├── mobilenetv2_30.json
│   │       ├── mobilenetv2_31.json
│   │       ├── mobilenetv2_32.json
│   │       ├── mobilenetv2_33.json
│   │       ├── mobilenetv2_34.json
│   │       ├── mobilenetv2_35.json
│   │       ├── mobilenetv2_36.json
│   │       ├── mobilenetv2_4.json
│   │       ├── mobilenetv2_47.json
│   │       ├── mobilenetv2_5.json
│   │       ├── mobilenetv2_6.json
│   │       ├── mobilenetv2_7.json
│   │       ├── mobilenetv2_8.json
│   │       ├── mobilenetv2_9.json
│   │       ├── mobilenetv2_complete.json
│   │       ├── mobilenetv2_conv3_1_0.json
│   │       ├── mobilenetv2_first.json
│   │       ├── mobilenetv2_first1.json
│   │       ├── mobilenetv2_first2.json
│   │       ├── mobilenetv2_half.json
│   │       ├── mobilenetv2_img2col.json
│   │       ├── mobilenetv2_no_first.json
│   │       ├── mobilenetv2_original.json
│   │       ├── mobilenetv2_test.json
│   │       ├── mobilenetv2_test_single.json
│   │       ├── resnet152.json
│   │       ├── resnet50.json
│   │       ├── resnet50_1.json
│   │       ├── resnet50_10.json
│   │       ├── resnet50_11.json
│   │       ├── resnet50_12.json
│   │       ├── resnet50_13.json
│   │       ├── resnet50_14.json
│   │       ├── resnet50_15.json
│   │       ├── resnet50_16.json
│   │       ├── resnet50_17.json
│   │       ├── resnet50_18.json
│   │       ├── resnet50_19.json
│   │       ├── resnet50_2.json
│   │       ├── resnet50_20.json
│   │       ├── resnet50_21.json
│   │       ├── resnet50_22.json
│   │       ├── resnet50_23.json
│   │       ├── resnet50_24.json
│   │       ├── resnet50_25.json
│   │       ├── resnet50_26.json
│   │       ├── resnet50_27.json
│   │       ├── resnet50_28.json
│   │       ├── resnet50_29.json
│   │       ├── resnet50_3.json
│   │       ├── resnet50_30.json
│   │       ├── resnet50_31.json
│   │       ├── resnet50_32.json
│   │       ├── resnet50_33.json
│   │       ├── resnet50_34.json
│   │       ├── resnet50_35.json
│   │       ├── resnet50_36.json
│   │       ├── resnet50_37.json
│   │       ├── resnet50_38.json
│   │       ├── resnet50_39.json
│   │       ├── resnet50_4.json
│   │       ├── resnet50_40.json
│   │       ├── resnet50_41.json
│   │       ├── resnet50_42.json
│   │       ├── resnet50_43.json
│   │       ├── resnet50_44.json
│   │       ├── resnet50_45.json
│   │       ├── resnet50_46.json
│   │       ├── resnet50_47.json
│   │       ├── resnet50_48.json
│   │       ├── resnet50_49.json
│   │       ├── resnet50_5.json
│   │       ├── resnet50_6.json
│   │       ├── resnet50_7.json
│   │       ├── resnet50_8.json
│   │       ├── resnet50_9.json
│   │       ├── resnet50_batch4.json
│   │       ├── resnet50_conv5_1.json
│   │       ├── resnet50_img2col.json
│   │       ├── resnet50_last.json
│   │       ├── resnet50_last2.json
│   │       ├── resnet50_original.json
│   │       ├── vgg16-2-img2col.json
│   │       ├── vgg16-3.json
│   │       ├── vgg16-4.json
│   │       ├── vgg16.json
│   │       ├── vgg16_1.json
│   │       ├── vgg16_10.json
│   │       ├── vgg16_11.json
│   │       ├── vgg16_12.json
│   │       ├── vgg16_13.json
│   │       ├── vgg16_2.json
│   │       ├── vgg16_3.json
│   │       ├── vgg16_4.json
│   │       ├── vgg16_5.json
│   │       ├── vgg16_6.json
│   │       ├── vgg16_7.json
│   │       ├── vgg16_8.json
│   │       ├── vgg16_9.json
│   │       └── vgg16_img2col.json
│   ├── optimizer.py
│   ├── optimizer_prune.py
│   ├── pe_group.py
│   ├── ppcg_changes/
│   │   ├── isl/
│   │   │   ├── ast_type.h
│   │   │   ├── files.txt
│   │   │   ├── isl_patch.sh
│   │   │   ├── isl_schedule.c
│   │   │   ├── isl_schedule_band.c
│   │   │   ├── isl_schedule_band.h
│   │   │   ├── isl_schedule_node.c
│   │   │   ├── isl_schedule_tree.c
│   │   │   ├── isl_schedule_tree.h
│   │   │   ├── schedule.h
│   │   │   ├── schedule_node.h
│   │   │   └── vec.h
│   │   └── ppcg/
│   │       └── files.txt
│   ├── resource_model.py
│   ├── tapa_scripts/
│   │   └── CMakeLists.txt
│   ├── tuner/
│   │   ├── constraint.py
│   │   ├── cst/
│   │   │   └── hw_cst.json
│   │   ├── design.py
│   │   ├── main.py
│   │   ├── search_task.py
│   │   ├── task/
│   │   │   ├── cnn.json
│   │   │   ├── mm.json
│   │   │   └── mm2.json
│   │   ├── tuner.py
│   │   ├── unit_test.py
│   │   └── utils.py
│   ├── tuning_scripts/
│   │   ├── cnn.sh
│   │   ├── gemm.sh
│   │   └── model_validate.sh
│   └── vitis_scripts/
│       ├── Makefile
│       └── connectivity.cfg
├── autosa_tests/
│   ├── cnn/
│   │   ├── Makefile
│   │   ├── README.md
│   │   ├── connectivity.cfg
│   │   ├── hls_script.tcl
│   │   ├── kernel.c
│   │   ├── kernel.h
│   │   ├── param_names.json
│   │   └── simd_info.json
│   ├── dnn_ops/
│   │   ├── dc_simd_info.json
│   │   ├── fc_simd_info.json
│   │   ├── hls_script.tcl
│   │   ├── kernel.c
│   │   ├── kernel.h
│   │   └── pc_simd_info.json
│   ├── large/
│   │   ├── cnn/
│   │   │   ├── Makefile
│   │   │   ├── README.md
│   │   │   ├── connectivity.cfg
│   │   │   ├── hls_script.tcl
│   │   │   ├── kernel.c
│   │   │   ├── kernel.h
│   │   │   ├── simd_info.json
│   │   │   ├── step1-run-hls.tcl
│   │   │   ├── step2-autobridge.py
│   │   │   ├── step3-pack-xo.tcl
│   │   │   └── step4-run-vitis.sh
│   │   ├── mm/
│   │   │   ├── Makefile
│   │   │   ├── README.md
│   │   │   ├── connectivity.cfg
│   │   │   ├── hls_script.tcl
│   │   │   ├── kernel.c
│   │   │   ├── kernel.h
│   │   │   ├── simd_info.json
│   │   │   ├── step1-run-hls.tcl
│   │   │   ├── step2-autobridge.py
│   │   │   ├── step3-pack-xo.tcl
│   │   │   └── step4-run-vitis.sh
│   │   ├── mm_block_sparse/
│   │   │   ├── Makefile
│   │   │   ├── README.md
│   │   │   ├── connectivity.cfg
│   │   │   ├── hls_script.tcl
│   │   │   ├── kernel.c
│   │   │   ├── kernel.h
│   │   │   └── simd_info.json
│   │   ├── mm_int16/
│   │   │   ├── Makefile
│   │   │   ├── README.md
│   │   │   ├── code.c
│   │   │   ├── connectivity.cfg
│   │   │   ├── hls_script.tcl
│   │   │   ├── kernel.c
│   │   │   ├── kernel.h
│   │   │   ├── simd_info.json
│   │   │   ├── step1-run-hls.tcl
│   │   │   ├── step2-autobridge.py
│   │   │   ├── step3-pack-xo.tcl
│   │   │   ├── step4-run-vitis.sh
│   │   │   └── unroll.py
│   │   ├── mm_int8/
│   │   │   ├── Makefile
│   │   │   ├── README.md
│   │   │   ├── code.c
│   │   │   ├── connectivity.cfg
│   │   │   ├── hls_script.tcl
│   │   │   ├── kernel.c
│   │   │   ├── kernel.h
│   │   │   ├── kernel_kernel_opt.cpp
│   │   │   ├── simd_info.json
│   │   │   ├── step1-run-hls.tcl
│   │   │   ├── step2-autobridge.py
│   │   │   ├── step3-pack-xo.tcl
│   │   │   ├── step4-run-vitis.sh
│   │   │   └── unroll.py
│   │   ├── mm_intel/
│   │   │   ├── Makefile
│   │   │   ├── README.md
│   │   │   ├── kernel.c
│   │   │   ├── kernel.h
│   │   │   └── simd_info.json
│   │   ├── mttkrp/
│   │   │   ├── Makefile
│   │   │   ├── README.md
│   │   │   ├── connectivity.cfg
│   │   │   ├── kernel.c
│   │   │   ├── kernel.h
│   │   │   ├── simd_info.json
│   │   │   ├── step1-run-hls.tcl
│   │   │   ├── step2-autobridge.py
│   │   │   ├── step3-pack-xo.tcl
│   │   │   └── step4-run-vitis.sh
│   │   ├── ttm/
│   │   │   ├── Makefile
│   │   │   ├── README.md
│   │   │   ├── connectivity.cfg
│   │   │   ├── kernel.c
│   │   │   ├── kernel.h
│   │   │   └── simd_info.json
│   │   └── ttmc/
│   │       ├── Makefile
│   │       ├── README.md
│   │       ├── connectivity.cfg
│   │       ├── kernel.c
│   │       ├── kernel.h
│   │       ├── simd_info.json
│   │       ├── step1-run-hls.tcl
│   │       ├── step2-autobridge.py
│   │       ├── step3-pack-xo.tcl
│   │       └── step4-run-vitis.sh
│   ├── lu/
│   │   ├── Makefile
│   │   ├── README.md
│   │   ├── add_batch.py
│   │   ├── hls_script.tcl
│   │   ├── kernel.c
│   │   ├── kernel.h
│   │   └── simd_info.json
│   ├── mm/
│   │   ├── Makefile
│   │   ├── README.md
│   │   ├── connectivity.cfg
│   │   ├── hls_script.tcl
│   │   ├── kernel.c
│   │   ├── kernel.h
│   │   ├── param_names.json
│   │   └── simd_info.json
│   ├── mm_block_sparse/
│   │   ├── Makefile
│   │   ├── README.md
│   │   ├── connectivity.cfg
│   │   ├── hls_script.tcl
│   │   ├── kernel.c
│   │   ├── kernel.h
│   │   └── simd_info.json
│   ├── mm_catapult/
│   │   ├── README.md
│   │   ├── directives.tcl
│   │   ├── kernel.c
│   │   ├── kernel.h
│   │   ├── kernel_kernel_hw.h
│   │   └── simd_info.json
│   ├── mm_getting_started/
│   │   ├── Makefile
│   │   ├── connectivity.cfg
│   │   ├── hls_script.tcl
│   │   ├── kernel.c
│   │   ├── kernel.h
│   │   └── simd_info.json
│   ├── mm_hbm/
│   │   ├── Makefile
│   │   ├── README.md
│   │   ├── connectivity.cfg
│   │   ├── hls_script.tcl
│   │   ├── kernel.c
│   │   ├── kernel.h
│   │   └── simd_info.json
│   ├── mm_hcl/
│   │   ├── README.md
│   │   ├── hls_script.tcl
│   │   ├── kernel.c
│   │   ├── kernel.h
│   │   └── simd_info.json
│   ├── mm_hcl_intel/
│   │   ├── Makefile
│   │   ├── README.md
│   │   ├── kernel.c
│   │   ├── kernel.h
│   │   ├── kernel2.c
│   │   └── simd_info.json
│   ├── mm_int16/
│   │   ├── Makefile
│   │   ├── README.md
│   │   ├── connectivity.cfg
│   │   ├── hls_script.tcl
│   │   ├── kernel.c
│   │   ├── kernel.h
│   │   └── simd_info.json
│   └── mm_intel/
│       ├── Makefile
│       ├── README.md
│       ├── kernel.c
│       ├── kernel.h
│       └── simd_info.json
├── clean.sh
├── docs/
│   ├── Makefile
│   ├── conf.py
│   ├── docker_image.rst
│   ├── examples/
│   │   ├── cnn.rst
│   │   ├── cnn_large.rst
│   │   ├── dnn_ops.rst
│   │   ├── index.rst
│   │   ├── lu.rst
│   │   ├── mm.rst
│   │   ├── mm_block_sparse.rst
│   │   ├── mm_hbm.rst
│   │   ├── mm_int16.rst
│   │   ├── mm_int16_large.rst
│   │   ├── mm_int8_large.rst
│   │   ├── mm_large.rst
│   │   ├── mttkrp_large.rst
│   │   └── ttmc_large.rst
│   ├── index.rst
│   ├── install_from_source.rst
│   ├── installation.rst
│   ├── make.bat
│   └── tutorials/
│       ├── auto_bridge.rst
│       ├── auto_tuning_exhaustive.rst
│       ├── auto_tuning_genetic.rst
│       ├── catapult_backend.rst
│       ├── getting_started.rst
│       ├── hcl_integrate.rst
│       ├── host_serialize.rst
│       ├── index.rst
│       ├── intel_backend.rst
│       ├── matrix_multiplication.rst
│       ├── optimize_array.rst
│       ├── structural_sparsity.rst
│       └── theory_background.rst
├── install.sh
├── ltmain.sh
├── requirements.txt
└── src/
    ├── ChangeLog
    ├── LICENSE
    ├── Makefile.am
    ├── README
    ├── autogen.sh
    ├── autosa_catapult_hls_c.cpp
    ├── autosa_catapult_hls_c.h
    ├── autosa_codegen.cpp
    ├── autosa_codegen.h
    ├── autosa_comm.cpp
    ├── autosa_comm.h
    ├── autosa_common.cpp
    ├── autosa_common.h
    ├── autosa_cpu.cpp
    ├── autosa_cpu.h
    ├── autosa_intel_opencl.cpp
    ├── autosa_intel_opencl.h
    ├── autosa_print.cpp
    ├── autosa_print.h
    ├── autosa_schedule_tree.cpp
    ├── autosa_schedule_tree.h
    ├── autosa_t2s.cpp
    ├── autosa_tapa_cpp.cpp
    ├── autosa_tapa_cpp.h
    ├── autosa_trans.cpp
    ├── autosa_trans.h
    ├── autosa_tuning.cpp
    ├── autosa_tuning.h
    ├── autosa_utils.cpp
    ├── autosa_utils.h
    ├── autosa_xilinx_hls_c.cpp
    ├── autosa_xilinx_hls_c.h
    ├── configure.ac
    ├── cpu.c
    ├── cpu.h
    ├── examples/
    │   └── chemv.c
    ├── get_submodules.sh
    ├── grouping.c
    ├── grouping.h
    ├── hybrid.c
    ├── hybrid.h
    ├── json.hpp
    ├── m4/
    │   ├── ax_check_opencl.m4
    │   ├── ax_check_openmp.m4
    │   ├── ax_detect_git_head.m4
    │   └── ax_submodule.m4
    ├── main.cpp
    ├── ocl_utilities.c
    ├── ocl_utilities.h
    ├── opencl_test.sh.in
    ├── polybench_test.sh.in
    ├── ppcg.c
    ├── ppcg.h
    ├── ppcg_files/
    │   ├── cuda.c
    │   ├── cuda.h
    │   ├── cuda_common.c
    │   ├── cuda_common.h
    │   ├── gpu.c
    │   ├── gpu.h
    │   ├── gpu_array_tile.c
    │   ├── gpu_array_tile.h
    │   ├── gpu_group.c
    │   ├── gpu_group.h
    │   ├── gpu_hybrid.c
    │   ├── gpu_hybrid.h
    │   ├── gpu_print.c
    │   ├── gpu_print.h
    │   ├── gpu_tree.c
    │   ├── gpu_tree.h
    │   ├── opencl.c
    │   └── opencl.h
    ├── ppcg_options.c
    ├── ppcg_options.h
    ├── print.c
    ├── print.h
    ├── schedule.c
    ├── schedule.h
    ├── tests/
    │   ├── call.c
    │   ├── call2.c
    │   ├── call2_opencl_functions.cl
    │   ├── call3.c
    │   ├── call3_opencl_functions.cl
    │   ├── call4.c
    │   ├── call5.c
    │   ├── call_opencl_functions.cl
    │   ├── dead.c
    │   ├── iterator.c
    │   ├── live_out.c
    │   ├── local.c
    │   ├── loop.c
    │   ├── not_accessed.c
    │   ├── not_accessed_opencl_functions.cl
    │   ├── scalar.c
    │   ├── shared_sink.c
    │   ├── struct.c
    │   ├── struct2.c
    │   ├── struct3.c
    │   ├── struct4.c
    │   └── struct5.c
    ├── util.c
    ├── util.h
    └── version.c
Copy disabled (too large) Download .txt
Showing preview only (48,929K chars total). Download the full file to get everything.
SYMBOL INDEX (3993 symbols across 163 files)

FILE: autosa_scripts/autosa.py
  function exec_sys_cmd (line 7) | def exec_sys_cmd(cmd):

FILE: autosa_scripts/codegen.py
  function delete_arg_from_arg_list (line 10) | def delete_arg_from_arg_list(line, arg, content):
  function print_module_def (line 44) | def print_module_def(
  function generate_intel_kernel (line 278) | def generate_intel_kernel(
  function contains_pipeline_for (line 389) | def contains_pipeline_for(pos, lines):
  function insert_xlnx_pragmas (line 414) | def insert_xlnx_pragmas(lines):
  function insert_catapult_pragmas (line 531) | def insert_catapult_pragmas(lines):
  function float_to_int (line 564) | def float_to_int(matchobj):
  function index_simplify (line 572) | def index_simplify(matchobj):
  function mod_simplify (line 599) | def mod_simplify(matchobj):
  function simplify_expressions (line 609) | def simplify_expressions(lines):
  function shrink_bit_width (line 634) | def shrink_bit_width(lines, target):
  function lift_split_buffers (line 712) | def lift_split_buffers(lines):
  function build_dummy_module_def (line 749) | def build_dummy_module_def(group_name, fifo_type, module_in, PE_ids):
  function build_dummy_module_call (line 779) | def build_dummy_module_call(group_name, fifo_name, module_in, PE_ids):
  function insert_dummy_modules (line 803) | def insert_dummy_modules(def_lines, call_lines):
  function modify_tb (line 914) | def modify_tb(lines):
  function reorder_module_calls (line 931) | def reorder_module_calls(lines, target):
  function xilinx_run (line 1040) | def xilinx_run(
  function catapult_run (line 1113) | def catapult_run(
  function insert_intel_pragmas (line 1183) | def insert_intel_pragmas(lines):
  function intel_run (line 1225) | def intel_run(
  function tapa_run (line 1346) | def tapa_run(

FILE: autosa_scripts/intel_opencl_scripts/common/inc/AOCLUtils/opencl.h
  function namespace (line 37) | namespace aocl_utils {

FILE: autosa_scripts/intel_opencl_scripts/common/inc/AOCLUtils/options.h
  function namespace (line 32) | namespace aocl_utils {

FILE: autosa_scripts/intel_opencl_scripts/common/inc/AOCLUtils/scoped_ptrs.h
  function namespace (line 27) | namespace aocl_utils {
  function m_ptr (line 101) | m_ptr(NULL) {}
  function m_ptr (line 102) | m_ptr(NULL) { reset(ptr); }
  function explicit (line 103) | explicit scoped_aligned_ptr(size_t n) : m_ptr(NULL) { reset(n); }
  function T (line 106) | T *get() const { return m_ptr; }
  function operator (line 107) | operator T *() const { return m_ptr; }
  function m_ptr (line 135) | m_ptr(NULL) {}
  function m_ptr (line 136) | m_ptr(NULL) { reset(ptr); }
  function explicit (line 137) | explicit scoped_SVM_aligned_ptr(cl_context ctx, size_t n) : m_ptr(NULL) ...
  function T (line 140) | T *get() const { return m_ptr; }
  function operator (line 141) | operator T *() const { return m_ptr; }

FILE: autosa_scripts/intel_opencl_scripts/common/src/AOCLUtils/opencl.cpp
  type aocl_utils (line 33) | namespace aocl_utils {
    function alignedFree (line 49) | void alignedFree(void * ptr) {
    function alignedFree (line 60) | void alignedFree(void * ptr) {
    function printError (line 70) | void printError(cl_int error) {
    function _checkError (line 279) | void _checkError(int line,
    function setCwdToExeDir (line 306) | bool setCwdToExeDir() {
    function cl_platform_id (line 341) | cl_platform_id findPlatform(const char *platform_name_search) {
    function getPlatformName (line 375) | std::string getPlatformName(cl_platform_id pid) {
    function getDeviceName (line 390) | std::string getDeviceName(cl_device_id did) {
    function cl_device_id (line 405) | cl_device_id *getDevices(cl_platform_id pid, cl_device_type dev_type, ...
    function cl_program (line 434) | cl_program createProgramFromBinary(cl_context context, const char *bin...
    function fileExists (line 512) | bool fileExists(const char *file_name) {
    function getBoardBinaryFile (line 521) | std::string getBoardBinaryFile(const char *prefix, cl_device_id device) {
    function getCurrentTimestamp (line 551) | double getCurrentTimestamp() {
    function cl_ulong (line 573) | cl_ulong getStartEndTime(cl_event event) {
    function cl_ulong (line 585) | cl_ulong getStartEndTime(cl_event *events, unsigned num_events) {
    function waitMilliseconds (line 614) | void waitMilliseconds(unsigned ms) {
    function oclContextCallback (line 625) | void oclContextCallback(const char *errinfo, const void *, size_t, voi...

FILE: autosa_scripts/intel_opencl_scripts/common/src/AOCLUtils/options.cpp
  type aocl_utils (line 28) | namespace aocl_utils {

FILE: autosa_scripts/latency_model.py
  function extract_latency_info (line 17) | def extract_latency_info(design_dir):
  function convert_latency_infos_to_df (line 81) | def convert_latency_infos_to_df(latency_infos):
  function is_loop_struct_leaf_empty (line 87) | def is_loop_struct_leaf_empty(loop_struct):
  function loop_struct_has_non_simd_loop (line 137) | def loop_struct_has_non_simd_loop(loop_struct, config):
  function loop_struct_has_for_loop (line 183) | def loop_struct_has_for_loop(loop_struct):
  function predict_module_latency_xilinx (line 223) | def predict_module_latency_xilinx(loop_struct, config):
  function predict_design_latency (line 437) | def predict_design_latency(latency_info, cycle=5, early_stop=-1):
  function unit_test_predict_design_latency (line 569) | def unit_test_predict_design_latency(design_dir):

FILE: autosa_scripts/module_group.py
  function compose_final_file (line 11) | def compose_final_file(output_f, prefix_content, module_defs, top_kernel):
  function extract_fifos_from_module_call (line 36) | def extract_fifos_from_module_call(module_call):
  function compose_group_wrapper (line 56) | def compose_group_wrapper(
  function create_group_wrapper (line 117) | def create_group_wrapper(
  function module_grouping (line 195) | def module_grouping(
  function run (line 308) | def run(input_f, output_f, config, host='opencl'):

FILE: autosa_scripts/odyssey/RL_utils.py
  class RLEnv (line 20) | class RLEnv():
    method __init__ (line 21) | def __init__(self, search_task, cst, param_idx_map, idx_param_map, sea...
    method reset (line 54) | def reset(self):
    method get_state (line 68) | def get_state(self):
    method set_constraint (line 71) | def set_constraint(self, cst):
    method build_action_space (line 76) | def build_action_space(self):
    method overuse_constraint (line 86) | def overuse_constraint(self, used_cst):
    method update_total_reward_constraint (line 106) | def update_total_reward_constraint(self, constraint, reward):
    method get_reward (line 112) | def get_reward(self, task_params):
    method norm_state (line 137) | def norm_state(self, T):
    method update_mode_and_step (line 144) | def update_mode_and_step(self):
    method update_reward_epoch (line 147) | def update_reward_epoch(self):
    method update_best_reward_list (line 151) | def update_best_reward_list(self, succeed):
    method update_reward_impt (line 161) | def update_reward_impt(self, done):
    method convert_action_to_vals (line 165) | def convert_action_to_vals(self, action):
    method step (line 190) | def step(self, action):
  class RLAgent (line 236) | class RLAgent():
    method __init__ (line 237) | def __init__(self, dim_size, n_action_steps, action_size, seed, batch,...
    method reset (line 276) | def reset(self):
    method adjust_lr (line 282) | def adjust_lr(self, ratio, min_lr=1e-8):
    method act (line 288) | def act(self, state, infos, eps=0.0, temperature=1):
    method step (line 311) | def step(self, state, actions, log_prob, reward, next_state, done, sig...
    method impt_adj_reward (line 321) | def impt_adj_reward(self, reward, impt):
    method learn (line 328) | def learn(self, gamma, impt, infos):
  class Actor (line 355) | class Actor(nn.Module):
    method __init__ (line 356) | def __init__(self, dim_size, n_action_steps, action_size, seed, h_size...
    method forward (line 403) | def forward(self, action_steps, temperature=1):

FILE: autosa_scripts/odyssey/design.py
  class Design (line 7) | class Design(object):
    method __init__ (line 8) | def __init__(self, name):
    method print_resource_est_func (line 19) | def print_resource_est_func(self, f, desp):
    method print_latency_est_func (line 132) | def print_latency_est_func(self, f, desp):
    method print_activity_est_func (line 441) | def print_activity_est_func(self, f, desp):
    method print_infer_params_func (line 755) | def print_infer_params_func(self, f, desp):
    method print_random_sampling_func (line 787) | def print_random_sampling_func(self, f, desp):
    method print_bound_check_func (line 843) | def print_bound_check_func(self, f, desp):
    method print_compute_arch_cst_func (line 894) | def print_compute_arch_cst_func(self, f, desp):
    method register (line 932) | def register(self, desp, py_f):
    method est_latency (line 988) | def est_latency(self, params):
    method est_resource (line 994) | def est_resource(self, params):
    method est_activity (line 1000) | def est_activity(self, params):
    method infer_params (line 1006) | def infer_params(self, params):
    method random_sampling (line 1012) | def random_sampling(self, params):
    method bound_check (line 1018) | def bound_check(self, params):
    method compute_arch_cst (line 1024) | def compute_arch_cst(self, params):

FILE: autosa_scripts/odyssey/explorer.py
  class ArchExplorer (line 10) | class ArchExplorer(object):
    method __init__ (line 13) | def __init__(self, cst, search_obj, max_epochs, max_time, search_confi...
    method search (line 22) | def search(self):
    method tune (line 61) | def tune(self, search_task, init_tasks=None, silent=0, use_cache=-1, m...
    method search_non_fusion_single_acc_exhaustive (line 138) | def search_non_fusion_single_acc_exhaustive(self):
    method search_non_fusion_single_acc_customized1 (line 141) | def search_non_fusion_single_acc_customized1(self, design_idx=-1, sear...
    method search_fusion_single_acc_customized1 (line 413) | def search_fusion_single_acc_customized1(self, design_idx=-1, search_t...
    method search_fusion_single_acc_customized2 (line 611) | def search_fusion_single_acc_customized2(self, workload_idx=None, desi...
    method search_fusion_multi_acc_customized1 (line 702) | def search_fusion_multi_acc_customized1(self, design_idx=-1, search_ta...
    method search_fusion_multi_acc_customized2 (line 1169) | def search_fusion_multi_acc_customized2(self, design_idx=-1, search_ta...

FILE: autosa_scripts/odyssey/main.py
  function get_design_name (line 87) | def get_design_name(elem):

FILE: autosa_scripts/odyssey/scripts/grid_search_xgb_params.py
  function takeBestReward (line 45) | def takeBestReward(elem):

FILE: autosa_scripts/odyssey/search_task.py
  class SingleTask (line 9) | class SingleTask(object):
    method __init__ (line 12) | def __init__(self, design, workload, hw_cst):
    method __repr__ (line 33) | def __repr__(self):
    method adjust_params (line 81) | def adjust_params(self, params):
    method generate_random_sample (line 126) | def generate_random_sample(self):
    method check_arch_legality (line 134) | def check_arch_legality(self, arch_features):
    method adjust_latency_buffer (line 159) | def adjust_latency_buffer(self, latency, latency_meta, params):
    method adjust_latency_multi_acc (line 312) | def adjust_latency_multi_acc(self, latency, latency_meta, params):
    method adjust_latency (line 358) | def adjust_latency(self, latency, latency_meta, params):
    method adjust_resource (line 381) | def adjust_resource(self, resource, resource_meta, params):
    method compute_arch_cst (line 411) | def compute_arch_cst(self, params):
    method evaluate (line 427) | def evaluate(self, params, metric="latency"):
    method compute_energy (line 479) | def compute_energy(self, activity):
    method compute_dsp_eff (line 545) | def compute_dsp_eff(self, latency, dsp):
    method compute_ops (line 551) | def compute_ops(self):
    method compute_bw (line 561) | def compute_bw(self, params):
    method est_off_chip_trans (line 571) | def est_off_chip_trans(self, params):
    method compute_ctc (line 631) | def compute_ctc(self, params):
    method set_arch_cst (line 641) | def set_arch_cst(self, arch_cst):
    method clear_arch_cst (line 645) | def clear_arch_cst(self):
    method set_arch_sol (line 649) | def set_arch_sol(self, sol):
    method set_aux_func (line 652) | def set_aux_func(self, tag, func_name):
    method call_aux_func (line 659) | def call_aux_func(self, tag):
    method clear_aux_func (line 711) | def clear_aux_func(self):
  class MultiTask (line 714) | class MultiTask(object):
    method __init__ (line 718) | def __init__(self, design, search_tasks, hw_cst, fuse=0, max_latency=-...
    method __repr__ (line 747) | def __repr__(self):
    method generate_random_sample (line 767) | def generate_random_sample(self):
    method compute_dsp_eff (line 775) | def compute_dsp_eff(self, latency, dsp):
    method compute_ops (line 781) | def compute_ops(self):
    method compute_arch_cst (line 794) | def compute_arch_cst(self, params):
    method set_arch_cst (line 820) | def set_arch_cst(self, arch_cst):
    method clear_arch_cst (line 829) | def clear_arch_cst(self):
    method set_arch_sol (line 835) | def set_arch_sol(self, sol):

FILE: autosa_scripts/odyssey/solver.py
  function off_chip_solver_gemm (line 5) | def off_chip_solver_gemm(search_task, cst, fixed_params=None, save=0):
  function off_chip_solver_conv (line 168) | def off_chip_solver_conv(search_task, cst, fixed_params=None, save=0):
  function off_chip_solver (line 341) | def off_chip_solver(search_task, cst, fixed_params=None, save=0):

FILE: autosa_scripts/odyssey/tuners.py
  class Constraint (line 31) | class Constraint(object):
    method __init__ (line 32) | def __init__(self, cst_path):
    method __repr__ (line 41) | def __repr__(self):
  class Tuner (line 48) | class Tuner(object):
    method __init__ (line 49) | def __init__(self, search_task, cst, search_obj, max_epoch, max_time, ...
    method log (line 75) | def log(self, str, force=0):
    method overuse_constraint (line 84) | def overuse_constraint(self, used_cst):
  function exhaustive_search (line 98) | def exhaustive_search(search_task, cst, search_obj, max_epochs, max_time...
  class ExhaustiveTuner (line 133) | class ExhaustiveTuner(Tuner):
    method __init__ (line 134) | def __init__(self, search_task, cst, obj, max_epoch, max_time, params,...
    method search (line 149) | def search(self):
  function random_search (line 264) | def random_search(search_task, cst, search_obj, max_epochs, max_time, n_...
  class RandomTuner (line 299) | class RandomTuner(Tuner):
    method __init__ (line 300) | def __init__(self, search_task, cst, obj, max_epoch, max_time, params,...
    method generate_random_sample (line 315) | def generate_random_sample(self):
    method search (line 337) | def search(self):
  function annealing_search (line 401) | def annealing_search(search_task, cst, search_obj, max_epochs, max_time,...
  class AnnealingTuner (line 438) | class AnnealingTuner(Tuner):
    method __init__ (line 439) | def __init__(self, search_task, cst, obj, max_epoch, max_time, params,...
    method update (line 453) | def update(self, args):
    method bound_check (line 481) | def bound_check(self, f_new, x_new, f_old, x_old):
    method print_minimal (line 503) | def print_minimal(self, x, f, accepted):
    method take_step (line 526) | def take_step(self, x):
    method search (line 630) | def search(self):
  function bayesian_search (line 667) | def bayesian_search(search_task, cst, search_obj, max_epochs, max_time, ...
  class BayesianTuner (line 703) | class BayesianTuner(Tuner):
    method __init__ (line 704) | def __init__(self, search_task, cst, obj, max_epoch, max_time, params,...
    method black_box_function (line 718) | def black_box_function(self, i_t1, j_t1, k_t1, i_t2, j_t2, k_t2):
    method search (line 758) | def search(self):
  function genetic_search (line 1089) | def genetic_search(search_task, cst, search_obj, max_epochs, max_time, s...
  class GeneticTuner (line 1253) | class GeneticTuner(Tuner):
    method __init__ (line 1254) | def __init__(self, search_task, cst, obj, max_epoch, max_time, params,...
    method select_parents (line 1268) | def select_parents(self, population, fitness, num_parents):
    method crossover (line 1275) | def crossover(self, pool, num_children):
    method mutation (line 1297) | def mutation(self, pool):
    method search (line 1394) | def search(self):
  function non_fuse_genetic_search (line 1539) | def non_fuse_genetic_search(search_task, init_tasks, cst, search_obj, ma...
  class MultiWorkloadArrayGeneticTuner (line 1661) | class MultiWorkloadArrayGeneticTuner(GeneticTuner):
    method __init__ (line 1662) | def __init__(self, search_task, cst, obj, max_epoch, max_time, params,...
    method xgboost_add_sample (line 1670) | def xgboost_add_sample(self, sol, cst, reward):
    method xgboost_train (line 1695) | def xgboost_train(self):
    method xgboost_predict (line 1716) | def xgboost_predict(self, sol, cst):
    method xgboost_prune (line 1737) | def xgboost_prune(self, sol, cst):
    method select_parents (line 1746) | def select_parents(self, population, fitness, num_parents, num_hw_pare...
    method init_population (line 1799) | def init_population(self, num_pop):
    method hash_params (line 1813) | def hash_params(self, sol):
    method search_design (line 1821) | def search_design(self, arch_sol, use_model=0, bst=None):
    method search (line 1847) | def search(self):
  function all_fuse_genetic_search (line 2072) | def all_fuse_genetic_search(search_task, init_tasks, cst, search_obj, ma...
  class AllFuseGeneticTuner (line 2175) | class AllFuseGeneticTuner(MultiWorkloadArrayGeneticTuner):
    method __init__ (line 2176) | def __init__(self, search_task, cst, obj, max_epoch, max_time, params,...
    method init_population (line 2179) | def init_population(self, num_pop):
    method update_task_configs (line 2191) | def update_task_configs(self, tasks):
    method update_fused_task_dims (line 2226) | def update_fused_task_dims(self, last_sol, last_task, cur_task, partial):
    method est_latency (line 2254) | def est_latency(self, layer_stats, search_task, mode=0):
    method est_off_chip_trans (line 2284) | def est_off_chip_trans(self, layer_stats, search_task, mode=0):
    method search_fixed_design (line 2329) | def search_fixed_design(self, last_layer_sol, use_model=0, bst=None):
    method search_design1 (line 2411) | def search_design1(self, arch_sol, use_model=0, bst=None):
    method search_design2 (line 2468) | def search_design2(self, arch_sol, use_model=0, bst=None):
    method search (line 2530) | def search(self):
  function fuse_genetic_search (line 2701) | def fuse_genetic_search(search_task, init_tasks, cst, search_obj, max_ep...
  class FuseDPTuner (line 2790) | class FuseDPTuner(object):
    method __init__ (line 2791) | def __init__(self, config, tasks, cst, n_worker=1):
    method hash_dp_task (line 2797) | def hash_dp_task(self, tasks):
    method DP (line 2803) | def DP(self, cur_tasks, cut_idx):
    method exec (line 2888) | def exec(self):
    method search (line 2905) | def search(self):
  class FuseGeneticTuner (line 2918) | class FuseGeneticTuner(MultiWorkloadArrayGeneticTuner):
    method __init__ (line 2919) | def __init__(self, search_task, cst, obj, max_epoch, max_time, params,...
    method init_population (line 2922) | def init_population(self, num_pop):
    method search_design (line 2934) | def search_design(self, arch_sol, use_model=0, bst=None):
    method search (line 2957) | def search(self):
  function multi_acc_search1 (line 3111) | def multi_acc_search1(search_task, init_tasks, cst, search_obj, max_epoc...
  class MultiAccTuner1 (line 3164) | class MultiAccTuner1(Tuner):
    method __init__ (line 3165) | def __init__(self, search_task, cst, obj, max_epoch, max_time, params,...
    method resource_alloc (line 3184) | def resource_alloc(self, partition):
    method est_URAM (line 3213) | def est_URAM(self, records):
    method est_mem (line 3221) | def est_mem(self, partition, records, verbose=0):
    method overuse_resource (line 3308) | def overuse_resource(self, partition, records):
    method est_resource (line 3329) | def est_resource(self, partition, records):
    method est_latency (line 3339) | def est_latency(self, partition, records, in_place=0, adjust=0, verbos...
    method est_dsp_eff (line 3437) | def est_dsp_eff(self, throughput, cst):
    method evaluate (line 3446) | def evaluate(self, partition, records, verbose=0):
    method is_finetune_required (line 3452) | def is_finetune_required(self, records, dsp_eff):
    method resource_alloc_adjust (line 3461) | def resource_alloc_adjust(self, partition, resource_alloc, records, ov...
    method update_bottleneck_idx (line 3639) | def update_bottleneck_idx(self, records):
    method find_legal_config (line 3685) | def find_legal_config(self, partition, resource_alloc, old_records=Non...
    method search_design (line 4095) | def search_design(self, partition_idx):
    method search (line 4202) | def search(self):
  function multi_acc_search2 (line 4225) | def multi_acc_search2(search_task, init_tasks, cst, search_obj, max_epoc...
  class MultiAccTuner2 (line 4280) | class MultiAccTuner2(MultiAccTuner1):
    method __init__ (line 4281) | def __init__(self, search_task, cst, obj, max_epoch, max_time, params,...
    method est_mem (line 4284) | def est_mem(self, partition, records, verbose=0):
    method est_latency (line 4392) | def est_latency(self, partition, records, in_place=0, adjust=0, verbos...
    method find_legal_config (line 4540) | def find_legal_config(self, partition, resource_alloc, old_records=Non...
    method search_design (line 4816) | def search_design(self, partition_idx):
    method search (line 4928) | def search(self):

FILE: autosa_scripts/odyssey/unit_test.py
  class Workload (line 8) | class Workload(object):
    method __init__ (line 9) | def __init__(self, params):
    method __repr__ (line 12) | def __repr__(self):
  class SearchTask (line 15) | class SearchTask(object):
    method __init__ (line 16) | def __init__(self, workload):
    method __repr__ (line 19) | def __repr__(self):
  function est_mm_performance (line 22) | def est_mm_performance():

FILE: autosa_scripts/odyssey/utils.py
  function factorization (line 15) | def factorization(x):
  function get_divisors (line 33) | def get_divisors(x, filter=None):
  function compute_tasks_latency (line 51) | def compute_tasks_latency(search_tasks, init_tasks):
  class PerfCounter (line 95) | class PerfCounter(object):
    method __init__ (line 96) | def __init__(self, logger=None):
    method init_counter (line 100) | def init_counter(self, name):
    method update_counter (line 103) | def update_counter(self, name):
    method get_counter (line 110) | def get_counter(self, name):
    method print_counter (line 115) | def print_counter(self, name):
    method print_counters (line 122) | def print_counters(self):
  function init_logger (line 128) | def init_logger(outdir):
  class SearchRecord (line 149) | class SearchRecord(object):
    method __init__ (line 152) | def __init__(self, max=1):
    method reset (line 190) | def reset(self):
    method update (line 225) | def update(self, new_record, save=0):
    method dup (line 273) | def dup(self):
    method extract_from_tuner_single_acc (line 308) | def extract_from_tuner_single_acc(self, tuner):
    method extract_from_tuner_multi_acc (line 363) | def extract_from_tuner_multi_acc(self, records, reward, latency, cst, ...
    method __repr__ (line 405) | def __repr__(self):
    method to_str (line 408) | def to_str(self):
    method append (line 457) | def append(self, record):
    method merge (line 490) | def merge(self, record1, record2):
  class NoDaemonProcess (line 541) | class NoDaemonProcess(mp.Process):
    method _get_daemon (line 543) | def _get_daemon(self):
    method _set_daemon (line 545) | def _set_daemon(self, value):
  class MyExecutor (line 549) | class MyExecutor(object):
    method __init__ (line 550) | def __init__(self, n_thread):
    method runner (line 566) | def runner(self, q, return_dict):
    method prune_jobs (line 577) | def prune_jobs(self, jobs):
    method exec (line 592) | def exec(self, job_list):

FILE: autosa_scripts/optimizer.py
  function timer (line 32) | def timer(func):
  function generate_loop_candidates (line 47) | def generate_loop_candidates(loops, config, stage):
  function multi_process (line 149) | def multi_process(loops, func, config):
  function cmp_designs (line 215) | def cmp_designs(design1, design2, metric):
  function generate_sa_sizes_cmd (line 244) | def generate_sa_sizes_cmd(sa_sizes):
  function train_resource_models_xilinx (line 268) | def train_resource_models_xilinx(config):
  function train_latency_models_xilinx (line 315) | def train_latency_models_xilinx(config):
  function execute_autosa_cmd (line 322) | def execute_autosa_cmd(config):
  function execute_sys_cmd (line 348) | def execute_sys_cmd(cmd, config):
  function generate_autosa_cmd_str (line 363) | def generate_autosa_cmd_str(cmds):
  function save_design_files (line 378) | def save_design_files(config):
  function clear_design_files (line 408) | def clear_design_files(config):
  function explore_design (line 416) | def explore_design(config):
  function simd_loop_filter (line 503) | def simd_loop_filter(loops, tuning):
  function explore_simd_vectorization (line 540) | def explore_simd_vectorization(config):
  function explore_latency_hiding (line 645) | def explore_latency_hiding(config):
  function explore_array_part_L2 (line 708) | def explore_array_part_L2(config):
  function explore_array_part_single_job (line 764) | def explore_array_part_single_job(loops, config, work_dir, is_multi_proc...
  function explore_array_part (line 810) | def explore_array_part(config):
  function explore_space_time (line 891) | def explore_space_time(config):
  function explore_design_space (line 934) | def explore_design_space(config):
  function synth_train_samples_single_job (line 966) | def synth_train_samples_single_job(config, job_id):
  function generate_train_samples (line 990) | def generate_train_samples(config):
  function synth_train_samples (line 1014) | def synth_train_samples(config):
  function train_xilinx (line 1085) | def train_xilinx(config):
  function get_default_pruning_policy (line 1117) | def get_default_pruning_policy(mode):
  function get_sample_policy (line 1124) | def get_sample_policy(mode, n_random=2):
  function print_best_design (line 1185) | def print_best_design(opt_design, hw_info=None):
  function save_search_log (line 1239) | def save_search_log(records, log):
  function search_xilinx (line 1252) | def search_xilinx(config):
  function init_logger (line 1322) | def init_logger(training, search, verbose, tmp_dir):
  function init_monitor (line 1376) | def init_monitor():
  function init_search_results (line 1389) | def init_search_results():
  function update_search_results (line 1410) | def update_search_results(results, cur_design, n_record, metric, hw_info):
  function merge_search_results (line 1455) | def merge_search_results(results, metric, n_record, hw_info):
  function init_config (line 1526) | def init_config(setting, verbose, hw_info, cmd, training, search, tmp_dir):
  function xilinx_run (line 1630) | def xilinx_run(cmd, hw_info, setting, training, search, verbose, tmp_dir):

FILE: autosa_scripts/optimizer_prune.py
  function array_part_loops_pruning (line 3) | def array_part_loops_pruning(loops, config):
  function array_part_L2_loops_pruning (line 36) | def array_part_L2_loops_pruning(loops, config):
  function latency_hiding_loops_pruning (line 69) | def latency_hiding_loops_pruning(loops, config):
  function SIMD_vectorization_PE_pruning (line 103) | def SIMD_vectorization_PE_pruning(config, postpone=0):
  function reorder_simd_loops (line 153) | def reorder_simd_loops(loops):
  function SIMD_vectorization_latency_pruning (line 183) | def SIMD_vectorization_latency_pruning(config):

FILE: autosa_scripts/pe_group.py
  function locate_data_trans_block (line 9) | def locate_data_trans_block(line_id, lines):
  function modify_index (line 27) | def modify_index(lines, var_map, PE_dims):
  function insert_data_trans (line 73) | def insert_data_trans(lines, data_trans_info, PE_dims):
  function modify_channels (line 115) | def modify_channels(lines, data_trans_info, PE_dims):
  function modify_body (line 246) | def modify_body(lines, PE_dims, var_map):
  function extract_data_trans_info (line 342) | def extract_data_trans_info(lines, PE_dims):
  function compose_PE (line 392) | def compose_PE(data_trans_info, PE_dims, PE_defs):
  function run (line 467) | def run(input_f, output_f):

FILE: autosa_scripts/ppcg_changes/isl/ast_type.h
  type autosa_loop_type (line 11) | enum autosa_loop_type {
  type __isl_export (line 22) | struct __isl_export
  type isl_ast_expr (line 23) | typedef struct isl_ast_expr isl_ast_expr;
  type __isl_export (line 25) | struct __isl_export
  type isl_ast_node (line 26) | typedef struct isl_ast_node isl_ast_node;
  type isl_ast_expr_op_type (line 28) | enum isl_ast_expr_op_type {
  type isl_ast_expr_type (line 87) | enum isl_ast_expr_type {
  type isl_ast_node_type (line 94) | enum isl_ast_node_type {
  type isl_ast_loop_type (line 103) | enum isl_ast_loop_type {
  type isl_ast_print_options (line 111) | struct isl_ast_print_options
  type isl_ast_print_options (line 112) | typedef struct isl_ast_print_options isl_ast_print_options;

FILE: autosa_scripts/ppcg_changes/isl/isl_schedule.c
  function __isl_give (line 38) | __isl_give isl_schedule *isl_schedule_from_schedule_tree(isl_ctx *ctx,
  function __isl_give (line 72) | __isl_give isl_schedule *isl_schedule_from_domain(
  function __isl_give (line 86) | __isl_give isl_schedule *isl_schedule_empty(__isl_take isl_space *space)
  function __isl_give (line 93) | __isl_give isl_schedule *isl_schedule_copy(__isl_keep isl_schedule *sched)
  function __isl_give (line 105) | __isl_give isl_schedule *isl_schedule_cow(__isl_take isl_schedule *sched...
  function __isl_null (line 121) | __isl_null isl_schedule *isl_schedule_free(__isl_take isl_schedule *sched)
  function __isl_give (line 137) | __isl_give isl_schedule *isl_schedule_set_root(
  function isl_ctx (line 160) | isl_ctx *isl_schedule_get_ctx(__isl_keep isl_schedule *schedule)
  function __isl_keep (line 167) | __isl_keep isl_schedule_tree *isl_schedule_peek_leaf(
  function isl_bool (line 175) | isl_bool isl_schedule_plain_is_equal(__isl_keep isl_schedule *schedule1,
  function __isl_give (line 189) | __isl_give isl_space *isl_schedule_get_space(
  function __isl_give (line 212) | __isl_give isl_schedule_node *isl_schedule_get_root(
  function __isl_give (line 231) | __isl_give isl_union_set *isl_schedule_get_domain(
  function isl_stat (line 247) | isl_stat isl_schedule_foreach_schedule_node_top_down(
  function __isl_give (line 272) | __isl_give isl_schedule *isl_schedule_map_schedule_node_bottom_up(
  function __isl_give (line 292) | static __isl_give isl_schedule_node *reset_user(
  function __isl_give (line 301) | __isl_give isl_schedule *isl_schedule_reset_user(
  function __isl_give (line 311) | static __isl_give isl_schedule_node *align_params(
  function __isl_give (line 322) | __isl_give isl_schedule *isl_schedule_align_params(
  function __isl_give (line 334) | static __isl_give isl_schedule_node *pullback_upma(
  function __isl_give (line 348) | __isl_give isl_schedule *isl_schedule_pullback_union_pw_multi_aff(
  function __isl_give (line 367) | __isl_give isl_schedule *isl_schedule_expand(__isl_take isl_schedule *sc...
  function __isl_give (line 395) | __isl_give isl_schedule *isl_schedule_intersect_domain(
  function __isl_give (line 425) | __isl_give isl_schedule *isl_schedule_gist_domain_params(
  function __isl_give (line 457) | __isl_give isl_union_map *isl_schedule_get_map(__isl_keep isl_schedule *...
  function __isl_give (line 485) | __isl_give isl_schedule *isl_schedule_insert_partial_schedule(
  function __isl_give (line 524) | __isl_give isl_schedule *isl_schedule_insert_context(
  function __isl_give (line 543) | __isl_give isl_schedule *isl_schedule_insert_guard(
  function __isl_give (line 563) | static __isl_give isl_schedule_tree *insert_filter_in_child_of_type(
  function __isl_give (line 594) | __isl_give isl_schedule *isl_schedule_pair(enum isl_schedule_node_type t...
  function __isl_give (line 654) | __isl_give isl_schedule *isl_schedule_sequence(
  function __isl_give (line 665) | __isl_give isl_schedule *isl_schedule_set(
  function __isl_give (line 673) | __isl_give isl_printer *isl_printer_print_schedule(__isl_take isl_printe...
  function __isl_give (line 685) | __isl_give isl_schedule *isl_schedule_dup(__isl_keep isl_schedule *sched)

FILE: autosa_scripts/ppcg_changes/isl/isl_schedule_band.c
  function isl_ctx (line 21) | isl_ctx *isl_schedule_band_get_ctx(__isl_keep isl_schedule_band *band)
  function __isl_give (line 28) | static __isl_give isl_schedule_band *isl_schedule_band_alloc(isl_ctx *ctx)
  function __isl_give (line 48) | __isl_give isl_schedule_band *isl_schedule_band_from_multi_union_pw_aff(
  function __isl_give (line 92) | __isl_give isl_schedule_band *isl_schedule_band_dup(
  function __isl_give (line 166) | __isl_give isl_schedule_band *isl_schedule_band_cow(
  function __isl_give (line 180) | __isl_give isl_schedule_band *isl_schedule_band_copy(
  function __isl_null (line 192) | __isl_null isl_schedule_band *isl_schedule_band_free(
  function isl_bool (line 218) | isl_bool isl_schedule_band_plain_is_equal(__isl_keep isl_schedule_band *...
  function isl_size (line 262) | isl_size isl_schedule_band_n_member(__isl_keep isl_schedule_band *band)
  function isl_bool (line 270) | isl_bool isl_schedule_band_member_get_coincident(
  function __isl_give (line 286) | __isl_give isl_schedule_band *isl_schedule_band_member_set_coincident(
  function isl_bool (line 309) | isl_bool isl_schedule_band_get_permutable(__isl_keep isl_schedule_band *...
  function __isl_give (line 318) | __isl_give isl_schedule_band *isl_schedule_band_set_permutable(
  function isl_schedule_band_is_anchored (line 337) | int isl_schedule_band_is_anchored(__isl_keep isl_schedule_band *band)
  function __isl_give (line 344) | __isl_give isl_space *isl_schedule_band_get_space(
  function __isl_give (line 354) | __isl_give isl_schedule_band *isl_schedule_band_intersect_domain(
  function __isl_give (line 375) | __isl_give isl_multi_union_pw_aff *isl_schedule_band_get_partial_schedule(
  function __isl_give (line 383) | __isl_give isl_schedule_band *isl_schedule_band_set_partial_schedule(
  function isl_schedule_band_member_get_ast_loop_type (line 404) | enum isl_ast_loop_type isl_schedule_band_member_get_ast_loop_type(
  function __isl_give (line 423) | __isl_give isl_schedule_band *isl_schedule_band_member_set_ast_loop_type(
  function isl_schedule_band_member_get_isolate_ast_loop_type (line 459) | enum isl_ast_loop_type isl_schedule_band_member_get_isolate_ast_loop_type(
  function __isl_give (line 479) | __isl_give isl_schedule_band *
  function __isl_give (line 531) | static __isl_give isl_space *loop_type_space(__isl_take isl_space *space,
  function __isl_give (line 561) | static __isl_give isl_union_set *add_loop_types(
  function __isl_give (line 597) | __isl_give isl_union_set *isl_schedule_band_get_ast_build_options(
  type isl_not_data (line 614) | struct isl_not_data {
  function isl_bool (line 620) | static isl_bool not(__isl_keep isl_set *set, void *user)
  function isl_bool (line 630) | static isl_bool has_any(__isl_keep isl_union_set *uset,
  function isl_bool (line 644) | static isl_bool is_isolate(__isl_keep isl_set *set)
  function isl_bool (line 662) | static isl_bool has_isolate_option(__isl_keep isl_union_set *options)
  function isl_bool (line 669) | static isl_bool is_loop_type_option(__isl_keep isl_set *set)
  function isl_bool (line 698) | static isl_bool is_isolate_loop_type_option(__isl_keep isl_set *set)
  function isl_bool (line 731) | static isl_bool has_isolate_loop_type_options(__isl_keep isl_union_set *...
  function isl_bool (line 738) | static isl_bool has_loop_type_options(__isl_keep isl_union_set *options)
  function extract_loop_type (line 747) | static enum isl_ast_loop_type extract_loop_type(
  function extract_loop_types (line 785) | static int extract_loop_types(__isl_keep isl_schedule_band *band,
  function extract_isolate_loop_types (line 811) | static int extract_isolate_loop_types(__isl_keep isl_schedule_band *band,
  function __isl_give (line 842) | static __isl_give isl_union_set *loop_types(__isl_take isl_space *space,
  function __isl_give (line 865) | static __isl_give isl_union_set *clear_loop_types(
  function __isl_give (line 879) | static __isl_give isl_union_set *clear_isolate_loop_types(
  function __isl_give (line 901) | __isl_give isl_schedule_band *isl_schedule_band_set_ast_build_options(
  function __isl_give (line 959) | __isl_give isl_set *isl_schedule_band_get_ast_isolate_option(
  function __isl_give (line 982) | __isl_give isl_schedule_band *isl_schedule_band_replace_ast_build_option(
  function __isl_give (line 1012) | __isl_give isl_schedule_band *isl_schedule_band_scale(
  function __isl_give (line 1033) | __isl_give isl_schedule_band *isl_schedule_band_scale_down(
  function __isl_give (line 1053) | __isl_give isl_schedule_band *isl_schedule_band_mod(
  function __isl_give (line 1073) | __isl_give isl_schedule_band *isl_schedule_band_shift(
  function isl_multi_union_pw_aff (line 1116) | static isl_multi_union_pw_aff *isl_multi_union_pw_aff_tile(
  function __isl_give (line 1154) | __isl_give isl_schedule_band *isl_schedule_band_tile(
  function __isl_give (line 1182) | __isl_give isl_schedule_band *isl_schedule_band_point(
  function __isl_give (line 1223) | __isl_give isl_schedule_band *isl_schedule_band_drop(
  function __isl_give (line 1274) | __isl_give isl_schedule_band *isl_schedule_band_reset_user(
  function __isl_give (line 1292) | __isl_give isl_schedule_band *isl_schedule_band_align_params(
  function __isl_give (line 1316) | __isl_give isl_schedule_band *isl_schedule_band_pullback_union_pw_multi_...
  function __isl_give (line 1340) | __isl_give isl_schedule_band *isl_schedule_band_gist(
  function isl_schedule_band_member_get_space_time (line 1366) | enum autosa_loop_type isl_schedule_band_member_get_space_time(
  function __isl_give (line 1384) | __isl_give isl_schedule_band *isl_schedule_band_member_set_space_time(
  function isl_schedule_band_member_get_pe_opt (line 1409) | enum autosa_loop_type isl_schedule_band_member_get_pe_opt(
  function __isl_give (line 1427) | __isl_give isl_schedule_band *isl_schedule_band_member_set_pe_opt(
  function isl_schedule_band_member_get_sched_pos (line 1451) | int isl_schedule_band_member_get_sched_pos(
  function __isl_give (line 1469) | __isl_give isl_schedule_band *isl_schedule_band_member_set_sched_pos(
  function __isl_give (line 1511) | __isl_give isl_schedule_band *isl_schedule_band_member_set_iter(

FILE: autosa_scripts/ppcg_changes/isl/isl_schedule_band.h
  type isl_schedule_band (line 29) | struct isl_schedule_band {
  type isl_schedule_band (line 50) | typedef struct isl_schedule_band isl_schedule_band;
  type isl_ast_loop_type (line 75) | enum isl_ast_loop_type
  type isl_ast_loop_type (line 79) | enum isl_ast_loop_type
  type isl_ast_loop_type (line 80) | enum isl_ast_loop_type
  type isl_ast_loop_type (line 85) | enum isl_ast_loop_type
  type autosa_loop_type (line 133) | enum autosa_loop_type
  type autosa_loop_type (line 136) | enum autosa_loop_type
  type autosa_loop_type (line 137) | enum autosa_loop_type
  type autosa_loop_type (line 140) | enum autosa_loop_type

FILE: autosa_scripts/ppcg_changes/isl/isl_schedule_node.c
  function __isl_give (line 27) | __isl_give isl_schedule_node *isl_schedule_node_alloc(
  function __isl_give (line 66) | __isl_give isl_schedule_node *isl_schedule_node_from_domain(
  function __isl_give (line 82) | __isl_give isl_schedule_node *isl_schedule_node_from_extension(
  function isl_ctx (line 104) | isl_ctx *isl_schedule_node_get_ctx(__isl_keep isl_schedule_node *node)
  function __isl_keep (line 111) | __isl_keep isl_schedule_tree *isl_schedule_node_peek_leaf(
  function __isl_give (line 119) | __isl_give isl_schedule_tree *isl_schedule_node_get_leaf(
  function isl_schedule_node_get_type (line 127) | enum isl_schedule_node_type isl_schedule_node_get_type(
  function isl_schedule_node_get_parent_type (line 136) | enum isl_schedule_node_type isl_schedule_node_get_parent_type(
  function __isl_give (line 167) | __isl_give isl_schedule_tree *isl_schedule_node_get_tree(
  function __isl_give (line 178) | __isl_give isl_schedule *isl_schedule_node_get_schedule(
  function __isl_take (line 188) | __isl_take isl_schedule_node *isl_schedule_node_dup(
  function __isl_give (line 203) | __isl_give isl_schedule_node *isl_schedule_node_cow(
  function __isl_give (line 217) | __isl_give isl_schedule_node *isl_schedule_node_copy(
  function __isl_null (line 229) | __isl_null isl_schedule_node *isl_schedule_node_free(
  function isl_bool (line 249) | isl_bool isl_schedule_node_is_equal(__isl_keep isl_schedule_node *node1,
  function isl_size (line 280) | isl_size isl_schedule_node_get_schedule_depth(
  type isl_schedule_node_get_filter_prefix_data (line 326) | struct isl_schedule_node_get_filter_prefix_data {
  type isl_schedule_node_get_filter_prefix_data (line 336) | struct isl_schedule_node_get_filter_prefix_data
  function isl_stat (line 346) | static isl_stat collect_filter_prefix_expansion(
  function isl_stat (line 411) | static isl_stat collect_universe_domain_extension(
  function isl_stat (line 460) | static isl_stat collect_filter_prefix_init(__isl_keep isl_schedule_tree ...
  function isl_stat (line 538) | static isl_stat collect_filter_prefix_update(__isl_keep isl_schedule_tre...
  function isl_stat (line 633) | static isl_stat collect_filter_prefix(__isl_keep isl_schedule_tree_list ...
  function __isl_give (line 683) | __isl_give isl_multi_union_pw_aff *
  function __isl_give (line 735) | __isl_give isl_union_pw_multi_aff *
  function __isl_give (line 783) | __isl_give isl_union_map *isl_schedule_node_get_prefix_schedule_union_map(
  function __isl_give (line 803) | __isl_give isl_union_map *isl_schedule_node_get_prefix_schedule_relation(
  function __isl_give (line 856) | __isl_give isl_union_set *isl_schedule_node_get_domain(
  function __isl_give (line 895) | __isl_give isl_union_set *isl_schedule_node_get_universe_domain(
  function __isl_give (line 936) | __isl_give isl_union_map *isl_schedule_node_get_subtree_schedule_union_map(
  function isl_size (line 961) | isl_size isl_schedule_node_get_tree_depth(__isl_keep isl_schedule_node *...
  function isl_bool (line 972) | isl_bool isl_schedule_node_has_parent(__isl_keep isl_schedule_node *node)
  function isl_size (line 984) | isl_size isl_schedule_node_get_child_position(
  function isl_bool (line 1006) | isl_bool isl_schedule_node_has_previous_sibling(
  function isl_bool (line 1028) | isl_bool isl_schedule_node_has_next_sibling(__isl_keep isl_schedule_node...
  function isl_bool (line 1058) | isl_bool isl_schedule_node_has_children(__isl_keep isl_schedule_node *node)
  function isl_size (line 1075) | isl_size isl_schedule_node_n_children(__isl_keep isl_schedule_node *node)
  function __isl_give (line 1098) | __isl_give isl_schedule_node *isl_schedule_node_ancestor(
  function __isl_give (line 1133) | __isl_give isl_schedule_node *isl_schedule_node_parent(
  function __isl_give (line 1147) | __isl_give isl_schedule_node *isl_schedule_node_root(
  function __isl_give (line 1163) | __isl_give isl_schedule_node *isl_schedule_node_child(
  function __isl_give (line 1208) | __isl_give isl_schedule_node *isl_schedule_node_first_child(
  function __isl_give (line 1217) | __isl_give isl_schedule_node *isl_schedule_node_previous_sibling(
  function __isl_give (line 1253) | __isl_give isl_schedule_node *isl_schedule_node_next_sibling(
  function __isl_give (line 1288) | __isl_give isl_schedule_node *isl_schedule_node_get_child(
  function __isl_give (line 1300) | static __isl_give isl_schedule_node *traverse(
  type isl_schedule_node_preorder_data (line 1338) | struct isl_schedule_node_preorder_data {
  function __isl_give (line 1353) | static __isl_give isl_schedule_node *preorder_enter(
  function __isl_give (line 1380) | static __isl_give isl_schedule_node *preorder_leave(
  function isl_stat (line 1396) | isl_stat isl_schedule_node_foreach_descendant_top_down(
  type isl_union_map_every_data (line 1418) | struct isl_union_map_every_data {
  function isl_bool (line 1428) | static isl_bool call_every(__isl_keep isl_schedule_node *node, void *user)
  function isl_bool (line 1444) | isl_bool isl_schedule_node_every_descendant(__isl_keep isl_schedule_node...
  type isl_schedule_node_postorder_data (line 1465) | struct isl_schedule_node_postorder_data {
  function __isl_give (line 1478) | static __isl_give isl_schedule_node *postorder_enter(
  function __isl_give (line 1493) | static __isl_give isl_schedule_node *postorder_leave(
  function __isl_give (line 1508) | __isl_give isl_schedule_node *isl_schedule_node_map_descendant_bottom_up(
  function isl_stat (line 1525) | isl_stat isl_schedule_node_foreach_ancestor_top_down(
  function isl_bool (line 1555) | isl_bool isl_schedule_node_is_subtree_anchored(
  function isl_size (line 1565) | isl_size isl_schedule_node_band_n_member(__isl_keep isl_schedule_node *n...
  function isl_bool (line 1575) | isl_bool isl_schedule_node_band_member_get_coincident(
  function __isl_give (line 1586) | __isl_give isl_schedule_node *isl_schedule_node_band_member_set_coincident(
  function isl_bool (line 1608) | isl_bool isl_schedule_node_band_get_permutable(
  function __isl_give (line 1619) | __isl_give isl_schedule_node *isl_schedule_node_band_set_permutable(
  function __isl_give (line 1638) | __isl_give isl_space *isl_schedule_node_band_get_space(
  function __isl_give (line 1649) | __isl_give isl_multi_union_pw_aff *isl_schedule_node_band_get_partial_sc...
  function __isl_give (line 1666) | __isl_give isl_union_map *isl_schedule_node_band_get_partial_schedule_un...
  function isl_schedule_node_band_member_get_ast_loop_type (line 1695) | enum isl_ast_loop_type isl_schedule_node_band_member_get_ast_loop_type(
  function __isl_give (line 1707) | __isl_give isl_schedule_node *isl_schedule_node_band_member_set_ast_loop...
  function isl_schedule_node_band_member_get_isolate_ast_loop_type (line 1724) | enum isl_ast_loop_type isl_schedule_node_band_member_get_isolate_ast_loo...
  function __isl_give (line 1737) | __isl_give isl_schedule_node *
  function __isl_give (line 1755) | __isl_give isl_union_set *isl_schedule_node_band_get_ast_build_options(
  function __isl_give (line 1766) | __isl_give isl_schedule_node *isl_schedule_node_band_set_ast_build_options(
  function __isl_give (line 1785) | __isl_give isl_set *isl_schedule_node_band_get_ast_isolate_option(
  function check_space_multi_val (line 1800) | static int check_space_multi_val(__isl_keep isl_schedule_node *node,
  function __isl_give (line 1824) | __isl_give isl_schedule_node *isl_schedule_node_band_scale(
  function __isl_give (line 1854) | __isl_give isl_schedule_node *isl_schedule_node_band_scale_down(
  function __isl_give (line 1884) | __isl_give isl_schedule_node *isl_schedule_node_band_mod(
  function isl_stat (line 1914) | static isl_stat check_space_multi_union_pw_aff(
  function __isl_give (line 1938) | __isl_give isl_schedule_node *isl_schedule_node_band_shift(
  function __isl_give (line 1989) | __isl_give isl_schedule_node *isl_schedule_node_band_tile(
  function __isl_give (line 2033) | __isl_give isl_schedule_node *isl_schedule_node_band_sink(
  function __isl_give (line 2079) | __isl_give isl_schedule_node *isl_schedule_node_band_split(
  function __isl_give (line 2095) | __isl_give isl_set *isl_schedule_node_context_get_context(
  function __isl_give (line 2106) | __isl_give isl_union_set *isl_schedule_node_domain_get_domain(
  function __isl_give (line 2117) | __isl_give isl_union_map *isl_schedule_node_expansion_get_expansion(
  function __isl_give (line 2128) | __isl_give isl_union_pw_multi_aff *isl_schedule_node_expansion_get_contr...
  function __isl_give (line 2140) | __isl_give isl_schedule_node *
  function __isl_give (line 2164) | __isl_give isl_union_map *isl_schedule_node_extension_get_extension(
  function __isl_give (line 2175) | __isl_give isl_schedule_node *isl_schedule_node_extension_set_extension(
  function __isl_give (line 2194) | __isl_give isl_union_set *isl_schedule_node_filter_get_filter(
  function __isl_give (line 2205) | __isl_give isl_schedule_node *isl_schedule_node_filter_set_filter(
  function __isl_give (line 2227) | __isl_give isl_schedule_node *isl_schedule_node_filter_intersect_filter(
  function __isl_give (line 2257) | __isl_give isl_set *isl_schedule_node_guard_get_guard(
  function __isl_give (line 2268) | __isl_give isl_id *isl_schedule_node_mark_get_id(
  function __isl_give (line 2280) | __isl_give isl_schedule_node *isl_schedule_node_sequence_splice(
  function __isl_give (line 2312) | __isl_give isl_schedule_node *isl_schedule_node_sequence_splice_child(
  function __isl_give (line 2369) | static __isl_give isl_schedule_node *update_ancestors(
  function __isl_give (line 2428) | __isl_give isl_schedule_node *isl_schedule_node_graft_tree(
  function check_insert (line 2455) | static int check_insert(__isl_keep isl_schedule_node *node)
  function __isl_give (line 2485) | __isl_give isl_schedule_node *isl_schedule_node_insert_partial_schedule(
  function __isl_give (line 2518) | __isl_give isl_schedule_node *isl_schedule_node_insert_context(
  function __isl_give (line 2542) | __isl_give isl_schedule_node *isl_schedule_node_insert_expansion(
  function __isl_give (line 2563) | __isl_give isl_schedule_node *isl_schedule_node_insert_extension(
  function __isl_give (line 2579) | __isl_give isl_schedule_node *isl_schedule_node_insert_filter(
  function __isl_give (line 2597) | __isl_give isl_schedule_node *isl_schedule_node_insert_guard(
  function __isl_give (line 2616) | __isl_give isl_schedule_node *isl_schedule_node_insert_mark(
  function __isl_give (line 2638) | static __isl_give isl_schedule_node *isl_schedule_node_insert_children(
  function __isl_give (line 2688) | __isl_give isl_schedule_node *isl_schedule_node_insert_sequence(
  function __isl_give (line 2701) | __isl_give isl_schedule_node *isl_schedule_node_insert_set(
  function __isl_give (line 2715) | __isl_give isl_schedule_node *isl_schedule_node_cut(
  function __isl_give (line 2746) | __isl_give isl_schedule_node *isl_schedule_node_delete(
  type isl_schedule_group_data (line 2816) | struct isl_schedule_group_data {
  function isl_bool (line 2833) | static isl_bool locally_covered_by_domain(__isl_keep isl_union_set *domain,
  function __isl_give (line 2860) | static __isl_give isl_schedule_tree *group_band(
  function __isl_give (line 2909) | static __isl_give isl_union_set *union_set_drop_extra_params(
  function __isl_give (line 2932) | static __isl_give isl_schedule_tree *group_context(
  function __isl_give (line 3012) | static __isl_give isl_schedule_tree *group_domain(
  function __isl_give (line 3051) | static __isl_give isl_schedule_tree *group_expansion(
  function __isl_give (line 3114) | static __isl_give isl_schedule_tree *group_ancestor(
  function __isl_give (line 3193) | __isl_give isl_schedule_node *isl_schedule_node_group(
  function __isl_give (line 3291) | __isl_give isl_schedule_node *isl_schedule_node_band_gist(
  type isl_node_gist_data (line 3310) | struct isl_node_gist_data {
  function __isl_give (line 3322) | static __isl_give isl_schedule_node *gist_enter_expansion(
  function __isl_give (line 3363) | static __isl_give isl_schedule_node *gist_leave_expansion(
  function __isl_give (line 3395) | static __isl_give isl_schedule_node *gist_enter_extension(
  function isl_bool (line 3422) | static isl_bool gist_done(__isl_keep isl_schedule_node *node,
  function __isl_give (line 3469) | static __isl_give isl_schedule_node *gist_enter(
  function __isl_give (line 3557) | static __isl_give isl_schedule_node *gist_leave(
  function __isl_give (line 3649) | __isl_give isl_schedule_node *isl_schedule_node_gist(
  function __isl_give (line 3669) | __isl_give isl_schedule_node *isl_schedule_node_domain_intersect_domain(
  function __isl_give (line 3710) | __isl_give isl_schedule_node *isl_schedule_node_domain_gist_params(
  type isl_subtree_expansion_data (line 3738) | struct isl_subtree_expansion_data {
  function __isl_give (line 3757) | static __isl_give isl_schedule_node *subtree_expansion_enter(
  function __isl_give (line 3830) | static __isl_give isl_schedule_node *subtree_expansion_leave(
  function __isl_give (line 3888) | __isl_give isl_union_map *isl_schedule_node_get_subtree_expansion(
  type isl_subtree_contraction_data (line 3923) | struct isl_subtree_contraction_data {
  function __isl_give (line 3942) | static __isl_give isl_schedule_node *subtree_contraction_enter(
  function __isl_give (line 4023) | static __isl_give isl_schedule_node *subtree_contraction_leave(
  function __isl_give (line 4084) | __isl_give isl_union_pw_multi_aff *isl_schedule_node_get_subtree_contrac...
  function isl_bool (line 4117) | static isl_bool has_ancestors(__isl_keep isl_schedule_node *node,
  function is_disjoint_extension (line 4155) | static int is_disjoint_extension(__isl_keep isl_schedule_node *node,
  function __isl_give (line 4188) | static __isl_give isl_schedule_node *extend_extension(
  function __isl_give (line 4226) | static __isl_give isl_union_set *replace_by_universe_if_disjoint(
  function __isl_give (line 4269) | static __isl_give isl_schedule_node *insert_extension(
  function __isl_give (line 4314) | static __isl_give isl_schedule_node *graft_or_splice(
  function __isl_give (line 4353) | static __isl_give isl_schedule_node *graft_extension(
  function __isl_give (line 4397) | static __isl_give isl_schedule_node *extension_from_domain(
  function __isl_give (line 4465) | static __isl_give isl_schedule_node *isl_schedule_node_graft_before_or_a...
  function __isl_give (line 4503) | __isl_give isl_schedule_node *isl_schedule_node_graft_before(
  function __isl_give (line 4521) | __isl_give isl_schedule_node *isl_schedule_node_graft_after(
  function __isl_give (line 4542) | static __isl_give isl_schedule_node *isl_schedule_node_order_before_or_a...
  function __isl_give (line 4618) | __isl_give isl_schedule_node *isl_schedule_node_order_before(
  function __isl_give (line 4631) | __isl_give isl_schedule_node *isl_schedule_node_order_after(
  function __isl_give (line 4640) | __isl_give isl_schedule_node *isl_schedule_node_reset_user(
  function __isl_give (line 4654) | __isl_give isl_schedule_node *isl_schedule_node_align_params(
  function __isl_give (line 4677) | __isl_give isl_schedule_node *isl_schedule_node_pullback_union_pw_multi_...
  type isl_schedule_expand_data (line 4695) | struct isl_schedule_expand_data {
  function __isl_give (line 4709) | static __isl_give isl_schedule_node *expand(__isl_take isl_schedule_node...
  function __isl_give (line 4754) | __isl_give isl_schedule_node *isl_schedule_node_expand(
  function isl_size (line 4788) | isl_size isl_schedule_node_get_ancestor_child_position(
  function __isl_give (line 4827) | __isl_give isl_schedule_node *isl_schedule_node_get_shared_ancestor(
  function __isl_give (line 4858) | __isl_give isl_printer *isl_printer_print_schedule_node(
  function isl_schedule_node_dump (line 4872) | void isl_schedule_node_dump(__isl_keep isl_schedule_node *node)
  function __isl_give (line 4892) | __isl_give char *isl_schedule_node_to_str(__isl_keep isl_schedule_node *...
  function isl_schedule_node_band_member_get_space_time (line 4913) | enum autosa_loop_type isl_schedule_node_band_member_get_space_time(
  function __isl_give (line 4924) | __isl_give isl_schedule_node *isl_schedule_node_band_member_set_space_time(
  function isl_schedule_node_band_member_get_pe_opt (line 4946) | enum autosa_loop_type isl_schedule_node_band_member_get_pe_opt(
  function __isl_give (line 4957) | __isl_give isl_schedule_node *isl_schedule_node_band_member_set_pe_opt(
  function isl_schedule_node_band_member_get_sched_pos (line 4979) | int isl_schedule_node_band_member_get_sched_pos(
  function __isl_give (line 4990) | __isl_give isl_schedule_node *isl_schedule_node_band_member_set_sched_pos(
  function __isl_give (line 5016) | __isl_give isl_schedule_node *isl_schedule_node_band_member_set_iter(

FILE: autosa_scripts/ppcg_changes/isl/isl_schedule_tree.c
  function isl_schedule_tree_is_leaf (line 35) | int isl_schedule_tree_is_leaf(__isl_keep isl_schedule_tree *tree)
  function __isl_give (line 47) | static __isl_give isl_schedule_tree *isl_schedule_tree_alloc(isl_ctx *ctx,
  function __isl_take (line 70) | __isl_take isl_schedule_tree *isl_schedule_tree_dup(
  function __isl_give (line 150) | __isl_give isl_schedule_tree *isl_schedule_tree_cow(
  function __isl_give (line 164) | __isl_give isl_schedule_tree *isl_schedule_tree_copy(
  function __isl_null (line 176) | __isl_null isl_schedule_tree *isl_schedule_tree_free(
  function __isl_give (line 225) | __isl_give isl_schedule_tree *isl_schedule_tree_leaf(isl_ctx *ctx)
  function __isl_give (line 233) | __isl_give isl_schedule_tree *isl_schedule_tree_from_band(
  function __isl_give (line 260) | __isl_give isl_schedule_tree *isl_schedule_tree_from_context(
  function __isl_give (line 285) | __isl_give isl_schedule_tree *isl_schedule_tree_from_domain(
  function __isl_give (line 310) | __isl_give isl_schedule_tree *isl_schedule_tree_from_expansion(
  function __isl_give (line 340) | __isl_give isl_schedule_tree *isl_schedule_tree_from_extension(
  function __isl_give (line 365) | __isl_give isl_schedule_tree *isl_schedule_tree_from_filter(
  function __isl_give (line 391) | __isl_give isl_schedule_tree *isl_schedule_tree_from_guard(
  function __isl_give (line 417) | __isl_give isl_schedule_tree *isl_schedule_tree_from_mark(
  function isl_bool (line 442) | isl_bool isl_schedule_tree_is_subtree_anchored(
  function isl_schedule_tree_is_anchored (line 453) | int isl_schedule_tree_is_anchored(__isl_keep isl_schedule_tree *tree)
  function __isl_give (line 487) | __isl_give isl_schedule_tree *isl_schedule_tree_update_anchored(
  function __isl_give (line 521) | __isl_give isl_schedule_tree *isl_schedule_tree_from_children(
  function __isl_give (line 550) | __isl_give isl_schedule_tree *isl_schedule_tree_from_pair(
  function __isl_give (line 590) | __isl_give isl_schedule_tree *isl_schedule_tree_sequence_pair(
  function __isl_give (line 603) | __isl_give isl_schedule_tree *isl_schedule_tree_set_pair(
  function isl_ctx (line 612) | isl_ctx *isl_schedule_tree_get_ctx(__isl_keep isl_schedule_tree *tree)
  function isl_schedule_tree_get_type (line 620) | enum isl_schedule_node_type isl_schedule_tree_get_type(
  function isl_bool (line 628) | isl_bool isl_schedule_tree_plain_is_equal(__isl_keep isl_schedule_tree *...
  function isl_schedule_tree_has_children (line 710) | int isl_schedule_tree_has_children(__isl_keep isl_schedule_tree *tree)
  function isl_size (line 722) | isl_size isl_schedule_tree_n_children(__isl_keep isl_schedule_tree *tree)
  function __isl_give (line 734) | __isl_give isl_schedule_tree *isl_schedule_tree_get_child(
  function __isl_give (line 748) | __isl_give isl_schedule_tree *isl_schedule_tree_child(
  function __isl_give (line 760) | __isl_give isl_schedule_tree *isl_schedule_tree_reset_children(
  function __isl_give (line 773) | __isl_give isl_schedule_tree *isl_schedule_tree_drop_child(
  function __isl_give (line 809) | __isl_give isl_schedule_tree *isl_schedule_tree_replace_child(
  function __isl_give (line 854) | __isl_give isl_schedule_tree *isl_schedule_tree_set_children(
  function __isl_give (line 873) | __isl_give isl_schedule_tree *isl_schedule_tree_insert_band(
  function __isl_give (line 885) | __isl_give isl_schedule_tree *isl_schedule_tree_insert_context(
  function __isl_give (line 897) | __isl_give isl_schedule_tree *isl_schedule_tree_insert_domain(
  function __isl_give (line 909) | __isl_give isl_schedule_tree *isl_schedule_tree_insert_expansion(
  function __isl_give (line 923) | __isl_give isl_schedule_tree *isl_schedule_tree_insert_extension(
  function __isl_give (line 937) | __isl_give isl_schedule_tree *isl_schedule_tree_insert_filter(
  function __isl_give (line 958) | __isl_give isl_schedule_tree *isl_schedule_tree_children_insert_filter(
  function __isl_give (line 988) | __isl_give isl_schedule_tree *isl_schedule_tree_insert_guard(
  function __isl_give (line 1000) | __isl_give isl_schedule_tree *isl_schedule_tree_insert_mark(
  function isl_size (line 1011) | isl_size isl_schedule_tree_band_n_member(__isl_keep isl_schedule_tree *t...
  function isl_bool (line 1026) | isl_bool isl_schedule_tree_band_member_get_coincident(
  function __isl_give (line 1042) | __isl_give isl_schedule_tree *isl_schedule_tree_band_member_set_coincident(
  function isl_bool (line 1066) | isl_bool isl_schedule_tree_band_get_permutable(
  function __isl_give (line 1081) | __isl_give isl_schedule_tree *isl_schedule_tree_band_set_permutable(
  function __isl_give (line 1103) | __isl_give isl_space *isl_schedule_tree_band_get_space(
  function __isl_give (line 1119) | __isl_give isl_schedule_tree *isl_schedule_tree_band_intersect_domain(
  function __isl_give (line 1142) | __isl_give isl_multi_union_pw_aff *isl_schedule_tree_band_get_partial_sc...
  function __isl_give (line 1157) | __isl_give isl_schedule_tree *isl_schedule_tree_band_set_partial_schedule(
  function isl_schedule_tree_band_member_get_ast_loop_type (line 1181) | enum isl_ast_loop_type isl_schedule_tree_band_member_get_ast_loop_type(
  function __isl_give (line 1197) | __isl_give isl_schedule_tree *isl_schedule_tree_band_member_set_ast_loop...
  function isl_schedule_tree_band_member_get_isolate_ast_loop_type (line 1220) | enum isl_ast_loop_type isl_schedule_tree_band_member_get_isolate_ast_loo...
  function __isl_give (line 1237) | __isl_give isl_schedule_tree *
  function __isl_give (line 1260) | __isl_give isl_union_set *isl_schedule_tree_band_get_ast_build_options(
  function __isl_give (line 1277) | __isl_give isl_schedule_tree *isl_schedule_tree_band_set_ast_build_options(
  function __isl_give (line 1308) | __isl_give isl_set *isl_schedule_tree_band_get_ast_isolate_option(
  function __isl_give (line 1323) | __isl_give isl_set *isl_schedule_tree_context_get_context(
  function __isl_give (line 1338) | __isl_give isl_union_set *isl_schedule_tree_domain_get_domain(
  function __isl_give (line 1353) | __isl_give isl_schedule_tree *isl_schedule_tree_domain_set_domain(
  function __isl_give (line 1376) | __isl_give isl_union_pw_multi_aff *isl_schedule_tree_expansion_get_contr...
  function __isl_give (line 1391) | __isl_give isl_union_map *isl_schedule_tree_expansion_get_expansion(
  function __isl_give (line 1407) | __isl_give isl_schedule_tree *
  function __isl_give (line 1436) | __isl_give isl_union_map *isl_schedule_tree_extension_get_extension(
  function __isl_give (line 1451) | __isl_give isl_schedule_tree *isl_schedule_tree_extension_set_extension(
  function __isl_give (line 1473) | __isl_give isl_union_set *isl_schedule_tree_filter_get_filter(
  function __isl_give (line 1488) | __isl_give isl_schedule_tree *isl_schedule_tree_filter_set_filter(
  function __isl_give (line 1511) | __isl_give isl_set *isl_schedule_tree_guard_get_guard(
  function __isl_give (line 1526) | __isl_give isl_id *isl_schedule_tree_mark_get_id(
  function isl_stat (line 1541) | static isl_stat set_range_dim(__isl_take isl_map *map, void *user)
  function isl_size (line 1557) | static isl_size range_dim(__isl_keep isl_union_map *umap)
  function __isl_give (line 1577) | static __isl_give isl_union_map *append_range(__isl_take isl_union_map *...
  function isl_bool (line 1612) | static isl_bool domain_less(__isl_keep isl_schedule_tree *tree)
  function __isl_give (line 1644) | __isl_give isl_schedule_tree *isl_schedule_tree_first_schedule_descendant(
  function __isl_give (line 1674) | static __isl_give isl_union_map *subtree_schedule_extend_child(
  function __isl_give (line 1695) | static __isl_give isl_space *extract_space_from_filter_child(
  function __isl_give (line 1731) | static __isl_give isl_union_map *subtree_schedule_extend_from_children(
  function __isl_give (line 1832) | static __isl_give isl_union_map *subtree_schedule_extend(
  function __isl_give (line 1902) | static __isl_give isl_union_set *initial_domain_from_children(
  function __isl_give (line 1938) | static __isl_give isl_union_set *initial_domain(
  function __isl_give (line 2018) | __isl_give isl_union_map *isl_schedule_tree_get_subtree_schedule_union_map(
  function __isl_give (line 2032) | __isl_give isl_schedule_tree *isl_schedule_tree_band_scale(
  function __isl_give (line 2059) | __isl_give isl_schedule_tree *isl_schedule_tree_band_scale_down(
  function __isl_give (line 2086) | __isl_give isl_schedule_tree *isl_schedule_tree_band_mod(
  function __isl_give (line 2112) | __isl_give isl_schedule_tree *isl_schedule_tree_band_shift(
  function __isl_give (line 2140) | __isl_give isl_schedule_tree *isl_schedule_tree_sequence_splice(
  function __isl_give (line 2187) | __isl_give isl_schedule_tree *isl_schedule_tree_band_tile(
  function __isl_give (line 2234) | static __isl_give isl_set *isolate_initial(__isl_keep isl_set *isolate,
  function __isl_give (line 2273) | static __isl_give isl_set *isolate_final(__isl_keep isl_set *isolate,
  function __isl_give (line 2306) | __isl_give isl_schedule_tree *isl_schedule_tree_band_split(
  function __isl_give (line 2361) | __isl_give isl_schedule_tree *isl_schedule_tree_append_to_leaves(
  function __isl_give (line 2397) | __isl_give isl_schedule_tree *isl_schedule_tree_reset_user(
  function __isl_give (line 2459) | __isl_give isl_schedule_tree *isl_schedule_tree_align_params(
  function involves_iteration_domain (line 2536) | static int involves_iteration_domain(__isl_keep isl_schedule_tree *tree)
  function __isl_give (line 2572) | __isl_give isl_schedule_tree *isl_schedule_tree_pullback_union_pw_multi_...
  function __isl_give (line 2630) | __isl_give isl_schedule_tree *isl_schedule_tree_band_gist(
  function isl_bool (line 2654) | static isl_bool any_coincident(__isl_keep isl_schedule_band *band)
  function isl_bool (line 2676) | static isl_bool any_space_time(__isl_keep isl_schedule_band *band)
  function isl_bool (line 2697) | static isl_bool any_pe_opt(__isl_keep isl_schedule_band *band)
  function isl_bool (line 2719) | static isl_bool any_sched_pos(__isl_keep isl_schedule_band *band)
  function __isl_give (line 2745) | static __isl_give isl_printer *print_tree_band(__isl_take isl_printer *p,
  function __isl_give (line 2961) | __isl_give isl_printer *isl_printer_print_schedule_tree_mark(
  function __isl_give (line 3076) | __isl_give isl_printer *isl_printer_print_schedule_tree(
  function isl_schedule_tree_dump (line 3082) | void isl_schedule_tree_dump(__isl_keep isl_schedule_tree *tree)
  function isl_schedule_tree_band_member_get_space_time (line 3102) | enum autosa_loop_type isl_schedule_tree_band_member_get_space_time(
  function __isl_give (line 3117) | __isl_give isl_schedule_tree *isl_schedule_tree_band_member_set_space_time(
  function isl_schedule_tree_band_member_get_pe_opt (line 3143) | enum autosa_loop_type isl_schedule_tree_band_member_get_pe_opt(
  function __isl_give (line 3158) | __isl_give isl_schedule_tree *isl_schedule_tree_band_member_set_pe_opt(
  function isl_schedule_tree_band_member_get_sched_pos (line 3184) | int isl_schedule_tree_band_member_get_sched_pos(
  function __isl_give (line 3199) | __isl_give isl_schedule_tree *isl_schedule_tree_band_member_set_sched_pos(
  function __isl_give (line 3240) | __isl_give isl_schedule_tree *isl_schedule_tree_band_member_set_iter(

FILE: autosa_scripts/ppcg_changes/isl/isl_schedule_tree.h
  type isl_schedule_tree (line 9) | struct isl_schedule_tree
  type isl_schedule_tree (line 10) | typedef struct isl_schedule_tree isl_schedule_tree;
  function isl_schedule_tree (line 12) | ISL_DECLARE_LIST(schedule_tree)
  type isl_schedule_node_type (line 76) | enum isl_schedule_node_type
  type isl_schedule_node_type (line 106) | enum isl_schedule_node_type
  type isl_schedule_node_type (line 109) | enum isl_schedule_node_type
  type isl_ast_loop_type (line 130) | enum isl_ast_loop_type
  type isl_ast_loop_type (line 134) | enum isl_ast_loop_type
  type isl_ast_loop_type (line 135) | enum isl_ast_loop_type
  type isl_ast_loop_type (line 140) | enum isl_ast_loop_type
  type autosa_loop_type (line 269) | enum autosa_loop_type
  type autosa_loop_type (line 272) | enum autosa_loop_type
  type autosa_loop_type (line 273) | enum autosa_loop_type
  type autosa_loop_type (line 276) | enum autosa_loop_type

FILE: autosa_scripts/ppcg_changes/isl/schedule.h
  type __isl_export (line 17) | struct __isl_export
  type isl_schedule_constraints (line 18) | typedef struct isl_schedule_constraints isl_schedule_constraints;

FILE: autosa_scripts/ppcg_changes/isl/schedule_node.h
  type isl_schedule_node_type (line 36) | enum isl_schedule_node_type
  type isl_ast_loop_type (line 128) | enum isl_ast_loop_type
  type isl_ast_loop_type (line 133) | enum isl_ast_loop_type
  type isl_ast_loop_type (line 134) | enum isl_ast_loop_type
  type isl_ast_loop_type (line 139) | enum isl_ast_loop_type
  type autosa_loop_type (line 303) | enum autosa_loop_type
  type autosa_loop_type (line 309) | enum autosa_loop_type

FILE: autosa_scripts/ppcg_changes/isl/vec.h
  type isl_vec (line 23) | struct isl_vec
  type isl_vec (line 24) | typedef struct isl_vec isl_vec;
  type isl_vec (line 49) | struct isl_vec
  type isl_vec (line 49) | struct isl_vec

FILE: autosa_scripts/resource_model.py
  function BRAM_predict_HLS (line 19) | def BRAM_predict_HLS(dw, depth, use_18K=0):
  function URAM_predict_HLS (line 40) | def URAM_predict_HLS(dw, depth):
  function BRAM_array_predict_HLS (line 54) | def BRAM_array_predict_HLS(dw, depth, n_part):
  function FF_array_predict_HLS (line 68) | def FF_array_predict_HLS(dw, depth):
  function URAM_array_predict_HLS (line 80) | def URAM_array_predict_HLS(dw, depth, n_part):
  function FIFO_predict_xilinx (line 83) | def FIFO_predict_xilinx(dw, depth):
  function extract_axi_res_from_hls_rpt (line 108) | def extract_axi_res_from_hls_rpt(rpt_path):
  function extract_design_info (line 133) | def extract_design_info(design_dir, synth=0):
  function extract_resource_info_from_hls_rpt (line 275) | def extract_resource_info_from_hls_rpt(rpt):
  function convert_design_infos_to_df (line 308) | def convert_design_infos_to_df(design_infos):
  function df_feature_extract (line 419) | def df_feature_extract(df, module):
  function get_feature_set (line 435) | def get_feature_set(module):
  function train (line 451) | def train(df, modules, fifos, design_infos, work_dir, logger):
  function predict_design_resource_usage (line 676) | def predict_design_resource_usage(df, modules, fifos, design_info, prj_d...
  function mean_absolute_percentage_error (line 826) | def mean_absolute_percentage_error(y_true, y_pred):
  function resource_valid (line 837) | def resource_valid(res, hw_info, range, target):
  function compute_res_util_score (line 864) | def compute_res_util_score(res, hw_info):
  function unit_test_predict_design_resource (line 886) | def unit_test_predict_design_resource(design_dir, hw_info, model_path):

FILE: autosa_scripts/tuner/constraint.py
  class Constraint (line 3) | class Constraint(object):
    method __init__ (line 4) | def __init__(self, cst_path):
    method __repr__ (line 12) | def __repr__(self):

FILE: autosa_scripts/tuner/design.py
  class Design (line 7) | class Design(object):
    method __init__ (line 8) | def __init__(self, name):
    method print_resource_est_func (line 18) | def print_resource_est_func(self, f, desp):
    method print_latency_est_func (line 117) | def print_latency_est_func(self, f, desp):
    method print_infer_params_func (line 356) | def print_infer_params_func(self, f, desp):
    method print_random_sampling_func (line 388) | def print_random_sampling_func(self, f, desp):
    method print_bound_check_func (line 444) | def print_bound_check_func(self, f, desp):
    method register (line 492) | def register(self, desp, py_f):
    method est_latency (line 541) | def est_latency(self, params):
    method est_resource (line 547) | def est_resource(self, params):
    method infer_params (line 553) | def infer_params(self, params):
    method random_sampling (line 559) | def random_sampling(self, params):
    method bound_check (line 565) | def bound_check(self, params):

FILE: autosa_scripts/tuner/search_task.py
  class SearchTask (line 9) | class SearchTask(object):
    method __init__ (line 10) | def __init__(self, design, task):
    method adjust_params (line 14) | def adjust_params(self, params):
    method generate_random_sample (line 44) | def generate_random_sample(self):
    method evaluate (line 52) | def evaluate(self, params, metric="latency"):

FILE: autosa_scripts/tuner/tuner.py
  class Tuner (line 6) | class Tuner(object):
    method __init__ (line 7) | def __init__(self, task, cst, obj, logger, max_epoch, max_time):
    method overuse_constraint (line 18) | def overuse_constraint(self, used_cst):
  class GeneticTuner (line 29) | class GeneticTuner(Tuner):
    method __init__ (line 30) | def __init__(self, task, cst, obj, logger, max_epoch, max_time, params):
    method select_parents (line 45) | def select_parents(self, population, fitness, num_parents):
    method crossover (line 52) | def crossover(self, pool, num_children):
    method mutation (line 81) | def mutation(self, pool):
    method search (line 161) | def search(self):
  function genetic_search (line 266) | def genetic_search(task, cst, obj, logger, max_epochs, max_time):

FILE: autosa_scripts/tuner/utils.py
  function factorization (line 13) | def factorization(x):
  function get_divisors (line 31) | def get_divisors(x, filter=None):
  class PerfCounter (line 49) | class PerfCounter(object):
    method __init__ (line 50) | def __init__(self, logger):
    method init_counter (line 54) | def init_counter(self, name):
    method update_counter (line 57) | def update_counter(self, name):
    method get_counter (line 64) | def get_counter(self, name):
    method print_counter (line 69) | def print_counter(self, name):
    method print_counters (line 74) | def print_counters(self):
  function init_logger (line 78) | def init_logger(outdir):
  class SearchRecord (line 99) | class SearchRecord(object):
    method __init__ (line 100) | def __init__(self, max=1):
    method reset (line 116) | def reset(self):
    method update (line 132) | def update(self, new_record):
    method extract_from_tuner (line 152) | def extract_from_tuner(self, tuner):
    method __repr__ (line 166) | def __repr__(self):

FILE: autosa_tests/cnn/kernel.c
  function main (line 3) | int main(int argc, char **argv){

FILE: autosa_tests/cnn/kernel.h
  type data_t (line 5) | typedef float data_t;

FILE: autosa_tests/dnn_ops/kernel.c
  function main (line 6) | int main(int argc, char **argv){

FILE: autosa_tests/dnn_ops/kernel.h
  type data_t (line 9) | typedef float data_t;

FILE: autosa_tests/large/cnn/kernel.c
  function main (line 3) | int main(int argc, char **argv){

FILE: autosa_tests/large/cnn/kernel.h
  type data_t (line 5) | typedef float data_t;

FILE: autosa_tests/large/mm/kernel.c
  function main (line 7) | int main(int argc, char **argv) {

FILE: autosa_tests/large/mm/kernel.h
  type data_t (line 6) | typedef int data_t;

FILE: autosa_tests/large/mm_block_sparse/kernel.c
  function main (line 24) | int main(int argc, char **argv) {

FILE: autosa_tests/large/mm_block_sparse/kernel.h
  type data_t (line 5) | typedef float data_t;

FILE: autosa_tests/large/mm_int16/kernel.c
  function main (line 3) | int main(int argc, char **argv) {

FILE: autosa_tests/large/mm_int16/kernel.h
  type data_t (line 5) | typedef unsigned short data_t;

FILE: autosa_tests/large/mm_int8/kernel.c
  function main (line 3) | int main(int argc, char **argv) {

FILE: autosa_tests/large/mm_int8/kernel.h
  type data_t (line 5) | typedef char data_t;

FILE: autosa_tests/large/mm_int8/kernel_kernel_opt.cpp
  function A_IO_L3_in (line 33) | void A_IO_L3_in(hls::stream<A_t64> &fifo_A_serialize, hls::stream<A_t64>...
  function A_IO_L3_in_serialize (line 63) | void A_IO_L3_in_serialize(A_t64 *A, hls::stream<A_t64> &fifo_A_local_out) {
  function A_IO_L2_in_intra_trans (line 78) | void A_IO_L2_in_intra_trans(int idx, int c0, int c1, int c2, A_t64 local...
  function A_IO_L2_in_inter_trans (line 110) | void A_IO_L2_in_inter_trans(int idx, int c0, int c1, int c2, A_t64 local...
  function A_IO_L2_in_inter_trans_boundary (line 151) | void A_IO_L2_in_inter_trans_boundary(int idx, int c0, int c1, int c2, A_...
  function A_IO_L2_in (line 179) | void A_IO_L2_in(int idx, hls::stream<A_t64> &fifo_A_in, hls::stream<A_t6...
  function A_IO_L2_in_boundary (line 276) | void A_IO_L2_in_boundary(int idx, hls::stream<A_t64> &fifo_A_in, hls::st...
  function B_IO_L3_in (line 371) | void B_IO_L3_in(hls::stream<B_t64> &fifo_B_serialize, hls::stream<B_t64>...
  function B_IO_L3_in_serialize (line 401) | void B_IO_L3_in_serialize(B_t64 *B, hls::stream<B_t64> &fifo_B_local_out) {
  function B_IO_L2_in_intra_trans (line 416) | void B_IO_L2_in_intra_trans(int idx, int c0, int c1, int c2, B_t64 local...
  function B_IO_L2_in_inter_trans (line 448) | void B_IO_L2_in_inter_trans(int idx, int c0, int c1, int c2, B_t64 local...
  function B_IO_L2_in_inter_trans_boundary (line 489) | void B_IO_L2_in_inter_trans_boundary(int idx, int c0, int c1, int c2, B_...
  function B_IO_L2_in (line 517) | void B_IO_L2_in(int idx, hls::stream<B_t64> &fifo_B_in, hls::stream<B_t6...
  function B_IO_L2_in_boundary (line 614) | void B_IO_L2_in_boundary(int idx, hls::stream<B_t64> &fifo_B_in, hls::st...
  function PE (line 709) | void PE(int idx, int idy, hls::stream<A_t64> &fifo_A_in, hls::stream<A_t...
  function PE_wrapper (line 1076) | void PE_wrapper(int idx, int idy, hls::stream<A_t64> &fifo_A_in, hls::st...
  function A_PE_dummy_in (line 1090) | void A_PE_dummy_in(int idx, int idy, hls::stream<A_t64> &fifo_A_in) {
  function B_PE_dummy_in (line 1114) | void B_PE_dummy_in(int idx, int idy, hls::stream<B_t64> &fifo_B_in) {
  function C_drain_IO_L1_out_intra_trans (line 1138) | void C_drain_IO_L1_out_intra_trans(int idx, int idy, int c0, int c1, C_t...
  function C_drain_IO_L1_out_inter_trans (line 1179) | void C_drain_IO_L1_out_inter_trans(int idx, int idy, int c0, int c1, C_t...
  function C_drain_IO_L1_out_inter_trans_boundary (line 1218) | void C_drain_IO_L1_out_inter_trans_boundary(int idx, int idy, int c0, in...
  function C_drain_IO_L1_out (line 1244) | void C_drain_IO_L1_out(int idx, int idy, hls::stream<C_t32> &fifo_C_drai...
  function C_drain_IO_L1_out_wrapper (line 1279) | void C_drain_IO_L1_out_wrapper(int idx, int idy, hls::stream<C_t32> &fif...
  function C_drain_IO_L1_out_boundary (line 1291) | void C_drain_IO_L1_out_boundary(int idx, int idy, hls::stream<C_t32> &fi...
  function C_drain_IO_L1_out_boundary_wrapper (line 1325) | void C_drain_IO_L1_out_boundary_wrapper(int idx, int idy, hls::stream<C_...
  function C_drain_IO_L2_out (line 1336) | void C_drain_IO_L2_out(int idx, hls::stream<C_t32> &fifo_C_drain_in, hls...
  function C_drain_IO_L2_out_boundary (line 1385) | void C_drain_IO_L2_out_boundary(int idx, hls::stream<C_t32> &fifo_C_drai...
  function C_drain_IO_L3_out (line 1418) | void C_drain_IO_L3_out(hls::stream<C_t32> &fifo_C_drain_serialize, hls::...
  function C_drain_IO_L3_out_serialize (line 1451) | void C_drain_IO_L3_out_serialize(C_t32 *C, hls::stream<C_t32> &fifo_C_dr...
  function kernel0 (line 1466) | void kernel0(A_t64 *A, B_t64 *B, C_t32 *C)

FILE: autosa_tests/large/mm_intel/kernel.c
  function main (line 7) | int main(int argc, char **argv) {

FILE: autosa_tests/large/mm_intel/kernel.h
  type data_t (line 5) | typedef float data_t;

FILE: autosa_tests/large/mttkrp/kernel.c
  function main (line 10) | int main(int argc, char **argv){

FILE: autosa_tests/large/mttkrp/kernel.h
  type data_t (line 5) | typedef float data_t;

FILE: autosa_tests/large/ttm/kernel.c
  function main (line 10) | int main(int argc, char **argv){

FILE: autosa_tests/large/ttm/kernel.h
  type data_t (line 5) | typedef float data_t;

FILE: autosa_tests/large/ttmc/kernel.c
  function main (line 10) | int main(int argc, char **argv){

FILE: autosa_tests/large/ttmc/kernel.h
  type data_t (line 5) | typedef float data_t;

FILE: autosa_tests/lu/add_batch.py
  function run (line 3) | def run(input_f, output_f, batch):

FILE: autosa_tests/lu/kernel.c
  function init_array (line 3) | void init_array(data_t A[N][N])
  function lu_cpu (line 33) | void lu_cpu(data_t A[N][N], data_t L[N][N], data_t U[N][N]) {
  function lu_device (line 64) | void lu_device(data_t A[N][N], data_t L[N][N], data_t U[N][N])
  function main (line 103) | int main(int argc, char **argv) {

FILE: autosa_tests/lu/kernel.h
  type data_t (line 5) | typedef float data_t;

FILE: autosa_tests/mm/kernel.c
  function main (line 3) | int main(int argc, char **argv) {

FILE: autosa_tests/mm/kernel.h
  type data_t (line 5) | typedef float data_t;

FILE: autosa_tests/mm_block_sparse/kernel.c
  function main (line 27) | int main(int argc, char **argv) {

FILE: autosa_tests/mm_block_sparse/kernel.h
  type data_t (line 5) | typedef float data_t;

FILE: autosa_tests/mm_catapult/kernel.c
  function main (line 3) | int main(int argc, char **argv) {

FILE: autosa_tests/mm_catapult/kernel.h
  type data_t (line 6) | typedef unsigned int data_t;

FILE: autosa_tests/mm_catapult/kernel_kernel_hw.h
  type A_IO_L2_in_local_A (line 3) | struct A_IO_L2_in_local_A {
  type B_IO_L2_in_local_B (line 7) | struct B_IO_L2_in_local_B {
  type C_drain_IO_L1_out_local_C (line 11) | struct C_drain_IO_L1_out_local_C {
  function class (line 18) | class A_IO_L3_in {
  function class (line 49) | class A_IO_L3_in_serialize {
  function class (line 76) | class A_IO_L2_in_intra_trans {
  function class (line 119) | class A_IO_L2_in_inter_trans {
  function class (line 164) | class A_IO_L2_in_inter_trans_boundary {
  function class (line 199) | class A_IO_L2_in {
  function class (line 229) | class A_IO_L2_in_boundary {
  function class (line 258) | class B_IO_L3_in {
  function class (line 289) | class B_IO_L3_in_serialize {
  function class (line 316) | class B_IO_L2_in_intra_trans {
  function class (line 359) | class B_IO_L2_in_inter_trans {
  function class (line 404) | class B_IO_L2_in_inter_trans_boundary {
  function class (line 439) | class B_IO_L2_in {
  function class (line 469) | class B_IO_L2_in_boundary {
  function class (line 498) | class PE {
  function class (line 571) | class C_drain_IO_L1_out_intra_trans {
  function class (line 614) | class C_drain_IO_L1_out_inter_trans {
  function class (line 658) | class C_drain_IO_L1_out_inter_trans_boundary {
  function class (line 692) | class C_drain_IO_L1_out {
  function class (line 724) | class C_drain_IO_L1_out_boundary {
  function class (line 755) | class C_drain_IO_L2_out {
  function class (line 798) | class C_drain_IO_L2_out_boundary {
  function class (line 830) | class C_drain_IO_L3_out {
  function class (line 861) | class C_drain_IO_L3_out_serialize {
  function class (line 896) | class kernel0 {

FILE: autosa_tests/mm_getting_started/kernel.c
  function main (line 6) | int main(int argc, char **argv) {

FILE: autosa_tests/mm_getting_started/kernel.h
  type data_t (line 5) | typedef float data_t;

FILE: autosa_tests/mm_hbm/kernel.c
  function main (line 3) | int main(int argc, char **argv) {

FILE: autosa_tests/mm_hbm/kernel.h
  type data_t (line 5) | typedef float data_t;

FILE: autosa_tests/mm_hcl/kernel.c
  function main (line 9) | int main(int argc, char **argv) {

FILE: autosa_tests/mm_hcl/kernel.h
  type data_t (line 5) | typedef float data_t;

FILE: autosa_tests/mm_hcl_intel/kernel.c
  function main (line 3) | int main(int argc, char **argv) {

FILE: autosa_tests/mm_hcl_intel/kernel.h
  type data_t (line 5) | typedef float data_t;

FILE: autosa_tests/mm_hcl_intel/kernel2.c
  function main (line 2) | int main(int argc, char **argv) {

FILE: autosa_tests/mm_int16/kernel.c
  function main (line 3) | int main(int argc, char **argv) {

FILE: autosa_tests/mm_int16/kernel.h
  type data_t (line 5) | typedef unsigned short data_t;

FILE: autosa_tests/mm_intel/kernel.c
  function main (line 3) | int main(int argc, char **argv) {

FILE: autosa_tests/mm_intel/kernel.h
  type data_t (line 5) | typedef float data_t;

FILE: src/autosa_catapult_hls_c.cpp
  type print_host_user_data (line 13) | struct print_host_user_data
    type hls_info (line 15) | struct hls_info
    type autosa_prog (line 16) | struct autosa_prog
    type autosa_hw_top_module (line 17) | struct autosa_hw_top_module
  type print_hw_module_data (line 20) | struct print_hw_module_data
    type hls_info (line 22) | struct hls_info
    type autosa_prog (line 23) | struct autosa_prog
    type autosa_hw_module (line 24) | struct autosa_hw_module
  function hls_open_files (line 32) | static void hls_open_files(struct hls_info *info, const char *input)
  function hls_close_files (line 152) | static void hls_close_files(struct hls_info *info)
  type autosa_array_ref_group (line 189) | struct autosa_array_ref_group
  type autosa_io_buffer (line 232) | struct autosa_io_buffer
  function isl_stat (line 276) | static isl_stat print_data_types_catapult(
  function __isl_give (line 439) | static __isl_give isl_printer *declare_and_allocate_cpu_arrays_catapult(
  function __isl_give (line 755) | static __isl_give isl_printer *init_device_catapult(__isl_take isl_print...
  function __isl_give (line 775) | static __isl_give isl_printer *autosa_free_cpu_arrays_catapult(
  function __isl_give (line 860) | static __isl_give isl_printer *clear_device_catapult(__isl_take isl_prin...
  function __isl_give (line 959) | static __isl_give isl_printer *drain_merge_catapult(
  function __isl_give (line 993) | static __isl_give isl_printer *copy_array_to_device_catapult(
  function __isl_give (line 1091) | static __isl_give isl_printer *copy_array_from_device_catapult(
  function __isl_give (line 1219) | static __isl_give isl_printer *print_device_node_catapult(__isl_take isl...
  function __isl_give (line 1278) | static __isl_give isl_printer *print_host_user_catapult(__isl_take isl_p...
  function __isl_give (line 1352) | static __isl_give isl_printer *print_module_core_header_catapult(
  function __isl_give (line 1383) | static __isl_give isl_printer *print_module_var_catapult(
  function __isl_give (line 1461) | static __isl_give isl_printer *print_module_vars_catapult(
  function __isl_give (line 1477) | static __isl_give isl_printer *print_for_with_pipeline(
  function __isl_give (line 1490) | static __isl_give isl_printer *print_for_with_unroll(
  function __isl_give (line 1503) | static __isl_give isl_printer *print_for_with_guard(
  function __isl_give (line 1630) | static __isl_give isl_printer *print_for_catapult(__isl_take isl_printer...
  function __isl_give (line 1706) | static __isl_give isl_printer *print_module_fields_catapult(
  function __isl_give (line 1769) | static __isl_give isl_printer *print_module_core_headers_catapult(
  function __isl_give (line 1827) | static __isl_give isl_printer *autosa_print_serialize_module(
  function __isl_give (line 1878) | static __isl_give isl_printer *autosa_print_default_module(
  function __isl_give (line 1969) | static __isl_give isl_printer *autosa_print_inter_trans_module(
  function __isl_give (line 2023) | static __isl_give isl_printer *autosa_print_intra_trans_module(
  function __isl_give (line 2085) | static __isl_give isl_printer *print_local_array_struct(
  function __isl_give (line 2130) | static __isl_give isl_printer *autosa_print_host_code(__isl_take isl_pri...
  function __isl_give (line 2211) | static __isl_give isl_printer *print_top_module_headers_catapult(
  function __isl_give (line 2252) | static __isl_give isl_printer *print_top_module_call_stmt(
  function __isl_give (line 2276) | static __isl_give isl_printer *print_top_module_call_inst(
  function __isl_give (line 2355) | static __isl_give isl_printer *print_top_module_fifo_stmt(__isl_take isl...
  function print_top_gen_host_code (line 2381) | static void print_top_gen_host_code(
  function print_tcl_code (line 2718) | static void print_tcl_code(
  function __isl_give (line 3019) | static __isl_give isl_printer *print_hw(
  function generate_autosa_catapult_hls_c (line 3048) | int generate_autosa_catapult_hls_c(isl_ctx *ctx, struct ppcg_options *op...

FILE: src/autosa_catapult_hls_c.h
  type ppcg_options (line 13) | struct ppcg_options

FILE: src/autosa_codegen.cpp
  type autosa_array_ref_group (line 15) | struct autosa_array_ref_group
  function __isl_give (line 52) | static __isl_give isl_multi_aff *parameter_vector(__isl_take isl_space *...
  function __isl_give (line 105) | static __isl_give isl_union_set *set_schedule_ge(
  function __isl_give (line 151) | static __isl_give isl_union_set *set_schedule_le(
  function __isl_give (line 194) | static __isl_give isl_multi_val *construct_band_tiles_sizes(
  function __isl_give (line 215) | static __isl_give isl_union_set *set_schedule_modulo(
  function init_suffix (line 260) | static void init_suffix(struct autosa_hw_module *module,
  function __isl_give (line 336) | static __isl_give isl_union_set *schedule_eq_lb(
  function __isl_give (line 414) | static __isl_give isl_union_set *schedule_neq_lb(
  function __isl_give (line 434) | static __isl_give isl_union_set *schedule_eq_ub(
  function __isl_give (line 479) | static __isl_give isl_union_set *schedule_neq_ub(
  type add_io_copies_stmt_acc_data (line 499) | struct add_io_copies_stmt_acc_data
    type autosa_kernel (line 501) | struct autosa_kernel
    type autosa_array_ref_group (line 502) | struct autosa_array_ref_group
    type autosa_stmt_access (line 503) | struct autosa_stmt_access
    type autosa_array_tile (line 504) | struct autosa_array_tile
    type autosa_hw_module (line 509) | struct autosa_hw_module
  function __isl_give (line 518) | static __isl_give isl_multi_aff *autosa_create_io_access_stmt(
  function isl_bool (line 560) | static isl_bool is_acc_stride_one_at_node(
  function __isl_give (line 586) | static __isl_give isl_schedule_node *add_io_copies_stmt_acc_single(
  function __isl_give (line 835) | static __isl_give isl_schedule_node *modify_simd_loop(
  function __isl_give (line 877) | __isl_give isl_schedule_node *add_io_copies_stmt_acc(
  function __isl_give (line 922) | static __isl_give isl_schedule_node *add_io_copies_stmt_tile(
  function __isl_give (line 1104) | static __isl_give isl_schedule_node *add_io_ids_filter(
  function __isl_give (line 1160) | static __isl_give isl_printer *print_io_stmt_prefix(
  function __isl_give (line 1208) | static __isl_give isl_printer *print_io_trans_stmt_prefix(
  function __isl_give (line 1252) | static __isl_give isl_printer *print_trans_stmt_coalesce(
  function __isl_give (line 1294) | static __isl_give isl_union_set *compute_io_group_access_domain(
  function __isl_give (line 1329) | static __isl_give isl_schedule_node *insert_io_group_access_domain(
  function __isl_give (line 1341) | static __isl_give isl_union_set *compute_io_group_access_domain_local_re...
  function __isl_give (line 1387) | static __isl_give isl_schedule_node *insert_io_group_access_domain_local...
  function __isl_give (line 1403) | __isl_give isl_schedule_node *insert_io_group_domain(
  function __isl_give (line 1420) | static __isl_give isl_union_set *compute_io_group_domain(
  function __isl_give (line 1444) | static __isl_give isl_union_set *compute_io_group_domain_at_level(
  function __isl_give (line 1471) | static __isl_give isl_union_set *extend_io_group_domain(
  function __isl_give (line 1519) | static __isl_give isl_schedule_node *insert_io_stmts_acc(
  function __isl_give (line 1549) | static __isl_give isl_schedule_node *insert_io_stmts_tile(
  function __isl_give (line 1610) | static __isl_give isl_schedule_node *insert_filter_trans_stmts(
  function get_local_reduce_sched_depth (line 1721) | static int get_local_reduce_sched_depth(
  function __isl_give (line 1755) | static __isl_give isl_schedule *generate_io_module_inter_trans(
  function __isl_give (line 1894) | static __isl_give isl_schedule_node *insert_io_group_guard(
  function __isl_give (line 1932) | static __isl_give isl_set *get_io_group_guard(
  function __isl_give (line 1963) | static __isl_give isl_schedule *generate_io_module_intra_trans(
  function create_io_module_var (line 2130) | static void create_io_module_var(isl_ctx *ctx,
  function isl_stat (line 2174) | static isl_stat create_io_module_vars(
  function __isl_give (line 2193) | static __isl_give isl_schedule *generate_io_module_outer(
  function __isl_give (line 2454) | static __isl_give struct autosa_hw_module *generate_filter_buffer_io_mod...
  type drain_merge_stmt_acc_data (line 2582) | struct drain_merge_stmt_acc_data
    type autosa_kernel (line 2584) | struct autosa_kernel
    type autosa_array_ref_group (line 2585) | struct autosa_array_ref_group
    type autosa_stmt_access (line 2586) | struct autosa_stmt_access
  function __isl_give (line 2589) | static __isl_give isl_multi_aff *autosa_create_drain_merge_stmt(
  function __isl_give (line 2615) | static __isl_give isl_schedule_node *add_drain_merge_stmt_acc_single(
  function __isl_give (line 2717) | static __isl_give isl_schedule_node *add_drain_merge_stmt_acc(
  function __isl_give (line 2733) | static __isl_give struct autosa_drain_merge_func *generate_drain_merge_f...
  type add_serialize_stmt_acc_data (line 2817) | struct add_serialize_stmt_acc_data
    type autosa_array_ref_group (line 2819) | struct autosa_array_ref_group
    type autosa_stmt_access (line 2820) | struct autosa_stmt_access
    type autosa_kernel (line 2821) | struct autosa_kernel
    type autosa_array_tile (line 2822) | struct autosa_array_tile
    type autosa_hw_module (line 2825) | struct autosa_hw_module
  function __isl_give (line 2828) | static __isl_give isl_schedule_node *add_serialize_stmt_acc_single(
  function __isl_give (line 2927) | static __isl_give isl_schedule_node *add_serialize_stmt_acc(
  function __isl_give (line 2950) | static __isl_give isl_schedule_node *add_serialize_stmt_tile(
  function __isl_give (line 3046) | static __isl_give isl_schedule *generate_serialize_schedule(
  function __isl_give (line 3149) | static __isl_give isl_schedule_node *update_io_module_context(
  function isl_stat (line 3206) | static isl_stat generate_default_io_module_schedule(
  function __isl_give (line 3462) | static __isl_give struct autosa_hw_module *generate_default_io_module(
  function __isl_give (line 3492) | static __isl_give struct autosa_hw_module *generate_io_module_by_type(
  function update_serialize_data_pack (line 3515) | static int update_serialize_data_pack(struct autosa_gen *gen, struct aut...
  function __isl_give (line 3585) | static __isl_give struct autosa_hw_module **sa_io_module_gen(
  function __isl_give (line 3826) | static __isl_give isl_schedule_node *split_band(
  function __isl_give (line 3857) | static __isl_give isl_multi_pw_aff *extract_sa_grid_size(
  type autosa_add_pe_ext_io_copies_data (line 3898) | struct autosa_add_pe_ext_io_copies_data
    type autosa_kernel (line 3900) | struct autosa_kernel
    type autosa_array_ref_group (line 3901) | struct autosa_array_ref_group
    type autosa_array_ref_group (line 3902) | struct autosa_array_ref_group
    type autosa_stmt_access (line 3903) | struct autosa_stmt_access
  type autosa_array_ref_group (line 3913) | struct autosa_array_ref_group
  type autosa_local_array_info (line 3914) | struct autosa_local_array_info
  type autosa_array_ref_group (line 3915) | struct autosa_array_ref_group
  type autosa_stmt_access (line 3916) | struct autosa_stmt_access
  type autosa_array_ref_group (line 3926) | struct autosa_array_ref_group
  function isl_bool (line 3938) | static isl_bool leaf_node_is_extended(__isl_keep isl_schedule_node *node)
  function __isl_give (line 3995) | __isl_give isl_schedule_node *add_pe_ext_io_copies_stmt(
  function __isl_give (line 4224) | static __isl_give isl_schedule_node *add_pe_ext_io_copies(
  function __isl_give (line 4254) | __isl_give isl_schedule_node *add_pe_int_io_copies(
  function isl_bool (line 4393) | static isl_bool find_latency_mark(__isl_keep isl_schedule_node *node, vo...
  function __isl_give (line 4415) | static __isl_give isl_schedule_node *insert_pipeline_mark(
  function __isl_give (line 4454) | static __isl_give isl_schedule_node *tile_simd_sparse(
  function __isl_give (line 4512) | static __isl_give isl_schedule_node *insert_unroll_mark(
  function __isl_give (line 4550) | static __isl_give isl_schedule_node *insert_context(struct autosa_kernel...
  function create_pe_module_var (line 4569) | static void create_pe_module_var(isl_ctx *ctx,
  function isl_stat (line 4631) | static isl_stat create_pe_module_vars(struct autosa_hw_module *module,
  function __isl_give (line 4683) | static __isl_give isl_schedule_node *add_pe_ext_io_copies_dummy(
  function __isl_give (line 4720) | static __isl_give isl_schedule *pe_module_dummy_gen(struct autosa_gen *gen,
  function __isl_give (line 4801) | static __isl_give struct autosa_hw_module *sa_pe_module_gen(struct autos...
  function __isl_give (line 5004) | static __isl_give struct autosa_hw_module **hw_module_reorder(
  function __isl_give (line 5058) | static __isl_give isl_schedule *pe_dummy_gen_module_call(struct autosa_g...
  function isl_stat (line 5245) | static isl_stat top_module_pe_gen_module_call(struct autosa_gen *gen,
  function isl_stat (line 5351) | static isl_stat top_module_pe_gen_fifo_decl(struct autosa_gen *gen,
  function isl_stat (line 5519) | static isl_stat top_module_pe_gen(struct autosa_gen *gen,
  function __isl_give (line 5539) | static __isl_give isl_schedule_node *io_gen_module_call(
  function __isl_give (line 5764) | static __isl_give isl_schedule_node *io_gen_ext_module(
  function isl_stat (line 5835) | static isl_stat top_module_io_gen_ext_module(
  function isl_stat (line 6023) | static isl_stat top_module_io_gen_module_call(
  function isl_stat (line 6186) | static isl_stat top_module_io_gen_fifo_decl(struct autosa_gen *gen,
  function isl_stat (line 6330) | static isl_stat top_module_io_gen(struct autosa_gen *gen,
  function __isl_give (line 6362) | __isl_give struct autosa_hw_top_module *sa_top_module_gen(struct autosa_...
  function generate_hw_modules (line 6395) | void generate_hw_modules(__isl_take isl_schedule *schedule,
  function __isl_give (line 6482) | static __isl_give isl_union_map *approximate_copy_out(
  type ppcg_may_persist_data (line 6528) | struct ppcg_may_persist_data
  function update_may_persist_at_band (line 6545) | static int update_may_persist_at_band(__isl_keep isl_schedule_node *node,
  function __isl_give (line 6576) | static __isl_give isl_union_set *expand_and_tag(
  function filter_flow (line 6594) | static int filter_flow(__isl_keep isl_schedule_node *node,
  function __isl_give (line 6614) | static __isl_give isl_union_set *add_previous_filters(
  function __isl_give (line 6638) | static __isl_give isl_union_set *add_next_filters(
  function remove_external_flow (line 6665) | static void remove_external_flow(struct ppcg_may_persist_data *data,
  function update_may_persist_at_filter (line 6692) | static int update_may_persist_at_filter(__isl_keep isl_schedule_node *node,
  function isl_stat (line 6729) | static isl_stat update_may_persist_at(__isl_keep isl_schedule_node *node,
  function __isl_give (line 6795) | static __isl_give isl_union_set *node_may_persist(
  function __isl_give (line 6843) | static __isl_give isl_union_set *extract_local_accesses(struct autosa_pr...
  function __isl_give (line 6902) | static __isl_give isl_union_set_list *create_copy_filters(struct autosa_...
  function __isl_give (line 6964) | __isl_give isl_set *autosa_array_positive_size_guard(struct autosa_array...
  function __isl_give (line 7001) | static __isl_give isl_schedule_node *insert_positive_size_guards(
  function __isl_give (line 7047) | static __isl_give isl_schedule_node *create_copy_device(struct autosa_pr...
  function __isl_give (line 7119) | __isl_give isl_schedule_node *sa_add_to_from_device(
  function __isl_give (line 7204) | __isl_give isl_schedule_node *sa_add_init_clear_device(
  function __isl_give (line 7236) | __isl_give isl_schedule_node *sa_add_drain_merge(
  type autosa_at_domain_data (line 7272) | struct autosa_at_domain_data
    type autosa_prog (line 7274) | struct autosa_prog
    type autosa_kernel (line 7275) | struct autosa_kernel
    type autosa_hw_module (line 7276) | struct autosa_hw_module
    type autosa_hw_top_module (line 7277) | struct autosa_hw_top_module
    type autosa_pe_dummy_module (line 7278) | struct autosa_pe_dummy_module
    type autosa_drain_merge_func (line 7279) | struct autosa_drain_merge_func
  type autosa_transform_data (line 7318) | struct autosa_transform_data
    type autosa_kernel (line 7320) | struct autosa_kernel
    type autosa_stmt_access (line 7321) | struct autosa_stmt_access
    type autosa_array_info (line 7325) | struct autosa_array_info
    type autosa_local_array_info (line 7328) | struct autosa_local_array_info
    type autosa_array_ref_group (line 7329) | struct autosa_array_ref_group
  function isl_bool (line 7335) | static isl_bool update_depth(__isl_keep isl_schedule_node *node, void *u...
  function __isl_give (line 7359) | static __isl_give isl_pw_multi_aff *compute_sched_to_copy(
  type autosa_stmt_access (line 7381) | struct autosa_stmt_access
  type autosa_stmt_access (line 7381) | struct autosa_stmt_access
  type autosa_stmt_access (line 7384) | struct autosa_stmt_access
  function find_array_index (line 7411) | static int find_array_index(struct autosa_kernel *kernel, const char *name)
  type autosa_array_ref_group (line 7426) | struct autosa_array_ref_group
  type autosa_local_array_info (line 7427) | struct autosa_local_array_info
  type autosa_stmt_access (line 7427) | struct autosa_stmt_access
  type autosa_array_ref_group (line 7433) | struct autosa_array_ref_group
  function __isl_give (line 7453) | static __isl_give isl_pw_multi_aff *compute_sched_to_copy_group(
  function __isl_give (line 7500) | static __isl_give isl_multi_pw_aff *tile_outer(
  function __isl_give (line 7575) | static __isl_give isl_multi_pw_aff *transform_index(
  function __isl_give (line 7667) | static __isl_give isl_ast_expr *dereference(__isl_take isl_ast_expr *expr)
  function __isl_give (line 7735) | __isl_give isl_ast_expr *autosa_local_array_info_linearize_index(
  function __isl_give (line 7805) | static __isl_give isl_ast_expr *transform_expr(__isl_take isl_ast_expr *...
  function __isl_give (line 7845) | static __isl_give isl_ast_node *create_domain_leaf(
  function autosa_array_requires_device_allocation (line 7901) | int autosa_array_requires_device_allocation(struct autosa_array_info *ar...
  function __isl_give (line 7916) | static __isl_give isl_ast_node *build_array_bounds(
  function __isl_give (line 7992) | static __isl_give isl_ast_node *create_access_leaf(struct autosa_kernel ...
  function __isl_give (line 8067) | static __isl_give isl_ast_node *at_domain(__isl_take isl_ast_node *node,
  function isl_stat (line 8111) | static isl_stat build_grid_size(struct autosa_kernel *kernel,
  function isl_stat (line 8129) | static isl_stat build_local_array_sizes(struct autosa_kernel *kernel,
  function isl_stat (line 8153) | static isl_stat build_grid_and_local_array_sizes(struct autosa_kernel *k...
  function isl_stat (line 8170) | static isl_stat before_mark(__isl_keep isl_id *mark,
  function __isl_give (line 8197) | static __isl_give isl_ast_node *after_mark(__isl_take isl_ast_node *node,
  function __isl_give (line 8238) | __isl_give isl_ast_node *sa_generate_code(struct autosa_gen *gen,
  function autosa_at_domain_data_init (line 8272) | static void autosa_at_domain_data_init(
  type autosa_array_ref_group (line 8296) | struct autosa_array_ref_group
  type autosa_local_array_info (line 8297) | struct autosa_local_array_info
  type autosa_stmt_access (line 8297) | struct autosa_stmt_access
  type autosa_array_ref_group (line 8303) | struct autosa_array_ref_group
  function __isl_give (line 8354) | static __isl_give isl_multi_pw_aff *transform_index_module(
  function __isl_give (line 8459) | static __isl_give isl_ast_expr *transform_expr_module(__isl_take isl_ast...
  function __isl_give (line 8529) | static __isl_give isl_ast_node *create_domain_leaf_module(
  function extract_autosa_stmt_int_field (line 8619) | static int extract_autosa_stmt_int_field(
  function __isl_give (line 8670) | static __isl_give char *extract_autosa_stmt_str_field(
  function __isl_give (line 8709) | static __isl_give isl_ast_node *create_serialize_leaf(struct autosa_kern...
  function __isl_give (line 8789) | static __isl_give isl_ast_node *create_io_leaf(struct autosa_kernel *ker...
  function __isl_give (line 9035) | static __isl_give isl_ast_node *create_drain_merge_leaf(struct autosa_ke...
  function __isl_give (line 9147) | static __isl_give isl_ast_node *create_ext_module_leaf(
  function __isl_give (line 9208) | static __isl_give isl_ast_node *create_module_call_leaf(
  function __isl_give (line 9332) | static __isl_give isl_ast_node *create_fifo_decl_leaf(
  function __isl_give (line 9384) | static __isl_give isl_ast_node *create_io_module_call_leaf(
  function __isl_give (line 9434) | static __isl_give isl_ast_node *at_domain_module(__isl_take isl_ast_node...
  function isl_stat (line 9529) | static isl_stat before_mark_module(__isl_keep isl_id *mark,
  function __isl_give (line 9585) | static __isl_give isl_ast_node *after_mark_module(__isl_take isl_ast_nod...
  function __isl_give (line 9789) | static __isl_give isl_id *before_for_module(
  function __isl_give (line 9827) | static __isl_give isl_ast_node *after_for_module(
  function __isl_give (line 9853) | static __isl_give isl_ast_node *autosa_generate_ast_from_schedule(
  type loop_infinitize_check_data (line 9888) | struct loop_infinitize_check_data
    type autosa_hw_module (line 9892) | struct autosa_hw_module
  type iterator_used_data (line 9899) | struct iterator_used_data
    type autosa_hw_module (line 9903) | struct autosa_hw_module
  function isl_bool (line 9909) | static isl_bool search_expr_id(__isl_keep isl_ast_expr *expr, __isl_keep...
  type search_id_to_expr_id_data (line 9938) | struct search_id_to_expr_id_data
  function isl_stat (line 9944) | isl_stat search_id_to_expr_id(__isl_take isl_id *key,
  function isl_bool (line 9955) | static isl_bool iterator_used(__isl_keep isl_ast_node *node, void *user)
  function isl_bool (line 10115) | static isl_bool loop_infinitize_check(__isl_keep isl_ast_node *node, voi...
  function loop_infinitization_optimize (line 10227) | static void loop_infinitization_optimize(struct autosa_hw_module *module)
  function isl_bool (line 10248) | static isl_bool update_for_visit(__isl_keep isl_ast_node *node, void *user)
  type count_loop_data (line 10270) | struct count_loop_data {
  function isl_bool (line 10281) | static isl_bool count_loop(__isl_keep isl_ast_node *node, void *user)
  type loop_coalesce_update_data (line 10312) | struct loop_coalesce_update_data {
  function isl_bool (line 10317) | static isl_bool update_latency_coalesce(__isl_keep isl_ast_node *node, v...
  function isl_bool (line 10360) | static isl_bool loop_coalesce_update(__isl_keep isl_ast_node *node, void...
  function loop_coalesce_optimize (line 10414) | static void loop_coalesce_optimize(struct autosa_hw_module *module)
  type loop_guards_update_data (line 10456) | struct loop_guards_update_data {
    type autosa_hw_module (line 10459) | struct autosa_hw_module
    type autosa_ast_node_userinfo (line 10467) | struct autosa_ast_node_userinfo
  function isl_bool (line 10481) | static isl_bool loop_guards_update(__isl_keep isl_ast_node *node, void *...
  function isl_bool (line 10553) | static isl_bool loop_pipeline_update(__isl_keep isl_ast_node *node, void...
  function loop_guards_optimize (line 10593) | static void loop_guards_optimize(struct autosa_hw_module *module)
  function __isl_give (line 10715) | static __isl_give isl_schedule_node *delete_marker_catapult(
  function isl_stat (line 10747) | isl_stat sa_filter_buffer_io_module_generate_code(struct autosa_gen *gen,
  function isl_stat (line 10899) | isl_stat sa_host_serialize_generate_code(struct autosa_gen *gen,
  function isl_stat (line 10921) | isl_stat sa_module_generate_code(struct autosa_gen *gen,
  function isl_stat (line 11007) | isl_stat sa_drain_merge_generate_code(struct autosa_gen *gen,
  function __isl_give (line 11030) | static __isl_give isl_ast_node *after_mark_fifo_decl(
  function __isl_give (line 11082) | __isl_give isl_ast_node *sa_fifo_decl_generate_code(
  function __isl_give (line 11126) | static __isl_give isl_ast_node *after_mark_module_call(
  function __isl_give (line 11178) | __isl_give isl_ast_node *sa_module_call_generate_code(
  function __isl_give (line 11224) | static __isl_give isl_ast_node *after_mark_ext_module(
  function __isl_give (line 11277) | __isl_give isl_ast_node *sa_set_ext_module_args_generate_code(
  function isl_stat (line 11317) | isl_stat sa_top_module_generate_code(struct autosa_gen *gen)
  type ppcg_stmt (line 11369) | struct ppcg_stmt {
    type pet_stmt (line 11370) | struct pet_stmt
  function __isl_give (line 11375) | static __isl_give isl_printer *print_user(__isl_take isl_printer *p,
  type pet_stmt (line 11416) | struct pet_stmt
  type ppcg_scop (line 11416) | struct ppcg_scop
  type pet_stmt (line 11421) | struct pet_stmt
  function __isl_give (line 11444) | static __isl_give isl_multi_pw_aff *pullback_index(
  function ppcg_stmt_free (line 11453) | static void ppcg_stmt_free(void *user)
  function __isl_give (line 11470) | static __isl_give isl_ast_node *at_each_domain(__isl_take isl_ast_node *...
  function print_code (line 11516) | void print_code(struct autosa_gen *gen, __isl_take isl_schedule *schedul...
  function dump_intermediate_code (line 11551) | void dump_intermediate_code(

FILE: src/autosa_codegen.h
  type autosa_gen (line 10) | struct autosa_gen
  type autosa_kernel (line 10) | struct autosa_kernel
  type autosa_prog (line 14) | struct autosa_prog
  type autosa_kernel (line 16) | struct autosa_kernel
  type autosa_gen (line 18) | struct autosa_gen
  type autosa_gen (line 20) | struct autosa_gen
  type autosa_gen (line 22) | struct autosa_gen
  type autosa_hw_module (line 23) | struct autosa_hw_module
  type autosa_gen (line 24) | struct autosa_gen
  type autosa_hw_module (line 25) | struct autosa_hw_module
  type autosa_gen (line 26) | struct autosa_gen
  type autosa_gen (line 27) | struct autosa_gen
  type autosa_drain_merge_func (line 28) | struct autosa_drain_merge_func
  type autosa_gen (line 29) | struct autosa_gen
  type autosa_hw_module (line 30) | struct autosa_hw_module
  type autosa_array_info (line 32) | struct autosa_array_info
  type autosa_array_ref_group (line 36) | struct autosa_array_ref_group
  type autosa_kernel (line 37) | struct autosa_kernel
  type autosa_gen (line 38) | struct autosa_gen
  type autosa_gen (line 41) | struct autosa_gen
  type autosa_gen (line 43) | struct autosa_gen

FILE: src/autosa_comm.cpp
  type autosa_group_data (line 13) | struct autosa_group_data
    type autosa_gen (line 15) | struct autosa_gen
    type ppcg_scop (line 16) | struct ppcg_scop
  function __isl_give (line 50) | static __isl_give isl_union_map *prefix_with_equalities(
  function isl_union_map (line 65) | static isl_union_map *expand(__isl_take isl_union_map *s,
  function populate_array_references_pe (line 81) | static int populate_array_references_pe(struct autosa_local_array_info *...
  type autosa_array_ref_group (line 149) | struct autosa_array_ref_group
  type autosa_array_ref_group (line 150) | struct autosa_array_ref_group
  type autosa_array_ref_group (line 151) | struct autosa_array_ref_group
  type autosa_array_ref_group (line 155) | struct autosa_array_ref_group
  type autosa_stmt_access (line 189) | struct autosa_stmt_access
  type autosa_stmt_access (line 199) | struct autosa_stmt_access
  type autosa_stmt_access (line 200) | struct autosa_stmt_access
  type autosa_array_ref_group (line 230) | struct autosa_array_ref_group
  type autosa_array_ref_group (line 231) | struct autosa_array_ref_group
  type autosa_array_ref_group (line 232) | struct autosa_array_ref_group
  type autosa_array_ref_group (line 234) | struct autosa_array_ref_group
  function set_array_groups_default (line 242) | static void set_array_groups_default(struct autosa_local_array_info *array,
  function group_array_references_default (line 257) | static int group_array_references_default(struct autosa_kernel *kernel,
  function __isl_give (line 312) | __isl_give isl_union_map *autosa_array_ref_group_access_relation(
  function __isl_give (line 337) | static __isl_give isl_map *local_access_pe(struct autosa_array_ref_group...
  function isl_bool (line 366) | static isl_bool detect_strides(struct autosa_array_tile *tile,
  function __isl_give (line 408) | static __isl_give isl_map *remove_strides(__isl_take isl_map *access,
  function isl_bool (line 449) | isl_bool can_tile(__isl_keep isl_map *access,
  type check_contraction_data (line 494) | struct check_contraction_data {
    type autosa_array_ref_group (line 496) | struct autosa_array_ref_group
    type autosa_kernel (line 497) | struct autosa_kernel
  type check_stmt_contain_acc_data (line 503) | struct check_stmt_contain_acc_data {
    type autosa_kernel (line 504) | struct autosa_kernel
    type autosa_array_ref_group (line 505) | struct autosa_array_ref_group
  function isl_bool (line 511) | static isl_bool check_stmt_contain_acc(__isl_keep isl_set *set, void *user)
  function __isl_give (line 546) | static __isl_give isl_schedule_node *check_contraction(
  function isl_stat (line 669) | static isl_stat compute_group_bounds_core_pe(struct autosa_kernel *kernel,
  type compute_local_tile_acc_data (line 760) | struct compute_local_tile_acc_data
    type autosa_kernel (line 762) | struct autosa_kernel
    type autosa_array_ref_group (line 763) | struct autosa_array_ref_group
  function __isl_give (line 777) | static __isl_give isl_schedule_node *compute_local_tile_acc(
  function isl_stat (line 847) | static isl_stat compute_group_bounds_core_pe_acc(struct autosa_kernel *k...
  function compute_group_bounds_pe (line 934) | static int compute_group_bounds_pe(struct autosa_kernel *kernel,
  function compute_group_bounds_pe_acc (line 949) | static int compute_group_bounds_pe_acc(struct autosa_kernel *kernel,
  function set_array_groups_pe (line 964) | static void set_array_groups_pe(struct autosa_local_array_info *array,
  function group_array_references_pe (line 986) | static int group_array_references_pe(struct autosa_kernel *kernel,
  function populate_array_references_io (line 1093) | static int populate_array_references_io(struct autosa_local_array_info *...
  function share_io (line 1175) | static int share_io(struct autosa_array_ref_group *group1,
  function group_io (line 1199) | static int group_io(struct autosa_kernel *kernel,
  function group_share_io (line 1237) | static int group_share_io(struct autosa_kernel *kernel,
  function isl_stat (line 1249) | static isl_stat autosa_interior_io_eliminate(
  function __isl_give (line 1298) | static __isl_give isl_schedule_node *io_cluster(
  function isl_stat (line 1393) | static isl_stat extract_set_max_dim(__isl_take isl_basic_set *bset, void...
  function __isl_give (line 1416) | static __isl_give isl_schedule_node *insert_io_module_context(
  function __isl_give (line 1474) | static __isl_give isl_schedule_node *hbm_optimize(
  function isl_bool (line 1656) | static isl_bool internal_group_in_out_overlap(
  function isl_bool (line 1776) | static isl_bool io_group_carried_by_array_loops(
  function isl_bool (line 1876) | static isl_bool is_inter_pe_comm_valid(
  function isl_bool (line 1937) | isl_bool is_io_module_valid(
  function isl_stat (line 2014) | static isl_stat compute_io_group_schedule(
  function __isl_give (line 2259) | static __isl_give isl_map *local_access_io_at_node(struct autosa_kernel ...
  function isl_stat (line 2291) | isl_stat compute_group_bounds_drain_at_node(struct autosa_kernel *kernel,
  function autosa_array_ref_group_type (line 2344) | enum autosa_group_access_type autosa_array_ref_group_type(
  type autosa_array_tile (line 2356) | struct autosa_array_tile
  type autosa_array_ref_group (line 2357) | struct autosa_array_ref_group
  function autosa_cpu_array_ref_group_type (line 2373) | enum autosa_group_access_type autosa_cpu_array_ref_group_type(
  function __isl_give (line 2402) | static __isl_give isl_multi_aff *strided_tile(
  function __isl_give (line 2447) | __isl_give isl_printer *autosa_array_ref_group_print_name(
  function autosa_array_ref_group_compute_tiling (line 2498) | void autosa_array_ref_group_compute_tiling(
  function isl_stat (line 2552) | static isl_stat compute_group_bounds_drain_at_node_PE(
  function isl_stat (line 2601) | static isl_stat compute_drain_tiling_at_PE(struct autosa_kernel *kernel,
  function isl_stat (line 2622) | isl_stat compute_group_bounds_io_at_node(struct autosa_kernel *kernel,
  function isl_stat (line 2671) | isl_stat compute_group_bounds_io_at_node_PE(
  function isl_stat (line 2720) | static isl_stat compute_io_tiling_at_PE(struct autosa_kernel *kernel,
  function __isl_give (line 2739) | static __isl_give isl_schedule_node *insert_io_module_ids(
  function isl_stat (line 2798) | static isl_stat compute_io_group_buffer(struct autosa_kernel *kernel,
  function tile_adjust_depth (line 2916) | static int tile_adjust_depth(struct autosa_array_tile *tile, int depth)
  function compute_tile_depth (line 2947) | static int compute_tile_depth(struct autosa_group_data *data,
  function isl_stat (line 2982) | static isl_stat tile_set_depth(struct autosa_group_data *data,
  type update_group_simd_data (line 2992) | struct update_group_simd_data
    type autosa_array_ref_group (line 2994) | struct autosa_array_ref_group
    type autosa_kernel (line 2995) | struct autosa_kernel
  function isl_bool (line 3003) | static isl_bool update_group_simd(__isl_keep isl_schedule_node *node, vo...
  function isl_stat (line 3067) | static isl_stat compute_io_group_data_pack_sparse(
  function isl_stat (line 3186) | static isl_stat compute_io_group_data_pack(struct autosa_kernel *kernel,
  function isl_stat (line 3395) | static isl_stat hoist_L1_io_buffer_local_reduce(
  type update_int_io_L1_buffer_data (line 3445) | struct update_int_io_L1_buffer_data {
    type autosa_array_ref_group (line 3446) | struct autosa_array_ref_group
    type autosa_kernel (line 3447) | struct autosa_kernel
  function __isl_give (line 3453) | static __isl_give isl_schedule_node *update_int_io_L1_depth(__isl_take i...
  function __isl_give (line 3540) | static __isl_give isl_schedule_node *update_int_io_L1_buffer(
  function __isl_give (line 3697) | static __isl_give isl_schedule_node *insert_io_L1_mark(
  function __isl_give (line 3721) | static __isl_give isl_schedule *generate_io_L1_lower_schedule(
  function isl_stat (line 3770) | static isl_stat lower_int_io_L1_buffer(
  function isl_stat (line 3811) | static isl_stat insert_L2_io_buffer(
  function isl_stat (line 3839) | static isl_stat hoist_L1_io_buffer(
  function isl_stat (line 3951) | static isl_stat hoist_L2_io_buffer(
  function __isl_give (line 4062) | static __isl_give isl_union_map *get_io_schedule_at_level(
  function __isl_give (line 4086) | static __isl_give isl_map *local_access_io(struct autosa_array_ref_group...
  function isl_stat (line 4118) | static isl_stat compute_group_bounds_core_io(struct autosa_kernel *kernel,
  function compute_group_bounds_io (line 4173) | static int compute_group_bounds_io(struct autosa_kernel *kernel,
  function set_array_groups_io (line 4189) | static void set_array_groups_io(struct autosa_local_array_info *array,
  function group_array_references_io (line 4212) | static int group_array_references_io(struct autosa_kernel *kernel,
  type extract_access_waw_domain_data (line 4260) | struct extract_access_waw_domain_data
    type autosa_stmt_access (line 4262) | struct autosa_stmt_access
  function extract_access_waw_domain (line 4270) | static void extract_access_waw_domain(__isl_keep isl_basic_map *dep, voi...
  function isl_bool (line 4304) | static isl_bool extract_access_waw_domain_wrap(__isl_keep isl_map *map, ...
  function isl_stat (line 4322) | static isl_stat compute_group_bounds_core_drain(struct autosa_kernel *ke...
  function compute_group_bounds_drain (line 4376) | static int compute_group_bounds_drain(struct autosa_kernel *kernel,
  function group_array_references_drain (line 4393) | static int group_array_references_drain(struct autosa_kernel *kernel,
  function gcd (line 4512) | static int gcd(int n1, int n2)
  function compute_group_tilings_pe (line 4527) | static void compute_group_tilings_pe(struct autosa_kernel *kernel)
  function compute_group_tilings_io (line 4542) | static void compute_group_tilings_io(struct autosa_kernel *kernel)
  function compute_group_tilings_drain (line 4557) | static void compute_group_tilings_drain(struct autosa_kernel *kernel)
  function isl_stat (line 4571) | static isl_stat autosa_io_clustering(struct autosa_kernel *kernel,
  function isl_stat (line 4590) | static isl_stat autosa_io_buffer_allocate(struct autosa_kernel *kernel,
  function isl_stat (line 4642) | static isl_stat autosa_io_data_pack(struct autosa_kernel *kernel,
  function __isl_give (line 4693) | static __isl_give isl_map *next(__isl_take isl_space *domain_space, int ...
  function explore_loop_permute (line 4732) | static void explore_loop_permute(struct autosa_kernel *kernel, struct au...
  function isl_stat (line 4856) | isl_stat sa_io_construct_optimize(struct autosa_kernel *kernel, struct a...
  function __isl_give (line 5109) | __isl_give isl_union_map *autosa_io_group_ref_access_relation(
  function __isl_give (line 5168) | __isl_give isl_union_map *autosa_drain_group_ref_access_relation(
  function __isl_give (line 5222) | __isl_give isl_union_map *autosa_io_group_access_relation(
  function __isl_give (line 5258) | __isl_give isl_union_map *group_tagged_access_relation(
  function __isl_give (line 5300) | __isl_give isl_union_map *wrapped_reference_to_access(
  function __isl_give (line 5398) | __isl_give isl_union_map *remove_local_accesses(
  function __isl_give (line 5491) | __isl_give isl_union_map *remove_local_accesses_flow(
  function __isl_give (line 5586) | __isl_give isl_union_map *remove_local_accesses_group_flow(
  function __isl_give (line 5614) | __isl_give isl_union_map *remove_local_accesses_group(
  function __isl_give (line 5635) | __isl_give isl_union_map *io_comm_access_ref(
  function __isl_give (line 5674) | __isl_give isl_union_map *io_comm_access(
  function free_group_pair (line 5712) | void free_group_pair(void *user)
  type autosa_array_tile (line 5721) | struct autosa_array_tile
  type autosa_array_ref_group (line 5723) | struct autosa_array_ref_group
  type autosa_stmt_access (line 5724) | struct autosa_stmt_access
  type autosa_array_tile (line 5731) | struct autosa_array_tile
  function __isl_give (line 5752) | static __isl_give isl_set *array_extent(struct autosa_array_info *array)
  function __isl_give (line 5814) | __isl_give isl_map *group_tile(struct autosa_array_ref_group *group)
  function __isl_give (line 5868) | __isl_give isl_map *group_tile_buffer(struct autosa_array_ref_group *group,
  function get_io_group_n_lane (line 5910) | int get_io_group_n_lane(struct autosa_hw_module *module,
  function __isl_give (line 5949) | static __isl_give isl_multi_aff *strided_tile_depth(
  function __isl_give (line 5995) | __isl_give isl_multi_aff *autosa_array_ref_group_recompute_tiling(
  function print_io_grouping_info (line 6046) | void print_io_grouping_info(FILE *fp, struct autosa_kernel *kernel)

FILE: src/autosa_comm.h
  type autosa_group_access_type (line 11) | enum autosa_group_access_type
  type autosa_array_ref_group (line 12) | struct autosa_array_ref_group
  type autosa_group_access_type (line 13) | enum autosa_group_access_type
  type autosa_array_ref_group (line 14) | struct autosa_array_ref_group
  type autosa_array_tile (line 15) | struct autosa_array_tile
  type autosa_array_ref_group (line 16) | struct autosa_array_ref_group
  type autosa_array_ref_group (line 18) | struct autosa_array_ref_group
  type autosa_array_ref_group (line 20) | struct autosa_array_ref_group
  type autosa_stmt_access (line 21) | struct autosa_stmt_access
  type autosa_array_ref_group (line 24) | struct autosa_array_ref_group
  type autosa_array_ref_group (line 26) | struct autosa_array_ref_group
  type autosa_kernel (line 27) | struct autosa_kernel
  type autosa_array_ref_group (line 30) | struct autosa_array_ref_group
  type autosa_stmt_access (line 31) | struct autosa_stmt_access
  type autosa_array_ref_group (line 34) | struct autosa_array_ref_group
  type autosa_prog (line 36) | struct autosa_prog
  type autosa_prog (line 42) | struct autosa_prog
  type autosa_kernel (line 46) | struct autosa_kernel
  type autosa_array_ref_group (line 46) | struct autosa_array_ref_group
  type autosa_kernel (line 50) | struct autosa_kernel
  type autosa_array_ref_group (line 50) | struct autosa_array_ref_group
  type autosa_kernel (line 54) | struct autosa_kernel
  type autosa_array_ref_group (line 55) | struct autosa_array_ref_group
  type autosa_stmt_access (line 56) | struct autosa_stmt_access
  type autosa_kernel (line 59) | struct autosa_kernel
  type autosa_array_ref_group (line 60) | struct autosa_array_ref_group
  type autosa_array_tile (line 62) | struct autosa_array_tile
  type autosa_array_ref_group (line 64) | struct autosa_array_ref_group
  type autosa_stmt_access (line 65) | struct autosa_stmt_access
  type autosa_array_ref_group (line 66) | struct autosa_array_ref_group
  type autosa_array_ref_group (line 67) | struct autosa_array_ref_group
  type autosa_array_tile (line 68) | struct autosa_array_tile
  type autosa_hw_module (line 69) | struct autosa_hw_module
  type autosa_pe_dummy_module (line 70) | struct autosa_pe_dummy_module
  type autosa_array_ref_group (line 71) | struct autosa_array_ref_group
  type autosa_array_tile (line 73) | struct autosa_array_tile
  type autosa_array_ref_group (line 74) | struct autosa_array_ref_group
  type autosa_kernel (line 78) | struct autosa_kernel
  type autosa_array_ref_group (line 79) | struct autosa_array_ref_group
  type autosa_kernel (line 80) | struct autosa_kernel

FILE: src/autosa_common.cpp
  type autosa_kernel (line 14) | struct autosa_kernel
  type autosa_local_array_info (line 41) | struct autosa_local_array_info
  type autosa_kernel (line 76) | struct autosa_kernel
  type autosa_kernel (line 76) | struct autosa_kernel
  type autosa_kernel (line 78) | struct autosa_kernel
  type autosa_kernel (line 78) | struct autosa_kernel
  type autosa_kernel (line 79) | struct autosa_kernel
  type autosa_kernel (line 144) | struct autosa_kernel
  type autosa_kernel (line 146) | struct autosa_kernel
  type autosa_kernel (line 146) | struct autosa_kernel
  type autosa_kernel (line 147) | struct autosa_kernel
  type autosa_kernel (line 197) | struct autosa_kernel
  type ppcg_scop (line 197) | struct ppcg_scop
  type autosa_kernel (line 199) | struct autosa_kernel
  function __isl_give (line 262) | static __isl_give isl_map *same(__isl_take isl_space *domain_space)
  function __isl_give (line 277) | static __isl_give isl_map *next(__isl_take isl_space *domain_space, int ...
  function isl_bool (line 301) | isl_bool access_is_stride_zero(__isl_keep isl_map *access, int pos)
  function isl_bool (line 352) | isl_bool access_is_stride_one(__isl_keep isl_map *access, int pos)
  type autosa_acc (line 400) | struct autosa_acc
  type autosa_io_buffer (line 414) | struct autosa_io_buffer
  type autosa_io_buffer (line 416) | struct autosa_io_buffer
  type autosa_io_buffer (line 416) | struct autosa_io_buffer
  type autosa_io_buffer (line 416) | struct autosa_io_buffer
  function __isl_null (line 461) | __isl_null struct autosa_iter *autosa_iter_free(struct autosa_iter *iter)
  function free_array_info (line 480) | static void free_array_info(struct autosa_prog *prog)
  function is_read_only_scalar (line 506) | static int is_read_only_scalar(struct autosa_array_info *array,
  function __isl_give (line 539) | static __isl_give isl_set *compute_extent(struct pet_array *array,
  function isl_stat (line 582) | static isl_stat collect_references(struct autosa_prog *prog,
  function isl_bool (line 631) | static isl_bool only_fixed_element_accessed(struct autosa_array_info *ar...
  function isl_stat (line 651) | static isl_stat extract_array_info(struct autosa_prog *prog,
  function __isl_give (line 730) | static __isl_give isl_union_map *remove_independences(struct autosa_prog...
  function isl_bool (line 752) | static isl_bool autosa_array_can_be_private(struct autosa_array_info *ar...
  function collect_order_dependences (line 769) | static void collect_order_dependences(struct autosa_prog *prog)
  function isl_stat (line 826) | isl_stat collect_array_info(struct autosa_prog *prog)
  function autosa_array_is_read_only_scalar (line 874) | int autosa_array_is_read_only_scalar(struct autosa_array_info *array)
  function autosa_array_is_scalar (line 884) | int autosa_array_is_scalar(struct autosa_array_info *array)
  function autosa_kernel_requires_array_argument (line 893) | int autosa_kernel_requires_array_argument(struct autosa_kernel *kernel, ...
  type autosa_array_ref_group (line 904) | struct autosa_array_ref_group
  type autosa_array_ref_group (line 905) | struct autosa_array_ref_group
  type autosa_array_ref_group (line 949) | struct autosa_array_ref_group
  type autosa_array_ref_group (line 950) | struct autosa_array_ref_group
  type autosa_array_tile (line 993) | struct autosa_array_tile
  type autosa_array_tile (line 993) | struct autosa_array_tile
  type autosa_array_tile (line 1016) | struct autosa_array_tile
  type autosa_array_tile (line 1019) | struct autosa_array_tile
  function __isl_give (line 1046) | __isl_give isl_val *autosa_array_tile_size(struct autosa_array_tile *tile)
  type autosa_io_info (line 1065) | struct autosa_io_info
  type autosa_stmt (line 1075) | struct autosa_stmt
  type autosa_stmt_access (line 1084) | struct autosa_stmt_access
  function isl_bool (line 1111) | static isl_bool is_stmt_killed(struct ppcg_scop *scop, struct pet_stmt *...
  function __isl_give (line 1143) | static __isl_give isl_map *extract_single_tagged_access(
  function isl_bool (line 1187) | static isl_bool complete_index(__isl_keep pet_expr *expr,
  function isl_bool (line 1224) | static isl_bool accesses_fixed_element(__isl_keep pet_expr *expr)
  function extract_access (line 1264) | static int extract_access(__isl_keep pet_expr *expr, void *user)
  function pet_stmt_extract_accesses (line 1331) | static int pet_stmt_extract_accesses(struct autosa_stmt *stmt,
  type autosa_stmt (line 1348) | struct autosa_stmt
  type ppcg_scop (line 1348) | struct ppcg_scop
  type autosa_stmt (line 1352) | struct autosa_stmt
  type autosa_stmt (line 1360) | struct autosa_stmt
  type autosa_stmt (line 1367) | struct autosa_stmt
  type autosa_stmt (line 1371) | struct autosa_stmt
  function autosa_kernel_stmt_free (line 1377) | void autosa_kernel_stmt_free(void *user)
  type autosa_stmt (line 1425) | struct autosa_stmt
  type autosa_prog (line 1425) | struct autosa_prog
  function __isl_give (line 1446) | static __isl_give isl_union_set *compute_may_persist(struct autosa_prog ...
  type autosa_prog (line 1477) | struct autosa_prog
  type ppcg_scop (line 1477) | struct ppcg_scop
  type autosa_prog (line 1479) | struct autosa_prog
  type autosa_prog (line 1512) | struct autosa_prog
  type autosa_prog (line 1515) | struct autosa_prog
  type autosa_prog (line 1521) | struct autosa_prog
  type autosa_hw_module (line 1545) | struct autosa_hw_module
  type autosa_gen (line 1545) | struct autosa_gen
  type autosa_hw_module (line 1547) | struct autosa_hw_module
  type autosa_hw_module (line 1547) | struct autosa_hw_module
  type autosa_hw_module (line 1548) | struct autosa_hw_module
  type autosa_hw_module (line 1628) | struct autosa_hw_module
  type autosa_hw_top_module (line 1710) | struct autosa_hw_top_module
  type autosa_hw_top_module (line 1712) | struct autosa_hw_top_module
  type autosa_hw_top_module (line 1712) | struct autosa_hw_top_module
  type autosa_hw_top_module (line 1713) | struct autosa_hw_top_module
  type autosa_hw_top_module (line 1741) | struct autosa_hw_top_module
  type autosa_pe_dummy_module (line 1810) | struct autosa_pe_dummy_module
  type autosa_pe_dummy_module (line 1812) | struct autosa_pe_dummy_module
  type autosa_pe_dummy_module (line 1812) | struct autosa_pe_dummy_module
  type autosa_pe_dummy_module (line 1813) | struct autosa_pe_dummy_module
  type autosa_pe_dummy_module (line 1823) | struct autosa_pe_dummy_module
  type autosa_drain_merge_func (line 1835) | struct autosa_drain_merge_func
  type autosa_gen (line 1835) | struct autosa_gen
  type autosa_drain_merge_func (line 1837) | struct autosa_drain_merge_func
  type autosa_drain_merge_func (line 1837) | struct autosa_drain_merge_func
  type autosa_drain_merge_func (line 1838) | struct autosa_drain_merge_func
  type autosa_drain_merge_func (line 1849) | struct autosa_drain_merge_func
  type autosa_ast_node_userinfo (line 1865) | struct autosa_ast_node_userinfo
  type autosa_ast_node_userinfo (line 1867) | struct autosa_ast_node_userinfo
  type autosa_ast_node_userinfo (line 1868) | struct autosa_ast_node_userinfo
  type autosa_ast_node_userinfo (line 1869) | struct autosa_ast_node_userinfo
  function free_ast_node_userinfo (line 1889) | void free_ast_node_userinfo(void *ptr)
  type autosa_extract_size_data (line 1903) | struct autosa_extract_size_data
  function isl_stat (line 1913) | static isl_stat extract_size_of_type(__isl_take isl_set *size, void *user)
  function __isl_give (line 1933) | __isl_give isl_set *extract_sa_sizes(__isl_keep isl_union_map *sizes,
  function isl_stat (line 1965) | static isl_stat read_sa_sizes_from_set(__isl_take isl_set *set, int *siz...
  function __isl_give (line 1999) | static __isl_give isl_set *extract_config_sizes(__isl_keep isl_union_map...
  function isl_stat (line 2040) | static isl_stat read_config_sizes_from_set(__isl_take isl_set *set,
  function set_sa_used_sizes (line 2075) | static void set_sa_used_sizes(struct autosa_kernel *sa, const char *type...
  type autosa_kernel (line 2088) | struct autosa_kernel
  function read_mem_port_map (line 2115) | int read_mem_port_map(__isl_keep isl_union_map *port_map, char *name)
  type autosa_kernel (line 2133) | struct autosa_kernel
  type autosa_kernel (line 2220) | struct autosa_kernel
  type autosa_kernel (line 2247) | struct autosa_kernel
  type autosa_kernel (line 2268) | struct autosa_kernel
  type autosa_kernel (line 2295) | struct autosa_kernel
  type autosa_kernel (line 2309) | struct autosa_kernel
  type autosa_kernel (line 2336) | struct autosa_kernel
  function read_space_time_kernel_id (line 2350) | int read_space_time_kernel_id(__isl_keep isl_union_map *sizes)
  type autosa_kernel (line 2368) | struct autosa_kernel
  type autosa_kernel (line 2395) | struct autosa_kernel
  type extract_loop_info_data (line 2412) | struct extract_loop_info_data
  function cJSON (line 2421) | static cJSON *extract_isl_ast_node_for(__isl_keep isl_ast_node *node, cJ...
  function cJSON (line 2496) | static cJSON *extract_isl_ast_node_block(__isl_keep isl_ast_node *node, ...
  function cJSON (line 2504) | static cJSON *extract_isl_ast_node_mark(__isl_keep isl_ast_node *node, c...
  function cJSON (line 2516) | static cJSON *extract_isl_ast_node_user(__isl_keep isl_ast_node *node, c...
  function cJSON (line 2533) | static cJSON *extract_loop_info_at_ast_node(__isl_keep isl_ast_node *node,
  type autosa_gen (line 2683) | struct autosa_gen
  function isl_stat (line 2744) | isl_stat sa_extract_loop_info(struct autosa_gen *gen, struct autosa_hw_m...
  function isl_stat (line 2805) | isl_stat sa_extract_array_info(struct autosa_kernel *kernel)
  function isl_stat (line 2851) | isl_stat TP_extract_loop_info(struct autosa_gen *gen, struct autosa_hw_m...
  function isl_stat (line 2877) | isl_stat TP_extract_module_attr(struct autosa_gen *gen, struct autosa_hw...
  function isl_stat (line 2899) | isl_stat TP_extract_resource_info(struct autosa_gen *gen, struct autosa_...
  function isl_stat (line 2964) | isl_stat TP_extract_array_info(struct autosa_gen *gen, struct autosa_ker...
  function TPArrayTile (line 2994) | TPArrayTile *TP_infer_tiled_array(
  function extract_memory_type (line 3051) | int extract_memory_type(struct autosa_hw_module *module,
  function cJSON (line 3097) | static cJSON *extract_buffer_info_from_module(struct autosa_gen *gen,
  function cJSON (line 3156) | static cJSON *extract_design_info_from_module(struct autosa_gen *gen,
  function cJSON (line 3225) | static cJSON *extract_design_info_from_serialize_module(struct autosa_ge...
  function cJSON (line 3248) | static cJSON *extract_design_info_from_pe_dummy_module(struct autosa_gen...
  function isl_stat (line 3267) | isl_stat sa_extract_design_info(struct autosa_gen *gen)
  function isl_stat (line 3398) | isl_stat autosa_kernel_extract_sparse_info(struct autosa_kernel *kernel,

FILE: src/autosa_common.h
  type autosa_group_access_type (line 53) | enum autosa_group_access_type
  type autosa_kernel_stmt_type (line 61) | enum autosa_kernel_stmt_type
  type autosa_dep_type (line 82) | enum autosa_dep_type
  type autosa_io_type (line 91) | enum autosa_io_type
  type autosa_io_dir (line 98) | enum autosa_io_dir
  type autosa_module_type (line 107) | enum autosa_module_type
  type autosa_group_type (line 114) | enum autosa_group_type
  type autosa_array_type (line 122) | enum autosa_array_type
  type platform (line 129) | enum platform
  type autosa_dep (line 137) | struct autosa_dep
  type autosa_types (line 152) | struct autosa_types
  type autosa_iter (line 158) | struct autosa_iter
  type autosa_kernel_var (line 169) | struct autosa_kernel_var
  type autosa_kernel (line 183) | struct autosa_kernel
  type autosa_io_info (line 323) | struct autosa_io_info
  type autosa_stmt_access (line 338) | struct autosa_stmt_access
  type ppcg_extract_access_data (line 382) | struct ppcg_extract_access_data
  type autosa_stmt (line 397) | struct autosa_stmt
  type autosa_array_info (line 407) | struct autosa_array_info
  type autosa_io_buffer (line 480) | struct autosa_io_buffer
  type autosa_array_ref_group (line 502) | struct autosa_array_ref_group
  type autosa_array_ref_group_pair (line 596) | struct autosa_array_ref_group_pair
  type autosa_local_array_info (line 618) | struct autosa_local_array_info
  type autosa_prog (line 676) | struct autosa_prog
  type autosa_hw_top_module (line 718) | struct autosa_hw_top_module
  type autosa_pe_dummy_module (line 746) | struct autosa_pe_dummy_module
  type autosa_drain_merge_func (line 756) | struct autosa_drain_merge_func
  type autosa_hw_module (line 766) | struct autosa_hw_module
  type autosa_gen (line 901) | struct autosa_gen
  type autosa_kernel_stmt (line 985) | struct autosa_kernel_stmt
  type autosa_acc (line 1065) | struct autosa_acc
  type autosa_node_band_prop (line 1074) | struct autosa_node_band_prop
  type autosa_ast_node_userinfo (line 1086) | struct autosa_ast_node_userinfo
  type autosa_array_bound (line 1118) | struct autosa_array_bound
  type autosa_array_tile (line 1147) | struct autosa_array_tile
  type hls_info (line 1157) | struct hls_info
  type autosa_node_band_prop (line 1179) | struct autosa_node_band_prop
  type autosa_node_band_prop (line 1180) | struct autosa_node_band_prop
  type ppcg_scop (line 1187) | struct ppcg_scop
  type autosa_array_ref_group (line 1226) | struct autosa_array_ref_group
  type autosa_kernel (line 1226) | struct autosa_kernel
  type autosa_gen (line 1238) | struct autosa_gen
  type autosa_gen (line 1239) | struct autosa_gen
  type autosa_gen (line 1240) | struct autosa_gen
  type autosa_kernel (line 1243) | struct autosa_kernel
  type autosa_kernel (line 1244) | struct autosa_kernel
  type autosa_kernel (line 1244) | struct autosa_kernel
  type autosa_kernel (line 1245) | struct autosa_kernel
  type autosa_kernel (line 1246) | struct autosa_kernel
  type ppcg_scop (line 1246) | struct ppcg_scop
  type autosa_acc (line 1251) | struct autosa_acc
  type autosa_io_buffer (line 1252) | struct autosa_io_buffer
  type autosa_iter (line 1258) | struct autosa_iter
  type autosa_iter (line 1258) | struct autosa_iter
  type autosa_prog (line 1261) | struct autosa_prog
  type autosa_array_info (line 1262) | struct autosa_array_info
  type autosa_array_info (line 1263) | struct autosa_array_info
  type autosa_kernel (line 1264) | struct autosa_kernel
  type autosa_array_ref_group (line 1265) | struct autosa_array_ref_group
  type autosa_array_ref_group (line 1266) | struct autosa_array_ref_group
  type autosa_array_ref_group (line 1267) | struct autosa_array_ref_group
  type autosa_array_ref_group (line 1268) | struct autosa_array_ref_group
  type autosa_array_tile (line 1269) | struct autosa_array_tile
  type autosa_array_tile (line 1269) | struct autosa_array_tile
  type autosa_array_tile (line 1270) | struct autosa_array_tile
  type autosa_array_tile (line 1271) | struct autosa_array_tile
  type autosa_stmt (line 1274) | struct autosa_stmt
  type ppcg_scop (line 1274) | struct ppcg_scop
  type autosa_stmt (line 1277) | struct autosa_stmt
  type autosa_prog (line 1277) | struct autosa_prog
  type autosa_prog (line 1280) | struct autosa_prog
  type ppcg_scop (line 1280) | struct ppcg_scop
  type autosa_prog (line 1281) | struct autosa_prog
  type autosa_hw_module (line 1284) | struct autosa_hw_module
  type autosa_gen (line 1284) | struct autosa_gen
  type autosa_hw_module (line 1285) | struct autosa_hw_module
  type autosa_hw_top_module (line 1286) | struct autosa_hw_top_module
  type autosa_hw_top_module (line 1287) | struct autosa_hw_top_module
  type autosa_pe_dummy_module (line 1288) | struct autosa_pe_dummy_module
  type autosa_pe_dummy_module (line 1289) | struct autosa_pe_dummy_module
  type autosa_drain_merge_func (line 1290) | struct autosa_drain_merge_func
  type autosa_gen (line 1290) | struct autosa_gen
  type autosa_drain_merge_func (line 1291) | struct autosa_drain_merge_func
  type autosa_ast_node_userinfo (line 1294) | struct autosa_ast_node_userinfo
  type autosa_kernel (line 1300) | struct autosa_kernel
  type autosa_kernel (line 1301) | struct autosa_kernel
  type autosa_kernel (line 1302) | struct autosa_kernel
  type autosa_kernel (line 1303) | struct autosa_kernel
  type autosa_kernel (line 1304) | struct autosa_kernel
  type autosa_kernel (line 1305) | struct autosa_kernel
  type autosa_kernel (line 1306) | struct autosa_kernel
  type autosa_kernel (line 1307) | struct autosa_kernel
  type autosa_kernel (line 1309) | struct autosa_kernel
  type autosa_kernel (line 1310) | struct autosa_kernel
  type autosa_gen (line 1316) | struct autosa_gen
  type autosa_hw_module (line 1316) | struct autosa_hw_module
  type autosa_kernel (line 1317) | struct autosa_kernel
  type autosa_hw_module (line 1318) | struct autosa_hw_module
  type autosa_kernel_var (line 1319) | struct autosa_kernel_var
  type autosa_gen (line 1320) | struct autosa_gen
  type autosa_gen (line 1323) | struct autosa_gen
  type autosa_hw_module (line 1323) | struct autosa_hw_module
  type autosa_gen (line 1324) | struct autosa_gen
  type autosa_hw_module (line 1324) | struct autosa_hw_module
  type autosa_gen (line 1325) | struct autosa_gen
  type autosa_hw_module (line 1325) | struct autosa_hw_module
  type autosa_gen (line 1326) | struct autosa_gen
  type autosa_kernel (line 1326) | struct autosa_kernel
  type autosa_gen (line 1328) | struct autosa_gen
  type autosa_kernel (line 1328) | struct autosa_kernel
  type isl_schedule_node (line 1328) | struct isl_schedule_node
  type autosa_array_ref_group (line 1329) | struct autosa_array_ref_group
  type autosa_kernel (line 1332) | struct autosa_kernel
  type autosa_gen (line 1333) | struct autosa_gen

FILE: src/autosa_cpu.h
  type ppcg_options (line 8) | struct ppcg_options
  type ppcg_options (line 10) | struct ppcg_options

FILE: src/autosa_intel_opencl.cpp
  type print_host_user_data (line 14) | struct print_host_user_data
    type hls_info (line 16) | struct hls_info
    type autosa_prog (line 17) | struct autosa_prog
    type autosa_hw_top_module (line 18) | struct autosa_hw_top_module
  type print_hw_module_data (line 21) | struct print_hw_module_data
    type hls_info (line 23) | struct hls_info
    type autosa_prog (line 24) | struct autosa_prog
    type autosa_hw_module (line 25) | struct autosa_hw_module
  function print_intel_host_header (line 30) | static void print_intel_host_header(FILE *fp)
  function opencl_open_files (line 126) | static void opencl_open_files(struct hls_info *info, const char *input)
  function opencl_close_files (line 199) | static void opencl_close_files(struct hls_info *info)
  type autosa_array_ref_group (line 232) | struct autosa_array_ref_group
  type autosa_io_buffer (line 236) | struct autosa_io_buffer
  function isl_stat (line 281) | static isl_stat print_data_types_intel(
  function __isl_give (line 507) | static __isl_give isl_printer *print_for_with_coalesce(__isl_keep isl_as...
  function __isl_give (line 525) | static __isl_give isl_printer *print_for_infinitize(__isl_keep isl_ast_n...
  function __isl_give (line 553) | static __isl_give isl_printer *print_module_for(__isl_take isl_printer *p,
  function __isl_give (line 710) | static __isl_give isl_printer *find_device_intel(__isl_take isl_printer *p,
  function __isl_give (line 1046) | static __isl_give isl_printer *declare_and_allocate_device_arrays_intel(
  function __isl_give (line 1393) | static __isl_give isl_printer *init_device_intel(__isl_take isl_printer *p,
  function __isl_give (line 1410) | static __isl_give isl_printer *clear_device_intel(__isl_take isl_printer...
  function __isl_give (line 1512) | static __isl_give isl_printer *drain_merge_intel(
  function __isl_give (line 1547) | static __isl_give isl_printer *copy_array_to_device_intel(__isl_take isl...
  function __isl_give (line 1608) | static __isl_give isl_printer *copy_array_from_device_intel(
  function __isl_give (line 1680) | static __isl_give isl_printer *print_device_node_intel(__isl_take isl_pr...
  function __isl_give (line 1741) | static __isl_give isl_printer *autosa_kernel_print_set_ext_module_args(
  function __isl_give (line 1939) | static __isl_give isl_printer *print_set_ext_module_args_stmt(
  function __isl_give (line 1963) | static __isl_give isl_printer *autosa_kernel_print_launch_ext_module_ker...
  function __isl_give (line 2023) | static __isl_give isl_printer *print_launch_ext_module_kernels_stmt(
  function __isl_give (line 2054) | static __isl_give isl_printer *print_set_kernel_arguments_intel(
  function __isl_give (line 2091) | static __isl_give isl_printer *print_launch_kernel_intel(
  function __isl_give (line 2131) | static __isl_give isl_printer *print_host_user_intel(__isl_take isl_prin...
  function __isl_give (line 2195) | static __isl_give isl_printer *print_module_header_intel(
  function isl_stat (line 2227) | static isl_stat print_module_headers_intel(
  function __isl_give (line 2251) | static __isl_give isl_printer *print_module_var_intel(
  function __isl_give (line 2319) | static __isl_give isl_printer *print_module_vars_intel(__isl_take isl_pr...
  function __isl_give (line 2369) | static __isl_give isl_printer *autosa_print_intra_trans_module(
  function __isl_give (line 2421) | static __isl_give isl_printer *autosa_print_inter_trans_module(
  function __isl_give (line 2482) | static __isl_give isl_printer *autosa_print_serialize_module(
  function __isl_give (line 2518) | static __isl_give isl_printer *autosa_print_default_module(
  function __isl_give (line 2619) | static __isl_give isl_printer *print_pe_dummy_module_core_header_intel(
  function __isl_give (line 2653) | static __isl_give isl_printer *print_pe_dummy_module_core_headers_intel(
  function __isl_give (line 2664) | static __isl_give isl_printer *print_pe_dummy_module_header_intel(
  function isl_stat (line 2704) | static isl_stat print_pe_dummy_module_headers_intel(
  function __isl_give (line 2728) | static __isl_give isl_printer *autosa_print_default_pe_dummy_module(
  type print_db_module_intel_data (line 2788) | struct print_db_module_intel_data {
  function __isl_give (line 2815) | static __isl_give isl_printer *print_double_buffer_module_vars_intel(
  function __isl_give (line 2907) | static __isl_give isl_printer *count_module_for(__isl_take isl_printer *p,
  function isl_bool (line 2933) | static isl_bool count_module_for_alt(__isl_keep isl_ast_node *node, void...
  function __isl_give (line 2953) | static __isl_give isl_printer *extract_module_for(__isl_take isl_printer...
  function extract_double_buffer_module_intel_data (line 3082) | static void extract_double_buffer_module_intel_data(
  function __isl_give (line 3189) | static __isl_give isl_printer *print_null_for(__isl_take isl_printer *p,
  function __isl_give (line 3204) | static __isl_give isl_printer *autosa_print_inter_trans_module_double_bu...
  function __isl_give (line 3230) | static __isl_give isl_printer *autosa_print_intra_trans_module_double_bu...
  function __isl_give (line 3310) | static __isl_give isl_printer *print_double_buffer_module_while(
  function __isl_give (line 3432) | static __isl_give isl_printer *autosa_print_host_code(__isl_take isl_pri...
  function __isl_give (line 3512) | static __isl_give isl_printer *print_top_module_headers_intel(
  function __isl_give (line 3591) | static __isl_give isl_printer *print_top_module_fifo_stmt(__isl_take isl...
  function __isl_give (line 3614) | static __isl_give isl_printer *print_top_module_call_stmt(
  function print_top_gen_host_code (line 3641) | static void print_top_gen_host_code(
  function is_autorun_legal (line 3976) | static int is_autorun_legal(struct autosa_prog *prog,
  function __isl_give (line 4022) | static __isl_give isl_printer *print_hw(
  function generate_autosa_intel_opencl (line 4061) | int generate_autosa_intel_opencl(isl_ctx *ctx, struct ppcg_options *opti...

FILE: src/autosa_intel_opencl.h
  type ppcg_options (line 12) | struct ppcg_options

FILE: src/autosa_print.cpp
  type IO_TRANS_DIR (line 13) | enum IO_TRANS_DIR {GLOBAL_BUF, LOCAL_BUF, FIFO}
  function __isl_give (line 17) | __isl_give isl_printer *autosa_array_info_print_call_argument(
  function __isl_give (line 43) | __isl_give isl_printer *autosa_array_ref_group_print_prefix(
  function __isl_give (line 70) | __isl_give isl_printer *autosa_array_ref_group_print_fifo_name(
  function already_printed (line 98) | static int already_printed(struct autosa_types *types,
  function __isl_give (line 114) | __isl_give isl_printer *autosa_print_types(__isl_take isl_printer *p,
  function __isl_give (line 153) | __isl_give isl_printer *autosa_print_local_declarations(
  function __isl_give (line 175) | __isl_give isl_printer *print_str_new_line(__isl_take isl_printer *p, co...
  function __isl_give (line 186) | __isl_give isl_printer *autosa_array_info_print_data_size(
  function __isl_give (line 217) | __isl_give isl_printer *autosa_array_info_print_size(
  function __isl_give (line 241) | __isl_give isl_printer *autosa_array_info_print_serialize_data_size(
  function __isl_give (line 255) | __isl_give isl_printer *autosa_array_info_print_serialize_size(
  function __isl_give (line 272) | __isl_give isl_printer *autosa_print_array_type(__isl_take isl_printer *p,
  function __isl_give (line 288) | __isl_give isl_printer *autosa_print_array_type_with_lane(
  function __isl_give (line 302) | __isl_give isl_printer *autosa_print_array_type_with_lane_sparse(
  function __isl_give (line 313) | __isl_give isl_printer *autosa_kernel_print_domain(__isl_take isl_printe...
  function __isl_give (line 321) | static __isl_give isl_printer *print_non_linearized_declaration_argument(
  function __isl_give (line 347) | __isl_give isl_printer *autosa_array_info_print_declaration_argument(
  function __isl_give (line 440) | __isl_give isl_printer *print_kernel_arguments(__isl_take isl_printer *p,
  function __isl_give (line 568) | __isl_give isl_printer *print_kernel_header(
  function isl_bool (line 600) | static isl_bool at_node(__isl_keep isl_ast_node *node, void *user)
  function print_indent (line 646) | static void print_indent(FILE *dst, int indent)
  function __isl_give (line 654) | static __isl_give isl_printer *print_iterators(
  function __isl_give (line 694) | __isl_give isl_printer *autosa_print_macros(__isl_take isl_printer *p,
  function __isl_give (line 703) | __isl_give isl_printer *print_module_iterators(
  function __isl_give (line 717) | __isl_give isl_printer *print_func_iterators(
  function __isl_give (line 731) | __isl_give isl_printer *print_serialize_counter(
  function __isl_give (line 753) | __isl_give isl_printer *print_host_serialize_arguments(
  function __isl_give (line 892) | __isl_give isl_printer *print_fifo_type_xilinx(__isl_take isl_printer *p,
  function __isl_give (line 919) | __isl_give isl_printer *print_fifo_type_catapult(__isl_take isl_printer *p,
  function __isl_give (line 946) | __isl_give isl_printer *print_fifo_type_intel(__isl_take isl_printer *p,
  function __isl_give (line 965) | __isl_give isl_printer *print_fifo_type_tapa(__isl_take isl_printer *p,
  function __isl_give (line 1001) | __isl_give isl_printer *autosa_fifo_print_declaration_arguments(
  function __isl_give (line 1032) | __isl_give isl_printer *autosa_fifo_print_call_argument(
  function __isl_give (line 1048) | __isl_give isl_printer *autosa_module_array_info_print_call_argument(
  function __isl_give (line 1060) | __isl_give isl_printer *autosa_print_var_initialization(
  function __isl_give (line 1120) | __isl_give isl_printer *print_module_arguments(
  function __isl_give (line 1653) | __isl_give isl_printer *print_pe_dummy_module_arguments(
  function __isl_give (line 1782) | __isl_give isl_printer *print_top_gen_arguments(__isl_take isl_printer *p,
  function __isl_give (line 1844) | static __isl_give isl_printer *print_top_gen_header(__isl_take isl_print...
  function print_top_gen_headers (line 1857) | void print_top_gen_headers(
  function __isl_give (line 1879) | static __isl_give isl_printer *print_fifo_comment(
  function __isl_give (line 1893) | static __isl_give isl_printer *print_inst_ids_inc_suffix(
  function __isl_give (line 1922) | static __isl_give isl_printer *print_inst_ids_suffix(
  function __isl_give (line 1953) | static __isl_give isl_printer *print_pretrans_inst_ids_suffix(
  function __isl_give (line 1995) | static __isl_give isl_printer *print_fifo_decl_single(
  function __isl_give (line 2269) | static __isl_give isl_printer *print_fifo_decl(__isl_take isl_printer *p,
  function __isl_give (line 2298) | __isl_give isl_printer *autosa_kernel_print_fifo_decl(
  function __isl_give (line 2312) | static __isl_give isl_printer *print_delimiter(__isl_take isl_printer *p,
  function __isl_give (line 2334) | static __isl_give isl_printer *print_fifo_annotation(__isl_take isl_prin...
  function __isl_give (line 2346) | static __isl_give isl_printer *print_fifo_prefix(__isl_take isl_printer *p,
  function __isl_give (line 2367) | __isl_give isl_printer *print_module_call_upper(__isl_take isl_printer *p,
  type autosa_hw_module (line 2755) | struct autosa_hw_module
  type autosa_array_ref_group (line 2757) | struct autosa_array_ref_group
  function __isl_give (line 2789) | static __isl_give isl_printer *print_fifo_prefix_lower(
  function __isl_give (line 2825) | static __isl_give isl_printer *print_module_call_lower(__isl_take isl_pr...
  function __isl_give (line 2918) | __isl_give isl_printer *autosa_kernel_print_module_call_inst(
  function __isl_give (line 2990) | __isl_give isl_printer *autosa_kernel_print_module_call(
  function __isl_give (line 3145) | __isl_give isl_printer *print_fifo_rw_xilinx(__isl_take isl_printer *p,
  function __isl_give (line 3161) | __isl_give isl_printer *print_fifo_rw_catapult(
  function __isl_give (line 3179) | __isl_give isl_printer *print_fifo_rw_intel(__isl_take isl_printer *p,
  function __isl_give (line 3197) | __isl_give isl_printer *print_fifo_rw_tapa(
  function __isl_give (line 3220) | __isl_give isl_printer *autosa_kernel_print_io(__isl_take isl_printer *p,
  function __isl_give (line 4204) | __isl_give isl_printer *autosa_print_reduce_data_pack(
  function __isl_give (line 4455) | __isl_give isl_printer *autosa_print_reduce_default(
  function __isl_give (line 4601) | static __isl_give isl_printer *autosa_kernel_print_io_transfer_default(
  function __isl_give (line 4836) | static __isl_give isl_printer *io_stmt_print_global_index(
  function __isl_give (line 4865) | static __isl_give isl_printer *io_stmt_print_index_last_dim(
  function __isl_give (line 4914) | static __isl_give isl_printer *io_transfer_update_data_split(
  function __isl_give (line 4972) | static __isl_give isl_printer *io_transfer_pack_out_data(
  function __isl_give (line 5063) | static __isl_give isl_printer *io_transfer_read_local_buf(
  function __isl_give (line 5112) | static __isl_give isl_printer *io_transfer_parse_sparse_data(
  function __isl_give (line 5151) | static __isl_give isl_printer *io_transfer_write_data_split(
  function __isl_give (line 5374) | static __isl_give isl_printer *io_transfer_read_data_split(
  function __isl_give (line 5434) | static __isl_give isl_printer *autosa_kernel_print_io_transfer(
  function __isl_give (line 5830) | static __isl_give isl_printer *autosa_kernel_print_io_transfer_wrapper(
  function __isl_give (line 5935) | static __isl_give isl_printer *autosa_kernel_print_io_transfer_data_pack(
  function __isl_give (line 6662) | __isl_give isl_printer *autosa_kernel_print_host_serialize(
  function __isl_give (line 6710) | __isl_give isl_printer *autosa_kernel_print_drain_merge(__isl_take isl_p...
  function __isl_give (line 6788) | __isl_give isl_printer *autosa_kernel_print_io_dram(
  function __isl_give (line 6971) | static __isl_give isl_printer *print_inter_trans_module_call(
  function __isl_give (line 7012) | __isl_give isl_printer *autosa_kernel_print_inter_trans(
  function __isl_give (line 7054) | static __isl_give isl_printer *print_intra_trans_module_call(
  function __isl_give (line 7094) | __isl_give isl_printer *autosa_kernel_print_intra_trans(
  function __isl_give (line 7136) | __isl_give isl_printer *autosa_kernel_print_inter_intra(
  function __isl_give (line 7182) | __isl_give isl_printer *autosa_kernel_print_intra_inter(
  function __isl_give (line 7228) | __isl_give isl_printer *autosa_kernel_print_state_handle(
  function __isl_give (line 7284) | __isl_give isl_printer *print_module_serialize_body(
  function isl_stat (line 8150) | isl_stat print_sparse_macros(struct autosa_kernel *kernel, struct hls_in...
  function __isl_give (line 8224) | __isl_give isl_printer *print_drain_merge_arguments(
  type print_hw_module_data (line 8356) | struct print_hw_module_data
    type hls_info (line 8358) | struct hls_info
    type autosa_prog (line 8359) | struct autosa_prog
    type autosa_hw_module (line 8360) | struct autosa_hw_module
  function isl_stat (line 8367) | isl_stat print_drain_merge_funcs(
  function __isl_give (line 8425) | __isl_give isl_printer *print_module_stmt(__isl_take isl_printer *p,
  function isl_stat (line 8478) | isl_stat print_host_serialize_funcs(
  function __isl_give (line 8540) | __isl_give isl_printer *print_cpu_user(__isl_take isl_printer *p,

FILE: src/autosa_print.h
  type autosa_array_info (line 10) | struct autosa_array_info
  type autosa_array_ref_group (line 12) | struct autosa_array_ref_group
  type autosa_array_ref_group (line 14) | struct autosa_array_ref_group
  type autosa_types (line 16) | struct autosa_types
  type autosa_prog (line 16) | struct autosa_prog
  type autosa_prog (line 18) | struct autosa_prog
  type autosa_array_info (line 20) | struct autosa_array_info
  type autosa_array_info (line 22) | struct autosa_array_info
  type autosa_array_info (line 24) | struct autosa_array_info
  type autosa_array_info (line 26) | struct autosa_array_info
  type autosa_array_info (line 28) | struct autosa_array_info
  type autosa_array_info (line 31) | struct autosa_array_info
  type autosa_array_info (line 34) | struct autosa_array_info
  type autosa_array_info (line 36) | struct autosa_array_info
  type polysa_array_info (line 39) | struct polysa_array_info
  type autosa_kernel_var (line 41) | struct autosa_kernel_var
  type platform (line 41) | enum platform
  type autosa_prog (line 50) | struct autosa_prog
  type autosa_kernel (line 50) | struct autosa_kernel
  type hls_info (line 51) | struct hls_info
  type autosa_prog (line 53) | struct autosa_prog
  type autosa_kernel (line 54) | struct autosa_kernel
  type hls_info (line 54) | struct hls_info
  type autosa_hw_module (line 58) | struct autosa_hw_module
  type autosa_prog (line 61) | struct autosa_prog
  type autosa_kernel (line 62) | struct autosa_kernel
  type autosa_hw_module (line 63) | struct autosa_hw_module
  type platform (line 64) | enum platform
  type autosa_prog (line 68) | struct autosa_prog
  type autosa_kernel (line 69) | struct autosa_kernel
  type autosa_pe_dummy_module (line 70) | struct autosa_pe_dummy_module
  type platform (line 72) | enum platform
  type autosa_prog (line 74) | struct autosa_prog
  type autosa_hw_top_module (line 74) | struct autosa_hw_top_module
  type hls_info (line 74) | struct hls_info
  type autosa_prog (line 76) | struct autosa_prog
  type autosa_kernel (line 76) | struct autosa_kernel
  type autosa_kernel_stmt (line 79) | struct autosa_kernel_stmt
  type autosa_prog (line 79) | struct autosa_prog
  type platform (line 80) | enum platform
  type autosa_kernel_stmt (line 83) | struct autosa_kernel_stmt
  type autosa_prog (line 83) | struct autosa_prog
  type platform (line 84) | enum platform
  type autosa_drain_merge_func (line 88) | struct autosa_drain_merge_func
  type autosa_hw_module (line 91) | struct autosa_hw_module
  type autosa_kernel (line 94) | struct autosa_kernel
  type autosa_array_ref_group (line 95) | struct autosa_array_ref_group
  type autosa_hw_module (line 96) | struct autosa_hw_module
  type autosa_array_ref_group (line 102) | struct autosa_array_ref_group
  type platform (line 103) | enum platform
  type autosa_array_ref_group (line 105) | struct autosa_array_ref_group
  type platform (line 106) | enum platform
  type autosa_kernel_stmt (line 109) | struct autosa_kernel_stmt
  type autosa_prog (line 109) | struct autosa_prog
  type hls_info (line 109) | struct hls_info
  type autosa_kernel_stmt (line 113) | struct autosa_kernel_stmt
  type autosa_kernel_stmt (line 115) | struct autosa_kernel_stmt
  type hls_info (line 115) | struct hls_info
  type autosa_kernel_stmt (line 118) | struct autosa_kernel_stmt
  type hls_info (line 118) | struct hls_info
  type autosa_kernel_stmt (line 120) | struct autosa_kernel_stmt
  type hls_info (line 120) | struct hls_info
  type autosa_kernel_stmt (line 123) | struct autosa_kernel_stmt
  type hls_info (line 123) | struct hls_info
  type autosa_kernel_stmt (line 126) | struct autosa_kernel_stmt
  type hls_info (line 126) | struct hls_info
  type autosa_kernel_stmt (line 129) | struct autosa_kernel_stmt
  type hls_info (line 129) | struct hls_info
  type autosa_kernel_stmt (line 132) | struct autosa_kernel_stmt
  type hls_info (line 132) | struct hls_info
  type autosa_kernel_stmt (line 135) | struct autosa_kernel_stmt
  type hls_info (line 135) | struct hls_info
  type autosa_kernel_stmt (line 138) | struct autosa_kernel_stmt
  type hls_info (line 138) | struct hls_info
  type autosa_kernel_stmt (line 141) | struct autosa_kernel_stmt
  type hls_info (line 142) | struct hls_info
  type autosa_hw_module (line 144) | struct autosa_hw_module
  type hls_info (line 144) | struct hls_info
  type autosa_array_ref_group (line 155) | struct autosa_array_ref_group
  type autosa_array_ref_group (line 161) | struct autosa_array_ref_group
  type autosa_array_ref_group (line 167) | struct autosa_array_ref_group
  type autosa_array_ref_group (line 173) | struct autosa_array_ref_group
  type autosa_kernel (line 179) | struct autosa_kernel
  type hls_info (line 179) | struct hls_info
  type autosa_kernel (line 184) | struct autosa_kernel
  type autosa_array_ref_group (line 185) | struct autosa_array_ref_group
  type autosa_drain_merge_func (line 186) | struct autosa_drain_merge_func
  type autosa_kernel (line 190) | struct autosa_kernel
  type autosa_drain_merge_func (line 191) | struct autosa_drain_merge_func
  type hls_info (line 192) | struct hls_info
  type autosa_kernel (line 194) | struct autosa_kernel
  type autosa_hw_module (line 195) | struct autosa_hw_module
  type hls_info (line 196) | struct hls_info

FILE: src/autosa_schedule_tree.cpp
  function is_marked (line 12) | int is_marked(__isl_keep isl_schedule_node *node, const char *name)
  function __isl_give (line 33) | static __isl_give isl_multi_val *multi_val_from_int_list(
  function __isl_give (line 59) | __isl_give isl_multi_val *construct_band_tile_sizes(
  type autosa_node_band_prop (line 73) | struct autosa_node_band_prop
  type autosa_node_band_prop (line 75) | struct autosa_node_band_prop
  type autosa_node_band_prop (line 103) | struct autosa_node_band_prop
  function isl_bool (line 118) | isl_bool is_permutable_node(__isl_keep isl_schedule_node *node)
  function isl_bool (line 136) | static isl_bool is_permutable_node_cnt(
  function isl_bool (line 152) | isl_bool has_single_permutable_node(__isl_keep isl_schedule *schedule)
  function isl_bool (line 177) | isl_bool is_dep_uniform_at_node(__isl_keep isl_schedule_node *node, void...
  function isl_bool (line 289) | isl_bool is_dep_uniform(__isl_take isl_basic_map *bmap, void *user)
  function isl_bool (line 354) | isl_bool is_dep_uniform_wrap(__isl_keep isl_map *map, void *user)
  function isl_bool (line 380) | isl_bool uniform_dep_check(__isl_keep isl_schedule *schedule, struct ppc...
  function isl_bool (line 401) | static isl_bool update_depth(__isl_keep isl_schedule_node *node, void *u...
  function __isl_give (line 417) | __isl_give isl_vec *get_dep_dis_at_schedule(__isl_keep isl_basic_map *dep,
  function __isl_give (line 486) | __isl_give isl_vec *get_dep_dis_at_node(__isl_keep isl_basic_map *dep, _...
  function __isl_give (line 586) | __isl_give isl_schedule_node *loop_interchange_at_node(
  function isl_bool (line 660) | static isl_bool is_outermost_permutable_node_update(
  function __isl_give (line 683) | __isl_give isl_schedule_node *get_outermost_permutable_node(
  function isl_bool (line 699) | static isl_bool is_innermost_permutable_node_update(__isl_keep isl_sched...
  function __isl_give (line 725) | __isl_give isl_schedule_node *get_innermost_permutable_node(__isl_keep i...
  function __isl_give (line 738) | __isl_give isl_schedule_node *tile_band(
  function __isl_give (line 765) | __isl_give isl_schedule_node *autosa_tile_band(
  function __isl_give (line 813) | static __isl_give isl_schedule_node *autosa_node_merge(
  function __isl_give (line 939) | __isl_give isl_schedule_node *autosa_node_band_tile_loop(
  function __isl_give (line 969) | __isl_give isl_schedule_node *clear_pe_opt_prop(
  function __isl_give (line 986) | __isl_give isl_schedule_node *restore_node_band_prop(
  function __isl_give (line 1024) | __isl_give isl_schedule_node *autosa_node_interchange(
  function __isl_give (line 1062) | __isl_give isl_schedule_node *autosa_node_interchange_up(
  function isl_bool (line 1121) | isl_bool no_permutable_node(__isl_keep isl_schedule_node *node, void *user)
  function isl_bool (line 1131) | isl_bool all_parallel_node(__isl_keep isl_schedule_node *node, void *user)
  function isl_bool (line 1148) | isl_bool is_flow_dep_carried_by_array_part_loops(__isl_keep isl_schedule...
  function is_dep_carried_by_node (line 1220) | int is_dep_carried_by_node(__isl_keep isl_basic_map *dep, __isl_keep isl...
  type insert_node_at_depth_data (line 1251) | struct insert_node_at_depth_data {
    type autosa_node_band_prop (line 1253) | struct autosa_node_band_prop
  function isl_bool (line 1257) | static isl_bool has_inserted_mark(__isl_keep isl_schedule_node *node, vo...
  function __isl_give (line 1265) | static __isl_give isl_schedule_node *delete_inserted_mark(__isl_take isl...
  function isl_bool (line 1273) | static isl_bool has_band_node(__isl_keep isl_schedule_node *node, void *...
  function __isl_give (line 1286) | static __isl_give isl_schedule_node *insert_node_at_depth(
  function __isl_give (line 1352) | __isl_give isl_schedule_node *autosa_node_sink_to_depth(
  type sink_node_to_mark_data (line 1382) | struct sink_node_to_mark_data {
    type autosa_node_band_prop (line 1384) | struct autosa_node_band_prop
  function __isl_give (line 1389) | static __isl_give isl_schedule_node *sink_node_to_mark(
  function __isl_give (line 1493) | __isl_give isl_schedule_node *autosa_node_sink_to_mark(
  function __isl_give (line 1547) | __isl_give isl_schedule_node *reorder_band_by_dep_dis(__isl_take isl_sch...
  function __isl_give (line 1563) | static __isl_give isl_schedule_node *band_sched_pos_setup(
  function __isl_give (line 1582) | __isl_give isl_schedule_node *sched_pos_setup(__isl_take isl_schedule_no...
  function get_band_single_schedule_val (line 1596) | int get_band_single_schedule_val(__isl_keep isl_schedule_node *node)
  function get_last_sched_dim_val (line 1629) | int get_last_sched_dim_val(__isl_keep isl_schedule_node *node)
  function __isl_give (line 1662) | static __isl_give isl_schedule_node *atomic(__isl_take isl_schedule_node...
  function __isl_give (line 1671) | __isl_give isl_schedule_node *autosa_atomic_ancestors(
  function isl_bool (line 1694) | isl_bool isl_schedule_node_is_io_mark(__isl_keep isl_schedule_node *node...
  function is_node_under_simd (line 1732) | int is_node_under_simd(__isl_keep isl_schedule_node *node)
  function is_node_under_latency (line 1759) | int is_node_under_latency(__isl_keep isl_schedule_node *node)
  function __isl_give (line 1818) | static __isl_give isl_multi_aff *parameter_vector(__isl_take isl_space *...
  function __isl_give (line 1871) | __isl_give isl_union_set *set_schedule_eq(
  function __isl_give (line 1908) | __isl_give isl_union_set *set_schedule_neq(
  function __isl_give (line 1954) | static __isl_give isl_schedule_constraints *construct_schedule_constraints(
  function __isl_give (line 2029) | __isl_give isl_schedule *compute_schedule(struct autosa_gen *gen)
  function __isl_give (line 2043) | static __isl_give isl_schedule_node *band_set_permutable(
  function __isl_give (line 2061) | static __isl_give isl_union_map *get_local_coincidence(
  function __isl_give (line 2102) | static __isl_give isl_schedule_node *band_set_coincident(
  function __isl_give (line 2152) | static __isl_give isl_schedule_node *set_band_properties(
  function __isl_give (line 2173) | static __isl_give isl_schedule *determine_properties_original_schedule(
  function __isl_give (line 2191) | static __isl_give isl_schedule *compute_or_set_properties(void *user)
  function __isl_give (line 2205) | __isl_give isl_schedule *get_schedule(struct autosa_gen *gen)
  function isl_bool (line 2216) | static isl_bool is_dep_non_neg_at_node(
  function __isl_give (line 2276) | __isl_give isl_schedule *merge_outer_bands(__isl_take isl_schedule *sche...
  function node_is_array (line 2318) | static int node_is_array(__isl_keep isl_schedule_node *node)
  function node_is_anchor (line 2325) | static int node_is_anchor(__isl_keep isl_schedule_node *node)
  function node_is_local (line 2332) | static int node_is_local(__isl_keep isl_schedule_node *node)
  function node_is_pe (line 2339) | static int node_is_pe(__isl_keep isl_schedule_node *node)
  function node_is_kernel (line 2346) | static int node_is_kernel(__isl_keep isl_schedule_node *node)
  function node_is_mark (line 2353) | static int node_is_mark(__isl_keep isl_schedule_node *node, const char *...
  function node_is_io_mark (line 2360) | static int node_is_io_mark(__isl_keep isl_schedule_node *node)
  function node_is_core (line 2388) | static int node_is_core(__isl_keep isl_schedule_node *node,
  function __isl_give (line 2412) | static __isl_give isl_schedule_node *core_child(
  function __isl_give (line 2450) | __isl_give isl_schedule_node *autosa_tree_move_down_to_depth(
  function __isl_give (line 2485) | __isl_give isl_schedule_node *autosa_tree_move_down_to_array(
  function __isl_give (line 2501) | __isl_give isl_schedule_node *autosa_tree_move_up_to_array(
  function __isl_give (line 2519) | __isl_give isl_schedule_node *autosa_tree_move_down_to_local(
  function __isl_give (line 2538) | __isl_give isl_schedule_node *autosa_tree_move_down_to_kernel(
  function __isl_give (line 2555) | __isl_give isl_schedule_node *autosa_tree_move_up_to_kernel(
  function __isl_give (line 2574) | __isl_give isl_schedule_node *autosa_tree_move_down_to_pe(
  function __isl_give (line 2590) | __isl_give isl_schedule_node *autosa_tree_move_up_to_pe(
  function __isl_give (line 2608) | __isl_give isl_schedule_node *autosa_tree_move_down_to_mark(
  function __isl_give (line 2624) | __isl_give isl_schedule_node *autosa_tree_move_up_to_mark(
  function __isl_give (line 2642) | __isl_give isl_schedule_node *autosa_tree_move_down_to_first_io_mark(
  function __isl_give (line 2660) | __isl_give isl_schedule_node *autosa_tree_move_down_to_io_mark(
  function __isl_give (line 2689) | __isl_give isl_schedule_node *autosa_tree_move_up_to_anchor(
  function autosa_tree_node_is_kernel (line 2705) | int autosa_tree_node_is_kernel(__isl_keep isl_schedule_node *node)
  function autosa_tree_node_is_mark (line 2712) | int autosa_tree_node_is_mark(__isl_keep isl_schedule_node *node, const c...
  function __isl_give (line 2722) | static __isl_give isl_schedule_node *insert_local(
  function __isl_give (line 2744) | __isl_give isl_schedule_node *autosa_tree_insert_local_before_array(

FILE: src/autosa_tapa_cpp.cpp
  type print_host_user_data (line 13) | struct print_host_user_data
    type hls_info (line 15) | struct hls_info
    type autosa_prog (line 16) | struct autosa_prog
    type autosa_hw_top_module (line 17) | struct autosa_hw_top_module
  type print_hw_module_data (line 20) | struct print_hw_module_data
    type hls_info (line 22) | struct hls_info
    type autosa_prog (line 23) | struct autosa_prog
    type autosa_hw_module (line 24) | struct autosa_hw_module
  function print_tapa_host_header (line 31) | static void print_tapa_host_header(FILE *fp)
  function hls_open_files (line 40) | static void hls_open_files(struct hls_info *info, const char *input)
  function hls_close_files (line 128) | static void hls_close_files(struct hls_info *info)
  type autosa_array_ref_group (line 158) | struct autosa_array_ref_group
  type autosa_io_buffer (line 201) | struct autosa_io_buffer
  function isl_stat (line 245) | static isl_stat print_data_types_tapa(
  function __isl_give (line 385) | static __isl_give isl_printer *declare_and_allocate_arrays(
  function __isl_give (line 730) | static __isl_give isl_printer *init_device_tapa(__isl_take isl_printer *p,
  function __isl_give (line 745) | static __isl_give isl_printer *clear_device_tapa(__isl_take isl_printer *p,
  function __isl_give (line 808) | static __isl_give isl_printer *drain_merge_tapa(
  function __isl_give (line 849) | static __isl_give isl_printer *print_device_node_tapa(__isl_take isl_pri...
  function print_kernel_headers_tapa (line 893) | static void print_kernel_headers_tapa(struct autosa_prog *prog,
  function __isl_give (line 920) | static __isl_give isl_printer *print_host_user_tapa(__isl_take isl_print...
  function __isl_give (line 967) | static __isl_give isl_printer *print_module_header_tapa(
  function isl_stat (line 1012) | static isl_stat print_module_headers_tapa(
  function __isl_give (line 1037) | static __isl_give isl_printer *print_module_var_tapa(
  function __isl_give (line 1199) | static __isl_give isl_printer *print_module_vars_tapa(__isl_take isl_pri...
  function __isl_give (line 1247) | static __isl_give isl_printer *print_for_with_pipeline(
  function __isl_give (line 1260) | static __isl_give isl_printer *print_for_with_unroll(
  function __isl_give (line 1273) | static __isl_give isl_printer *print_for_tapa(__isl_take isl_printer *p,
  function __isl_give (line 1310) | static __isl_give isl_printer *autosa_print_intra_trans_module(
  function __isl_give (line 1381) | static __isl_give isl_printer *autosa_print_inter_trans_module(
  function __isl_give (line 1444) | static __isl_give isl_printer *print_module_core_header_tapa(
  function __isl_give (line 1502) | static __isl_give isl_printer *print_module_core_headers_tapa(
  function __isl_give (line 1512) | static __isl_give isl_printer *print_module_wrapper_header_tapa(
  function isl_stat (line 1549) | static isl_stat print_module_wrapper_headers_tapa(
  function __isl_give (line 1574) | static __isl_give isl_printer *autosa_print_serialize_module(
  function __isl_give (line 1615) | static __isl_give isl_printer *autosa_print_default_module(
  function __isl_give (line 1743) | static __isl_give isl_printer *print_pe_dummy_module_core_header_tapa(
  function __isl_give (line 1777) | static __isl_give isl_printer *print_pe_dummy_module_core_headers_tapa(
  function __isl_give (line 1786) | static __isl_give isl_printer *print_pe_dummy_module_wrapper_header_tapa(
  function isl_stat (line 1820) | static isl_stat print_pe_dummy_module_wrapper_headers_tapa(
  function __isl_give (line 1842) | static __isl_give isl_printer *autosa_print_default_pe_dummy_module(
  type print_db_module_while_data (line 1919) | struct print_db_module_while_data {
  function __isl_give (line 1946) | static __isl_give isl_printer *print_double_buffer_module_vars_while(
  function __isl_give (line 2043) | static __isl_give isl_printer *count_module_for(__isl_take isl_printer *p,
  function isl_bool (line 2069) | static isl_bool count_module_for_alt(__isl_keep isl_ast_node *node, void...
  function __isl_give (line 2089) | static __isl_give isl_printer *extract_module_for(__isl_take isl_printer...
  function extract_double_buffer_module_while_data (line 2192) | static void extract_double_buffer_module_while_data(
  function __isl_give (line 2298) | static __isl_give isl_printer *print_null_for(__isl_take isl_printer *p,
  function __isl_give (line 2313) | static __isl_give isl_printer *autosa_print_inter_trans_module_double_bu...
  function __isl_give (line 2336) | static __isl_give isl_printer *autosa_print_intra_trans_module_double_bu...
  function __isl_give (line 2416) | static __isl_give isl_printer *print_double_buffer_module_while(
  function __isl_give (line 2542) | static __isl_give isl_printer *autosa_print_host_code(__isl_take isl_pri...
  function __isl_give (line 2627) | static __isl_give isl_printer *print_top_module_headers_tapa(
  function __isl_give (line 2706) | static __isl_give isl_printer *print_top_module_fifo_stmt(__isl_take isl...
  function __isl_give (line 2729) | static __isl_give isl_printer *print_top_module_call_stmt(
  function print_top_gen_host_code (line 2756) | static void print_top_gen_host_code(
  function __isl_give (line 3087) | static __isl_give isl_printer *print_hw(
  function generate_autosa_tapa_cpp (line 3114) | int generate_autosa_tapa_cpp(isl_ctx *ctx, struct ppcg_options *options,

FILE: src/autosa_tapa_cpp.h
  type ppcg_options (line 13) | struct ppcg_options

FILE: src/autosa_trans.cpp
  function isl_bool (line 19) | isl_bool sa_legality_check(__isl_keep isl_schedule *schedule, struct ppc...
  function cJSON (line 49) | static cJSON *load_tuning_config(char *config_file)
  type autosa_kernel (line 92) | struct autosa_kernel
  type ppcg_scop (line 93) | struct ppcg_scop
  type autosa_kernel (line 96) | struct autosa_kernel
  type autosa_kernel (line 158) | struct autosa_kernel
  type autosa_kernel (line 171) | struct autosa_kernel
  type autosa_kernel (line 172) | struct autosa_kernel
  type autosa_kernel (line 209) | struct autosa_kernel
  type autosa_kernel (line 222) | struct autosa_kernel
  type autosa_kernel (line 223) | struct autosa_kernel
  type autosa_kernel (line 270) | struct autosa_kernel
  type autosa_kernel (line 283) | struct autosa_kernel
  type autosa_kernel (line 284) | struct autosa_kernel
  type autosa_kernel (line 310) | struct autosa_kernel
  type ppcg_scop (line 311) | struct ppcg_scop
  type autosa_kernel (line 314) | struct autosa_kernel
  type autosa_kernel (line 375) | struct autosa_kernel
  type autosa_kernel (line 387) | struct autosa_kernel
  type autosa_kernel (line 388) | struct autosa_kernel
  type autosa_kernel (line 427) | struct autosa_kernel
  type autosa_kernel (line 439) | struct autosa_kernel
  type autosa_kernel (line 440) | struct autosa_kernel
  type autosa_kernel (line 492) | struct autosa_kernel
  type autosa_kernel (line 503) | struct autosa_kernel
  type autosa_kernel (line 504) | struct autosa_kernel
  type autosa_kernel (line 527) | struct autosa_kernel
  type ppcg_scop (line 528) | struct ppcg_scop
  type autosa_kernel (line 544) | struct autosa_kernel
  type ppcg_scop (line 545) | struct ppcg_scop
  type autosa_kernel (line 547) | struct autosa_kernel
  type autosa_kernel (line 565) | struct autosa_kernel
  type autosa_kernel (line 571) | struct autosa_kernel
  type autosa_kernel (line 572) | struct autosa_kernel
  type autosa_kernel (line 589) | struct autosa_kernel
  type autosa_kernel (line 595) | struct autosa_kernel
  type autosa_kernel (line 596) | struct autosa_kernel
  type autosa_kernel (line 613) | struct autosa_kernel
  type autosa_kernel (line 619) | struct autosa_kernel
  type autosa_kernel (line 620) | struct autosa_kernel
  function __isl_give (line 644) | static __isl_give isl_schedule_node *init_band_node_sa_properties(
  function isl_stat (line 669) | isl_stat sa_loop_init(struct autosa_kernel *sa)
  function isl_stat (line 688) | isl_stat sa_space_time_loop_setup(struct autosa_kernel *sa)
  type sa_candidates_smart_pick_update_data (line 724) | struct sa_candidates_smart_pick_update_data
    type autosa_kernel (line 727) | struct autosa_kernel
    type autosa_dep_type (line 728) | enum autosa_dep_type
  type dep_space_test_internal_data (line 732) | struct dep_space_test_internal_data
  function isl_bool (line 744) | static isl_bool not_carried_at_space(__isl_keep isl_schedule_node *node,...
  function isl_bool (line 800) | static isl_bool sa_candidates_smart_pick_update(__isl_keep isl_map *map,...
  type autosa_kernel (line 839) | struct autosa_kernel
  type autosa_kernel (line 840) | struct autosa_kernel
  type autosa_kernel (line 844) | struct autosa_kernel
  type autosa_kernel (line 850) | struct autosa_kernel
  type sa_candidates_smart_pick_update_data (line 851) | struct sa_candidates_smart_pick_update_data
    type autosa_kernel (line 727) | struct autosa_kernel
    type autosa_dep_type (line 728) | enum autosa_dep_type
  type autosa_kernel (line 891) | struct autosa_kernel
  type autosa_kernel (line 891) | struct autosa_kernel
  type autosa_kernel (line 894) | struct autosa_kernel
  type autosa_kernel (line 913) | struct autosa_kernel
  type autosa_kernel (line 914) | struct autosa_kernel
  type autosa_prog (line 914) | struct autosa_prog
  type autosa_kernel (line 928) | struct autosa_kernel
  type data_transfer_opt_data (line 954) | struct data_transfer_opt_data
    type autosa_stmt_access (line 956) | struct autosa_stmt_access
    type autosa_kernel (line 957) | struct autosa_kernel
    type autosa_dep_type (line 958) | enum autosa_dep_type
  function isl_stat (line 966) | isl_stat data_transfer_update(__isl_keep isl_basic_map *dep, struct data...
  function isl_bool (line 1035) | static isl_bool data_transfer_update_wrap(__isl_keep isl_map *map, void ...
  function isl_stat (line 1056) | static isl_stat sa_io_update(struct autosa_kernel *sa)
  function extract_sa_dims_from_node (line 1109) | void extract_sa_dims_from_node(__isl_keep isl_schedule_node *node, int *...
  function isl_stat (line 1131) | isl_stat sa_array_partitioning_optimize(struct autosa_kernel *sa,
  function __isl_give (line 1471) | static __isl_give isl_schedule_node *add_hls_pipeline(
  type latency_opt_check_data (line 1538) | struct latency_opt_check_data
    type autosa_kernel (line 1540) | struct autosa_kernel
  function __isl_give (line 1550) | static __isl_give isl_schedule_node *latency_opt_check(
  function isl_schedule_node (line 1635) | static isl_schedule_node *detect_latency_hiding_loop(__isl_take isl_sche...
  function __isl_give (line 1656) | static __isl_give isl_schedule_node *add_latency_mark(
  function __isl_give (line 1681) | __isl_give isl_schedule_node *autosa_latency_node_band_sink_time(
  function __isl_give (line 1747) | static __isl_give isl_schedule_node *autosa_latency_tile_band_loop(
  type count_latency_hiding_loop_data (line 1850) | struct count_latency_hiding_loop_data
    type autosa_kernel (line 1854) | struct autosa_kernel
  function __isl_give (line 1898) | static __isl_give isl_schedule_node *count_latency_hiding_loop(
  function __isl_give (line 1957) | static __isl_give isl_schedule_node *autosa_latency_tile_loop(
  function isl_stat (line 2083) | isl_stat sa_latency_hiding_optimize(struct autosa_kernel *sa, bool en, c...
  type simd_vectorization_data (line 2158) | struct simd_vectorization_data
    type autosa_kernel (line 2160) | struct autosa_kernel
  type stride_coalesced_data (line 2177) | struct stride_coalesced_data
    type autosa_kernel (line 2179) | struct autosa_kernel
  function isl_bool (line 2189) | static isl_bool is_stride_coalesced_stmt(__isl_keep isl_set *set, void *...
  function isl_bool (line 2273) | static isl_bool is_stride_coalesced_at_node(__isl_keep isl_schedule_node...
  function is_stride_coalesced (line 2311) | static float is_stride_coalesced(__isl_keep isl_schedule_node *node,
  function isl_schedule_node (line 2419) | static isl_schedule_node *detect_simd_vectorization_loop(
  function __isl_give (line 2586) | static __isl_give isl_schedule_node *add_simd_mark(
  function isl_bool (line 2608) | static isl_bool update_simd_acc_stmt(__isl_keep isl_set *set, void *user)
  function isl_bool (line 2661) | static isl_bool update_simd_acc(__isl_keep isl_schedule_node *node, void...
  function __isl_give (line 2690) | static __isl_give isl_schedule_node *autosa_simd_tile_loop(
  function __isl_give (line 2802) | static __isl_give char *load_simd_info(struct autosa_kernel *sa)
  function isl_stat (line 2874) | isl_stat sa_simd_vectorization_optimize(struct autosa_kernel *sa, char *...
  function isl_stat (line 3085) | isl_stat compute_management(
  function __isl_give (line 3143) | static __isl_give isl_set *extract_context(__isl_keep isl_schedule_node ...
  function __isl_give (line 3186) | static __isl_give isl_union_set *accessed_by_domain(
  function __isl_give (line 3221) | static __isl_give isl_multi_pw_aff *extract_grid_size(
  function __isl_give (line 3257) | static __isl_give isl_schedule_node *group_statements(
  function __isl_give (line 3274) | static __isl_give isl_pw_aff *set_universally_zero(__isl_take isl_pw_aff...
  function localize_bounds (line 3301) | static void localize_bounds(struct autosa_kernel *kernel)
  function isl_stat (line 3354) | isl_stat comm_management(struct autosa_kernel *sa, struct autosa_gen *gen)
  type autosa_kernel (line 3366) | struct autosa_kernel
  type autosa_kernel (line 3366) | struct autosa_kernel
  type autosa_gen (line 3366) | struct autosa_gen
  type autosa_kernel (line 3464) | struct autosa_kernel
  type autosa_kernel (line 3464) | struct autosa_kernel
  type autosa_gen (line 3464) | struct autosa_gen
  function __isl_give (line 3570) | static __isl_give isl_schedule_node *compute_and_comm_optimize(
  function __isl_give (line 3676) | static __isl_give isl_union_map *anchored_non_local_accesses(
  function __isl_give (line 3710) | static __isl_give isl_multi_aff *create_from_access(isl_ctx *ctx,
  function __isl_give (line 3776) | static __isl_give isl_schedule_node *add_copies_group_local(
  function __isl_give (line 3877) | static __isl_give isl_schedule_node *add_copies_group(
  function create_kernel_var (line 3890) | static void create_kernel_var(isl_ctx *ctx,
  function isl_stat (line 3915) | static isl_stat create_kernel_vars(struct autosa_kernel *kernel)
  function __isl_give (line 3968) | static __isl_give isl_schedule_node *add_copies(struct autosa_kernel *ke...
  function __isl_give (line 3993) | static __isl_give isl_schedule_node *sa_add_copies(
  function __isl_give (line 4034) | __isl_give isl_schedule *sa_map_to_device(struct autosa_gen *gen,
  function __isl_give (line 4168) | static __isl_give isl_printer *generate(__isl_take isl_printer *p,
  function __isl_give (line 4306) | static __isl_give isl_printer *generate_wrap(__isl_take isl_printer *p,
  function generate_sa (line 4317) | int generate_sa(isl_ctx *ctx, const char *input, FILE *out,

FILE: src/autosa_trans.h
  type autosa_pe_opt_tile_data (line 17) | struct autosa_pe_opt_tile_data
  type ppcg_options (line 27) | struct ppcg_options
  type autosa_prog (line 29) | struct autosa_prog
  type autosa_hw_module (line 30) | struct autosa_hw_module
  type autosa_hw_top_module (line 31) | struct autosa_hw_top_module
  type autosa_drain_merge_func (line 32) | struct autosa_drain_merge_func
  type autosa_types (line 33) | struct autosa_types
  type autosa_gen (line 35) | struct autosa_gen
  type ppcg_scop (line 37) | struct ppcg_scop
  type autosa_kernel (line 40) | struct autosa_kernel
  type ppcg_scop (line 41) | struct ppcg_scop
  type autosa_kernel (line 43) | struct autosa_kernel
  type ppcg_scop (line 44) | struct ppcg_scop
  type autosa_kernel (line 46) | struct autosa_kernel
  type ppcg_scop (line 47) | struct ppcg_scop
  type autosa_kernel (line 49) | struct autosa_kernel
  type autosa_kernel (line 50) | struct autosa_kernel
  type autosa_kernel (line 51) | struct autosa_kernel
  type autosa_kernel (line 52) | struct autosa_kernel
  type autosa_kernel (line 53) | struct autosa_kernel
  type ppcg_scop (line 54) | struct ppcg_scop
  type autosa_kernel (line 58) | struct autosa_kernel
  type autosa_kernel (line 60) | struct autosa_kernel
  type autosa_kernel (line 62) | struct autosa_kernel
  type autosa_gen (line 64) | struct autosa_gen
  type autosa_kernel (line 65) | struct autosa_kernel
  type autosa_kernel (line 67) | struct autosa_kernel
  type autosa_kernel (line 68) | struct autosa_kernel

FILE: src/autosa_tuning.cpp
  function __isl_give (line 15) | __isl_give TPExpr *TPExpr::div_by_param(__isl_take TPExpr *divisor) {
  function __isl_give (line 20) | __isl_give TPExpr *TPExpr::ceil() {
  function __isl_give (line 25) | __isl_give TPExpr *TPExpr::add(__isl_take TPExpr *expr) {
  function __isl_give (line 35) | __isl_give TPExpr *TPExpr::mul(__isl_take TPExpr *expr) {
  function __isl_give (line 51) | __isl_give TPExpr *TPExpr::subtract(__isl_take TPExpr *expr) {
  function __isl_give (line 71) | __isl_give TPExpr *TPExpr::min(__isl_take TPExpr *expr) {
  function __isl_give (line 91) | __isl_give TPExpr *TPExpr::max(__isl_take TPExpr *expr) {
  function __isl_give (line 112) | __isl_give TPExpr *TPExpr::dup() {
  function __isl_give (line 130) | __isl_give TPParameter *TPParameter::dup() {
  function __isl_give (line 153) | __isl_give TPConst *TPConst::dup() {
  function propagate_cst (line 161) | bool propagate_cst(TPExpr *expr, int cst) {
  function __isl_give (line 180) | __isl_give TPExpr *const_propagation(__isl_take TPExpr *expr) {
  function __isl_give (line 207) | __isl_give TPExpr *combine_like_terms(__isl_take TPExpr *expr) {
  function __isl_give (line 236) | __isl_give TPExpr *simplify_chain_ops(__isl_take TPExpr *expr) {
  function __isl_give (line 252) | __isl_give TPExpr *TPExpr::simplify() {
  function __isl_give (line 266) | __isl_give TPExpr *TPExpr::replace(__isl_keep TPExpr *match, __isl_keep ...
  function __isl_give (line 376) | __isl_give TPExpr *TPExpr::infer_bound(
  function __isl_give (line 460) | static __isl_give isl_schedule_node *extract_tuning_program_from_schedule(
  function __isl_give (line 508) | __isl_give isl_schedule *TuningProgram::init_from_schedule(__isl_take is...
  function __isl_give (line 540) | __isl_give isl_schedule_node *TuningProgram::tile(__isl_take isl_schedul...
  function __isl_give (line 605) | __isl_give isl_schedule_node *TuningProgram::tile(
  function __isl_give (line 734) | static __isl_give isl_schedule_node *modify_tuning_schedule(
  function __isl_give (line 776) | __isl_give isl_schedule *TuningProgram::generate_tuning_schedule(__isl_t...
  function extract_isl_ast_node_user (line 791) | std::shared_ptr<json> extract_isl_ast_node_user(__isl_keep isl_ast_node ...
  type extract_loop_info_data (line 811) | struct extract_loop_info_data {
  function extract_loop_info (line 815) | std::shared_ptr<json> extract_loop_info(__isl_keep isl_ast_node *node, v...
  type extract_loop_info_data (line 959) | struct extract_loop_info_data
  type extract_loop_info_data (line 965) | struct extract_loop_info_data
  type build_dim_iter_map_data (line 999) | struct build_dim_iter_map_data {
  function __isl_give (line 1011) | __isl_give isl_schedule_node *build_dim_iter_map(__isl_take isl_schedule...
  function isl_stat (line 1049) | isl_stat extract_dim_expr(__isl_take isl_basic_map *bmap, void *user)
  type build_dim_iter_map_data (line 1106) | struct build_dim_iter_map_data
  function TPArrayTile (line 1194) | TPArrayTile *TuningProgram::infer_tiled_array_bounds(TPArrayTile *tile, ...
  type mul_space_dim_data (line 1225) | struct mul_space_dim_data {
  function isl_bool (line 1230) | isl_bool mul_space_dim(__isl_keep isl_ast_node *node, void *user) {
  type mul_space_dim_data (line 1253) | struct mul_space_dim_data
  type extract_space_dim_data (line 1260) | struct extract_space_dim_data {
  function isl_bool (line 1267) | isl_bool extract_space_dim(__isl_keep isl_ast_node *node, void *user) {
  type extract_space_dim_data (line 1289) | struct extract_space_dim_data
  function isl_bool (line 1295) | isl_bool extract_space_dim_io(__isl_keep isl_ast_node *node, void *user) {
  type extract_space_dim_data (line 1322) | struct extract_space_dim_data

FILE: src/autosa_tuning.h
  function class (line 31) | class TPExpr {
  function virtual (line 64) | virtual ~TPExpr() {
  function class (line 71) | class TPIterator {
  function class (line 91) | class TPParameter: public TPExpr {
  function virtual (line 140) | virtual ~TPParameter(){
  function class (line 150) | class TPConst: public TPExpr {
  function class (line 163) | class TPArrayRef {
  function class (line 194) | class TPArrayTile {

FILE: src/autosa_utils.cpp
  function __isl_give (line 13) | __isl_give isl_union_map *extract_sizes_from_str(isl_ctx *ctx, const cha...
  function isl_stat (line 22) | static isl_stat concat_basic_map(__isl_take isl_map *el, void *user)
  function __isl_give (line 41) | __isl_give isl_basic_map_list *isl_union_map_get_basic_map_list(
  function isl_stat (line 52) | static isl_stat acc_n_basic_map(__isl_take isl_map *el, void *user)
  function isl_size (line 64) | isl_size isl_union_map_n_basic_map(__isl_keep isl_union_map *umap)
  function __isl_give (line 75) | __isl_give isl_basic_map *isl_basic_map_from_map(__isl_take isl_map *map)
  function __isl_give (line 95) | __isl_give isl_union_set *isl_multi_union_pw_aff_nonneg_union_set(
  function isl_stat (line 132) | static isl_stat nonneg_union_set(__isl_take isl_pw_aff *pa, void *user)
  function __isl_give (line 144) | __isl_give isl_union_set *isl_union_pw_aff_nonneg_union_set(
  function __isl_give (line 162) | __isl_give isl_union_set *isl_multi_union_pw_aff_non_zero_union_set(
  function isl_stat (line 199) | static isl_stat non_zero_union_set(__isl_take isl_pw_aff *pa, void *user)
  function __isl_give (line 210) | __isl_give isl_union_set *isl_union_pw_aff_non_zero_union_set(
  function print_mat (line 225) | void print_mat(FILE *fp, __isl_keep isl_mat *mat)
  function isl_vec_cmp (line 242) | int isl_vec_cmp(__isl_keep isl_vec *vec1, __isl_keep isl_vec *vec2)
  function isl_vec_is_zero (line 273) | bool isl_vec_is_zero(__isl_keep isl_vec *vec)
  function suffixcmp (line 289) | int suffixcmp(const char *s, const char *suffix)
  function __isl_give (line 305) | __isl_give isl_set *add_bounded_parameters_dynamic(
  function convert_pwqpoly_to_int (line 350) | long int convert_pwqpoly_to_int(__isl_keep isl_pw_qpolynomial *to_convert)
  function isl_val_get_num (line 389) | long isl_val_get_num(__isl_take isl_val *val)
  function isl_stat (line 401) | static isl_stat find_pa_min(__isl_take isl_set *set, __isl_take isl_aff ...
  function compute_set_min (line 414) | long compute_set_min(__isl_keep isl_set *set, int dim)
  function isl_stat (line 424) | static isl_stat find_pa_max(__isl_take isl_set *set, __isl_take isl_aff ...
  function compute_set_max (line 437) | long compute_set_max(__isl_keep isl_set *set, int dim)
  function get_factors (line 447) | std::vector<int> get_factors(int x) {

FILE: src/autosa_xilinx_hls_c.cpp
  type print_host_user_data (line 13) | struct print_host_user_data
    type hls_info (line 15) | struct hls_info
    type autosa_prog (line 16) | struct autosa_prog
    type autosa_hw_top_module (line 17) | struct autosa_hw_top_module
  type print_hw_module_data (line 20) | struct print_hw_module_data
    type hls_info (line 22) | struct hls_info
    type autosa_prog (line 23) | struct autosa_prog
    type autosa_hw_module (line 24) | struct autosa_hw_module
  function print_xilinx_host_header (line 31) | static void print_xilinx_host_header(FILE *fp)
  function hls_open_files (line 117) | static void hls_open_files(struct hls_info *info, const char *input)
  function hls_close_files (line 214) | static 
Condensed preview — 587 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (9,930K chars).
[
  {
    "path": ".dockerignore",
    "chars": 508,
    "preview": "src/.deps/\nsrc/.libs/\nsrc/Makefile\nsrc/Makefile.in\nsrc/aclocal.m4\nsrc/autom4te.cache/\nsrc/compile\nsrc/config.guess\nsrc/c"
  },
  {
    "path": ".gitignore",
    "chars": 819,
    "preview": "src/.deps/\nsrc/.libs/\nsrc/Makefile\nsrc/Makefile.in\nsrc/aclocal.m4\nsrc/autom4te.cache/\nsrc/compile\nsrc/config.guess\nsrc/c"
  },
  {
    "path": ".gitmodules",
    "chars": 316,
    "preview": "[submodule \"src/isl\"]\n\tpath = src/isl\n\turl = git://repo.or.cz/isl.git\n[submodule \"src/pet\"]\n\tpath = src/pet\n\turl = git:/"
  },
  {
    "path": "ChangeLog",
    "chars": 94,
    "preview": "version: 0.01\n2020-5-10 Jie Wang <jiewang@cs.ucla.edu>\nchanges:\n  - initial release of AutoSA\n"
  },
  {
    "path": "Dockerfile",
    "chars": 1114,
    "preview": "# Get the base Ubuntu image from Docker Hub\nFROM ubuntu:latest\nLABEL maintainer=\"jiewang@cs.ucla.edu\"\nENV DEBIAN_FRONTEN"
  },
  {
    "path": "LICENSE",
    "chars": 1042,
    "preview": "MIT License (MIT)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and ass"
  },
  {
    "path": "README.md",
    "chars": 4803,
    "preview": "<div align=\"center\">\n  <img src=\".github/autosa_logo.png\", width=\"200\">\n</div>\n\n# AutoSA: Polyhedral-Based Systolic Arra"
  },
  {
    "path": "autosa_config/autosa_config.json",
    "chars": 386,
    "preview": "{\n    \"space_time\": {\n        \"mode\": \"manual\"\n    },\n    \"array_part\": {\n        \"enable\": 1,\n        \"mode\": \"manual\"\n"
  },
  {
    "path": "autosa_config/hw_info.json",
    "chars": 89,
    "preview": "{\n  \"BRAM18K\": 5376,\n  \"DSP\": 12288,\n  \"FF\": 3456000,\n  \"LUT\": 1728000,\n  \"URAM\": 1280\n}\n"
  },
  {
    "path": "autosa_config/hw_info_libs/hw_info.json.ku3",
    "chars": 80,
    "preview": "{\n  \"BRAM\": 2160,\n  \"DSP\": 2760,\n  \"FF\": 663360,\n  \"LUT\": 331680,\n  \"URAM\": 0\n}\n"
  },
  {
    "path": "autosa_config/hw_info_libs/hw_info.json.u200",
    "chars": 84,
    "preview": "{\n  \"BRAM\": 4320,\n  \"DSP\": 6840,\n  \"FF\": 2364480,\n  \"LUT\": 1182240,\n  \"URAM\": 960\n}\n"
  },
  {
    "path": "autosa_config/hw_info_libs/hw_info.json.u250",
    "chars": 89,
    "preview": "{\n  \"BRAM18K\": 5376,\n  \"DSP\": 12288,\n  \"FF\": 3456000,\n  \"LUT\": 1728000,\n  \"URAM\": 1280\n}\n"
  },
  {
    "path": "autosa_config/module_group.json",
    "chars": 23,
    "preview": "{\n  \"x\": 8,\n  \"y\": 1\n}\n"
  },
  {
    "path": "autosa_config/optimizer_settings.json",
    "chars": 3772,
    "preview": "{\n    \"training\": {\n        \"sample\": {\n            \"space_time\": {\n                \"mode\": \"exhaustive\",\n              "
  },
  {
    "path": "autosa_config/optimizer_settings_libs/gemm3_fp32.json",
    "chars": 3771,
    "preview": "{\n    \"training\": {\n        \"sample\": {\n            \"space_time\": {\n                \"mode\": \"exhaustive\",\n              "
  },
  {
    "path": "autosa_config/optimizer_settings_libs/gemm3_int16.json",
    "chars": 3771,
    "preview": "{\n    \"training\": {\n        \"sample\": {\n            \"space_time\": {\n                \"mode\": \"exhaustive\",\n              "
  },
  {
    "path": "autosa_config/optimizer_settings_libs/gemm3_int16_32.json",
    "chars": 3760,
    "preview": "{\n    \"training\": {\n        \"sample\": {\n            \"space_time\": {\n                \"mode\": \"exhaustive\",\n              "
  },
  {
    "path": "autosa_config/optimizer_settings_libs/gemm3_int8.json",
    "chars": 3773,
    "preview": "{\n    \"training\": {\n        \"sample\": {\n            \"space_time\": {\n                \"mode\": \"exhaustive\",\n              "
  },
  {
    "path": "autosa_config/optimizer_settings_libs/gemm3_int8_64.json",
    "chars": 3762,
    "preview": "{\n    \"training\": {\n        \"sample\": {\n            \"space_time\": {\n                \"mode\": \"exhaustive\",\n              "
  },
  {
    "path": "autosa_config/optimizer_settings_libs/gemm4_fp32.json",
    "chars": 3769,
    "preview": "{\n    \"training\": {\n        \"sample\": {\n            \"space_time\": {\n                \"mode\": \"exhaustive\",\n              "
  },
  {
    "path": "autosa_config/optimizer_settings_libs/mm_small.json",
    "chars": 3768,
    "preview": "{\n    \"training\": {\n        \"sample\": {\n            \"space_time\": {\n                \"mode\": \"exhaustive\",\n              "
  },
  {
    "path": "autosa_config/optimizer_settings_libs/mttkrp_fp32.json",
    "chars": 3769,
    "preview": "{\n    \"training\": {\n        \"sample\": {\n            \"space_time\": {\n                \"mode\": \"exhaustive\",\n              "
  },
  {
    "path": "autosa_config/optimizer_settings_libs/ttm_fp32.json",
    "chars": 3768,
    "preview": "{\n    \"training\": {\n        \"sample\": {\n            \"space_time\": {\n                \"mode\": \"exhaustive\",\n              "
  },
  {
    "path": "autosa_config/optimizer_settings_libs/ttmc_fp32.json",
    "chars": 3768,
    "preview": "{\n    \"training\": {\n        \"sample\": {\n            \"space_time\": {\n                \"mode\": \"exhaustive\",\n              "
  },
  {
    "path": "autosa_scripts/autosa.py",
    "chars": 7028,
    "preview": "#!/usr/bin/env python3\nimport sys\nimport subprocess\nimport os\nimport time\n\ndef exec_sys_cmd(cmd):\n    p = subprocess.Pop"
  },
  {
    "path": "autosa_scripts/codegen.py",
    "chars": 50662,
    "preview": "#!/usr/bin/env python3\n\nimport sympy\nimport sys\nimport argparse\nimport re\nimport numpy as np\nimport os\n\ndef delete_arg_f"
  },
  {
    "path": "autosa_scripts/hls_scripts/hls_script.tcl",
    "chars": 717,
    "preview": "############################################################\n## This file is generated automatically by Vivado HLS.\n## P"
  },
  {
    "path": "autosa_scripts/hls_scripts/hls_script_synth.tcl",
    "chars": 717,
    "preview": "############################################################\n## This file is generated automatically by Vivado HLS.\n## P"
  },
  {
    "path": "autosa_scripts/intel_opencl_scripts/Makefile",
    "chars": 3895,
    "preview": "APP ?= kernel\nAOCL_BOARD ?= s10mx_hbm_es\nSW_EMU_AOCX ?= $(APP)_sw_emu.aocx\nHW_EMU_AOCX ?= $(APP)_hw_emu.aocx\nHW_AOCX ?= "
  },
  {
    "path": "autosa_scripts/intel_opencl_scripts/common/inc/AOCLUtils/aocl_utils.h",
    "chars": 1539,
    "preview": "// Copyright (C) 2013-2020 Altera Corporation, San Jose, California, USA. All rights reserved.\n// Permission is hereby g"
  },
  {
    "path": "autosa_scripts/intel_opencl_scripts/common/inc/AOCLUtils/opencl.h",
    "chars": 4913,
    "preview": "// Copyright (C) 2013-2020 Altera Corporation, San Jose, California, USA. All rights reserved.\n// Permission is hereby g"
  },
  {
    "path": "autosa_scripts/intel_opencl_scripts/common/inc/AOCLUtils/options.h",
    "chars": 4618,
    "preview": "// Copyright (C) 2013-2020 Altera Corporation, San Jose, California, USA. All rights reserved.\n// Permission is hereby g"
  },
  {
    "path": "autosa_scripts/intel_opencl_scripts/common/inc/AOCLUtils/scoped_ptrs.h",
    "chars": 5773,
    "preview": "// Copyright (C) 2013-2020 Altera Corporation, San Jose, California, USA. All rights reserved.\n// Permission is hereby g"
  },
  {
    "path": "autosa_scripts/intel_opencl_scripts/common/readme.css",
    "chars": 5219,
    "preview": "/*\nCopyright (C) 2013-2020 Altera Corporation, San Jose, California, USA. All rights reserved.\nPermission is hereby gran"
  },
  {
    "path": "autosa_scripts/intel_opencl_scripts/common/src/AOCLUtils/opencl.cpp",
    "chars": 17325,
    "preview": "// Copyright (C) 2013-2020 Altera Corporation, San Jose, California, USA. All rights reserved.\n// Permission is hereby g"
  },
  {
    "path": "autosa_scripts/intel_opencl_scripts/common/src/AOCLUtils/options.cpp",
    "chars": 3191,
    "preview": "// Copyright (C) 2013-2020 Altera Corporation, San Jose, California, USA. All rights reserved.\n// Permission is hereby g"
  },
  {
    "path": "autosa_scripts/intel_opencl_scripts/compile_design.sh",
    "chars": 1200,
    "preview": "#!/bin/bash\n\n# - A script to compile and run the host program and bitstream on Intel OpenCL platform\n\nif [ $# != 1 ];\nth"
  },
  {
    "path": "autosa_scripts/latency_model.py",
    "chars": 21473,
    "preview": "import os\nimport json\nimport re\nimport xml.etree.ElementTree as ET\nimport numpy as np\nimport pandas as pd\nimport joblib\n"
  },
  {
    "path": "autosa_scripts/module_group.py",
    "chars": 17333,
    "preview": "#!/usr/bin/env python3\n\nimport sympy\nimport sys\nimport argparse\nimport re\nimport json\nimport numpy as np\n\n\ndef compose_f"
  },
  {
    "path": "autosa_scripts/odyssey/RL_utils.py",
    "chars": 16688,
    "preview": "import torch.nn as nn\nimport numpy as np\nimport random\nimport bisect\nimport copy\n\nimport torch\nimport torch.optim as opt"
  },
  {
    "path": "autosa_scripts/odyssey/analyze.py",
    "chars": 4091,
    "preview": "import seaborn as sns\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport csv\nimport pandas as pd\nimport os\nimport"
  },
  {
    "path": "autosa_scripts/odyssey/clean_up.sh",
    "chars": 93,
    "preview": "#!/bin/bash\n\nrm -rf db/*\nrm -rf opentuner.db\nrm -rf outdir/*\nrm -rf __pycache__\nrm -rf tmp/*\n"
  },
  {
    "path": "autosa_scripts/odyssey/cst/hw_cst.json",
    "chars": 274,
    "preview": "{\n  \"BRAM18K\": {\n    \"total\": 5376,\n    \"ratio\": 0.7\n  },\n  \"DSP\": {\n    \"total\": 12288,\n    \"ratio\": 0.7\n  },\n  \"FF\": {"
  },
  {
    "path": "autosa_scripts/odyssey/cst/single_test.json",
    "chars": 271,
    "preview": "{\n  \"BRAM18K\": {\n    \"total\": 300,\n    \"ratio\": 1.0\n  },\n  \"DSP\": {\n    \"total\": 800,\n    \"ratio\": 1.0\n  },\n  \"FF\": {\n  "
  },
  {
    "path": "autosa_scripts/odyssey/cst/u250.json",
    "chars": 274,
    "preview": "{\n  \"BRAM18K\": {\n    \"total\": 5376,\n    \"ratio\": 0.7\n  },\n  \"DSP\": {\n    \"total\": 12288,\n    \"ratio\": 0.7\n  },\n  \"FF\": {"
  },
  {
    "path": "autosa_scripts/odyssey/cst/vu9p.json",
    "chars": 163,
    "preview": "{\n  \"BRAM18K\": {\n    \"total\": 4318,\n    \"ratio\": 0.7\n  },\n  \"DSP\": {\n    \"total\": 6840,\n    \"ratio\": 0.7\n  },\n  \"URAM\": "
  },
  {
    "path": "autosa_scripts/odyssey/design.py",
    "chars": 46985,
    "preview": "import numpy as np\nimport json\nimport sys\nimport os\nfrom numpy import ceil, floor\n\nclass Design(object):\n    def __init_"
  },
  {
    "path": "autosa_scripts/odyssey/designs/kernel3.json",
    "chars": 44425,
    "preview": "{\n    \"attr\": {\n        \"A_IO_L2_in\": {\n            \"double_buffer\": 1,\n            \"filter\": 1,\n            \"in\": 1,\n  "
  },
  {
    "path": "autosa_scripts/odyssey/designs_lib/cnn/kernel0_0.json",
    "chars": 73668,
    "preview": "{\n    \"attr\": {\n        \"PE\": {\n            \"double_buffer\": 0,\n            \"filter\": 0,\n            \"in\": -1,\n         "
  },
  {
    "path": "autosa_scripts/odyssey/designs_lib/cnn/kernel0_1.json",
    "chars": 50739,
    "preview": "{\n    \"attr\": {\n        \"PE\": {\n            \"double_buffer\": 0,\n            \"filter\": 0,\n            \"in\": -1,\n         "
  },
  {
    "path": "autosa_scripts/odyssey/designs_lib/cnn/kernel0_2.json",
    "chars": 74400,
    "preview": "{\n    \"attr\": {\n        \"PE\": {\n            \"double_buffer\": 0,\n            \"filter\": 0,\n            \"in\": -1,\n         "
  },
  {
    "path": "autosa_scripts/odyssey/designs_lib/cnn/kernel1_0.json",
    "chars": 74488,
    "preview": "{\n    \"attr\": {\n        \"PE\": {\n            \"double_buffer\": 0,\n            \"filter\": 0,\n            \"in\": -1,\n         "
  },
  {
    "path": "autosa_scripts/odyssey/designs_lib/cnn/kernel1_1.json",
    "chars": 50752,
    "preview": "{\n    \"attr\": {\n        \"PE\": {\n            \"double_buffer\": 0,\n            \"filter\": 0,\n            \"in\": -1,\n         "
  },
  {
    "path": "autosa_scripts/odyssey/designs_lib/cnn/kernel1_2.json",
    "chars": 73681,
    "preview": "{\n    \"attr\": {\n        \"PE\": {\n            \"double_buffer\": 0,\n            \"filter\": 0,\n            \"in\": -1,\n         "
  },
  {
    "path": "autosa_scripts/odyssey/designs_lib/cnn/kernel2_0.json",
    "chars": 74488,
    "preview": "{\n    \"attr\": {\n        \"PE\": {\n            \"double_buffer\": 0,\n            \"filter\": 0,\n            \"in\": -1,\n         "
  },
  {
    "path": "autosa_scripts/odyssey/designs_lib/cnn/kernel2_1.json",
    "chars": 50752,
    "preview": "{\n    \"attr\": {\n        \"PE\": {\n            \"double_buffer\": 0,\n            \"filter\": 0,\n            \"in\": -1,\n         "
  },
  {
    "path": "autosa_scripts/odyssey/designs_lib/cnn/kernel2_2.json",
    "chars": 73681,
    "preview": "{\n    \"attr\": {\n        \"PE\": {\n            \"double_buffer\": 0,\n            \"filter\": 0,\n            \"in\": -1,\n         "
  },
  {
    "path": "autosa_scripts/odyssey/designs_lib/cnn/kernel3_0.json",
    "chars": 71637,
    "preview": "{\n    \"attr\": {\n        \"PE\": {\n            \"double_buffer\": 0,\n            \"filter\": 0,\n            \"in\": -1,\n         "
  },
  {
    "path": "autosa_scripts/odyssey/designs_lib/cnn/kernel3_1.json",
    "chars": 53722,
    "preview": "{\n    \"attr\": {\n        \"PE\": {\n            \"double_buffer\": 0,\n            \"filter\": 0,\n            \"in\": -1,\n         "
  },
  {
    "path": "autosa_scripts/odyssey/designs_lib/cnn/kernel3_2.json",
    "chars": 71562,
    "preview": "{\n    \"attr\": {\n        \"PE\": {\n            \"double_buffer\": 0,\n            \"filter\": 0,\n            \"in\": -1,\n         "
  },
  {
    "path": "autosa_scripts/odyssey/designs_lib/cnn/kernel4_0.json",
    "chars": 94254,
    "preview": "{\n    \"attr\": {\n        \"PE\": {\n            \"double_buffer\": 0,\n            \"filter\": 0,\n            \"in\": -1,\n         "
  },
  {
    "path": "autosa_scripts/odyssey/designs_lib/cnn/kernel4_1.json",
    "chars": 59607,
    "preview": "{\n    \"attr\": {\n        \"PE\": {\n            \"double_buffer\": 0,\n            \"filter\": 0,\n            \"in\": -1,\n         "
  },
  {
    "path": "autosa_scripts/odyssey/designs_lib/cnn/kernel4_2.json",
    "chars": 94163,
    "preview": "{\n    \"attr\": {\n        \"PE\": {\n            \"double_buffer\": 0,\n            \"filter\": 0,\n            \"in\": -1,\n         "
  },
  {
    "path": "autosa_scripts/odyssey/designs_lib/cnn/kernel5_0.json",
    "chars": 94254,
    "preview": "{\n    \"attr\": {\n        \"PE\": {\n            \"double_buffer\": 0,\n            \"filter\": 0,\n            \"in\": -1,\n         "
  },
  {
    "path": "autosa_scripts/odyssey/designs_lib/cnn/kernel5_1.json",
    "chars": 59607,
    "preview": "{\n    \"attr\": {\n        \"PE\": {\n            \"double_buffer\": 0,\n            \"filter\": 0,\n            \"in\": -1,\n         "
  },
  {
    "path": "autosa_scripts/odyssey/designs_lib/cnn/kernel5_2.json",
    "chars": 94163,
    "preview": "{\n    \"attr\": {\n        \"PE\": {\n            \"double_buffer\": 0,\n            \"filter\": 0,\n            \"in\": -1,\n         "
  },
  {
    "path": "autosa_scripts/odyssey/designs_lib/cnn/kernel6_0.json",
    "chars": 89090,
    "preview": "{\n    \"attr\": {\n        \"PE\": {\n            \"double_buffer\": 0,\n            \"filter\": 0,\n            \"in\": -1,\n         "
  },
  {
    "path": "autosa_scripts/odyssey/designs_lib/cnn/kernel6_1.json",
    "chars": 63238,
    "preview": "{\n    \"attr\": {\n        \"PE\": {\n            \"double_buffer\": 0,\n            \"filter\": 0,\n            \"in\": -1,\n         "
  },
  {
    "path": "autosa_scripts/odyssey/designs_lib/cnn/kernel6_2.json",
    "chars": 88331,
    "preview": "{\n    \"attr\": {\n        \"PE\": {\n            \"double_buffer\": 0,\n            \"filter\": 0,\n            \"in\": -1,\n         "
  },
  {
    "path": "autosa_scripts/odyssey/designs_lib/cnn/kernel7_0.json",
    "chars": 98881,
    "preview": "{\n    \"attr\": {\n        \"PE\": {\n            \"double_buffer\": 0,\n            \"filter\": 0,\n            \"in\": -1,\n         "
  },
  {
    "path": "autosa_scripts/odyssey/designs_lib/cnn/kernel7_1.json",
    "chars": 65073,
    "preview": "{\n    \"attr\": {\n        \"PE\": {\n            \"double_buffer\": 0,\n            \"filter\": 0,\n            \"in\": -1,\n         "
  },
  {
    "path": "autosa_scripts/odyssey/designs_lib/cnn/kernel7_2.json",
    "chars": 99549,
    "preview": "{\n    \"attr\": {\n        \"PE\": {\n            \"double_buffer\": 0,\n            \"filter\": 0,\n            \"in\": -1,\n         "
  },
  {
    "path": "autosa_scripts/odyssey/designs_lib/cnn/kernel8_0.json",
    "chars": 88294,
    "preview": "{\n    \"attr\": {\n        \"PE\": {\n            \"double_buffer\": 0,\n            \"filter\": 0,\n            \"in\": -1,\n         "
  },
  {
    "path": "autosa_scripts/odyssey/designs_lib/cnn/kernel8_1.json",
    "chars": 63201,
    "preview": "{\n    \"attr\": {\n        \"PE\": {\n            \"double_buffer\": 0,\n            \"filter\": 0,\n            \"in\": -1,\n         "
  },
  {
    "path": "autosa_scripts/odyssey/designs_lib/cnn/kernel8_2.json",
    "chars": 88962,
    "preview": "{\n    \"attr\": {\n        \"PE\": {\n            \"double_buffer\": 0,\n            \"filter\": 0,\n            \"in\": -1,\n         "
  },
  {
    "path": "autosa_scripts/odyssey/designs_lib/cnn/kernel9_0.json",
    "chars": 88294,
    "preview": "{\n    \"attr\": {\n        \"PE\": {\n            \"double_buffer\": 0,\n            \"filter\": 0,\n            \"in\": -1,\n         "
  },
  {
    "path": "autosa_scripts/odyssey/designs_lib/cnn/kernel9_1.json",
    "chars": 63201,
    "preview": "{\n    \"attr\": {\n        \"PE\": {\n            \"double_buffer\": 0,\n            \"filter\": 0,\n            \"in\": -1,\n         "
  },
  {
    "path": "autosa_scripts/odyssey/designs_lib/cnn/kernel9_2.json",
    "chars": 88962,
    "preview": "{\n    \"attr\": {\n        \"PE\": {\n            \"double_buffer\": 0,\n            \"filter\": 0,\n            \"in\": -1,\n         "
  },
  {
    "path": "autosa_scripts/odyssey/designs_lib/gemm/kernel0_0.json",
    "chars": 55321,
    "preview": "{\n    \"attr\": {\n        \"A_IO_L1_in\": {\n            \"double_buffer\": 1,\n            \"filter\": 1,\n            \"in\": 1,\n  "
  },
  {
    "path": "autosa_scripts/odyssey/designs_lib/gemm/kernel0_1.json",
    "chars": 54882,
    "preview": "{\n    \"attr\": {\n        \"A_IO_L1_in\": {\n            \"double_buffer\": 1,\n            \"filter\": 1,\n            \"in\": 1,\n  "
  },
  {
    "path": "autosa_scripts/odyssey/designs_lib/gemm/kernel0_2.json",
    "chars": 36451,
    "preview": "{\n    \"attr\": {\n        \"A_IO_L1_in\": {\n            \"double_buffer\": 1,\n            \"filter\": 1,\n            \"in\": 1,\n  "
  },
  {
    "path": "autosa_scripts/odyssey/designs_lib/gemm/kernel1_0.json",
    "chars": 54884,
    "preview": "{\n    \"attr\": {\n        \"A_IO_L2_in\": {\n            \"double_buffer\": 1,\n            \"filter\": 1,\n            \"in\": 1,\n  "
  },
  {
    "path": "autosa_scripts/odyssey/designs_lib/gemm/kernel1_1.json",
    "chars": 55323,
    "preview": "{\n    \"attr\": {\n        \"A_IO_L2_in\": {\n            \"double_buffer\": 1,\n            \"filter\": 1,\n            \"in\": 1,\n  "
  },
  {
    "path": "autosa_scripts/odyssey/designs_lib/gemm/kernel1_2.json",
    "chars": 36453,
    "preview": "{\n    \"attr\": {\n        \"A_IO_L2_in\": {\n            \"double_buffer\": 1,\n            \"filter\": 1,\n            \"in\": 1,\n  "
  },
  {
    "path": "autosa_scripts/odyssey/designs_lib/gemm/kernel2_0.json",
    "chars": 51513,
    "preview": "{\n    \"attr\": {\n        \"A_IO_L1_in\": {\n            \"double_buffer\": 1,\n            \"filter\": 1,\n            \"in\": 1,\n  "
  },
  {
    "path": "autosa_scripts/odyssey/designs_lib/gemm/kernel2_1.json",
    "chars": 51513,
    "preview": "{\n    \"attr\": {\n        \"A_IO_L1_in\": {\n            \"double_buffer\": 1,\n            \"filter\": 1,\n            \"in\": 1,\n  "
  },
  {
    "path": "autosa_scripts/odyssey/designs_lib/gemm/kernel2_2.json",
    "chars": 37898,
    "preview": "{\n    \"attr\": {\n        \"A_IO_L1_in\": {\n            \"double_buffer\": 1,\n            \"filter\": 1,\n            \"in\": 1,\n  "
  },
  {
    "path": "autosa_scripts/odyssey/designs_lib/gemm/kernel3_0.json",
    "chars": 73162,
    "preview": "{\n    \"attr\": {\n        \"A_IO_L2_in\": {\n            \"double_buffer\": 1,\n            \"filter\": 1,\n            \"in\": 1,\n  "
  },
  {
    "path": "autosa_scripts/odyssey/designs_lib/gemm/kernel3_1.json",
    "chars": 73162,
    "preview": "{\n    \"attr\": {\n        \"A_IO_L2_in\": {\n            \"double_buffer\": 1,\n            \"filter\": 1,\n            \"in\": 1,\n  "
  },
  {
    "path": "autosa_scripts/odyssey/designs_lib/gemm/kernel3_2.json",
    "chars": 44425,
    "preview": "{\n    \"attr\": {\n        \"A_IO_L2_in\": {\n            \"double_buffer\": 1,\n            \"filter\": 1,\n            \"in\": 1,\n  "
  },
  {
    "path": "autosa_scripts/odyssey/designs_lib/gemm/kernel4_0.json",
    "chars": 66817,
    "preview": "{\n    \"attr\": {\n        \"A_IO_L1_in\": {\n            \"double_buffer\": 1,\n            \"filter\": 1,\n            \"in\": 1,\n  "
  },
  {
    "path": "autosa_scripts/odyssey/designs_lib/gemm/kernel4_1.json",
    "chars": 67208,
    "preview": "{\n    \"attr\": {\n        \"A_IO_L1_in\": {\n            \"double_buffer\": 1,\n            \"filter\": 1,\n            \"in\": 1,\n  "
  },
  {
    "path": "autosa_scripts/odyssey/designs_lib/gemm/kernel4_2.json",
    "chars": 46466,
    "preview": "{\n    \"attr\": {\n        \"A_IO_L1_in\": {\n            \"double_buffer\": 1,\n            \"filter\": 1,\n            \"in\": 1,\n  "
  },
  {
    "path": "autosa_scripts/odyssey/designs_lib/gemm/kernel5_0.json",
    "chars": 67208,
    "preview": "{\n    \"attr\": {\n        \"A_IO_L2_in\": {\n            \"double_buffer\": 1,\n            \"filter\": 1,\n            \"in\": 1,\n  "
  },
  {
    "path": "autosa_scripts/odyssey/designs_lib/gemm/kernel5_1.json",
    "chars": 66817,
    "preview": "{\n    \"attr\": {\n        \"A_IO_L2_in\": {\n            \"double_buffer\": 1,\n            \"filter\": 1,\n            \"in\": 1,\n  "
  },
  {
    "path": "autosa_scripts/odyssey/designs_lib/gemm/kernel5_2.json",
    "chars": 46467,
    "preview": "{\n    \"attr\": {\n        \"A_IO_L2_in\": {\n            \"double_buffer\": 1,\n            \"filter\": 1,\n            \"in\": 1,\n  "
  },
  {
    "path": "autosa_scripts/odyssey/explorer.py",
    "chars": 69998,
    "preview": "import copy\nimport pprint\nimport numpy as np\nimport random\n\nimport utils\nimport tuners\nfrom search_task import SingleTas"
  },
  {
    "path": "autosa_scripts/odyssey/main.py",
    "chars": 7768,
    "preview": "import argparse\nfrom datetime import datetime\nimport logging\nimport numpy as np\nimport os\nimport pickle\nimport concurren"
  },
  {
    "path": "autosa_scripts/odyssey/requirements.txt",
    "chars": 1006,
    "preview": "bayesian-optimization==1.1.0\ncertifi==2021.10.8\ndill @ file:///home/conda/feedstock_root/build_artifacts/dill_1623610058"
  },
  {
    "path": "autosa_scripts/odyssey/scripts/compute_network_info.py",
    "chars": 2499,
    "preview": "import csv\nimport json\n\ncsv_columns = [\"Layer\", \"Name\", \"i\", \"o\", \"r\", \"c\", \"p\", \"q\", \"ops\", \"parallelism\", \"ai\", \"paral"
  },
  {
    "path": "autosa_scripts/odyssey/scripts/grid_search_xgb_params.py",
    "chars": 1952,
    "preview": "import os\nimport subprocess\nimport re\nimport pprint\n\n'''\nfor model_gens in [5, 10, 20, 50]:\n    for xgb_thres in [0.2, 0"
  },
  {
    "path": "autosa_scripts/odyssey/scripts/img2col.py",
    "chars": 726,
    "preview": "import json\n\n#with open('workload/vgg16.json') as f:\n#with open('workload/resnet50.json') as f:\nwith open('workload/mobi"
  },
  {
    "path": "autosa_scripts/odyssey/scripts/run_arch1.sh",
    "chars": 456,
    "preview": "#!/bin/bash\n\ncd ..\nrm -rf outdir/*\nrm -rf tmp/*\nfor design_idx in 1 4 7 10 13 16 19 22 25 28\ndo\n    python main.py --wor"
  },
  {
    "path": "autosa_scripts/odyssey/scripts/run_arch1_free.sh",
    "chars": 610,
    "preview": "#!/bin/bash\n\ncd ..\nrm -rf outdir/*\nrm -rf tmp/*\nfor design_idx in 1 4 7 10 13 16 19 22 25 28\ndo\n    #for layer_idx in {1"
  },
  {
    "path": "autosa_scripts/odyssey/scripts/run_arch1_ml_cmp.sh",
    "chars": 345,
    "preview": "#!/bin/bash\n\ncd ..\nrm -rf outdir/*\n#rm -rf tmp/*\nfor design_idx in 1 4 7 10 13 16 19 22 25 28\ndo\n    #python main.py --w"
  },
  {
    "path": "autosa_scripts/odyssey/scripts/run_arch2.sh",
    "chars": 1479,
    "preview": "#!/bin/bash\n\ncd ..\nrm -rf outdir/*\nrm -rf tmp/*\n\npython main.py --workload=vgg16 --stop-after-time=10 --use-db=0 --n-wor"
  },
  {
    "path": "autosa_scripts/odyssey/scripts/run_arch3.sh",
    "chars": 1057,
    "preview": "#!/bin/bash\n\ncd ..\nrm -rf outdir/*\nrm -rf tmp/*\n\n#python main.py --workload=vgg16 --stop-after-time=10 --use-db=0 --n-wo"
  },
  {
    "path": "autosa_scripts/odyssey/scripts/run_arch4.sh",
    "chars": 2157,
    "preview": "#!/bin/bash\n\ncd ..\nrm -rf outdir/*\n#rm -rf tmp/*\n\n#python main.py --workload=vgg16 --stop-after-time=10 --use-db=0 --n-w"
  },
  {
    "path": "autosa_scripts/odyssey/scripts/run_dataflow_cmp_cnn.sh",
    "chars": 347,
    "preview": "#!/bin/bash\n\ncd ..\nrm -rf outdir/*\nrm -rf tmp/*\n#for design_idx in {0..29}\nfor design_idx in 6 7 8 15 16 17 27 28 29\ndo\n"
  },
  {
    "path": "autosa_scripts/odyssey/scripts/run_dataflow_cmp_mm.sh",
    "chars": 657,
    "preview": "#!/bin/bash\n\ncd ..\nrm -rf outdir/*\nrm -rf tmp/*\n#for design_idx in {0..17}\nfor design_idx in 0\n#for design_idx in {14..1"
  },
  {
    "path": "autosa_scripts/odyssey/scripts/run_dataflow_cmp_mm_energy.sh",
    "chars": 260,
    "preview": "#!/bin/bash\n\ncd ..\nrm -rf outdir/*\nrm -rf tmp/*\nfor design_idx in {0..17}\ndo    \n    python main.py --workload=mm --stop"
  },
  {
    "path": "autosa_scripts/odyssey/scripts/run_img2col_single.sh",
    "chars": 291,
    "preview": "#!/bin/bash\n\ncd ..\npython main.py --workload=vgg16_img2col --stop-after-time=10 --use-db=0 --n-worker=32\npython main.py "
  },
  {
    "path": "autosa_scripts/odyssey/scripts/run_method_cmp.sh",
    "chars": 1032,
    "preview": "#!/bin/bash\n\ncd ..\nrm -rf outdir/*\nrm -rf tmp/*\nfor design_idx in {0..17}\ndo\n    python main.py --workload=mm --stop-aft"
  },
  {
    "path": "autosa_scripts/odyssey/scripts/run_metric_cmp.sh",
    "chars": 930,
    "preview": "#!/bin/bash\n\ncd ..\nrm -rf outdir/*\nrm -rf tmp/*\n#python main.py --workload=mm --stop-after-time=20 --use-db=0 --unit-tas"
  },
  {
    "path": "autosa_scripts/odyssey/scripts/run_mutation_cmp.sh",
    "chars": 273,
    "preview": "#!/bin/bash\n\n# Use solver by default\n# Set epsilon to 0 when only using the factorization mutation\ncd ..\nrm -rf outdir/*"
  },
  {
    "path": "autosa_scripts/odyssey/scripts/split_cnn_layers.py",
    "chars": 377,
    "preview": "import csv\nimport json\n\n#network = \"resnet50\"\nnetwork = \"mobilenetv2\"\nwith open(f\"../workload/{network}.json\", \"r\") as f"
  },
  {
    "path": "autosa_scripts/odyssey/search_task.py",
    "chars": 35709,
    "preview": "import json\nimport random\nimport numpy as np\nimport bisect\n\nimport utils\nfrom design import Design\n\nclass SingleTask(obj"
  },
  {
    "path": "autosa_scripts/odyssey/solver.py",
    "chars": 16579,
    "preview": "from subprocess import Popen, PIPE\nimport tempfile\nimport shutil\n\ndef off_chip_solver_gemm(search_task, cst, fixed_param"
  },
  {
    "path": "autosa_scripts/odyssey/tuners.py",
    "chars": 240198,
    "preview": "import json\nimport numpy as np\nimport xgboost as xgb\nimport random\nimport sys\nimport shutil\nimport copy\nimport pprint\nfr"
  },
  {
    "path": "autosa_scripts/odyssey/unit_test.py",
    "chars": 2026,
    "preview": "\nimport copy\nfrom search_task import SingleTask\nfrom design import Design\nimport json\nfrom tuners import Constraint\n\ncla"
  },
  {
    "path": "autosa_scripts/odyssey/utils.py",
    "chars": 23175,
    "preview": "import time\nimport functools\nimport math\nimport logging\nimport itertools\nfrom datetime import datetime\nfrom subprocess i"
  },
  {
    "path": "autosa_scripts/odyssey/workload/conv.json",
    "chars": 207,
    "preview": "{\n  \"workloads\": [\n    {\n      \"name\": \"conv1-1\",\n      \"tags\": [\"conv\"],\n      \"params\": {\n        \"i\": 1,\n        \"o\":"
  },
  {
    "path": "autosa_scripts/odyssey/workload/mm.json",
    "chars": 165,
    "preview": "{\n  \"workloads\": [\n    {\n      \"name\": \"gemm\",\n      \"tags\": [\"gemm\"],\n      \"params\": {\n        \"i\": 1024,\n        \"j\":"
  },
  {
    "path": "autosa_scripts/odyssey/workload/mm64.json",
    "chars": 159,
    "preview": "{\n  \"workloads\": [\n    {\n      \"name\": \"gemm\",\n      \"tags\": [\"gemm\"],\n      \"params\": {\n        \"i\": 64,\n        \"j\": 6"
  },
  {
    "path": "autosa_scripts/odyssey/workload/mobilenetv2.json",
    "chars": 7509,
    "preview": "{\n  \"workloads\": [\n    {\n      \"name\": \"conv1\",\n      \"tags\": [\n        \"conv\"\n      ],\n      \"params\": {\n        \"i\": 3"
  },
  {
    "path": "autosa_scripts/odyssey/workload/mobilenetv2_1.json",
    "chars": 323,
    "preview": "{\n    \"workloads\": [\n        {\n            \"name\": \"conv1\",\n            \"tags\": [\n                \"conv\"\n            ],\n"
  },
  {
    "path": "autosa_scripts/odyssey/workload/mobilenetv2_10.json",
    "chars": 327,
    "preview": "{\n    \"workloads\": [\n        {\n            \"name\": \"conv4_1-1\",\n            \"tags\": [\n                \"conv\"\n           "
  },
  {
    "path": "autosa_scripts/odyssey/workload/mobilenetv2_11.json",
    "chars": 327,
    "preview": "{\n    \"workloads\": [\n        {\n            \"name\": \"conv4_3-1\",\n            \"tags\": [\n                \"conv\"\n           "
  },
  {
    "path": "autosa_scripts/odyssey/workload/mobilenetv2_12.json",
    "chars": 327,
    "preview": "{\n    \"workloads\": [\n        {\n            \"name\": \"conv4_1-2\",\n            \"tags\": [\n                \"conv\"\n           "
  },
  {
    "path": "autosa_scripts/odyssey/workload/mobilenetv2_13.json",
    "chars": 327,
    "preview": "{\n    \"workloads\": [\n        {\n            \"name\": \"conv4_3-2\",\n            \"tags\": [\n                \"conv\"\n           "
  },
  {
    "path": "autosa_scripts/odyssey/workload/mobilenetv2_14.json",
    "chars": 356,
    "preview": "{\n    \"workloads\": [\n        {\n            \"name\": \"conv5_1-0\",\n            \"tags\": [\n                \"conv\",\n          "
  },
  {
    "path": "autosa_scripts/odyssey/workload/mobilenetv2_15.json",
    "chars": 327,
    "preview": "{\n    \"workloads\": [\n        {\n            \"name\": \"conv5_3-0\",\n            \"tags\": [\n                \"conv\"\n           "
  },
  {
    "path": "autosa_scripts/odyssey/workload/mobilenetv2_16.json",
    "chars": 327,
    "preview": "{\n    \"workloads\": [\n        {\n            \"name\": \"conv5_1-1\",\n            \"tags\": [\n                \"conv\"\n           "
  },
  {
    "path": "autosa_scripts/odyssey/workload/mobilenetv2_17.json",
    "chars": 327,
    "preview": "{\n    \"workloads\": [\n        {\n            \"name\": \"conv5_3-1\",\n            \"tags\": [\n                \"conv\"\n           "
  },
  {
    "path": "autosa_scripts/odyssey/workload/mobilenetv2_18.json",
    "chars": 327,
    "preview": "{\n    \"workloads\": [\n        {\n            \"name\": \"conv5_1-2\",\n            \"tags\": [\n                \"conv\"\n           "
  },
  {
    "path": "autosa_scripts/odyssey/workload/mobilenetv2_19.json",
    "chars": 327,
    "preview": "{\n    \"workloads\": [\n        {\n            \"name\": \"conv5_3-2\",\n            \"tags\": [\n                \"conv\"\n           "
  },
  {
    "path": "autosa_scripts/odyssey/workload/mobilenetv2_2.json",
    "chars": 328,
    "preview": "{\n    \"workloads\": [\n        {\n            \"name\": \"conv2_1-0\",\n            \"tags\": [\n                \"conv\"\n           "
  },
  {
    "path": "autosa_scripts/odyssey/workload/mobilenetv2_20.json",
    "chars": 327,
    "preview": "{\n    \"workloads\": [\n        {\n            \"name\": \"conv5_1-3\",\n            \"tags\": [\n                \"conv\"\n           "
  },
  {
    "path": "autosa_scripts/odyssey/workload/mobilenetv2_21.json",
    "chars": 327,
    "preview": "{\n    \"workloads\": [\n        {\n            \"name\": \"conv5_3-3\",\n            \"tags\": [\n                \"conv\"\n           "
  },
  {
    "path": "autosa_scripts/odyssey/workload/mobilenetv2_22.json",
    "chars": 327,
    "preview": "{\n    \"workloads\": [\n        {\n            \"name\": \"conv6_1-0\",\n            \"tags\": [\n                \"conv\"\n           "
  },
  {
    "path": "autosa_scripts/odyssey/workload/mobilenetv2_23.json",
    "chars": 327,
    "preview": "{\n    \"workloads\": [\n        {\n            \"name\": \"conv6_3-0\",\n            \"tags\": [\n                \"conv\"\n           "
  },
  {
    "path": "autosa_scripts/odyssey/workload/mobilenetv2_24.json",
    "chars": 327,
    "preview": "{\n    \"workloads\": [\n        {\n            \"name\": \"conv6_1-1\",\n            \"tags\": [\n                \"conv\"\n           "
  },
  {
    "path": "autosa_scripts/odyssey/workload/mobilenetv2_25.json",
    "chars": 327,
    "preview": "{\n    \"workloads\": [\n        {\n            \"name\": \"conv6_3-1\",\n            \"tags\": [\n                \"conv\"\n           "
  },
  {
    "path": "autosa_scripts/odyssey/workload/mobilenetv2_26.json",
    "chars": 327,
    "preview": "{\n    \"workloads\": [\n        {\n            \"name\": \"conv6_1-2\",\n            \"tags\": [\n                \"conv\"\n           "
  },
  {
    "path": "autosa_scripts/odyssey/workload/mobilenetv2_27.json",
    "chars": 327,
    "preview": "{\n    \"workloads\": [\n        {\n            \"name\": \"conv6_3-2\",\n            \"tags\": [\n                \"conv\"\n           "
  },
  {
    "path": "autosa_scripts/odyssey/workload/mobilenetv2_28.json",
    "chars": 356,
    "preview": "{\n    \"workloads\": [\n        {\n            \"name\": \"conv7_1-0\",\n            \"tags\": [\n                \"conv\",\n          "
  },
  {
    "path": "autosa_scripts/odyssey/workload/mobilenetv2_29.json",
    "chars": 326,
    "preview": "{\n    \"workloads\": [\n        {\n            \"name\": \"conv7_3-0\",\n            \"tags\": [\n                \"conv\"\n           "
  },
  {
    "path": "autosa_scripts/odyssey/workload/mobilenetv2_3.json",
    "chars": 328,
    "preview": "{\n    \"workloads\": [\n        {\n            \"name\": \"conv2_3-0\",\n            \"tags\": [\n                \"conv\"\n           "
  },
  {
    "path": "autosa_scripts/odyssey/workload/mobilenetv2_30.json",
    "chars": 326,
    "preview": "{\n    \"workloads\": [\n        {\n            \"name\": \"conv7_1-1\",\n            \"tags\": [\n                \"conv\"\n           "
  },
  {
    "path": "autosa_scripts/odyssey/workload/mobilenetv2_31.json",
    "chars": 326,
    "preview": "{\n    \"workloads\": [\n        {\n            \"name\": \"conv7_3-1\",\n            \"tags\": [\n                \"conv\"\n           "
  },
  {
    "path": "autosa_scripts/odyssey/workload/mobilenetv2_32.json",
    "chars": 326,
    "preview": "{\n    \"workloads\": [\n        {\n            \"name\": \"conv7_1-2\",\n            \"tags\": [\n                \"conv\"\n           "
  },
  {
    "path": "autosa_scripts/odyssey/workload/mobilenetv2_33.json",
    "chars": 326,
    "preview": "{\n    \"workloads\": [\n        {\n            \"name\": \"conv7_3-2\",\n            \"tags\": [\n                \"conv\"\n           "
  },
  {
    "path": "autosa_scripts/odyssey/workload/mobilenetv2_34.json",
    "chars": 326,
    "preview": "{\n    \"workloads\": [\n        {\n            \"name\": \"conv8_1-0\",\n            \"tags\": [\n                \"conv\"\n           "
  },
  {
    "path": "autosa_scripts/odyssey/workload/mobilenetv2_35.json",
    "chars": 326,
    "preview": "{\n    \"workloads\": [\n        {\n            \"name\": \"conv8_3-0\",\n            \"tags\": [\n                \"conv\"\n           "
  },
  {
    "path": "autosa_scripts/odyssey/workload/mobilenetv2_36.json",
    "chars": 323,
    "preview": "{\n    \"workloads\": [\n        {\n            \"name\": \"conv9\",\n            \"tags\": [\n                \"conv\"\n            ],\n"
  },
  {
    "path": "autosa_scripts/odyssey/workload/mobilenetv2_4.json",
    "chars": 357,
    "preview": "{\n    \"workloads\": [\n        {\n            \"name\": \"conv3_1-0\",\n            \"tags\": [\n                \"conv\",\n          "
  },
  {
    "path": "autosa_scripts/odyssey/workload/mobilenetv2_47.json",
    "chars": 866,
    "preview": "{\n  \"workloads\": [\n    {\n      \"name\": \"conv3_3-0\",\n      \"tags\": [\n        \"conv\"\n      ],\n      \"params\": {\n        \"i"
  },
  {
    "path": "autosa_scripts/odyssey/workload/mobilenetv2_5.json",
    "chars": 326,
    "preview": "{\n    \"workloads\": [\n        {\n            \"name\": \"conv3_3-0\",\n            \"tags\": [\n                \"conv\"\n           "
  },
  {
    "path": "autosa_scripts/odyssey/workload/mobilenetv2_6.json",
    "chars": 326,
    "preview": "{\n    \"workloads\": [\n        {\n            \"name\": \"conv3_1-1\",\n            \"tags\": [\n                \"conv\"\n           "
  },
  {
    "path": "autosa_scripts/odyssey/workload/mobilenetv2_7.json",
    "chars": 326,
    "preview": "{\n    \"workloads\": [\n        {\n            \"name\": \"conv3_3-1\",\n            \"tags\": [\n                \"conv\"\n           "
  },
  {
    "path": "autosa_scripts/odyssey/workload/mobilenetv2_8.json",
    "chars": 356,
    "preview": "{\n    \"workloads\": [\n        {\n            \"name\": \"conv4_1-0\",\n            \"tags\": [\n                \"conv\",\n          "
  },
  {
    "path": "autosa_scripts/odyssey/workload/mobilenetv2_9.json",
    "chars": 327,
    "preview": "{\n    \"workloads\": [\n        {\n            \"name\": \"conv4_3-0\",\n            \"tags\": [\n                \"conv\"\n           "
  },
  {
    "path": "autosa_scripts/odyssey/workload/mobilenetv2_complete.json",
    "chars": 7729,
    "preview": "{\n  \"workloads\": [\n    {\n      \"name\": \"conv1\",\n      \"tags\": [\n        \"conv\",\n        \"maxpool_2\"\n      ],\n      \"para"
  },
  {
    "path": "autosa_scripts/odyssey/workload/mobilenetv2_conv3_1_0.json",
    "chars": 260,
    "preview": "{\n  \"workloads\": [    \n    {\n      \"name\": \"conv3_1-0\",\n      \"tags\": [\n        \"conv\",\n        \"maxpool_2\"\n      ],\n   "
  },
  {
    "path": "autosa_scripts/odyssey/workload/mobilenetv2_first.json",
    "chars": 848,
    "preview": "{\n  \"workloads\": [\n    {\n      \"name\": \"conv3_1-0\",\n      \"tags\": [\n        \"conv\"\n      ],\n      \"params\": {\n        \"i"
  },
  {
    "path": "autosa_scripts/odyssey/workload/mobilenetv2_first1.json",
    "chars": 446,
    "preview": "{\n  \"workloads\": [\n    {\n      \"name\": \"conv3_1-0\",\n      \"tags\": [\n        \"conv\"\n      ],\n      \"params\": {\n        \"i"
  },
  {
    "path": "autosa_scripts/odyssey/workload/mobilenetv2_first2.json",
    "chars": 442,
    "preview": "{\n  \"workloads\": [    \n    {\n      \"name\": \"conv3_3-0\",\n      \"tags\": [\n        \"conv\"\n      ],\n      \"params\": {\n      "
  },
  {
    "path": "autosa_scripts/odyssey/workload/mobilenetv2_half.json",
    "chars": 1262,
    "preview": "{\n  \"workloads\": [\n    {\n      \"name\": \"conv4_1-0\",\n      \"tags\": [\n        \"conv\"\n      ],\n      \"params\": {\n        \"i"
  },
  {
    "path": "autosa_scripts/odyssey/workload/mobilenetv2_img2col.json",
    "chars": 5747,
    "preview": "{\n  \"workloads\": [\n    {\n      \"name\": \"conv1\",\n      \"tags\": [\n        \"gemm\"\n      ],\n      \"params\": {\n        \"i\": 3"
  },
  {
    "path": "autosa_scripts/odyssey/workload/mobilenetv2_no_first.json",
    "chars": 7307,
    "preview": "{\n  \"workloads\": [\n    {\n      \"name\": \"conv2_1-0\",\n      \"tags\": [\n        \"conv\"\n      ],\n      \"params\": {\n        \"i"
  },
  {
    "path": "autosa_scripts/odyssey/workload/mobilenetv2_original.json",
    "chars": 7529,
    "preview": "{\n  \"workloads\": [\n    {\n      \"name\": \"conv1\",\n      \"tags\": [\n        \"conv\",\n        \"maxpool_2\"\n      ],\n      \"para"
  },
  {
    "path": "autosa_scripts/odyssey/workload/mobilenetv2_test.json",
    "chars": 1956,
    "preview": "{\n    \"workloads\": [      \n      {\n        \"name\": \"conv2_1-0\",\n        \"tags\": [\n          \"conv\"\n        ],\n        \"p"
  },
  {
    "path": "autosa_scripts/odyssey/workload/mobilenetv2_test_single.json",
    "chars": 300,
    "preview": "{\n    \"workloads\": [          \n      {\n        \"name\": \"conv3_1-0\",\n        \"tags\": [\n          \"conv\",\n          \"maxpo"
  },
  {
    "path": "autosa_scripts/odyssey/workload/resnet152.json",
    "chars": 31483,
    "preview": "{\n  \"workloads\": [\n    {\n      \"name\": \"conv1\",\n      \"tags\": [\n        \"conv\",\n        \"maxpool_4\"\n      ],\n      \"para"
  },
  {
    "path": "autosa_scripts/odyssey/workload/resnet50.json",
    "chars": 10232,
    "preview": "{\n  \"workloads\": [\n    {\n      \"name\": \"conv1\",\n      \"tags\": [\n        \"conv\",\n        \"maxpool_2\"\n      ],\n      \"para"
  },
  {
    "path": "autosa_scripts/odyssey/workload/resnet50_1.json",
    "chars": 352,
    "preview": "{\n    \"workloads\": [\n        {\n            \"name\": \"conv1\",\n            \"tags\": [\n                \"conv\",\n              "
  },
  {
    "path": "autosa_scripts/odyssey/workload/resnet50_10.json",
    "chars": 356,
    "preview": "{\n    \"workloads\": [\n        {\n            \"name\": \"conv2_3-2\",\n            \"tags\": [\n                \"conv\",\n          "
  },
  {
    "path": "autosa_scripts/odyssey/workload/resnet50_11.json",
    "chars": 328,
    "preview": "{\n    \"workloads\": [\n        {\n            \"name\": \"conv3_1-0\",\n            \"tags\": [\n                \"conv\"\n           "
  },
  {
    "path": "autosa_scripts/odyssey/workload/resnet50_12.json",
    "chars": 328,
    "preview": "{\n    \"workloads\": [\n        {\n            \"name\": \"conv3_2-0\",\n            \"tags\": [\n                \"conv\"\n           "
  },
  {
    "path": "autosa_scripts/odyssey/workload/resnet50_13.json",
    "chars": 328,
    "preview": "{\n    \"workloads\": [\n        {\n            \"name\": \"conv3_3-0\",\n            \"tags\": [\n                \"conv\"\n           "
  },
  {
    "path": "autosa_scripts/odyssey/workload/resnet50_14.json",
    "chars": 328,
    "preview": "{\n    \"workloads\": [\n        {\n            \"name\": \"conv3_1-1\",\n            \"tags\": [\n                \"conv\"\n           "
  },
  {
    "path": "autosa_scripts/odyssey/workload/resnet50_15.json",
    "chars": 328,
    "preview": "{\n    \"workloads\": [\n        {\n            \"name\": \"conv3_2-1\",\n            \"tags\": [\n                \"conv\"\n           "
  },
  {
    "path": "autosa_scripts/odyssey/workload/resnet50_16.json",
    "chars": 328,
    "preview": "{\n    \"workloads\": [\n        {\n            \"name\": \"conv3_3-1\",\n            \"tags\": [\n                \"conv\"\n           "
  },
  {
    "path": "autosa_scripts/odyssey/workload/resnet50_17.json",
    "chars": 328,
    "preview": "{\n    \"workloads\": [\n        {\n            \"name\": \"conv3_1-2\",\n            \"tags\": [\n                \"conv\"\n           "
  },
  {
    "path": "autosa_scripts/odyssey/workload/resnet50_18.json",
    "chars": 328,
    "preview": "{\n    \"workloads\": [\n        {\n            \"name\": \"conv3_2-2\",\n            \"tags\": [\n                \"conv\"\n           "
  },
  {
    "path": "autosa_scripts/odyssey/workload/resnet50_19.json",
    "chars": 328,
    "preview": "{\n    \"workloads\": [\n        {\n            \"name\": \"conv3_3-2\",\n            \"tags\": [\n                \"conv\"\n           "
  },
  {
    "path": "autosa_scripts/odyssey/workload/resnet50_2.json",
    "chars": 326,
    "preview": "{\n    \"workloads\": [\n        {\n            \"name\": \"conv2_1-0\",\n            \"tags\": [\n                \"conv\"\n           "
  },
  {
    "path": "autosa_scripts/odyssey/workload/resnet50_20.json",
    "chars": 328,
    "preview": "{\n    \"workloads\": [\n        {\n            \"name\": \"conv3_1-3\",\n            \"tags\": [\n                \"conv\"\n           "
  },
  {
    "path": "autosa_scripts/odyssey/workload/resnet50_21.json",
    "chars": 328,
    "preview": "{\n    \"workloads\": [\n        {\n            \"name\": \"conv3_2-3\",\n            \"tags\": [\n                \"conv\"\n           "
  },
  {
    "path": "autosa_scripts/odyssey/workload/resnet50_22.json",
    "chars": 357,
    "preview": "{\n    \"workloads\": [\n        {\n            \"name\": \"conv3_3-3\",\n            \"tags\": [\n                \"conv\",\n          "
  },
  {
    "path": "autosa_scripts/odyssey/workload/resnet50_23.json",
    "chars": 328,
    "preview": "{\n    \"workloads\": [\n        {\n            \"name\": \"conv4_1-0\",\n            \"tags\": [\n                \"conv\"\n           "
  },
  {
    "path": "autosa_scripts/odyssey/workload/resnet50_24.json",
    "chars": 328,
    "preview": "{\n    \"workloads\": [\n        {\n            \"name\": \"conv4_2-0\",\n            \"tags\": [\n                \"conv\"\n           "
  },
  {
    "path": "autosa_scripts/odyssey/workload/resnet50_25.json",
    "chars": 329,
    "preview": "{\n    \"workloads\": [\n        {\n            \"name\": \"conv4_3-0\",\n            \"tags\": [\n                \"conv\"\n           "
  },
  {
    "path": "autosa_scripts/odyssey/workload/resnet50_26.json",
    "chars": 329,
    "preview": "{\n    \"workloads\": [\n        {\n            \"name\": \"conv4_1-1\",\n            \"tags\": [\n                \"conv\"\n           "
  },
  {
    "path": "autosa_scripts/odyssey/workload/resnet50_27.json",
    "chars": 328,
    "preview": "{\n    \"workloads\": [\n        {\n            \"name\": \"conv4_2-1\",\n            \"tags\": [\n                \"conv\"\n           "
  },
  {
    "path": "autosa_scripts/odyssey/workload/resnet50_28.json",
    "chars": 329,
    "preview": "{\n    \"workloads\": [\n        {\n            \"name\": \"conv4_3-1\",\n            \"tags\": [\n                \"conv\"\n           "
  },
  {
    "path": "autosa_scripts/odyssey/workload/resnet50_29.json",
    "chars": 329,
    "preview": "{\n    \"workloads\": [\n        {\n            \"name\": \"conv4_1-2\",\n            \"tags\": [\n                \"conv\"\n           "
  },
  {
    "path": "autosa_scripts/odyssey/workload/resnet50_3.json",
    "chars": 326,
    "preview": "{\n    \"workloads\": [\n        {\n            \"name\": \"conv2_2-0\",\n            \"tags\": [\n                \"conv\"\n           "
  },
  {
    "path": "autosa_scripts/odyssey/workload/resnet50_30.json",
    "chars": 328,
    "preview": "{\n    \"workloads\": [\n        {\n            \"name\": \"conv4_2-2\",\n            \"tags\": [\n                \"conv\"\n           "
  },
  {
    "path": "autosa_scripts/odyssey/workload/resnet50_31.json",
    "chars": 329,
    "preview": "{\n    \"workloads\": [\n        {\n            \"name\": \"conv4_3-2\",\n            \"tags\": [\n                \"conv\"\n           "
  }
]

// ... and 387 more files (download for full content)

About this extraction

This page contains the full source code of the UCLA-VAST/AutoSA GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 587 files (8.9 MB), approximately 2.4M tokens, and a symbol index with 3993 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!