Pragmas Syntax - 2020.2 English

Vitis HLS Migration Guide (UG1391)

Document ID
UG1391
Release Date
2020-11-24
Version
2020.2 English

Allocation

  • The Syntax of the allocation pragma must be followed..

    Example:

    #pragma HLS allocation instances=mul limit=1 operation // Invalid format
    #pragma HLS allocation operation instances=mul limit=1 // Valid format
    #pragma HLS allocation instances=foo limit=2 function // Invalid format
    #pragma HLS allocation function instances=foo limit=2 // Valid format
    
    IMPORTANT: If the referenced function/operation is not located after "allocation", it will be ignored with a warning message:
    WARNING: [HLS 207-1604] unexpected pragma argument 'instances', expects function/operation.
  • When Using Template functions, the allocation pragma syntax has to be adhered as shown below.
    template <typename DT>
    void foo(DT a, DT b){
    }
    
    
    
    Invalid syntax 
    // Below is invalid
    #pragma HLS ALLOCATION function instances = foo
    Valid syntax 
    
    // Below is valid
    #pragma HLS ALLOCATION function instances = foo<DT>