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

#include <sc_logic.hh>

Public Member Functions

 sc_logic ()
 
 sc_logic (const sc_logic &a)
 
 sc_logic (sc_logic_value_t v)
 
 sc_logic (bool a)
 
 sc_logic (char a)
 
 sc_logic (int a)
 
 sc_logic (const sc_bit &a)
 
 ~sc_logic ()
 
sc_logicoperator= (const sc_logic &a)
 
sc_logicoperator&= (const sc_logic &b)
 
sc_logicoperator|= (const sc_logic &b)
 
sc_logicoperator^= (const sc_logic &b)
 
const sc_logic operator~ () const
 
sc_logicb_not ()
 
sc_logic_value_t value () const
 
bool is_01 () const
 
bool to_bool () const
 
char to_char () const
 
void print (::std::ostream &os=::std::cout) const
 
void scan (::std::istream &is=::std::cin)
 

Static Public Member Functions

static void * operator new (std::size_t, void *p)
 
static void * operator new (std::size_t sz)
 
static void operator delete (void *p, std::size_t sz)
 
static void * operator new[] (std::size_t sz)
 
static void operator delete[] (void *p, std::size_t sz)
 

Static Public Attributes

static const sc_logic_value_t char_to_logic [128]
 
static const char logic_to_char [4] = { '0', '1', 'Z', 'X' }
 
static const sc_logic_value_t and_table [4][4]
 
static const sc_logic_value_t or_table [4][4]
 
static const sc_logic_value_t xor_table [4][4]
 
static const sc_logic_value_t not_table [4]
 

Private Member Functions

void invalid_01 () const
 
 sc_logic (const char *)
 
sc_logicoperator= (const char *)
 

Static Private Member Functions

static void invalid_value (sc_logic_value_t)
 
static void invalid_value (char)
 
static void invalid_value (int)
 
static sc_logic_value_t to_value (sc_logic_value_t v)
 
static sc_logic_value_t to_value (bool b)
 
static sc_logic_value_t to_value (char c)
 
static sc_logic_value_t to_value (int i)
 

Private Attributes

sc_logic_value_t m_val
 

Friends

const sc_logic operator& (const sc_logic &, const sc_logic &)
 
const sc_logic operator| (const sc_logic &, const sc_logic &)
 
const sc_logic operator^ (const sc_logic &, const sc_logic &)
 
bool operator== (const sc_logic &, const sc_logic &)
 
bool operator!= (const sc_logic &, const sc_logic &)
 

Detailed Description

Definition at line 98 of file sc_logic.hh.

Constructor & Destructor Documentation

◆ sc_logic() [1/8]

sc_dt::sc_logic::sc_logic ( )
inline

Definition at line 154 of file sc_logic.hh.

Referenced by operator~().

◆ sc_logic() [2/8]

sc_dt::sc_logic::sc_logic ( const sc_logic a)
inline

Definition at line 155 of file sc_logic.hh.

◆ sc_logic() [3/8]

sc_dt::sc_logic::sc_logic ( sc_logic_value_t  v)
inline

Definition at line 156 of file sc_logic.hh.

◆ sc_logic() [4/8]

sc_dt::sc_logic::sc_logic ( bool  a)
inlineexplicit

Definition at line 157 of file sc_logic.hh.

◆ sc_logic() [5/8]

sc_dt::sc_logic::sc_logic ( char  a)
inlineexplicit

Definition at line 158 of file sc_logic.hh.

◆ sc_logic() [6/8]

sc_dt::sc_logic::sc_logic ( int  a)
inlineexplicit

Definition at line 159 of file sc_logic.hh.

◆ sc_logic() [7/8]

sc_dt::sc_logic::sc_logic ( const sc_bit a)
inlineexplicit

Definition at line 160 of file sc_logic.hh.

◆ ~sc_logic()

sc_dt::sc_logic::~sc_logic ( )
inline

Definition at line 163 of file sc_logic.hh.

