Skip to content

Latest commit

 

History

History

array_partition_lib_simple

This is a simple example using HLS's hls::array_partition library
(hls::gather) to guarantee II=1 parallel access to a cyclically partitioned
array, even when the access indices are only known at runtime.

The design sums 4 strided elements of an array, A[i], A[i+s], A[i+2s],
A[i+3s], where the stride s is a runtime argument. Because s is not known
at compile time, #pragma HLS ARRAY_PARTITION alone cannot prove the 4
parallel accesses land in different banks and would fall back to
sequential (II>1) access. hls::gather<T, K> shifts that proof obligation
to the caller: as long as the stride is coprime with K (here K=4, so any
odd stride), the gather is guaranteed conflict-free and reaches II=1.

Files Included in this Package
==============================

* this file:
README
* design files:
array_partition_lib_simple.cpp
array_partition_lib_simple.h
array_partition_lib_simple_test.cpp
* scripts:
run_hls.tcl
run.py
run_vitis_commandline.sh
hls_config-for-commandline-use.cfg

Running the Design using Vitis HLS
==================================

Use vitis-run to execute the script "run_hls.tcl" ; edit it to set $hls_exec and enable specific run steps.
$ vitis-run --mode hls --tcl run_hls.tcl

Running the design using Vitis v++ and vitis-run commands
=========================================================

Use "run_vitis_commandline.sh" to run on the commands line the specified flow steps in the given order.
$ ./run_vitis_commandline.sh help
$ ./run_vitis_commandline.sh csim
$ ./run_vitis_commandline.sh csim csynth cosim

Running the design using Python and python script
=================================================
Use Vitis to set up a workspace and component from the script and runs csim csynth cosim.
$ vitis -s run.py