gem5  v21.1.0.2
Macros | Typedefs | Functions
The BitUnion API.

These are a collection of methods and macros of the BitUnion system of defining bitfields on top of an underlying class. More...

Macros

#define EndBitUnion(name)
 This closes off the class and union started by the above macro. More...
 
#define EndSubBitUnion(name)
 This closes off the union created above and gives it a name. More...
 
#define SubBitUnion(name, first, last)   __SubBitUnion(name, Bitfield, first, last)
 Regular bitfields These define macros for read/write regular bitfield based subbitfields. More...
 
#define SignedSubBitUnion(name, first, last)   __SubBitUnion(name, SignedBitfield, first, last)
 Regular bitfields These define macros for read/write regular bitfield based subbitfields. More...
 
#define BitUnion(type, name)   __BitUnion(type, name)
 Use this to define an arbitrary type overlayed with bitfields. More...
 
#define BitUnion64(name)   __BitUnion(uint64_t, name)
 Use this to define conveniently sized values overlayed with bitfields. More...
 

Typedefs

template<typename T >
using gem5::BitUnionType = bitfield_backend::BitUnionOperators< T >
 
template<typename T >
using gem5::BitUnionBaseType = typename bitfield_backend::BitUnionBaseType< T >::Type
 

Functions

template<typename T >
std::ostream & gem5::operator<< (std::ostream &os, const BitUnionType< T > &bu)
 A default << operator which casts a bitunion to its underlying type and passes it to bitfield_backend::bitfieldBackendPrinter. More...
 

Detailed Description

These are a collection of methods and macros of the BitUnion system of defining bitfields on top of an underlying class.

Macro Definition Documentation

◆ BitUnion

#define BitUnion (   type,
  name 
)    __BitUnion(type, name)

Use this to define an arbitrary type overlayed with bitfields.

Definition at line 488 of file bitunion.hh.

◆ BitUnion64

#define BitUnion64 (   name)    __BitUnion(uint64_t, name)

Use this to define conveniently sized values overlayed with bitfields.

Definition at line 495 of file bitunion.hh.

◆ EndBitUnion

#define EndBitUnion (   name)
Value:
}; \
}; \
BitfieldUnderlyingClasses##name> name;

This closes off the class and union started by the above macro.

It is followed by a typedef which makes "name" refer to a BitfieldOperator class inheriting from the class and union just defined, which completes building up the type for the user.

Definition at line 429 of file bitunion.hh.

◆ EndSubBitUnion

#define EndSubBitUnion (   name)
Value:
}; \
inline operator __StorageType () const \
{ return __storage; } \
\
inline __StorageType operator = (const __StorageType & _storage) \
{ return __storage = _storage;} \
} name;

This closes off the union created above and gives it a name.

Unlike the top level BitUnion, we're interested in creating an object instead of a type. The operators are defined in the macro itself instead of a class for technical reasons. If someone determines a way to move them to one, please do so.

Definition at line 456 of file bitunion.hh.

◆ SignedSubBitUnion

#define SignedSubBitUnion (   name,
  first,
  last 
)    __SubBitUnion(name, SignedBitfield, first, last)

Regular bitfields These define macros for read/write regular bitfield based subbitfields.

Definition at line 480 of file bitunion.hh.

◆ SubBitUnion

#define SubBitUnion (   name,
  first,
  last 
)    __SubBitUnion(name, Bitfield, first, last)

Regular bitfields These define macros for read/write regular bitfield based subbitfields.

Definition at line 471 of file bitunion.hh.

Typedef Documentation

◆ BitUnionBaseType

template<typename T >
using gem5::BitUnionBaseType = typedef typename bitfield_backend::BitUnionBaseType<T>::Type

Definition at line 541 of file bitunion.hh.

◆ BitUnionType

template<typename T >
using gem5::BitUnionType = typedef bitfield_backend::BitUnionOperators<T>

Definition at line 520 of file bitunion.hh.

Function Documentation

◆ operator<<()

template<typename T >
std::ostream& gem5::operator<< ( std::ostream &  os,
const BitUnionType< T > &  bu 
)

A default << operator which casts a bitunion to its underlying type and passes it to bitfield_backend::bitfieldBackendPrinter.

Definition at line 581 of file bitunion.hh.

References gem5::bitfield_backend::bitfieldBackendPrinter(), and gem5::X86ISA::os.

gem5::bitfield_backend::BitUnionOperators
Definition: bitunion.hh:252
name
const std::string & name()
Definition: trace.cc:49

Generated on Tue Sep 21 2021 12:27:00 for gem5 by doxygen 1.8.17