Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

sc_dt::sc_int_base Class Reference

#include <sc_int_base.h>

Inheritance diagram for sc_dt::sc_int_base:

Inheritance graph
[legend]
Collaboration diagram for sc_dt::sc_int_base:

Collaboration graph
[legend]
List of all members.

Public Methods

 sc_int_base (int w=sc_length_param().len())
 sc_int_base (int_type v, int w)
 sc_int_base (const sc_int_base &a)
 sc_int_base (const sc_int_subref_r &a)
 sc_int_base (const sc_concatref &a)
 sc_int_base (const sc_signed &a)
 sc_int_base (const sc_unsigned &a)
virtual ~sc_int_base ()
sc_int_base & operator= (int_type v)
sc_int_base & operator= (const sc_int_base &a)
sc_int_base & operator= (const sc_int_subref_r &a)
sc_int_base & operator= (const sc_concatref &a)
sc_int_base & operator= (const sc_signed &a)
sc_int_base & operator= (const sc_unsigned &a)
sc_int_base & operator= (const sc_bv_base &a)
sc_int_base & operator= (const sc_lv_base &a)
sc_int_base & operator= (const char *a)
sc_int_base & operator= (unsigned long a)
sc_int_base & operator= (long a)
sc_int_base & operator= (unsigned int a)
sc_int_base & operator= (int a)
sc_int_base & operator= (uint64 a)
sc_int_base & operator= (double a)
sc_int_base & operator+= (int_type v)
sc_int_base & operator-= (int_type v)
sc_int_base & operator *= (int_type v)
sc_int_base & operator/= (int_type v)
sc_int_base & operator%= (int_type v)
sc_int_base & operator &= (int_type v)
sc_int_base & operator|= (int_type v)
sc_int_base & operator^= (int_type v)
sc_int_base & operator<<= (int_type v)
sc_int_base & operator>>= (int_type v)
sc_int_base & operator++ ()
const sc_int_base operator++ (int)
sc_int_base & operator-- ()
const sc_int_base operator-- (int)
sc_int_bitref operator[] (int i)
sc_int_bitref_r operator[] (int i) const
sc_int_bitref bit (int i)
sc_int_bitref_r bit (int i) const
sc_int_subref operator() (int left, int right)
sc_int_subref_r operator() (int left, int right) const
sc_int_subref range (int left, int right)
sc_int_subref_r range (int left, int right) const
bool test (int i) const
void set (int i)
void set (int i, bool v)
int length () const
virtual int concat_length (bool *xz_present_p) const
virtual bool concat_get_ctrl (unsigned long *dst_p, int low_i) const
virtual bool concat_get_data (unsigned long *dst_p, int low_i) const
virtual uint64 concat_get_uint64 () const
virtual void concat_set (int64 src, int low_i)
virtual void concat_set (const sc_signed &src, int low_i)
virtual void concat_set (const sc_unsigned &src, int low_i)
virtual void concat_set (uint64 src, int low_i)
bool and_reduce () const
bool nand_reduce () const
bool or_reduce () const
bool nor_reduce () const
bool xor_reduce () const
bool xnor_reduce () const
 operator int_type () const
int_type value () 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
double to_double () const
long long_low () const
long long_high () const
const sc_string to_string (sc_numrep numrep=SC_DEC) const
const sc_string to_string (sc_numrep numrep, bool w_prefix) const
void print (ostream &os=cout) const
void scan (istream &is=cin)

Protected Attributes

int_type m_val
int m_len
int m_ulen

Friends

class sc_int_bitref_r
class sc_int_bitref
class sc_int_subref_r
class sc_int_subref
bool operator== (const sc_int_base &a, const sc_int_base &b)
bool operator!= (const sc_int_base &a, const sc_int_base &b)
bool operator< (const sc_int_base &a, const sc_int_base &b)
bool operator<= (const sc_int_base &a, const sc_int_base &b)
bool operator> (const sc_int_base &a, const sc_int_base &b)
bool operator>= (const sc_int_base &a, const sc_int_base &b)

