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

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

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

Inheritance diagram for sc_dt::sc_fix:
Collaboration diagram for sc_dt::sc_fix:

Public Member Functions

 sc_fix (sc_fxnum_observer *=0)
 
 sc_fix (int, int, sc_fxnum_observer *=0)
 
 sc_fix (sc_q_mode, sc_o_mode, sc_fxnum_observer *=0)
 
 sc_fix (sc_q_mode, sc_o_mode, int, sc_fxnum_observer *=0)
 
 sc_fix (int, int, sc_q_mode, sc_o_mode, sc_fxnum_observer *=0)
 
 sc_fix (int, int, sc_q_mode, sc_o_mode, int, sc_fxnum_observer *=0)
 
 sc_fix (const sc_fxcast_switch &, sc_fxnum_observer *=0)
 
 sc_fix (int, int, const sc_fxcast_switch &, sc_fxnum_observer *=0)
 
 sc_fix (sc_q_mode, sc_o_mode, const sc_fxcast_switch &, sc_fxnum_observer *=0)
 
 sc_fix (sc_q_mode, sc_o_mode, int, const sc_fxcast_switch &, sc_fxnum_observer *=0)
 
 sc_fix (int, int, sc_q_mode, sc_o_mode, const sc_fxcast_switch &, sc_fxnum_observer *=0)
 
 sc_fix (int, int, sc_q_mode, sc_o_mode, int, const sc_fxcast_switch &, sc_fxnum_observer *=0)
 
 sc_fix (const sc_fxtype_params &, sc_fxnum_observer *=0)
 
 sc_fix (const sc_fxtype_params &, const sc_fxcast_switch &, sc_fxnum_observer *=0)
 
 sc_fix (const sc_fix &)
 
const sc_fix operator~ () const
 
sc_fixoperator= (const sc_fix &)
 
const sc_fxval operator++ (int)
 
const sc_fxval operator-- (int)
 
sc_fixoperator++ ()
 
sc_fixoperator-- ()
 
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
 

Friends

void b_not (sc_fix &, const sc_fix &)
 
const sc_fix operator& (const sc_fix &, const sc_fix &)
 
const sc_fix operator& (const sc_fix &, const sc_fix_fast &)
 
const sc_fix operator& (const sc_fix_fast &, const sc_fix &)
 
const sc_fix operator| (const sc_fix &, const sc_fix &)
 
const sc_fix operator| (const sc_fix &, const sc_fix_fast &)
 
const sc_fix operator| (const sc_fix_fast &, const sc_fix &)
 
const sc_fix operator^ (const sc_fix &, const sc_fix &)
 
const sc_fix operator^ (const sc_fix &, const sc_fix_fast &)
 
const sc_fix operator^ (const sc_fix_fast &, const sc_fix &)
 
void b_and (sc_fix &, const sc_fix &, const sc_fix &)
 
void b_and (sc_fix &, const sc_fix &, const sc_fix_fast &)
 
void b_and (sc_fix &, const sc_fix_fast &, const sc_fix &)
 
void b_or (sc_fix &, const sc_fix &, const sc_fix &)
 
void b_or (sc_fix &, const sc_fix &, const sc_fix_fast &)
 
void b_or (sc_fix &, const sc_fix_fast &, const sc_fix &)
 
void b_xor (sc_fix &, const sc_fix &, const sc_fix &)
 
void b_xor (sc_fix &, const sc_fix &, const sc_fix_fast &)
 
void b_xor (sc_fix &, const sc_fix_fast &, const sc_fix &)
 

Detailed Description

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

Definition at line 71 of file sc_fix.h.

Constructor & Destructor Documentation

◆ sc_fix() [1/15]

sc_dt::sc_fix::sc_fix ( sc_fxnum_observer observer_ = 0)
inlineexplicit

Definition at line 537 of file sc_fix.h.

◆ sc_fix() [2/15]

sc_dt::sc_fix::sc_fix ( int  wl_,
int  iwl_,
sc_fxnum_observer observer_ = 0 
)
inline

Definition at line 545 of file sc_fix.h.

◆ sc_fix() [3/15]

sc_dt::sc_fix::sc_fix ( sc_q_mode  qm,
sc_o_mode  om,
sc_fxnum_observer observer_ = 0 
)
inline

Definition at line 554 of file sc_fix.h.

◆ sc_fix() [4/15]

sc_dt::sc_fix::sc_fix ( sc_q_mode  qm,
sc_o_mode  om,
int  nb,
sc_fxnum_observer observer_ = 0 
)
inline

Definition at line 563 of file sc_fix.h.

◆ sc_fix() [5/15]

sc_dt::sc_fix::sc_fix ( int  wl_,
int  iwl_,
sc_q_mode  qm,
sc_o_mode  om,
sc_fxnum_observer observer_ = 0 
)
inline

Definition at line 572 of file sc_fix.h.

◆ sc_fix() [6/15]

sc_dt::sc_fix::sc_fix ( int  wl_,
int  iwl_,
sc_q_mode  qm,
sc_o_mode  om,
int  nb,
sc_fxnum_observer observer_ = 0 
)
inline

Definition at line 581 of file sc_fix.h.

◆ sc_fix() [7/15]

sc_dt::sc_fix::sc_fix ( const sc_fxcast_switch cast_sw,
sc_fxnum_observer observer_ = 0 
)
inlineexplicit

Definition at line 590 of file sc_fix.h.

◆ sc_fix() [8/15]

sc_dt::sc_fix::sc_fix ( int  wl_,
int  iwl_,
const sc_fxcast_switch cast_sw,
sc_fxnum_observer observer_ = 0 
)
inline

Definition at line 599 of file sc_fix.h.

◆ sc_fix() [9/15]

sc_dt::sc_fix::sc_fix ( sc_q_mode  qm,
sc_o_mode  om,
const sc_fxcast_switch cast_sw,
sc_fxnum_observer observer_ = 0 
)
inline

Definition at line 609 of file sc_fix.h.

◆ sc_fix() [10/15]

sc_dt::sc_fix::sc_fix ( sc_q_mode  qm,
sc_o_mode  om,
int  nb,
const sc_fxcast_switch cast_sw,
sc_fxnum_observer observer_ = 0 
)
inline

Definition at line 619 of file sc_fix.h.

◆ sc_fix() [11/15]

sc_dt::sc_fix::sc_fix ( int  wl_,
int  iwl_,
sc_q_mode  qm,
sc_o_mode  om,
const sc_fxcast_switch cast_sw,
sc_fxnum_observer observer_ = 0 
)
inline

Definition at line 629 of file sc_fix.h.

◆ sc_fix() [12/15]

sc_dt::sc_fix::sc_fix ( int  wl_,
int  iwl_,
sc_q_mode  qm,
sc_o_mode  om,
int  nb,
const sc_fxcast_switch cast_sw,
sc_fxnum_observer observer_ = 0 
)
inline

Definition at line 639 of file sc_fix.h.

◆ sc_fix() [13/15]

sc_dt::sc_fix::sc_fix ( const sc_fxtype_params type_params_,
sc_fxnum_observer observer_ = 0 
)
inlineexplicit

Definition at line 649 of file sc_fix.h.

◆ sc_fix() [14/15]

sc_dt::sc_fix::sc_fix ( const sc_fxtype_params type_params_,
const sc_fxcast_switch cast_sw,
sc_fxnum_observer observer_ = 0 
)
inline

Definition at line 658 of file sc_fix.h.

◆ sc_fix() [15/15]

sc_dt::sc_fix::sc_fix ( const sc_fix a)
inline

Definition at line 1013 of file sc_fix.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]

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

Definition at line 1207 of file sc_fix.h.

◆ operator++() [2/2]

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

Definition at line 1221 of file sc_fix.h.

◆ operator-()

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

Definition at line 2671 of file sc_fxnum.h.

◆ operator--() [1/2]

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

Definition at line 1214 of file sc_fix.h.

◆ operator--() [2/2]

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

Definition at line 1229 of file sc_fix.h.

◆ operator=()

sc_fix & sc_dt::sc_fix::operator= ( const sc_fix a)
inline

Definition at line 1122 of file sc_fix.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
inline

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.

Friends And Related Function Documentation

◆ b_and [1/3]

void b_and ( sc_fix ,
const sc_fix ,
const sc_fix  
)
friend

◆ b_and [2/3]

void b_and ( sc_fix ,
const sc_fix ,
const sc_fix_fast  
)
friend

◆ b_and [3/3]

void b_and ( sc_fix ,
const sc_fix_fast ,
const sc_fix  
)
friend

◆ b_not

void b_not ( sc_fix c,
const sc_fix a 
)
friend

Definition at line 1042 of file sc_fix.h.

◆ b_or [1/3]

void b_or ( sc_fix ,
const sc_fix ,
const sc_fix  
)
friend

◆ b_or [2/3]

void b_or ( sc_fix ,
const sc_fix ,
const sc_fix_fast  
)
friend

◆ b_or [3/3]

void b_or ( sc_fix ,
const sc_fix_fast ,
const sc_fix  
)
friend

◆ b_xor [1/3]

void b_xor ( sc_fix ,
const sc_fix ,
const sc_fix  
)
friend

◆ b_xor [2/3]

void b_xor ( sc_fix ,
const sc_fix ,
const sc_fix_fast  
)
friend

◆ b_xor [3/3]

void b_xor ( sc_fix ,
const sc_fix_fast ,
const sc_fix  
)
friend

◆ operator& [1/3]

const sc_fix operator & ( const sc_fix ,
const sc_fix  
)
friend

◆ operator& [2/3]

const sc_fix operator & ( const sc_fix ,
const sc_fix_fast  
)
friend

◆ operator& [3/3]

const sc_fix operator & ( const sc_fix_fast ,
const sc_fix  
)
friend

◆ operator^ [1/3]

const sc_fix operator^ ( const sc_fix ,
const sc_fix  
)
friend

◆ operator^ [2/3]

const sc_fix operator^ ( const sc_fix ,
const sc_fix_fast  
)
friend

◆ operator^ [3/3]

const sc_fix operator^ ( const sc_fix_fast ,
const sc_fix  
)
friend

◆ operator| [1/3]

const sc_fix operator| ( const sc_fix ,
const sc_fix  
)
friend

◆ operator| [2/3]

const sc_fix operator| ( const sc_fix ,
const sc_fix_fast  
)
friend

◆ operator| [3/3]

const sc_fix operator| ( const sc_fix_fast ,
const sc_fix  
)
friend

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