SystemC  2.3.2
Accellera SystemC proof-of-concept library
sc_dt::sc_fixed< W, I, Q, O, N > Class Template Reference

"Constrained" signed fixed-point class; arbitrary precision. More...

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

Inheritance diagram for sc_dt::sc_fixed< W, I, Q, O, N >:
Collaboration diagram for sc_dt::sc_fixed< W, I, Q, O, N >:

Public Member Functions

 sc_fixed (sc_fxnum_observer *=0)
 
 sc_fixed (const sc_fxcast_switch &, sc_fxnum_observer *=0)
 
 sc_fixed (const sc_fixed< W, I, Q, O, N > &)
 
sc_fixedoperator= (const sc_fixed< W, I, Q, O, N > &)
 
const sc_fxval operator++ (int)
 
const sc_fxval operator-- (int)
 
sc_fixedoperator++ ()
 
sc_fixedoperator-- ()
 
const sc_fix operator~ () const
 
const sc_fxval operator- () const
 
const sc_fxval operator+ () const
 
const sc_fxnum_bitref operator[] (int) const
 
sc_fxnum_bitref operator[] (int)
 
const sc_fxnum_bitref bit (int) const
 
sc_fxnum_bitref bit (int)
 
const sc_fxnum_subref operator() (int, int) const
 
sc_fxnum_subref operator() (int, int)
 
const sc_fxnum_subref operator() () const
 
sc_fxnum_subref operator() ()
 
const sc_fxnum_subref range (int, int) const
 
sc_fxnum_subref range (int, int)
 
const sc_fxnum_subref range () const
 
sc_fxnum_subref range ()
 
 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_normal () const
 
bool quantization_flag () const
 
bool overflow_flag () const
 
const sc_fxval value () const
 
int wl () const
 
int iwl () const
 
sc_q_mode q_mode () const
 
sc_o_mode o_mode () const
 
int n_bits () const
 
const sc_fxtype_paramstype_params () const
 
const sc_fxcast_switchcast_switch () const
 
void print (::std::ostream &=::std::cout) const
 
void scan (::std::istream &=::std::cin)
 
void dump (::std::ostream &=::std::cout) const
 
void observer_read () const
 
bool get_bit (int) const
 

Protected Member Functions

sc_fxnum_observerobserver () const
 
void cast ()
 
const scfx_repget_rep () const
 
bool set_bit (int, bool)
 
bool get_slice (int, int, sc_bv_base &) const
 
bool set_slice (int, int, const sc_bv_base &)
 
sc_fxnum_observerlock_observer () const
 
void unlock_observer (sc_fxnum_observer *) const
 

Detailed Description

template<int W, int I, sc_q_mode Q = SC_DEFAULT_Q_MODE_, sc_o_mode O = SC_DEFAULT_O_MODE_, int N = SC_DEFAULT_N_BITS_>
class sc_dt::sc_fixed< W, I, Q, O, N >

"Constrained" signed fixed-point class; arbitrary precision.

Definition at line 61 of file sc_fixed.h.

Constructor & Destructor Documentation

◆ sc_fixed() [1/3]

template<int W, int I, sc_q_mode Q, sc_o_mode O, int N>
sc_dt::sc_fixed< W, I, Q, O, N >::sc_fixed ( sc_fxnum_observer observer_ = 0)
inlineexplicit

Definition at line 320 of file sc_fixed.h.

◆ sc_fixed() [2/3]

template<int W, int I, sc_q_mode Q, sc_o_mode O, int N>
sc_dt::sc_fixed< W, I, Q, O, N >::sc_fixed ( const sc_fxcast_switch cast_sw,
sc_fxnum_observer observer_ = 0 
)
inlineexplicit

Definition at line 326 of file sc_fixed.h.

◆ sc_fixed() [3/3]

template<int W, int I, sc_q_mode Q, sc_o_mode O, int N>
sc_dt::sc_fixed< W, I, Q, O, N >::sc_fixed ( const sc_fixed< W, I, Q, O, N > &  a)
inline

Definition at line 373 of file sc_fixed.h.

Member Function Documentation

◆ bit() [1/2]

const sc_fxnum_bitref sc_dt::sc_fxnum::bit ( int  i) const
inlineinherited

Definition at line 3329 of file sc_fxnum.h.

◆ bit() [2/2]

sc_fxnum_bitref sc_dt::sc_fxnum::bit ( int  i)
inlineinherited

Definition at line 3338 of file sc_fxnum.h.

◆ cast()

void sc_dt::sc_fxnum::cast ( )
inlineprotectedinherited

Definition at line 2572 of file sc_fxnum.h.

◆ cast_switch()

const sc_fxcast_switch & sc_dt::sc_fxnum::cast_switch ( ) const
inlineinherited

Definition at line 3611 of file sc_fxnum.h.

◆ dump()

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

◆ get_bit()

bool sc_dt::sc_fxnum::get_bit ( int  i) const
inlineinherited

Definition at line 3629 of file sc_fxnum.h.

◆ get_rep()

const scfx_rep * sc_dt::sc_fxnum::get_rep ( ) const
inlineprotectedinherited

