gem5  v21.2.0.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Member Functions | Private Attributes | List of all members
gem5::InstResult Class Reference

#include <inst_res.hh>

Public Member Functions

 InstResult ()
 Default constructor creates an invalid result. More...
 
 InstResult (const InstResult &)=default
 
template<typename T >
 InstResult (T val)
 
template<typename T , std::enable_if_t< std::is_floating_point_v< T >, int > = 0>
 InstResult (T val)
 
template<typename T , std::enable_if_t< std::is_integral_v< T > &&!std::is_same_v< T, RegVal >, int > = 0>
 InstResult (T val)
 
InstResultoperator= (const InstResult &that)
 
bool operator== (const InstResult &that) const
 Result comparison Two invalid results always differ. More...
 
bool operator!= (const InstResult &that) const
 
template<typename T >
bool is () const
 Checks. More...
 
template<typename T >
std::enable_if_t< std::is_integral_v< T > &&!std::is_same_v< T, RegVal >, bool > is () const
 
bool isValid () const
 Is this a valid result?. More...
 
template<typename T >
as () const
 Explicit cast-like operations. More...
 
template<typename T >
std::enable_if_t< std::is_integral_v< T > &&!std::is_same_v< T, RegVal >, RegValas () const
 
template<typename T >
asNoAssert () const
 Cast to integer without checking type. More...
 

Private Attributes

std::any result
 
std::function< bool(const std::any &a, const std::any &b)> equals
 

Detailed Description

Definition at line 50 of file inst_res.hh.

Constructor & Destructor Documentation

◆ InstResult() [1/5]

gem5::InstResult::InstResult ( )
inline

Default constructor creates an invalid result.

Definition at line 58 of file inst_res.hh.

References gem5::ArmISA::a, gem5::ArmISA::b, and gem5_assert.

◆ InstResult() [2/5]

gem5::InstResult::InstResult ( const InstResult )
default

◆ InstResult() [3/5]

template<typename T >
gem5::InstResult::InstResult ( val)
inlineexplicit

Definition at line 69 of file inst_res.hh.

References gem5::ArmISA::a, gem5::ArmISA::b, and gem5_assert.

◆ InstResult() [4/5]

template<typename T , std::enable_if_t< std::is_floating_point_v< T >, int > = 0>
gem5::InstResult::InstResult ( val)
inlineexplicit

Definition at line 99 of file inst_res.hh.

◆ InstResult() [5/5]

template<typename T , std::enable_if_t< std::is_integral_v< T > &&!std::is_same_v< T, RegVal >, int > = 0>
gem5::InstResult::InstResult ( val)
inlineexplicit

Definition at line 105 of file inst_res.hh.

Member Function Documentation

◆ as() [1/2]

template<typename T >
T gem5::InstResult::as ( ) const
inline

Explicit cast-like operations.

Definition at line 158 of file inst_res.hh.

References result.

Referenced by gem5::Checker< gem5::RefCountingPtr >::copyResult(), and gem5::Checker< gem5::RefCountingPtr >::validateExecution().

◆ as() [2/2]

template<typename T >
std::enable_if_t<std::is_integral_v<T> && !std::is_same_v<T, RegVal>, RegVal> gem5::InstResult::as ( ) const
inline

Definition at line 167 of file inst_res.hh.

◆ asNoAssert()

template<typename T >
T gem5::InstResult::asNoAssert ( ) const
inline

Cast to integer without checking type.

This is required to have the o3 cpu checker happy, as it compares results as integers without being fully aware of their nature.

Definition at line 178 of file inst_res.hh.

Referenced by gem5::Checker< gem5::RefCountingPtr >::validateExecution().

◆ is() [1/2]

template<typename T >
bool gem5::InstResult::is ( ) const
inline

Checks.

Definition at line 136 of file inst_res.hh.

References result.

Referenced by gem5::Checker< gem5::RefCountingPtr >::validateExecution().

◆ is() [2/2]

template<typename T >
std::enable_if_t<std::is_integral_v<T> && !std::is_same_v<T, RegVal>, bool> gem5::InstResult::is ( ) const
inline

Definition at line 145 of file inst_res.hh.

◆ isValid()

bool gem5::InstResult::isValid ( ) const
inline

Is this a valid result?.

Definition at line 151 of file inst_res.hh.

References result.

◆ operator!=()

bool gem5::InstResult::operator!= ( const InstResult that) const
inline

Definition at line 126 of file inst_res.hh.

References operator==().

◆ operator=()

InstResult& gem5::InstResult::operator= ( const InstResult that)
inline

Definition at line 108 of file inst_res.hh.

References equals, and result.

◆ operator==()

bool gem5::InstResult::operator== ( const InstResult that) const
inline

Result comparison Two invalid results always differ.

Definition at line 120 of file inst_res.hh.

References equals, and result.

Referenced by operator!=().

Member Data Documentation

◆ equals

std::function<bool(const std::any &a, const std::any &b)> gem5::InstResult::equals
private

Definition at line 54 of file inst_res.hh.

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

◆ result

std::any gem5::InstResult::result
private

Definition at line 53 of file inst_res.hh.

Referenced by as(), is(), isValid(), operator=(), and operator==().


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

Generated on Tue Dec 21 2021 11:35:04 for gem5 by doxygen 1.8.17