cloudFPGA (cF) API  1.0
The documentation of the source code of cloudFPGA (cF)
log2Ceil< n > Struct Template Reference

#include <nts_utils.hpp>

Public Types

enum  
 

Detailed Description

template<uint64_t n>
struct log2Ceil< n >

A synthesizable version of the C++ log2ceil function.

Parameters
[in]nThe input value to compute.
Returns
ceil(log(n)).

Usage: ap_uint<log2Ceil<N>::val> counter; #define NUM_BITS 8 #define CTRL_BITS LOG2_CEIL<NUM_BITS>::val+1

Definition at line 65 of file nts_utils.hpp.

Member Enumeration Documentation

◆ anonymous enum

template<uint64_t n>
anonymous enum

Definition at line 74 of file nts_utils.hpp.

74  {
75  val = \
76  n <= 0x1 ? 1 : \
77  n <= 0x2 ? 1 : \
78  n <= 0x4 ? 2 : \
79  n <= 0x8 ? 3 : \
80  n <= 0x10 ? 4 : \
81  n <= 0x20 ? 5 : \
82  n <= 0x40 ? 6 : \
83  n <= 0x80 ? 7 : \
84  n <= 0x100 ? 8 : \
85  n <= 0x200 ? 9 : \
86  n <= 0x400 ? 10 : \
87  n <= 0x800 ? 11 : \
88  n <= 0x1000 ? 12 : \
89  n <= 0x2000 ? 13 : \
90  n <= 0x4000 ? 14 : \
91  n <= 0x8000 ? 15 : \
92  n <= 0x10000 ? 16 : \
93  n <= 0x20000 ? 17 : \
94  n <= 0x40000 ? 18 : \
95  n <= 0x80000 ? 19 : \
96  n <= 0x100000 ? 20 : \
97  n <= 0x200000 ? 21 : \
98  n <= 0x400000 ? 22 : \
99  n <= 0x800000 ? 23 : \
100  n <= 0x1000000 ? 24 : \
101  n <= 0x2000000 ? 25 : \
102  n <= 0x4000000 ? 26 : \
103  n <= 0x8000000 ? 27 : \
104  n <= 0x10000000 ? 28 : \
105  n <= 0x20000000 ? 29 : \
106  n <= 0x40000000 ? 30 : \
107  n <= 0x80000000 ? 31 : \
108  n <= 0x100000000 ? 32 : \
109  33
110  };

The documentation for this struct was generated from the following file: