scc 2025.09
SystemC components library
Common utilities

Namespaces

namespace  util
 SCC common utilities.
namespace  logging
 SCC C++ logging.
template<unsigned int bit, unsigned int width, typename T>
CONSTEXPR std::enable_if< std::is_unsigned< T >::value, T >::type bit_sub (T v)
 extract bit ranges from plain data types
template<typename T>
std::enable_if< std::is_unsigned< T >::value, T >::type bit_sub (T v, unsigned int bit, unsigned int width)
template<unsigned offset, typename R, typename T>
_bit_comb (T v)
template<unsigned offset, typename R, typename T, typename... Args>
_bit_comb (T first, Args... args)
template<typename R, typename T, typename... Args>
bit_comb (T first, Args... args)
template<typename T, unsigned B>
CONSTEXPR T signextend (const typename std::make_unsigned< T >::type x)
 sign-extend a given value
template<unsigned int bit, unsigned int width, typename T>
constexpr std::make_signed< T >::type signed_bit_sub (T v)
 a function that converts from B bits to T in one operation
constexpr uint64_t operator""_kB (unsigned long long val)
 UDL for kilobyte.
constexpr uint64_t operator""_MB (unsigned long long val)
 UDL for megabyte.
constexpr uint64_t operator""_GB (unsigned long long val)
 UDL for gigabyte.
constexpr uint64_t operator""_KiB (unsigned long long val)
constexpr uint64_t operator""_MiB (unsigned long long val)
 UDL for megabyte.
constexpr uint64_t operator""_GiB (unsigned long long val)
 UDL for gigabyte.
constexpr uint64_t operator""_TiB (unsigned long long val)
 UDL for gigabyte.

Detailed Description

This module contains generic C++ functions being independent of SystemC

Function Documentation

◆ _bit_comb() [1/2]

template<unsigned offset, typename R, typename T, typename... Args>
R _bit_comb ( T first,
Args... args )

Definition at line 111 of file ities.h.

◆ _bit_comb() [2/2]

template<unsigned offset, typename R, typename T>
R _bit_comb ( T v)

Definition at line 110 of file ities.h.

◆ bit_comb()

template<typename R, typename T, typename... Args>
R bit_comb ( T first,
Args... args )

combines the integer arguments into a large integer in an platform independent way, the first argument is the least significant byte

Template Parameters
Rthe return type of the function
Tthe type of the first parameter of the function
Argsthe remainign parameter pack
Parameters
vfirst first argument of type T
argsthe remaining parameters
Returns
the resulting integer value

Definition at line 123 of file ities.h.

◆ bit_sub() [1/2]

template<unsigned int bit, unsigned int width, typename T>
CONSTEXPR std::enable_if< std::is_unsigned< T >::value, T >::type bit_sub ( T v)

extract bit ranges from plain data types

Template Parameters
bitstart bit
widthsize of the bit field to extract
Tdata type carrying the bits
Parameters
vvalue from which the bytes are to be extracted
Returns
the extracted bit. It is of the same data type as the passed value

Definition at line 55 of file ities.h.

◆ bit_sub() [2/2]

template<typename T>
std::enable_if< std::is_unsigned< T >::value, T >::type bit_sub ( T v,
unsigned int bit,
unsigned int width )

Definition at line 70 of file ities.h.

◆ operator""_GB()

uint64_t operator""_GB ( unsigned long long val)
inlineconstexpr

UDL for gigabyte.

Definition at line 167 of file ities.h.

◆ operator""_GiB()

uint64_t operator""_GiB ( unsigned long long val)
inlineconstexpr

UDL for gigabyte.

Definition at line 173 of file ities.h.

◆ operator""_kB()

uint64_t operator""_kB ( unsigned long long val)
inlineconstexpr

UDL for kilobyte.

Definition at line 163 of file ities.h.

◆ operator""_KiB()

uint64_t operator""_KiB ( unsigned long long val)
inlineconstexpr

Definition at line 169 of file ities.h.

◆ operator""_MB()

uint64_t operator""_MB ( unsigned long long val)
inlineconstexpr

UDL for megabyte.

Definition at line 165 of file ities.h.

◆ operator""_MiB()

uint64_t operator""_MiB ( unsigned long long val)
inlineconstexpr

UDL for megabyte.

Definition at line 171 of file ities.h.

◆ operator""_TiB()

uint64_t operator""_TiB ( unsigned long long val)
inlineconstexpr

UDL for gigabyte.

Definition at line 175 of file ities.h.

◆ signed_bit_sub()

template<unsigned int bit, unsigned int width, typename T>
std::make_signed< T >::type signed_bit_sub ( T v)
inlineconstexpr

a function that converts from B bits to T in one operation

Template Parameters
bit
width
T
Parameters
v
Returns

Definition at line 152 of file ities.h.

◆ signextend()

template<typename T, unsigned B>
CONSTEXPR T signextend ( const typename std::make_unsigned< T >::type x)

sign-extend a given value

Template Parameters
Tthe datatype
Bthe numer of signed bits
Parameters
xthe actualö value
Returns
the sign-extended value of type T

Definition at line 133 of file ities.h.