SystemC  2.3.2
Accellera SystemC proof-of-concept library
sc_dt::sc_fxval Class Reference

Fixed-point value type; arbitrary precision. More...

#include <sysc/datatypes/fx/sc_fxval.h>

Collaboration diagram for sc_dt::sc_fxval:

Public Member Functions

 sc_fxval (scfx_rep *)
 
 sc_fxval (sc_fxval_observer *=0)
 
SCFX_EXPLICIT_ sc_fxval (int, sc_fxval_observer *=0)
 
SCFX_EXPLICIT_ sc_fxval (unsigned int, sc_fxval_observer *=0)
 
SCFX_EXPLICIT_ sc_fxval (long, sc_fxval_observer *=0)
 
SCFX_EXPLICIT_ sc_fxval (unsigned long, sc_fxval_observer *=0)
 
SCFX_EXPLICIT_ sc_fxval (float, sc_fxval_observer *=0)
 
SCFX_EXPLICIT_ sc_fxval (double, sc_fxval_observer *=0)
 
SCFX_EXPLICIT_ sc_fxval (const char *, sc_fxval_observer *=0)
 
 sc_fxval (const sc_fxval &, sc_fxval_observer *=0)
 
 sc_fxval (const sc_fxval_fast &, sc_fxval_observer *=0)
 
 sc_fxval (const sc_fxnum &, sc_fxval_observer *=0)
 
 sc_fxval (const sc_fxnum_fast &, sc_fxval_observer *=0)
 
SCFX_EXPLICIT_OTHER_ sc_fxval (int64, sc_fxval_observer *=0)
 
SCFX_EXPLICIT_OTHER_ sc_fxval (uint64, sc_fxval_observer *=0)
 
SCFX_EXPLICIT_OTHER_ sc_fxval (const sc_int_base &, sc_fxval_observer *=0)
 
SCFX_EXPLICIT_OTHER_ sc_fxval (const sc_uint_base &, sc_fxval_observer *=0)
 
SCFX_EXPLICIT_OTHER_ sc_fxval (const sc_signed &, sc_fxval_observer *=0)
 
SCFX_EXPLICIT_OTHER_ sc_fxval (const sc_unsigned &, sc_fxval_observer *=0)
 
 ~sc_fxval ()
 
const scfx_repget_rep () const
 
void set_rep (scfx_rep *)
 
const sc_fxval operator- () const
 