Definition at line 2660 of file sc_fxnum.h.

◆ get_slice()

bool sc_dt::sc_fxnum::get_slice ( int  i,
int  j,
sc_bv_base bv 
) const
inlineprotectedinherited

Definition at line 3650 of file sc_fxnum.h.

◆ is_neg()

bool sc_dt::sc_fxnum::is_neg ( ) const
inlineinherited

Definition at line 3516 of file sc_fxnum.h.

◆ is_normal()

bool sc_dt::sc_fxnum::is_normal ( ) const
inlineinherited

Definition at line 3533 of file sc_fxnum.h.

◆ is_zero()

bool sc_dt::sc_fxnum::is_zero ( ) const
inlineinherited

Definition at line 3524 of file sc_fxnum.h.

◆ iwl()

int sc_dt::sc_fxnum::iwl ( ) const
inlineinherited

Definition at line 3574 of file sc_fxnum.h.

◆ lock_observer()

sc_fxnum_observer* sc_dt::sc_fxnum::lock_observer ( ) const
protectedinherited

◆ n_bits()

int sc_dt::sc_fxnum::n_bits ( ) const
inlineinherited

Definition at line 3595 of file sc_fxnum.h.

◆ o_mode()

sc_o_mode sc_dt::sc_fxnum::o_mode ( ) const
inlineinherited

Definition at line 3588 of file sc_fxnum.h.

◆ observer()

sc_fxnum_observer * sc_dt::sc_fxnum::observer ( ) const
inlineprotectedinherited

Definition at line 2564 of file sc_fxnum.h.

◆ observer_read()

void sc_dt::sc_fxnum::observer_read ( ) const
inlineinherited

Definition at line 3620 of file sc_fxnum.h.

◆ operator double()

sc_dt::sc_fxnum::operator double ( ) const
inlineinherited

Definition at line 3422 of file sc_fxnum.h.

◆ operator()() [1/4]

const sc_fxnum_subref sc_dt::sc_fxnum::operator() ( int  i,
int  j 
) const
inlineinherited

Definition at line 3349 of file sc_fxnum.h.

◆ operator()() [2/4]

sc_fxnum_subref sc_dt::sc_fxnum::operator() ( int  i,
int  j 
)
inlineinherited

Definition at line 3360 of file sc_fxnum.h.

◆ operator()() [3/4]

const sc_fxnum_subref sc_dt::sc_fxnum::operator() ( ) const
inlineinherited

Definition at line 3392 of file sc_fxnum.h.

◆ operator()() [4/4]

sc_fxnum_subref sc_dt::sc_fxnum::operator() ( )
inlineinherited

Definition at line 3399 of file sc_fxnum.h.

◆ operator+()

const sc_fxval sc_dt::sc_fxnum::operator+ ( ) const
inlineinherited

Definition at line 2679 of file sc_fxnum.h.

◆ operator++() [1/2]

template<int W, int I, sc_q_mode Q, sc_o_mode O, int N>
const sc_fxval sc_dt::sc_fixed< W, I, Q, O, N >::operator++ ( int  )
inline

Definition at line 452 of file sc_fixed.h.

◆ operator++() [2/2]

template<int W, int I, sc_q_mode Q, sc_o_mode O, int N>
sc_fixed< W, I, Q, O, N > & sc_dt::sc_fixed< W, I, Q, O, N >::operator++ ( )
inline

Definition at line 468 of file sc_fixed.h.

◆ operator-()

const sc_fxval sc_dt::sc_fxnum::operator- ( ) const
inlineinherited

Definition at line 2671 of file sc_fxnum.h.

◆ operator--() [1/2]

template<int W, int I, sc_q_mode Q, sc_o_mode O, int N>
const sc_fxval sc_dt::sc_fixed< W, I, Q, O, N >::operator-- ( int  )
inline

Definition at line 460 of file sc_fixed.h.

◆ operator--() [2/2]

template<int W, int I, sc_q_mode Q, sc_o_mode O, int N>
sc_fixed< W, I, Q, O, N > & sc_dt::sc_fixed< W, I, Q, O, N >::operator-- ( )
inline

Definition at line 477 of file sc_fixed.h.

◆ operator=()

template<int W, int I, sc_q_mode Q, sc_o_mode O, int N>
sc_fixed< W, I, Q, O, N > & sc_dt::sc_fixed< W, I, Q, O, N >::operator= ( const sc_fixed< W, I, Q, O, N > &  a)
inline

Definition at line 383 of file sc_fixed.h.

◆ operator[]() [1/2]

const sc_fxnum_bitref sc_dt::sc_fxnum::operator[] ( int  i) const
inlineinherited

Definition at line 3312 of file sc_fxnum.h.

◆ operator[]() [2/2]

sc_fxnum_bitref sc_dt::sc_fxnum::operator[] ( int  i)
inlineinherited

Definition at line 3321 of file sc_fxnum.h.

◆ operator~()

const sc_fix sc_dt::sc_fix::operator~ ( ) const
inlineinherited

Definition at line 1026 of file sc_fix.h.

◆ overflow_flag()

