gem5  v22.1.0.0
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
sc_dt::sc_fxnum Class Reference

#include <sc_fxnum.hh>

Inheritance diagram for sc_dt::sc_fxnum:
sc_dt::sc_fix sc_dt::sc_ufix sc_dt::sc_fixed< W, I, Q, O, N > sc_dt::sc_ufixed< W, I, Q, O, N >

Public Member Functions

const sc_fxval operator- () const
 
const sc_fxval operator+ () const
 
const sc_fxval operator++ (int)
 
const sc_fxval operator-- (int)
 
sc_fxnumoperator++ ()
 
sc_fxnumoperator-- ()
 
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 range (int, int) const
 
sc_fxnum_subref range (int, int)
 
const sc_fxnum_subref operator() () const
 
sc_fxnum_subref operator() ()
 
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 ()
 
 sc_fxnum (const sc_fxtype_params &, sc_enc, const sc_fxcast_switch &, sc_fxnum_observer *)
 
 ~sc_fxnum ()
 
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
 

Private Member Functions

 sc_fxnum ()
 
 sc_fxnum (const sc_fxnum &)
 

Private Attributes

scfx_repm_rep
 
scfx_params m_params
 
bool m_q_flag
 
bool m_o_flag
 
sc_fxnum_observerm_observer
 

Friends

class sc_fxval
 
class sc_fxnum_bitref
 
class sc_fxnum_subref
 
class sc_fxnum_fast_bitref
 
class sc_fxnum_fast_subref
 
template<typename T , typename B >
class sc_gem5::TraceValFxnumBase
 
void neg (sc_fxval &, const sc_fxnum &)
 
void neg (sc_fxnum &, const sc_fxnum &)
 
const sc_fxval operator/ (const sc_fxnum &, const sc_fxnum &)
 
const sc_fxval operator<< (const sc_fxnum &, int)
 
const sc_fxval operator>> (const sc_fxnum &, int)
 
void lshift (sc_fxval &, const sc_fxnum &, int)
 
void rshift (sc_fxval &, const sc_fxnum &, int)
 
void lshift (sc_fxnum &, const sc_fxnum &, int)
 
void rshift (sc_fxnum &, const sc_fxnum &, int)
 

Detailed Description

Definition at line 483 of file sc_fxnum.hh.

Constructor & Destructor Documentation

◆ sc_fxnum() [1/3]

sc_dt::sc_fxnum::sc_fxnum ( const sc_fxtype_params type_params_,
sc_enc  enc_,
const sc_fxcast_switch cast_sw,
sc_fxnum_observer observer_ 
)
inlineprotected

Definition at line 2185 of file sc_fxnum.hh.

References SC_FXNUM_OBSERVER_CONSTRUCT_, and SC_FXNUM_OBSERVER_DEFAULT_.

◆ ~sc_fxnum()

sc_dt::sc_fxnum::~sc_fxnum ( )
inlineprotected

Definition at line 2239 of file sc_fxnum.hh.

References m_rep, and SC_FXNUM_OBSERVER_DESTRUCT_.

◆ sc_fxnum() [2/3]

sc_dt::sc_fxnum::sc_fxnum ( )
private

◆ sc_fxnum() [3/3]

sc_dt::sc_fxnum::sc_fxnum ( const sc_fxnum )
private

Member Function Documentation

◆ bit() [1/2]

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

◆ bit() [2/2]

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

◆ cast()

void sc_dt::sc_fxnum::cast ( )
inlineprotected

◆ cast_switch()

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

Definition at line 3073 of file sc_fxnum.hh.

References sc_dt::scfx_params::cast_switch(), and m_params.

◆ dump()

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

◆ get_bit()

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

◆ get_rep()

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

Definition at line 2247 of file sc_fxnum.hh.

References m_rep, and SC_FXNUM_OBSERVER_READ_.

◆ get_slice()

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

◆ is_neg()

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

Definition at line 2994 of file sc_fxnum.hh.

References sc_dt::scfx_rep::is_neg(), m_rep, and SC_FXNUM_OBSERVER_READ_.

