gem5 v24.0.0.0
Loading...
Searching...
No Matches
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 &a, const sc_logic &b)
 
const sc_logic operator| (const sc_logic &a, const sc_logic &b)
 
const sc_logic operator^ (const sc_logic &a, const sc_logic &b)
 
bool operator== (const sc_logic &a, const sc_logic &b)
 
bool operator!= (const sc_logic &a, const sc_logic &b)
 

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 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 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 invalid_value().

Referenced by invalid_value(), to_value(), to_value(), and 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< X >::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 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 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.

◆ 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, 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 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 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 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 to_char().

◆ scan()

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

Definition at line 147 of file sc_logic.cc.

References c.

◆ to_bool()

◆ 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< X >::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 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 c, char_to_logic, 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 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(), and sc_dt::Log_X.

◆ value()

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

Friends And Related Symbol 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

◆ char_to_logic

◆ 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

◆ 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 Tue Jun 18 2024 16:24:55 for gem5 by doxygen 1.11.0