Constructor & Destructor Documentation

sc_dt::sc_int_base::sc_int_base int    w = sc_length_param().len() [inline, explicit]
 

Definition at line 555 of file sc_int_base.h.

References m_len, m_ulen, m_val, and SC_INTWIDTH.

sc_dt::sc_int_base::sc_int_base int_type    v,
int    w
[inline]
 

Definition at line 559 of file sc_int_base.h.

References sc_dt::int_type, m_len, m_ulen, m_val, and SC_INTWIDTH.

sc_dt::sc_int_base::sc_int_base const sc_int_base &    a [inline]
 

Definition at line 563 of file sc_int_base.h.

References m_len, m_ulen, and m_val.

sc_dt::sc_int_base::sc_int_base const sc_int_subref_r   a [inline, explicit]
 

Definition at line 567 of file sc_int_base.h.

References length(), m_len, m_ulen, m_val, and SC_INTWIDTH.

sc_dt::sc_int_base::sc_int_base const sc_concatref   a [explicit]
 

sc_dt::sc_int_base::sc_int_base const sc_signed   a [explicit]
 

Definition at line 394 of file sc_int_base.cpp.

References m_len, SC_INTWIDTH, and set().

sc_dt::sc_int_base::sc_int_base const sc_unsigned   a [explicit]
 

Definition at line 404 of file sc_int_base.cpp.

References m_len, SC_INTWIDTH, and set().

virtual sc_dt::sc_int_base::~sc_int_base   [inline, virtual]
 

Definition at line 583 of file sc_int_base.h.


Member Function Documentation

bool sc_dt::sc_int_base::and_reduce  
 

Definition at line 539 of file sc_int_base.cpp.

References sc_dt::int_type, and m_val.

Referenced by sc_dt::and_reduce(), sc_dt::sc_int_subref_r::and_reduce(), and nand_reduce().

sc_int_bitref_r sc_dt::sc_int_base::bit int    i const [inline]
 

Definition at line 1225 of file sc_int_base.h.

References sc_int_bitref_r.

sc_int_bitref sc_dt::sc_int_base::bit int    i [inline]
 

Definition at line 1217 of file sc_int_base.h.

References sc_int_bitref.

bool sc_dt::sc_int_base::concat_get_ctrl unsigned long *    dst_p,
int    low_i
const [virtual]
 

Reimplemented from sc_dt::sc_value_base.

Definition at line 565 of file sc_int_base.cpp.

References BITS_PER_DIGIT, m_len, and sc_dt::uint_type.

bool sc_dt::sc_int_base::concat_get_data unsigned long *    dst_p,
int    low_i
const [virtual]
 

Reimplemented from sc_dt::sc_value_base.

Definition at line 583 of file sc_int_base.cpp.

References BITS_PER_DIGIT, DIGIT_MASK, m_len, m_val, and sc_dt::uint_type.

virtual uint64 sc_dt::sc_int_base::concat_get_uint64   const [inline, virtual]
 

Reimplemented from sc_dt::sc_value_base.

Definition at line 753 of file sc_int_base.h.

References m_len, m_val, and sc_dt::uint64.

virtual int sc_dt::sc_int_base::concat_length bool *    xz_present_p const [inline, virtual]
 

Reimplemented from sc_dt::sc_value_base.

Definition at line 749 of file sc_int_base.h.

References length().

void sc_dt::sc_int_base::concat_set uint64    src,
int    low_i
[virtual]
 

Reimplemented from sc_dt::sc_value_base.

Definition at line 666 of file sc_int_base.cpp.

References sc_dt::uint64.

void sc_dt::sc_int_base::concat_set const sc_unsigned   src,
int    low_i
[virtual]
 

Reimplemented from sc_dt::sc_value_base.

Definition at line 658 of file sc_int_base.cpp.