◆ sc_logic() [8/8]

sc_dt::sc_logic::sc_logic ( const char *  )
explicitprivate

Member Function Documentation

◆ b_not()

sc_logic& sc_dt::sc_logic::b_not ( )
inline

Definition at line 229 of file sc_logic.hh.

References m_val, and not_table.

◆ invalid_01()

void sc_dt::sc_logic::invalid_01 ( ) const
private

◆ invalid_value() [1/3]

void sc_dt::sc_logic::invalid_value ( char  c)
staticprivate

Definition at line 72 of file sc_logic.cc.

References gem5::VegaISA::c, sc_core::SC_ID_VALUE_NOT_VALID_, and SC_REPORT_ERROR.

◆ invalid_value() [2/3]

void sc_dt::sc_logic::invalid_value ( int  i)
staticprivate

Definition at line 80 of file sc_logic.cc.

References gem5::ArmISA::i, sc_core::SC_ID_VALUE_NOT_VALID_, and SC_REPORT_ERROR.

◆ invalid_value() [3/3]

void sc_dt::sc_logic::invalid_value ( sc_logic_value_t  v)
staticprivate

Definition at line 66 of file sc_logic.cc.

References gem5::VegaISA::v.

Referenced by to_value().

◆ is_01()

bool sc_dt::sc_logic::is_01 ( ) const
inline

Definition at line 238 of file sc_logic.hh.

References sc_dt::Log_0, sc_dt::Log_1, and m_val.

Referenced by sc_dt::sc_bitref_r< T >::is_01(), and to_bool().

◆ operator delete()

static void sc_dt::sc_logic::operator delete ( void *  p,
std::size_t  sz 
)
inlinestatic

Definition at line 263 of file sc_logic.hh.

References gem5::VegaISA::p, and sc_core::sc_mempool::release().

◆ operator delete[]()

static void sc_dt::sc_logic::operator delete[] ( void *  p,
std::size_t  sz 
)
inlinestatic

Definition at line 273 of file sc_logic.hh.

References gem5::VegaISA::p, and sc_core::sc_mempool::release().

◆ operator new() [1/2]

static void* sc_dt::sc_logic::operator new ( std::size_t  sz)
inlinestatic

Definition at line 258 of file sc_logic.hh.

References sc_core::sc_mempool::allocate().

◆ operator new() [2/2]

static void* sc_dt::sc_logic::operator new ( std::size_t  ,
void *  p 
)
inlinestatic

Definition at line 256 of file sc_logic.hh.

References gem5::VegaISA::p.

◆ operator new[]()

static void* sc_dt::sc_logic::operator new[] ( std::size_t  sz)
inlinestatic

Definition at line 268 of file sc_logic.hh.

References sc_core::sc_mempool::allocate().

◆ operator&=()

sc_logic& sc_dt::sc_logic::operator&= ( const sc_logic b)
inline

Definition at line 189 of file sc_logic.hh.

References and_table, gem5::ArmISA::b, and m_val.

◆ operator=() [1/2]

sc_logic& sc_dt::sc_logic::operator= ( const char *  )
private

◆ operator=() [2/2]

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

Definition at line 182 of file sc_logic.hh.

References gem5::ArmISA::a, and m_val.

◆ operator^=()

sc_logic& sc_dt::sc_logic::operator^= ( const sc_logic b)
inline

Definition at line 203 of file sc_logic.hh.

References gem5::ArmISA::b, m_val, and xor_table.

◆ operator|=()

sc_logic& sc_dt::sc_logic::operator|= ( const sc_logic b)
inline

Definition at line 196 of file sc_logic.hh.

References gem5::ArmISA::b, m_val, and or_table.

◆ operator~()

const sc_logic sc_dt::sc_logic::operator~ ( ) const
inline

Definition at line 227 of file sc_logic.hh.

References m_val, not_table, and sc_logic().

◆ print()

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

Definition at line 251 of file sc_logic.hh.

