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

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
1 #include <TypeToBits.h>
2 
3 ...
4 NVUINT4 input = 4;
5 sc_lv<4> output = TypeToBits<NVUINT4>(input);
6 ...

Definition at line 48 of file TypeToBits.h.

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
1 #include <TypeToBits.h>
2 
3 ...
4 sc_lv<4> input = 4;
5 NVUINT4 output = BitsToType<NVUINT4>(input);
6 ...

Definition at line 81 of file TypeToBits.h.

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
1 #include <TypeToBits.h>
2 
3 ...
4 Word_t input;
5 ...
6 NVUINT4 output = TypeToNVUINT<Word_t>(input);
7 ...

Definition at line 115 of file TypeToBits.h.

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
1 #include <TypeToBits.h>
2 
3 ...
4 NVUINT4 input = 4;
5 Word_t output = NVUINTToType<Word_t>(input);
6 ...

Definition at line 144 of file TypeToBits.h.