◆ is_normal()

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

Definition at line 3009 of file sc_fxnum.hh.

References sc_dt::scfx_rep::is_normal(), m_rep, and SC_FXNUM_OBSERVER_READ_.

◆ is_zero()

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

Definition at line 3001 of file sc_fxnum.hh.

References sc_dt::scfx_rep::is_zero(), m_rep, and SC_FXNUM_OBSERVER_READ_.

◆ iwl()

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

Definition at line 3043 of file sc_fxnum.hh.

References sc_dt::scfx_params::iwl(), and m_params.

Referenced by sc_dt::sc_fix::operator~(), and sc_dt::sc_ufix::operator~().

◆ lock_observer()

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

Definition at line 328 of file sc_fxnum.cc.

References m_observer, and SC_ASSERT_.

◆ n_bits()

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

Definition at line 3061 of file sc_fxnum.hh.

References m_params, and sc_dt::scfx_params::n_bits().

◆ o_mode()

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

Definition at line 3055 of file sc_fxnum.hh.

References m_params, and sc_dt::scfx_params::o_mode().

◆ observer()

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

Definition at line 2170 of file sc_fxnum.hh.

References m_observer.

◆ observer_read()

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

Definition at line 3080 of file sc_fxnum.hh.

References SC_FXNUM_OBSERVER_READ_.

◆ operator double()

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

Definition at line 2915 of file sc_fxnum.hh.

References m_rep, SC_FXNUM_OBSERVER_READ_, and sc_dt::scfx_rep::to_double().

◆ operator()() [1/4]

sc_fxnum_subref sc_dt::sc_fxnum::operator() ( )
inline

Definition at line 2897 of file sc_fxnum.hh.

References m_params, operator()(), and sc_dt::scfx_params::wl().

◆ operator()() [2/4]

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

Definition at line 2891 of file sc_fxnum.hh.

References m_params, and sc_dt::scfx_params::wl().

Referenced by operator()().

◆ operator()() [3/4]

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

◆ operator()() [4/4]

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

◆ operator+()

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

Definition at line 2262 of file sc_fxnum.hh.

References m_rep, SC_FXNUM_OBSERVER_READ_, and sc_fxval.

◆ operator++() [1/2]

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

Definition at line 2805 of file sc_fxnum.hh.

Referenced by sc_dt::sc_fix::operator++(), and sc_dt::sc_ufix::operator++().

◆ operator++() [2/2]

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

Definition at line 2789 of file sc_fxnum.hh.

References gem5::VegaISA::c.

◆ operator-()

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

Definition at line 2255 of file sc_fxnum.hh.

References m_rep, sc_dt::neg_scfx_rep(), SC_FXNUM_OBSERVER_READ_, and sc_fxval.

◆ operator--() [1/2]

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

Definition at line 2812 of file sc_fxnum.hh.

Referenced by sc_dt::sc_fix::operator--(), and sc_dt::sc_ufix::operator--().

◆ operator--() [2/2]

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

Definition at line 2797 of file sc_fxnum.hh.

References gem5::VegaISA::c.

◆ operator[]() [1/2]

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

◆ operator[]() [2/2]

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

◆ overflow_flag()

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

Definition at line 3022 of file sc_fxnum.hh.

References m_o_flag.

◆ print()

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

◆ q_mode()

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

Definition at line 3049 of file sc_fxnum.hh.

References m_params, and sc_dt::scfx_params::q_mode().

◆ quantization_flag()

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

Definition at line 3016 of file sc_fxnum.hh.

References m_q_flag.

◆ range() [1/4]

sc_fxnum_subref sc_dt::sc_fxnum::range ( )
inline

Definition at line 2909 of file sc_fxnum.hh.

References m_params, range(), and sc_dt::scfx_params::wl().

◆ range() [2/4]

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

Definition at line 2903 of file sc_fxnum.hh.

References m_params, and sc_dt::scfx_params::wl().

Referenced by range().

◆ range() [3/4]

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