bool sc_dt::sc_fxnum::overflow_flag ( ) const
inlineinherited

Definition at line 3548 of file sc_fxnum.h.

◆ print()

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

◆ q_mode()

sc_q_mode sc_dt::sc_fxnum::q_mode ( ) const
inlineinherited

Definition at line 3581 of file sc_fxnum.h.

◆ quantization_flag()

bool sc_dt::sc_fxnum::quantization_flag ( ) const
inlineinherited

Definition at line 3541 of file sc_fxnum.h.

◆ range() [1/4]

const sc_fxnum_subref sc_dt::sc_fxnum::range ( int  i,
int  j 
) const
inlineinherited

Definition at line 3370 of file sc_fxnum.h.

◆ range() [2/4]

sc_fxnum_subref sc_dt::sc_fxnum::range ( int  i,
int  j 
)
inlineinherited

Definition at line 3381 of file sc_fxnum.h.

◆ range() [3/4]

const sc_fxnum_subref sc_dt::sc_fxnum::range ( ) const
inlineinherited

Definition at line 3406 of file sc_fxnum.h.

◆ range() [4/4]

sc_fxnum_subref sc_dt::sc_fxnum::range ( )
inlineinherited

Definition at line 3413 of file sc_fxnum.h.

◆ scan()

void sc_dt::sc_fxnum::scan ( ::std::istream &  = ::std::cin)
inherited

◆ set_bit()

bool sc_dt::sc_fxnum::set_bit ( int  i,
bool  high 
)
inlineprotectedinherited

Definition at line 3639 of file sc_fxnum.h.

◆ set_slice()

bool sc_dt::sc_fxnum::set_slice ( int  i,
int  j,
const sc_bv_base bv 
)
inlineprotectedinherited

Definition at line 3657 of file sc_fxnum.h.

◆ to_bin()

const std::string sc_dt::sc_fxnum::to_bin ( ) const
inherited

◆ to_dec()

const std::string sc_dt::sc_fxnum::to_dec ( ) const
inherited

◆ to_double()

double sc_dt::sc_fxnum::to_double ( ) const
inlineinherited

Definition at line 3505 of file sc_fxnum.h.

◆ to_float()

float sc_dt::sc_fxnum::to_float ( ) const
inlineinherited

Definition at line 3497 of file sc_fxnum.h.

◆ to_hex()

const std::string sc_dt::sc_fxnum::to_hex ( ) const
inherited

◆ to_int()

int sc_dt::sc_fxnum::to_int ( ) const
inlineinherited

Definition at line 3449 of file sc_fxnum.h.

◆ to_int64()

int64 sc_dt::sc_fxnum::to_int64 ( ) const
inlineinherited

Definition at line 3457 of file sc_fxnum.h.

◆ to_long()

long sc_dt::sc_fxnum::to_long ( ) const
inlineinherited

Definition at line 3481 of file sc_fxnum.h.

◆ to_oct()

const std::string sc_dt::sc_fxnum::to_oct ( ) const
inherited

◆ to_short()

short sc_dt::sc_fxnum::to_short ( ) const
inlineinherited

Definition at line 3433 of file sc_fxnum.h.

◆ to_string() [1/6]

const std::string sc_dt::sc_fxnum::to_string ( ) const
inherited

◆ to_string() [2/6]

const std::string sc_dt::sc_fxnum::to_string ( sc_numrep  ) const
inherited

◆ to_string() [3/6]

const std::string sc_dt::sc_fxnum::to_string ( sc_numrep  ,
bool   
) const
inherited

◆ to_string() [4/6]

const std::string sc_dt::sc_fxnum::to_string ( sc_fmt  ) const
inherited

◆ to_string() [5/6]

const std::string sc_dt::sc_fxnum::to_string ( sc_numrep  ,
sc_fmt   
) const
inherited

◆ to_string() [6/6]

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

◆ to_uint()

unsigned int sc_dt::sc_fxnum::to_uint ( ) const
inlineinherited

Definition at line 3465 of file sc_fxnum.h.

◆ to_uint64()

uint64 sc_dt::sc_fxnum::to_uint64 ( ) const
inlineinherited

Definition at line 3473 of file sc_fxnum.h.

◆ to_ulong()

unsigned long sc_dt::sc_fxnum::to_ulong ( ) const
inlineinherited

Definition at line 3489 of file sc_fxnum.h.

◆ to_ushort()

unsigned short sc_dt::sc_fxnum::to_ushort ( ) const
inlineinherited

Definition at line 3441 of file sc_fxnum.h.

◆ type_params()

const sc_fxtype_params & sc_dt::sc_fxnum::type_params ( ) const
inlineinherited

Definition at line 3603 of file sc_fxnum.h.

◆ unlock_observer()

void sc_dt::sc_fxnum::unlock_observer ( sc_fxnum_observer ) const
protectedinherited

◆ value()

const sc_fxval sc_dt::sc_fxnum::value ( ) const
inlineinherited

Definition at line 3556 of file sc_fxnum.h.

◆ wl()

int sc_dt::sc_fxnum::wl ( ) const
inlineinherited

Definition at line 3567 of file sc_fxnum.h.


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