MatchLib
Functions

Convert any datatype to bit-vector. More...

Functions

template<typename T >
sc_lv< Wrapped< T >::width > TypeToBits (T in)
 Convert Type to logic vector. More...
 
template<typename T >
BitsToType (sc_lv< Wrapped< T >::width > mbits)
 Convert logic vector to type. More...
 
template<typename T >
 NVUINTW (Wrapped< T >::width) TypeToNVUINT(T in)
 Convert Type to NVUINT. More...
 
template<typename T >
NVUINTToType (const NVUINTW(Wrapped< T >::width) &uintbits)
 Convert NVUINT to type. More...
 

Detailed Description

Convert any datatype to bit-vector.

Function Documentation

◆ TypeToBits()

template<typename T >
sc_lv<Wrapped<T>::width> TypeToBits ( in)

Convert Type to logic vector.

Template Parameters
TDataType
Parameters
[in]inInput variable of type T
[out]ReturnValinput variable converted to logic vector
A Simple Example
#include <TypeToBits.h>
...
NVUINT4 input = 4;
sc_lv<4> output = TypeToBits<NVUINT4>(input);
...

Definition at line 48 of file TypeToBits.h.

◆ BitsToType()

template<typename T >
T BitsToType ( sc_lv< Wrapped< T >::width >  mbits)

Convert logic vector to type.

Template Parameters
TDataType
Parameters
[in]inInput variable of sc_lv type
[out]ReturnValinput variable converted to target datatype
A Simple Example
#include <TypeToBits.h>
...
sc_lv<4> input = 4;
NVUINT4 output = BitsToType<NVUINT4>(input);
...

Definition at line 81 of file TypeToBits.h.

◆ NVUINTW()

template<typename T >
NVUINTW ( Wrapped< T >::width  )

Convert Type to NVUINT.

Template Parameters
TDataType
Parameters
[in]inInput variable of type T
[out]ReturnValinput variable converted to NVUINT
A Simple Example
#include <TypeToBits.h>
...
Word_t input;
...
NVUINT4 output = TypeToNVUINT<Word_t>(input);
...

Definition at line 115 of file TypeToBits.h.

◆ NVUINTToType()

template<typename T >
T NVUINTToType ( const NVUINTW(Wrapped< T >::width) &  uintbits)

Convert NVUINT to type.

Template Parameters
TDataType
Parameters
[in]inInput variable of NVUINT type
[out]ReturnValinput variable converted to target datatype
A Simple Example
#include <TypeToBits.h>
...
NVUINT4 input = 4;
Word_t output = NVUINTToType<Word_t>(input);
...

Definition at line 144 of file TypeToBits.h.