MatchLib
|
Integer library with built-in support for sc_int and ac_int datatypes. More...
Classes | |
struct | nvhls::nbits< X > |
Compute number of bits to represent a constant. More... | |
struct | nvhls::log2_floor< X > |
Compute Floor of log2 of a constant. More... | |
struct | nvhls::log2_floor< 0 > |
log2 of 0 is not defined: generate compiler error More... | |
struct | nvhls::log2_ceil< X > |
Compute Celing of log2 of a constant. More... | |
struct | nvhls::log2_ceil< 0 > |
log2 of 0 is not defined: generate compiler error More... | |
struct | nvhls::next_pow2< n_val > |
Compute power of 2 value greater than a given value. More... | |
struct | nvhls::index_width< X > |
Compute index width of a constant. More... | |
struct | nvhls::nvhls_t< N, B > |
Definition of vendor agnostic integer data types. More... | |
Macros | |
#define | NVUINTW(width) typename nvhls::nvhls_t<width>::nvuint_t |
#define | NVINTW(width) typename nvhls::nvhls_t<width>::nvint_t |
#define | NVINTC(width) nvhls::nvhls_t<width>::nvint_t |
#define | NVUINTC(width) nvhls::nvhls_t<width>::nvuint_t |
Functions | |
template<typename type1 , typename type2 > | |
type1 | nvhls::set_slc (type1 X, type2 Y, const unsigned int i) |
Function that replaces slice of bits. | |
template<unsigned int W, typename type > | |
nvhls_t< W >::nvuint_t | nvhls::get_slc (type X, const unsigned int i) |
Function that returns slice of bits. | |
template<typename type > | |
type | nvhls::get_slc (type X, const unsigned int i, const unsigned int j) |
Function that returns slice of bits with dynamic range. | |
template<unsigned int W1, typename type1 , typename type2 > | |
type2 | nvhls::leading_ones (type1 X) |
LeadingOne Detector. | |
template<typename type1 > | |
unsigned int | nvhls::lzd (type1 X) |
Leading zero detector. | |
template<typename type > | |
type | nvhls::get_min_val () |
Minimum Value of a type. | |
template<typename type > | |
type | nvhls::left_shift (type X, int shift) |
Function that performs left shift while preserving sign. | |
template<typename type > | |
type | nvhls::right_shift (type X, int shift) |
Function that performs right shift while preserving sign. | |
template<typename type1 , typename type2 > | |
bool | nvhls::normalize (type1 &X, type2 &Y) |
Normalize function. | |
Integer library with built-in support for sc_int and ac_int datatypes.
#define NVUINTW | ( | width | ) | typename nvhls::nvhls_t<width>::nvuint_t |
Macro to declare nvuint type with template parameter width
Definition at line 35 of file nvhls_types.h.
#define NVINTW | ( | width | ) | typename nvhls::nvhls_t<width>::nvint_t |
Macro to declare nvint type with template parameter width
Definition at line 51 of file nvhls_types.h.
#define NVINTC | ( | width | ) | nvhls::nvhls_t<width>::nvint_t |
Macro to declare nvuint type with constant width
Definition at line 79 of file nvhls_types.h.
#define NVUINTC | ( | width | ) | nvhls::nvhls_t<width>::nvuint_t |
Macro to declare nvint type with constant width
Definition at line 66 of file nvhls_types.h.
Function that replaces slice of bits.
type1 | Datatype of X |
type2 | Datatype of Y |
[in] | X | Variable whose bits are to be replaced |
[in] | Y | Variable that stores new bits for the bit slice |
[in] | i | Starting LSB position in variable X |
[out] | ReturnType | variable of type1 with slice of bits replaced. |
Definition at line 387 of file nvhls_int.h.
nvhls_t< W >::nvuint_t nvhls::get_slc | ( | type | X, |
const unsigned int | i | ||
) |
Function that returns slice of bits.
type | Datatype |
W | width of slice |
[in] | X | Variable whose bit slice is requested |
[in] | i | Starting LSB position in variable X |
[out] | ReturnType | Slice of bits |
Definition at line 437 of file nvhls_int.h.
type nvhls::get_slc | ( | type | X, |
const unsigned int | i, | ||
const unsigned int | j | ||
) |
Function that returns slice of bits with dynamic range.
type | Datatype |
[in] | X | Variable whose bit slice is requested |
[in] | i | LSB position for bit-slice in variable X |
[in] | j | MSB position for bit-slice in variable X |
[out] | ReturnType | Slice of bits |
Definition at line 487 of file nvhls_int.h.
LeadingOne Detector.
type1 | InputDatatype |
type2 | ReturnType |
W1 | Width of type1 |
[in] | X | Variable whose leading one pos is requested |
[out] | ReturnType | Position of leading one |
Definition at line 561 of file nvhls_int.h.
Leading zero detector.
type1 | InputDatatype |
[in] | X | Variable whose leading zero position is requested |
[out] | ReturnType | Position of leading one |
Definition at line 627 of file nvhls_int.h.
type nvhls::get_min_val | ( | ) |
Minimum Value of a type.
type | Datatype |
[out] | ReturnVal | Minimum value of the type |
Definition at line 682 of file nvhls_int.h.
Function that performs left shift while preserving sign.
type | Datatype |
[in] | X | Input variable |
[in] | shift | Number of bits to be shifted |
[out] | ReturnVal | X shifted left while preserving sign |
Definition at line 722 of file nvhls_int.h.
Function that performs right shift while preserving sign.
type | Datatype |
[in] | X | Input variable |
[in] | shift | Number of bits to be shifted |
[out] | ReturnVal | X shifted right while preserving sign |
Definition at line 782 of file nvhls_int.h.
Normalize function.
type1 | MantissaType |
type2 | ExponentType |
[in,out] | X | mantissa |
[in,out] | Y | exponent |
[out] | ReturnVal | success? |
Definition at line 848 of file nvhls_int.h.