References gem5::X86ISA::os, and to_char().

◆ scan()

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

Definition at line 147 of file sc_logic.cc.

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

◆ to_bool()

bool sc_dt::sc_logic::to_bool ( ) const
inline

◆ to_char()

char sc_dt::sc_logic::to_char ( ) const
inline

Definition at line 248 of file sc_logic.hh.

References logic_to_char, and m_val.

Referenced by print(), and sc_dt::sc_bitref_r< T >::to_char().

◆ to_value() [1/4]

static sc_logic_value_t sc_dt::sc_logic::to_value ( bool  b)
inlinestaticprivate

Definition at line 117 of file sc_logic.hh.

References gem5::ArmISA::b, sc_dt::Log_0, and sc_dt::Log_1.

◆ to_value() [2/4]

static sc_logic_value_t sc_dt::sc_logic::to_value ( char  c)
inlinestaticprivate

Definition at line 120 of file sc_logic.hh.

References gem5::VegaISA::c, char_to_logic, gem5::MipsISA::index, and invalid_value().

◆ to_value() [3/4]

static sc_logic_value_t sc_dt::sc_logic::to_value ( int  i)
inlinestaticprivate

Definition at line 132 of file sc_logic.hh.

References gem5::ArmISA::i, invalid_value(), and sc_dt::Log_X.

◆ to_value() [4/4]

static sc_logic_value_t sc_dt::sc_logic::to_value ( sc_logic_value_t  v)
inlinestaticprivate

Definition at line 107 of file sc_logic.hh.

References invalid_value(), sc_dt::Log_X, and gem5::VegaISA::v.

◆ value()

sc_logic_value_t sc_dt::sc_logic::value ( void  ) const
inline

Definition at line 236 of file sc_logic.hh.

References m_val.

Referenced by sc_dt::sc_lv_base::init(), and sc_dt::sc_bitref< X >::operator=().

Friends And Related Function Documentation

◆ operator!=

bool operator!= ( const sc_logic a,
const sc_logic b 
)
friend

Definition at line 339 of file sc_logic.hh.

◆ operator&

const sc_logic operator& ( const sc_logic a,
const sc_logic b 
)
friend

Definition at line 291 of file sc_logic.hh.

◆ operator==

bool operator== ( const sc_logic a,
const sc_logic b 
)
friend

Definition at line 333 of file sc_logic.hh.

◆ operator^

const sc_logic operator^ ( const sc_logic a,
const sc_logic b 
)
friend

Definition at line 303 of file sc_logic.hh.

◆ operator|

const sc_logic operator| ( const sc_logic a,
const sc_logic b 
)
friend

Definition at line 297 of file sc_logic.hh.

Member Data Documentation

◆ and_table

const sc_logic_value_t sc_dt::sc_logic::and_table
static
Initial value:
= {
}
@ Log_1
Definition: sc_logic.hh:87
@ Log_X
Definition: sc_logic.hh:89
@ Log_0
Definition: sc_logic.hh:86

Definition at line 148 of file sc_logic.hh.

Referenced by sc_dt::sc_proxy< X >::and_reduce(), sc_dt::operator&(), sc_dt::sc_bitref< X >::operator&=(), and operator&=().

◆ char_to_logic

const sc_logic_value_t sc_dt::sc_logic::char_to_logic
static

◆ logic_to_char

const char sc_dt::sc_logic::logic_to_char = { '0', '1', 'Z', 'X' }
static

Definition at line 147 of file sc_logic.hh.

Referenced by to_char(), and sc_dt::sc_proxy< X >::to_string().

◆ m_val

sc_logic_value_t sc_dt::sc_logic::m_val
private

◆ not_table

const sc_logic_value_t sc_dt::sc_logic::not_table
static

◆ or_table

const sc_logic_value_t sc_dt::sc_logic::or_table
static

◆ xor_table

const sc_logic_value_t sc_dt::sc_logic::xor_table
static

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

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