◆ range() [4/4]

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

◆ scan()

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

Definition at line 299 of file sc_fxnum.cc.

References gem5::MipsISA::is, and gem5::VegaISA::s.

◆ set_bit()

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

◆ set_slice()

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

◆ to_bin()

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

Definition at line 273 of file sc_fxnum.cc.

References m_params, m_rep, sc_dt::SC_BIN, sc_dt::SC_F, and sc_dt::scfx_rep::to_string().

◆ to_dec()

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

Definition at line 267 of file sc_fxnum.cc.

References m_params, m_rep, sc_dt::SC_DEC, sc_dt::SC_F, and sc_dt::scfx_rep::to_string().

◆ to_double()

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

Definition at line 2986 of file sc_fxnum.hh.

References m_rep, SC_FXNUM_OBSERVER_READ_, and sc_dt::scfx_rep::to_double().

◆ to_float()

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

Definition at line 2979 of file sc_fxnum.hh.

References m_rep, SC_FXNUM_OBSERVER_READ_, and sc_dt::scfx_rep::to_double().

◆ to_hex()

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

Definition at line 285 of file sc_fxnum.cc.

References m_params, m_rep, sc_dt::SC_F, sc_dt::SC_HEX, and sc_dt::scfx_rep::to_string().

◆ to_int()

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

Definition at line 2937 of file sc_fxnum.hh.

References m_rep, SC_FXNUM_OBSERVER_READ_, and sc_dt::scfx_rep::to_uint64().

◆ to_int64()

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

Definition at line 2944 of file sc_fxnum.hh.

References m_rep, SC_FXNUM_OBSERVER_READ_, and sc_dt::scfx_rep::to_uint64().

◆ to_long()

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

Definition at line 2965 of file sc_fxnum.hh.

References m_rep, SC_FXNUM_OBSERVER_READ_, and sc_dt::scfx_rep::to_uint64().

◆ to_oct()

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

Definition at line 279 of file sc_fxnum.cc.

References m_params, m_rep, sc_dt::SC_F, sc_dt::SC_OCT, and sc_dt::scfx_rep::to_string().

◆ to_short()

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

Definition at line 2923 of file sc_fxnum.hh.

References m_rep, SC_FXNUM_OBSERVER_READ_, and sc_dt::scfx_rep::to_uint64().

◆ to_string() [1/6]

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

Definition at line 228 of file sc_fxnum.cc.

References m_params, m_rep, sc_dt::SC_DEC, sc_dt::SC_F, and sc_dt::scfx_rep::to_string().

◆ to_string() [2/6]

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

Definition at line 247 of file sc_fxnum.cc.

References m_params, m_rep, sc_dt::SC_DEC, and sc_dt::scfx_rep::to_string().

◆ to_string() [3/6]

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

Definition at line 234 of file sc_fxnum.cc.

References m_params, m_rep, sc_dt::SC_F, and sc_dt::scfx_rep::to_string().

◆ to_string() [4/6]

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

Definition at line 240 of file sc_fxnum.cc.

References m_params, m_rep, sc_dt::SC_F, and sc_dt::scfx_rep::to_string().

◆ to_string() [5/6]

const std::string sc_dt::sc_fxnum::to_string ( sc_numrep  numrep,
bool  w_prefix,
sc_fmt  fmt 
) const

Definition at line 259 of file sc_fxnum.cc.

References m_params, m_rep, and sc_dt::scfx_rep::to_string().

◆ to_string() [6/6]

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

Definition at line 253 of file sc_fxnum.cc.

References m_params, m_rep, and sc_dt::scfx_rep::to_string().

◆ to_uint()

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

Definition at line 2951 of file sc_fxnum.hh.

References m_rep, SC_FXNUM_OBSERVER_READ_, and sc_dt::scfx_rep::to_uint64().

◆ to_uint64()

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

Definition at line 2958 of file sc_fxnum.hh.

References m_rep, SC_FXNUM_OBSERVER_READ_, and sc_dt::scfx_rep::to_uint64().

◆ to_ulong()

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

Definition at line 2972 of file sc_fxnum.hh.

References m_rep, SC_FXNUM_OBSERVER_READ_, and sc_dt::scfx_rep::to_uint64().

◆ to_ushort()

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

Definition at line 2930 of file sc_fxnum.hh.

References m_rep, SC_FXNUM_OBSERVER_READ_, and sc_dt::scfx_rep::to_uint64().

◆ type_params()

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

Definition at line 3067 of file sc_fxnum.hh.

References m_params, and sc_dt::scfx_params::type_params().

◆ unlock_observer()

void sc_dt::sc_fxnum::unlock_observer ( sc_fxnum_observer observer_) const
protected

Definition at line 337 of file sc_fxnum.cc.

References m_observer, and SC_ASSERT_.

◆ value()

const sc_fxval sc_dt::sc_fxnum::value ( void  ) const
inline

Definition at line 3029 of file sc_fxnum.hh.

References m_rep, SC_FXNUM_OBSERVER_READ_, and sc_fxval.

◆ wl()

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

Definition at line 3037 of file sc_fxnum.hh.

References m_params, and sc_dt::scfx_params::wl().

Referenced by sc_dt::sc_fix::operator~(), and sc_dt::sc_ufix::operator~().

Friends And Related Function Documentation

◆ lshift [1/2]

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

Definition at line 2550 of file sc_fxnum.hh.

◆ lshift [2/2]

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

Definition at line 2536 of file sc_fxnum.hh.

◆ neg [1/2]

void neg ( sc_fxnum c,
const sc_fxnum a 
)
friend

Definition at line 2277 of file sc_fxnum.hh.

◆ neg [2/2]

void neg ( sc_fxval c,
const sc_fxnum a 
)
friend

Definition at line 2270 of file sc_fxnum.hh.

◆ operator/

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

Definition at line 2356 of file sc_fxnum.hh.

◆ operator<<

const sc_fxval operator<< ( const sc_fxnum a,
int  b 
)
friend

Definition at line 2399 of file sc_fxnum.hh.

◆ operator>>

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

Definition at line 2407 of file sc_fxnum.hh.

◆ rshift [1/2]

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

Definition at line 2560 of file sc_fxnum.hh.

◆ rshift [2/2]

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

Definition at line 2543 of file sc_fxnum.hh.

◆ sc_fxnum_bitref

friend class sc_fxnum_bitref
friend

Definition at line 487 of file sc_fxnum.hh.

Referenced by bit(), and operator[]().

◆ sc_fxnum_fast_bitref

friend class sc_fxnum_fast_bitref
friend

Definition at line 489 of file sc_fxnum.hh.

◆ sc_fxnum_fast_subref

friend class sc_fxnum_fast_subref
friend

Definition at line 490 of file sc_fxnum.hh.

◆ sc_fxnum_subref

friend class sc_fxnum_subref
friend

Definition at line 488 of file sc_fxnum.hh.

Referenced by operator()(), and range().

◆ sc_fxval

friend class sc_fxval
friend

◆ sc_gem5::TraceValFxnumBase

template<typename T , typename B >
friend class sc_gem5::TraceValFxnumBase
friend

Definition at line 493 of file sc_fxnum.hh.

Member Data Documentation

◆ m_o_flag

bool sc_dt::sc_fxnum::m_o_flag
private

Definition at line 827 of file sc_fxnum.hh.

Referenced by cast(), dump(), and overflow_flag().

◆ m_observer

sc_fxnum_observer* sc_dt::sc_fxnum::m_observer
mutableprivate

◆ m_params

scfx_params sc_dt::sc_fxnum::m_params
private

◆ m_q_flag

bool sc_dt::sc_fxnum::m_q_flag
private

Definition at line 826 of file sc_fxnum.hh.

Referenced by cast(), dump(), and quantization_flag().

◆ m_rep

scfx_rep* sc_dt::sc_fxnum::m_rep
private

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

Generated on Wed Dec 21 2022 10:25:09 for gem5 by doxygen 1.9.1