References sc_dt::sc_unsigned::length().

void sc_dt::sc_int_base::concat_set const sc_signed   src,
int    low_i
[virtual]
 

Reimplemented from sc_dt::sc_value_base.

Definition at line 650 of file sc_int_base.cpp.

References sc_dt::sc_signed::length().

void sc_dt::sc_int_base::concat_set int64    src,
int    low_i
[virtual]
 

Reimplemented from sc_dt::sc_value_base.

Definition at line 645 of file sc_int_base.cpp.

References sc_dt::int64.

int sc_dt::sc_int_base::length   const [inline]
 

Definition at line 739 of file sc_int_base.h.

References m_len.

Referenced by concat_length(), and sc_int_base().

long sc_dt::sc_int_base::long_high   const [inline]
 

Definition at line 822 of file sc_int_base.h.

References m_val, and sc_dt::UINT64_32ONES.

long sc_dt::sc_int_base::long_low   const [inline]
 

Definition at line 819 of file sc_int_base.h.

References m_val, and sc_dt::UINT64_32ONES.

bool sc_dt::sc_int_base::nand_reduce   const [inline]
 

Definition at line 770 of file sc_int_base.h.

References and_reduce().

Referenced by sc_dt::nand_reduce().

bool sc_dt::sc_int_base::nor_reduce   const [inline]
 

Definition at line 775 of file sc_int_base.h.

References or_reduce().

Referenced by sc_dt::nor_reduce().

sc_int_base& sc_dt::sc_int_base::operator &= int_type    v [inline]
 

Reimplemented in sc_dt::sc_int< W >.

Definition at line 654 of file sc_int_base.h.

References sc_dt::int_type, and m_val.

sc_int_base& sc_dt::sc_int_base::operator *= int_type    v [inline]
 

Reimplemented in sc_dt::sc_int< W >.

Definition at line 642 of file sc_int_base.h.

References sc_dt::int_type, and m_val.

sc_dt::sc_int_base::operator int_type   const [inline]
 

Definition at line 786 of file sc_int_base.h.

References m_val.

Referenced by value().

sc_int_base& sc_dt::sc_int_base::operator%= int_type    v [inline]
 

Reimplemented in sc_dt::sc_int< W >.

Definition at line 648 of file sc_int_base.h.

References sc_dt::int_type, and m_val.

sc_int_subref_r sc_dt::sc_int_base::operator() int    left,
int    right
const [inline]
 

Definition at line 1244 of file sc_int_base.h.

References sc_int_subref_r.

sc_int_subref sc_dt::sc_int_base::operator() int    left,
int    right
[inline]
 

Definition at line 1236 of file sc_int_base.h.

References sc_int_subref.

const sc_int_base sc_dt::sc_int_base::operator++ int    [inline]
 

Reimplemented in sc_dt::sc_int< W >.

Definition at line 676 of file sc_int_base.h.

References m_val.

sc_int_base& sc_dt::sc_int_base::operator++   [inline]
 

Reimplemented in sc_dt::sc_int< W >.

Definition at line 673 of file sc_int_base.h.

References m_val.

sc_int_base& sc_dt::sc_int_base::operator+= int_type    v [inline]
 

Reimplemented in sc_dt::sc_int< W >.

Definition at line 636 of file sc_int_base.h.

References sc_dt::int_type, and m_val.

const sc_int_base sc_dt::sc_int_base::operator-- int    [inline]
 

Reimplemented in sc_dt::sc_int< W >.

Definition at line 682 of file sc_int_base.h.

References m_val.

sc_int_base& sc_dt::sc_int_base::operator--   [inline]
 

Reimplemented in sc_dt::sc_int< W >.

Definition at line 679 of file sc_int_base.h.

References m_val.

sc_int_base& sc_dt::sc_int_base::operator-= int_type    v [inline]
 

Reimplemented in sc_dt::sc_int< W >.

Definition at line 639 of file sc_int_base.h.

References sc_dt::int_type, and m_val.

sc_int_base& sc_dt::sc_int_base::operator/= int_type    v [inline]
 

Reimplemented in sc_dt::sc_int< W >.

Definition at line 645 of file sc_int_base.h.

References sc_dt::int_type, and m_val.

sc_int_base& sc_dt::sc_int_base::operator<<= int_type    v [inline]
 

Reimplemented in sc_dt::sc_int< W >.

Definition at line 664 of file sc_int_base.h.

References sc_dt::int_type, and m_val.

sc_int_base& sc_dt::sc_int_base::operator= double    a [inline]
 

Reimplemented in sc_dt::sc_int< W >.

Definition at line 630 of file sc_int_base.h.

References m_val.

sc_int_base& sc_dt::sc_int_base::operator= uint64    a [inline]
 

Reimplemented in sc_dt::sc_int< W >.

Definition at line 627 of file sc_int_base.h.

References m_val, and sc_dt::uint64.

sc_int_base& sc_dt::sc_int_base::operator= int    a [inline]
 

Reimplemented in sc_dt::sc_int< W >.

Definition at line 624 of file sc_int_base.h.

References m_val.

sc_int_base& sc_dt::sc_int_base::operator= unsigned int    a [inline]
 

Reimplemented in sc_dt::sc_int< W >.

Definition at line 621 of file sc_int_base.h.

References m_val.

sc_int_base& sc_dt::sc_int_base::operator= long    a [inline]
 

Reimplemented in sc_dt::sc_int< W >.

Definition at line 618 of file sc_int_base.h.

References m_val.

sc_int_base& sc_dt::sc_int_base::operator= unsigned long    a [inline]
 

Reimplemented in sc_dt::sc_int< W >.

Definition at line 615 of file sc_int_base.h.

References m_val.

sc_int_base & sc_dt::sc_int_base::operator= const char *    a
 

Reimplemented in sc_dt::sc_int< W >.

Definition at line 484 of file sc_int_base.cpp.

References m_len, operator=(), sc_dt::SC_ON, SC_REPORT_ERROR, sc_dt::SC_TRN, sc_dt::SC_WRAP, and sprintf().

sc_int_base & sc_dt::sc_int_base::operator= const sc_lv_base   a
 

Reimplemented in sc_dt::sc_int< W >.

Definition at line 468 of file sc_int_base.cpp.

References sc_dt::sc_lv_base::get_bit(), sc_dt::sc_lv_base::length(), m_len, sc_min(), and set().

sc_int_base & sc_dt::sc_int_base::operator= const sc_bv_base   a
 

Reimplemented in sc_dt::sc_int< W >.

Definition at line 452 of file sc_int_base.cpp.

References sc_dt::sc_bv_base::get_bit(), sc_dt::sc_bv_base::length(), m_len, sc_min(), and set().

sc_int_base & sc_dt::sc_int_base::operator= const sc_unsigned   a
 

Reimplemented in sc_dt::sc_int< W >.

Definition at line 435 of file sc_int_base.cpp.

References sc_dt::sc_unsigned::length(), m_len, sc_min(), set(), and sc_dt::sc_unsigned::test().

sc_int_base & sc_dt::sc_int_base::operator= const sc_signed   a
 

Reimplemented in sc_dt::sc_int< W >.

Definition at line 418 of file sc_int_base.cpp.

References sc_dt::sc_signed::length(), m_len, sc_min(), set(), sc_dt::sc_signed::sign(), and sc_dt::sc_signed::test().

sc_int_base & sc_dt::sc_int_base::operator= const sc_concatref   a
 

Reimplemented in sc_dt::sc_int< W >.

Definition at line 508 of file sc_int_base.cpp.

References m_val, and sc_dt::sc_concatref::to_int64().

sc_int_base& sc_dt::sc_int_base::operator= const sc_int_subref_r   a [inline]
 

Reimplemented in sc_dt::sc_int< W >.

Definition at line 594 of file sc_int_base.h.

References m_val.

sc_int_base& sc_dt::sc_int_base::operator= const sc_int_base &    a [inline]
 

Reimplemented in sc_dt::sc_int< W >.

Definition at line 591 of file sc_int_base.h.

References m_val.

sc_int_base& sc_dt::sc_int_base::operator= int_type    v [inline]
 

Reimplemented in sc_dt::sc_int< W >.

Definition at line 588 of file sc_int_base.h.

References sc_dt::int_type, and m_val.

Referenced by operator=().

sc_int_base& sc_dt::sc_int_base::operator>>= int_type    v [inline]
 

Reimplemented in sc_dt::sc_int< W >.

Definition at line 667 of file sc_int_base.h.

References sc_dt::int_type, and m_val.

sc_int_bitref_r sc_dt::sc_int_base::operator[] int    i const [inline]
 

Definition at line 1208 of file sc_int_base.h.

References sc_int_bitref_r.

sc_int_bitref sc_dt::sc_int_base::operator[] int    i [inline]
 

Definition at line 1200 of file sc_int_base.h.

References sc_int_bitref.

sc_int_base& sc_dt::sc_int_base::operator^= int_type    v [inline]
 

Reimplemented in sc_dt::sc_int< W >.

Definition at line 660 of file sc_int_base.h.

References sc_dt::int_type, and m_val.

sc_int_base& sc_dt::sc_int_base::operator|= int_type    v [inline]
 

Reimplemented in sc_dt::sc_int< W >.

Definition at line 657 of file sc_int_base.h.

References sc_dt::int_type, and m_val.

bool sc_dt::sc_int_base::or_reduce  
 

Definition at line 545 of file sc_int_base.cpp.

References sc_dt::int_type, and m_val.

Referenced by nor_reduce(), sc_dt::or_reduce(), and sc_dt::sc_int_subref_r::or_reduce().

void sc_dt::sc_int_base::print ostream &    os = cout const [inline]
 

Definition at line 835 of file sc_int_base.h.

References to_string().

Referenced by sc_dt::operator<<().

sc_int_subref_r sc_dt::sc_int_base::range int    left,
int    right
const [inline]
 

Definition at line 1261 of file sc_int_base.h.

References sc_int_subref_r.

sc_int_subref sc_dt::sc_int_base::range int    left,
int    right
[inline]
 

Definition at line 1253 of file sc_int_base.h.

References sc_int_subref.

void sc_dt::sc_int_base::scan istream &    is = cin
 

Definition at line 674 of file sc_int_base.cpp.

References sc_string::c_str(), and s.

Referenced by sc_dt::operator>>().

void sc_dt::sc_int_base::set int    i,
bool    v
[inline]
 

Definition at line 733 of file sc_int_base.h.

References m_val, and sc_dt::UINT_ONE.

void sc_dt::sc_int_base::set int    i [inline]
 

Definition at line 730 of file sc_int_base.h.

References m_val, and sc_dt::UINT_ONE.

Referenced by sc_dt::sc_int_bitref::operator &=(), sc_dt::sc_int_bitref::operator=(), operator=(), sc_dt::sc_int_bitref::operator|=(), and sc_int_base().

bool sc_dt::sc_int_base::test int    i const [inline]
 

Definition at line 727 of file sc_int_base.h.

References m_val, and sc_dt::UINT_ONE.

Referenced by sc_dt::sc_int_bitref_r::operator bool(), sc_dt::sc_int_bitref_r::operator!(), and sc_dt::sc_int_bitref_r::operator~().

double sc_dt::sc_int_base::to_double   const [inline]
 

Definition at line 814 of file sc_int_base.h.

References m_val.

Referenced by sc_dt::sc_int_subref_r::to_double().

int sc_dt::sc_int_base::to_int   const [inline]
 

Definition at line 796 of file sc_int_base.h.

References m_val.

Referenced by sc_dt::sc_int_subref_r::to_int().

int64 sc_dt::sc_int_base::to_int64   const [inline]
 

Definition at line 808 of file sc_int_base.h.

References sc_dt::int64, and m_val.

Referenced by sc_dt::sc_int_subref_r::to_int64().

long sc_dt::sc_int_base::to_long   const [inline]
 

Definition at line 802 of file sc_int_base.h.

References m_val.

Referenced by sc_dt::sc_int_subref_r::to_long().

const sc_string sc_dt::sc_int_base::to_string sc_numrep    numrep,
bool    w_prefix
const
 

Definition at line 528 of file sc_int_base.cpp.

References m_len, sc_numrep, sc_dt::SC_ON, sc_dt::SC_TRN, sc_dt::SC_WRAP, and sc_dt::sc_fxnum::to_string().

const sc_string sc_dt::sc_int_base::to_string sc_numrep    numrep = SC_DEC const
 

Definition at line 520 of file sc_int_base.cpp.

References m_len, sc_numrep, sc_dt::SC_ON, sc_dt::SC_TRN, sc_dt::SC_WRAP, and sc_dt::sc_fxnum::to_string().

Referenced by print(), and sc_dt::sc_int_subref_r::to_string().

unsigned int sc_dt::sc_int_base::to_uint   const [inline]
 

Definition at line 799 of file sc_int_base.h.

References m_val.

Referenced by sc_dt::sc_int_subref_r::to_uint().

uint64 sc_dt::sc_int_base::to_uint64   const [inline]
 

Definition at line 811 of file sc_int_base.h.

References m_val, and sc_dt::uint64.

Referenced by sc_dt::sc_int_subref_r::to_uint64().

unsigned long sc_dt::sc_int_base::to_ulong   const [inline]
 

Definition at line 805 of file sc_int_base.h.

References m_val.

Referenced by sc_dt::sc_int_subref_r::to_ulong().

int_type sc_dt::sc_int_base::value   const [inline]
 

Definition at line 792 of file sc_int_base.h.

References sc_dt::int_type, and operator int_type().

bool sc_dt::sc_int_base::xnor_reduce   const [inline]
 

Definition at line 780 of file sc_int_base.h.

References xor_reduce().

Referenced by sc_dt::xnor_reduce().

bool sc_dt::sc_int_base::xor_reduce  
 

Definition at line 551 of file sc_int_base.cpp.

References m_ulen, m_val, SC_INTWIDTH, sc_dt::uint_type, and sc_dt::UINT_ZERO.

Referenced by xnor_reduce(), sc_dt::xor_reduce(), and sc_dt::sc_int_subref_r::xor_reduce().


Friends And Related Function Documentation

bool operator!= const sc_int_base &    a,
const sc_int_base &    b
[friend]
 

Definition at line 691 of file sc_int_base.h.

bool operator< const sc_int_base &    a,
const sc_int_base &    b
[friend]
 

Definition at line 694 of file sc_int_base.h.

bool operator<= const sc_int_base &    a,
const sc_int_base &    b
[friend]
 

Definition at line 697 of file sc_int_base.h.

bool operator== const sc_int_base &    a,
const sc_int_base &    b
[friend]
 

Definition at line 688 of file sc_int_base.h.

bool operator> const sc_int_base &    a,
const sc_int_base &    b
[friend]
 

Definition at line 700 of file sc_int_base.h.

bool operator>= const sc_int_base &    a,
const sc_int_base &    b
[friend]
 

Definition at line 703 of file sc_int_base.h.

friend class sc_int_bitref [friend]
 

Definition at line 521 of file sc_int_base.h.

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

friend class sc_int_bitref_r [friend]
 

Definition at line 520 of file sc_int_base.h.

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

friend class sc_int_subref [friend]
 

Definition at line 523 of file sc_int_base.h.

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