const sc_fxvaloperator+ () const
 
 DECL_BIN_OP_T (/, int64) DECL_BIN_OP_T(/
 
uint64 DECL_BIN_OP_T (/, const sc_int_base &) DECL_BIN_OP_T(/
 
uint64 const sc_uint_baseDECL_BIN_OP_T (/, const sc_signed &) friend const sc_fxval operator<<(const sc_fxval &
 
const sc_fxval operator++ (int)
 
const sc_fxval operator-- (int)
 
sc_fxvaloperator++ ()
 
sc_fxvaloperator-- ()
 
 operator double () const
 
short to_short () const
 
unsigned short to_ushort () const
 
int to_int () const
 
unsigned int to_uint () const
 
long to_long () const
 
unsigned long to_ulong () const
 
int64 to_int64 () const
 
uint64 to_uint64 () const
 
float to_float () const
 
double to_double () const
 
const std::string to_string () const
 
const std::string to_string (sc_numrep) const
 
const std::string to_string (sc_numrep, bool) const
 
const std::string to_string (sc_fmt) const
 
const std::string to_string (sc_numrep, sc_fmt) const
 
const std::string to_string (sc_numrep, bool, sc_fmt) const
 
const std::string to_dec () const
 
const std::string to_bin () const
 
const std::string to_oct () const
 
const std::string to_hex () const
 
bool is_neg () const
 
bool is_zero () const
 
bool is_nan () const
 
bool is_inf () const
 
bool is_normal () const
 
bool rounding_flag () const
 
void print (::std::ostream &=::std::cout) const
 
void scan (::std::istream &=::std::cin)
 
void dump (::std::ostream &=::std::cout) const
 
bool get_bit (int) const
 

Public Attributes

uint64 const sc_uint_base int
 

Protected Member Functions

sc_fxval_observerobserver () const
 
sc_fxval_observerlock_observer () const
 
void unlock_observer (sc_fxval_observer *) const
 
void get_type (int &, int &, sc_enc &) const
 
const sc_fxval quantization (const scfx_params &, bool &) const
 
const sc_fxval overflow (const scfx_params &, bool &) const
 

Friends

class sc_fxnum
 
void neg (sc_fxval &, const sc_fxval &)
 
const sc_fxval operator/ (const sc_fxval &, const sc_fxval &)
 
const sc_fxval operator>> (const sc_fxval &, int)
 
void lshift (sc_fxval &, const sc_fxval &, int)
 
void rshift (sc_fxval &, const sc_fxval &, int)
 

Detailed Description

Fixed-point value type; arbitrary precision.

Definition at line 95 of file sc_fxval.h.

Constructor & Destructor Documentation

◆ sc_fxval() [1/19]

sc_dt::sc_fxval::sc_fxval ( scfx_rep a)
inlineexplicit

Definition at line 784 of file sc_fxval.h.

◆ sc_fxval() [2/19]

sc_dt::sc_fxval::sc_fxval ( sc_fxval_observer observer_ = 0)
inlineexplicit

Definition at line 793 of file sc_fxval.h.

◆ sc_fxval() [3/19]

SCFX_EXPLICIT_ sc_dt::sc_fxval::sc_fxval ( int  ,
sc_fxval_observer = 0 
)

◆ sc_fxval() [4/19]

SCFX_EXPLICIT_ sc_dt::sc_fxval::sc_fxval ( unsigned  int,
sc_fxval_observer = 0 
)

◆ sc_fxval() [5/19]

SCFX_EXPLICIT_ sc_dt::sc_fxval::sc_fxval ( long  ,
sc_fxval_observer = 0 
)

◆ sc_fxval() [6/19]

SCFX_EXPLICIT_ sc_dt::sc_fxval::sc_fxval ( unsigned  long,
sc_fxval_observer = 0 
)

◆ sc_fxval() [7/19]

SCFX_EXPLICIT_ sc_dt::sc_fxval::sc_fxval ( float  ,
sc_fxval_observer = 0 
)

◆ sc_fxval() [8/19]

SCFX_EXPLICIT_ sc_dt::sc_fxval::sc_fxval ( double  ,
sc_fxval_observer = 0 
)

◆ sc_fxval() [9/19]

SCFX_EXPLICIT_ sc_dt::sc_fxval::sc_fxval ( const char *  ,
sc_fxval_observer = 0 
)

◆ sc_fxval() [10/19]

sc_dt::sc_fxval::sc_fxval ( const sc_fxval a,
sc_fxval_observer observer_ = 0 
)
inline

Definition at line 802 of file sc_fxval.h.

◆ sc_fxval() [11/19]

sc_dt::sc_fxval::sc_fxval ( const sc_fxval_fast ,
sc_fxval_observer = 0 
)

◆ sc_fxval() [12/19]

sc_dt::sc_fxval::sc_fxval ( const sc_fxnum a,
sc_fxval_observer observer_ = 0 
)
inline

Definition at line 4792 of file sc_fxnum.h.

◆ sc_fxval() [13/19]

sc_dt::sc_fxval::sc_fxval ( const sc_fxnum_fast a,
sc_fxval_observer observer_ = 0 
)
inline

Definition at line 4803 of file sc_fxnum.h.

◆ sc_fxval() [14/19]

SCFX_EXPLICIT_OTHER_ sc_dt::sc_fxval::sc_fxval ( int64  ,
sc_fxval_observer = 0 
)

◆ sc_fxval() [15/19]

SCFX_EXPLICIT_OTHER_ sc_dt::sc_fxval::sc_fxval ( uint64  ,
sc_fxval_observer = 0 
)

◆ sc_fxval() [16/19]

SCFX_EXPLICIT_OTHER_ sc_dt::sc_fxval::sc_fxval ( const sc_int_base ,
sc_fxval_observer = 0 
)

◆ sc_fxval() [17/19]

SCFX_EXPLICIT_OTHER_ sc_dt::sc_fxval::sc_fxval ( const sc_uint_base ,
sc_fxval_observer = 0 
)

◆ sc_fxval() [18/19]

SCFX_EXPLICIT_OTHER_ sc_dt::sc_fxval::sc_fxval ( const sc_signed ,
sc_fxval_observer = 0 
)

◆ sc_fxval() [19/19]

SCFX_EXPLICIT_OTHER_ sc_dt::sc_fxval::sc_fxval ( const sc_unsigned ,
sc_fxval_observer = 0 
)

◆ ~sc_fxval()

sc_dt::sc_fxval::~sc_fxval ( )
inline

Definition at line 853 of file sc_fxval.h.

Member Function Documentation

◆ DECL_BIN_OP_T() [1/3]

sc_dt::sc_fxval::DECL_BIN_OP_T ( ,
int64   
)

◆ DECL_BIN_OP_T() [2/3]

uint64 sc_dt::sc_fxval::DECL_BIN_OP_T ( ,
const sc_int_base  
)

◆ DECL_BIN_OP_T() [3/3]

uint64 const sc_uint_base& sc_dt::sc_fxval::DECL_BIN_OP_T ( ,
const sc_signed  
) const &

◆ dump()

void sc_dt::sc_fxval::dump ( ::std::ostream &  = ::std::cout) const

◆ get_bit()

bool sc_dt::sc_fxval::get_bit ( int  i) const
inline

Definition at line 1488 of file sc_fxval.h.

◆ get_rep()

const scfx_rep * sc_dt::sc_fxval::get_rep ( ) const
inline

Definition at line 863 of file sc_fxval.h.

◆ get_type()

void sc_dt::sc_fxval::get_type ( int wl,
int iwl,
sc_enc enc 
) const
inlineprotected

Definition at line 1498 of file sc_fxval.h.

◆ is_inf()

bool sc_dt::sc_fxval::is_inf ( ) const
inline

Definition at line 1462 of file sc_fxval.h.

◆ is_nan()

bool sc_dt::sc_fxval::is_nan ( ) const
inline

Definition at line 1454 of file sc_fxval.h.

◆ is_neg()

bool sc_dt::sc_fxval::is_neg ( ) const
inline

Definition at line 1438 of file sc_fxval.h.

◆ is_normal()

bool sc_dt::sc_fxval::is_normal ( ) const
inline

Definition at line 1470 of file sc_fxval.h.

◆ is_zero()

bool sc_dt::sc_fxval::is_zero ( ) const
inline

Definition at line 1446 of file sc_fxval.h.

◆ lock_observer()

sc_fxval_observer* sc_dt::sc_fxval::lock_observer ( ) const
protected

◆ observer()

sc_fxval_observer * sc_dt::sc_fxval::observer ( ) const
inlineprotected

Definition at line 776 of file sc_fxval.h.

◆ operator double()

sc_dt::sc_fxval::operator double ( ) const
inline

Definition at line 1344 of file sc_fxval.h.

◆ operator+()

const sc_fxval & sc_dt::sc_fxval::operator+ ( ) const
inline

Definition at line 892 of file sc_fxval.h.

◆ operator++() [1/2]

const sc_fxval sc_dt::sc_fxval::operator++ ( int  )
inline

Definition at line 1308 of file sc_fxval.h.

◆ operator++() [2/2]

sc_fxval & sc_dt::sc_fxval::operator++ ( )
inline

Definition at line 1326 of file sc_fxval.h.

◆ operator-()

const sc_fxval sc_dt::sc_fxval::operator- ( ) const
inline

Definition at line 884 of file sc_fxval.h.

◆ operator--() [1/2]

const sc_fxval sc_dt::sc_fxval::operator-- ( int  )
inline

Definition at line 1317 of file sc_fxval.h.

◆ operator--() [2/2]

sc_fxval & sc_dt::sc_fxval::operator-- ( )
inline

Definition at line 1334 of file sc_fxval.h.

◆ overflow()

const sc_fxval sc_dt::sc_fxval::overflow ( const scfx_params params,
bool &  o_flag 
) const
inlineprotected

Definition at line 1513 of file sc_fxval.h.

◆ print()

void sc_dt::sc_fxval::print ( ::std::ostream &  = ::std::cout) const

◆ quantization()

const sc_fxval sc_dt::sc_fxval::quantization ( const scfx_params params,
bool &  q_flag 
) const
inlineprotected

Definition at line 1506 of file sc_fxval.h.

◆ rounding_flag()

bool sc_dt::sc_fxval::rounding_flag ( ) const
inline

Definition at line 1479 of file sc_fxval.h.

◆ scan()

void sc_dt::sc_fxval::scan ( ::std::istream &  = ::std::cin)

◆ set_rep()

void sc_dt::sc_fxval::set_rep ( scfx_rep rep_)
inline

Definition at line 872 of file sc_fxval.h.

◆ to_bin()

const std::string sc_dt::sc_fxval::to_bin ( ) const

◆ to_dec()

const std::string sc_dt::sc_fxval::to_dec ( ) const

◆ to_double()

double sc_dt::sc_fxval::to_double ( ) const
inline

Definition at line 1427 of file sc_fxval.h.

◆ to_float()

float sc_dt::sc_fxval::to_float ( ) const
inline

Definition at line 1419 of file sc_fxval.h.

◆ to_hex()

const std::string sc_dt::sc_fxval::to_hex ( ) const

◆ to_int()

int sc_dt::sc_fxval::to_int ( ) const
inline

Definition at line 1371 of file sc_fxval.h.

◆ to_int64()

int64 sc_dt::sc_fxval::to_int64 ( ) const
inline

Definition at line 1379 of file sc_fxval.h.

◆ to_long()

long sc_dt::sc_fxval::to_long ( ) const
inline

Definition at line 1403 of file sc_fxval.h.

◆ to_oct()

const std::string sc_dt::sc_fxval::to_oct ( ) const

◆ to_short()

short sc_dt::sc_fxval::to_short ( ) const
inline

Definition at line 1355 of file sc_fxval.h.

◆ to_string() [1/6]

const std::string sc_dt::sc_fxval::to_string ( ) const

◆ to_string() [2/6]

const std::string sc_dt::sc_fxval::to_string ( sc_numrep  ) const

◆ to_string() [3/6]

const std::string sc_dt::sc_fxval::to_string ( sc_numrep  ,
bool   
) const

◆ to_string() [4/6]

const std::string sc_dt::sc_fxval::to_string ( sc_fmt  ) const

◆ to_string() [5/6]

const std::string sc_dt::sc_fxval::to_string ( sc_numrep  ,
sc_fmt   
) const

◆ to_string() [6/6]

const std::string sc_dt::sc_fxval::to_string ( sc_numrep  ,
bool  ,
sc_fmt   
) const

◆ to_uint()

unsigned int sc_dt::sc_fxval::to_uint ( ) const
inline

Definition at line 1387 of file sc_fxval.h.

◆ to_uint64()

uint64 sc_dt::sc_fxval::to_uint64 ( ) const
inline

Definition at line 1395 of file sc_fxval.h.

◆ to_ulong()

unsigned long sc_dt::sc_fxval::to_ulong ( ) const
inline

Definition at line 1411 of file sc_fxval.h.

◆ to_ushort()

unsigned short sc_dt::sc_fxval::to_ushort ( ) const
inline

Definition at line 1363 of file sc_fxval.h.

◆ unlock_observer()

void sc_dt::sc_fxval::unlock_observer ( sc_fxval_observer ) const
protected

Friends And Related Function Documentation

◆ lshift

void lshift ( sc_fxval c,
const sc_fxval a,
int  b 
)
friend

Definition at line 1090 of file sc_fxval.h.

◆ neg

void neg ( sc_fxval c,
const sc_fxval a 
)
friend

Definition at line 903 of file sc_fxval.h.

◆ operator/

const sc_fxval operator/ ( const sc_fxval a,
const sc_fxval b 
)
friend

Definition at line 972 of file sc_fxval.h.

◆ operator>>

const sc_fxval operator>> ( const sc_fxval a,
int  b 
)
friend

Definition at line 1012 of file sc_fxval.h.

◆ rshift

void rshift ( sc_fxval c,
const sc_fxval a,
int  b 
)
friend

Definition at line 1100 of file sc_fxval.h.

◆ sc_fxnum

friend class sc_fxnum
friend

Definition at line 98 of file sc_fxval.h.

Member Data Documentation

◆ int

uint64 const sc_uint_base sc_dt::sc_fxval::int

Definition at line 212 of file sc_fxval.h.


The documentation for this class was generated from the following files: