OpenASIP  2.0
Public Types | Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | List of all members
SimValue Class Reference

#include <SimValue.hh>

Collaboration diagram for SimValue:
Collaboration graph

Public Types

typedef DoubleWord DoubleFloatWord
 

Public Member Functions

 SimValue ()
 
 SimValue (int width)
 
 SimValue (SLongWord value, int width)
 
 SimValue (const SimValue &source)
 
 ~SimValue ()
 
int width () const
 
void setBitWidth (int width)
 
SimValueoperator= (const SIntWord &source)
 
SimValueoperator= (const UIntWord &source)
 
SimValueoperator= (const SLongWord &source)
 
SimValueoperator= (const ULongWord &source)
 
SimValueoperator= (const HalfFloatWord &source)
 
SimValueoperator= (const FloatWord &source)
 
SimValueoperator= (const DoubleWord &source)
 
SimValueoperator= (const SimValue &source)
 
void deepCopy (const SimValue &source)
 
const SimValue operator+ (const SIntWord &rightHand)
 
const SimValue operator+ (const UIntWord &rightHand)
 
const SimValue operator+ (const SLongWord &rightHand)
 
const SimValue operator+ (const ULongWord &rightHand)
 
const SimValue operator+ (const HalfFloatWord &rightHand)
 
const SimValue operator+ (const FloatWord &rightHand)
 
const SimValue operator+ (const DoubleWord &rightHand)
 
const SimValue operator- (const SIntWord &rightHand)
 
const SimValue operator- (const UIntWord &rightHand)
 
const SimValue operator- (const SLongWord &rightHand)
 
const SimValue operator- (const ULongWord &rightHand)
 
const SimValue operator- (const HalfFloatWord &rightHand)
 
const SimValue operator- (const FloatWord &rightHand)
 
const SimValue operator- (const DoubleWord &rightHand)
 
const SimValue operator/ (const SIntWord &rightHand)
 
const SimValue operator/ (const UIntWord &rightHand)
 
const SimValue operator/ (const SLongWord &rightHand)
 
const SimValue operator/ (const ULongWord &rightHand)
 
const SimValue operator/ (const HalfFloatWord &rightHand)
 
const SimValue operator/ (const FloatWord &rightHand)
 
const SimValue operator/ (const DoubleWord &rightHand)
 
const SimValue operator* (const SIntWord &rightHand)
 
const SimValue operator* (const UIntWord &rightHand)
 
const SimValue operator* (const SLongWord &rightHand)
 
const SimValue operator* (const ULongWord &rightHand)
 
const SimValue operator* (const HalfFloatWord &rightHand)
 
const SimValue operator* (const FloatWord &rightHand)
 
const SimValue operator* (const DoubleWord &rightHand)
 
int operator== (const SimValue &rightHand) const
 
int operator== (const SIntWord &rightHand) const
 
int operator== (const UIntWord &rightHand) const
 
int operator== (const SLongWord &rightHand) const
 
int operator== (const ULongWord &rightHand) const
 
int operator== (const HalfFloatWord &rightHand) const
 
int operator== (const FloatWord &rightHand) const
 
int operator== (const DoubleWord &rightHand) const
 
int intValue () const
 
unsigned int unsignedValue () const
 
SIntWord sIntWordValue () const
 
UIntWord uIntWordValue () const
 
SLongWord sLongWordValue () const
 
ULongWord uLongWordValue () const
 
DoubleWord doubleWordValue () const
 
FloatWord floatWordValue () const
 
HalfFloatWord halfFloatWordValue () const
 
TCEString binaryValue () const
 
TCEString hexValue (bool noHexIdentifier=false) const
 
Word wordElement (size_t elementIndex) const
 
SIntWord sIntWordElement (size_t elementIndex) const
 
UIntWord uIntWordElement (size_t elementIndex) const
 
HalfWord halfWordElement (size_t elementIndex) const
 
HalfFloatWord halfFloatElement (size_t elementIndex) const
 
FloatWord floatElement (size_t elementIndex) const
 
DoubleFloatWord doubleFloatElement (size_t elementIndex) const
 
Byte byteElement (size_t elementIndex) const
 
UIntWord bitElement (size_t elementIndex) const
 
Word element (size_t elementIndex, size_t elementWidth) const
 
void setWordElement (size_t elementIndex, Word data)
 
void setHalfWordElement (size_t elementIndex, HalfWord data)
 
void setByteElement (size_t elementIndex, Byte data)
 
void setBitElement (size_t elementIndex, UIntWord data)
 
void setElement (size_t elementIndex, size_t elementWidth, Word data)
 
void setHalfFloatElement (size_t elementIndex, HalfFloatWord data)
 
void setFloatElement (size_t elementIndex, FloatWord data)
 
void setDoubleFloatElement (size_t elementIndex, DoubleFloatWord data)
 
void setValue (TCEString hexValue)
 
void clearToZero (int bitWidth)
 
void clearToZero ()
 
void signExtendTo (int bitWidth)
 
void zeroExtendTo (int bitWidth)
 
TCEString dump () const
 

Public Attributes

Byte rawData_ [SIMVALUE_MAX_BYTE_SIZE]
 Array that contains SimValue's underlaying bytes in little endian. More...
 
int bitWidth_
 The bitwidth of the value. More...
 

Private Member Functions

template<typename T >
vectorElement (size_t elementIndex) const
 
template<typename T >
void setVectorElement (size_t elementIndex, T data)
 
void swapByteOrder (const Byte *from, size_t byteCount, Byte *to) const
 

Private Attributes

ULongWord mask_
 Mask for masking extra bits when returning unsigned value. More...
 

Detailed Description

Class that represents values in simulation.

This class represents any data type that can be manipulated by operations of the target architecture template, and provides the interface to access the data in predefined types.

Values are always (regardless of the endianness of the machine) stored in little-endian convention in the rawData_ byte array. This is to model closer the internal registers and buses where the convention is to:

This is to avoid the need to implement two variations of function unit implementations, for both endianness modes.

This also means that big endian machines need endianness-aware load/stores as they need to swap the elements to the little-endian "internal format". However, as we lean towards using little-endian with vector machines (for example due to buggy LLVM BE/vector code gen), it means we usually use endianness-unaware "chunk" memory operations that can be uses both for scalar and vector data.

When a user wants to interpret SimValue as any primitive value (FloatWord, UIntWord, etc.), depending on the user's machine endianness the interpreted bytes are swapped correctly to be either in big-endian or little-endian convention. For instance, if the user has a big-endian machine and calls the uIntWordValue() function for a SimValue, which has the above value, it gets swapped so the OSAL operations can treat the result as a host integer to model the computation with.

The same swapping convention also occurs when a primitive value is assigned to SimValue. If the value to be assigned is in big-endian and its bytes are 0xabcd0000, the last four bytes in the SimValue are as 0x0000cdab.

SimValue users don't need to worry about the possible byte swapping since it is automatic and is done only if the user's machine is a little-endian machine. However, users shouldn't access the public rawData_ member directly unless they know exactly what they are doing, and always use the accessors for getting/setting lane data.

Definition at line 96 of file SimValue.hh.

Member Typedef Documentation

◆ DoubleFloatWord

Definition at line 99 of file SimValue.hh.

Constructor & Destructor Documentation

◆ SimValue() [1/4]

SimValue::SimValue ( )

Default constructor.

To allow creation of SimValue arrays. Constructs a SimValue with width of SIMULATOR_MAX_INTWORD_BITWIDTH bits.

Definition at line 47 of file SimValue.cc.

47  :
48  mask_(~ULongWord(0)) {
49 
51 }

References setBitWidth(), and SIMULATOR_MAX_LONGWORD_BITWIDTH.

Here is the call graph for this function:

◆ SimValue() [2/4]

SimValue::SimValue ( int  width)
explicit

Constructor.

Parameters
widthThe bit width of the created SimValue.

Definition at line 58 of file SimValue.cc.

58  :
59  mask_(~ULongWord(0)) {
60 
62 }

References setBitWidth(), and width().

Here is the call graph for this function:

◆ SimValue() [3/4]

SimValue::SimValue ( SLongWord  value,
int  width 
)
explicit

Constructor.

Parameters
valueThe numeric value of this SimValue (in host endianness).
widthThe bit width of the created SimValue.

Definition at line 71 of file SimValue.cc.

71  :
72  mask_(~ULongWord(0)) {
73 
75 
76  // Don't memcpy more than 8 bytes
77  const int BYTE_COUNT =
78  width < 64 ? (width + (BYTE_BITWIDTH - 1)) / BYTE_BITWIDTH : 8;
79 
80 #if HOST_BIGENDIAN == 1
81  swapByteOrder(((const Byte*)&value), BYTE_COUNT, rawData_);
82 #else
83  memcpy(rawData_, &value, BYTE_COUNT);
84 #endif
85 }

References BYTE_BITWIDTH, rawData_, setBitWidth(), swapByteOrder(), and width().

Here is the call graph for this function:

◆ SimValue() [4/4]

SimValue::SimValue ( const SimValue source)

Copy constructor.

Parameters
sourceThe source object from which to copy data.

Definition at line 93 of file SimValue.cc.

93  {
94  deepCopy(source);
95 }

References deepCopy().

Here is the call graph for this function:

◆ ~SimValue()

SimValue::~SimValue ( )
inline

Definition at line 104 of file SimValue.hh.

104 {}

Member Function Documentation

◆ binaryValue()

TCEString SimValue::binaryValue ( ) const

Returns the value as a 2's complement (MSB left) binary string in ascii.

Definition at line 1121 of file SimValue.cc.

1121  {
1122 
1123  const size_t BYTE_COUNT = bitWidth_ / BYTE_BITWIDTH;
1124 
1125  int remainBits = bitWidth_ % BYTE_BITWIDTH;
1126  TCEString binaryStr = "";
1127 
1128  if (remainBits > 0) {
1129  binaryStr += Conversion::toBinary(
1130  static_cast<unsigned int>(rawData_[BYTE_COUNT]),
1131  remainBits);
1132  }
1133 
1134  for (int i = BYTE_COUNT - 1; i >= 0; --i) {
1135  binaryStr += Conversion::toBinary(
1136  static_cast<unsigned int>(rawData_[i]), 8);
1137  }
1138 
1139  return binaryStr;
1140 }

References bitWidth_, BYTE_BITWIDTH, rawData_, and Conversion::toBinary().

Referenced by TesterContext::toOutputFormat().

Here is the call graph for this function:

◆ bitElement()

UIntWord SimValue::bitElement ( size_t  elementIndex) const

Returns desired 1-bit bit element.

Definition at line 1288 of file SimValue.cc.

1288  {
1289  // Element index must not cross SimValue's bitwidth.
1290  assert((elementIndex+1) <= SIMD_WORD_WIDTH);
1291 
1292  const size_t OFFSET = elementIndex / BYTE_BITWIDTH;
1293  const size_t LEFT_SHIFTS = elementIndex % BYTE_BITWIDTH;
1294 
1295  Byte data = rawData_[OFFSET];
1296 
1297  if (data & (1 << LEFT_SHIFTS)) {
1298  return 1;
1299  } else {
1300  return 0;
1301  }
1302 }

References assert, BYTE_BITWIDTH, rawData_, and SIMD_WORD_WIDTH.

Referenced by element(), and signExtendTo().

◆ byteElement()

Byte SimValue::byteElement ( size_t  elementIndex) const

Returns desired 8-bit byte element.

Definition at line 1274 of file SimValue.cc.

1274  {
1275  const size_t BYTE_COUNT = sizeof(Byte);
1276  const size_t OFFSET = elementIndex * BYTE_COUNT;
1277 
1278  // Element index must not cross SimValue's bitwidth.
1279  assert((elementIndex+1) <= (SIMVALUE_MAX_BYTE_SIZE / BYTE_COUNT));
1280 
1281  return rawData_[OFFSET];
1282 }

References assert, rawData_, and SIMVALUE_MAX_BYTE_SIZE.

◆ clearToZero() [1/2]

void SimValue::clearToZero ( )

Sets all SimValue bytes to 0.

Definition at line 1516 of file SimValue.cc.

1516  {
1518 }

References SIMD_WORD_WIDTH.

Referenced by setBitWidth(), signExtendTo(), and zeroExtendTo().

◆ clearToZero() [2/2]

void SimValue::clearToZero ( int  bitWidth)

Sets SimValue bytes to 0 for the given bitwidth.

Parameters
bitWidthThe width that is to be nullified.

Definition at line 1504 of file SimValue.cc.

1504  {
1505  assert(bitWidth <= SIMD_WORD_WIDTH);
1506 
1507  const size_t BYTE_COUNT = (bitWidth + (BYTE_BITWIDTH - 1)) / BYTE_BITWIDTH;
1508 
1509  memset(rawData_, 0, BYTE_COUNT);
1510 }

References assert, BYTE_BITWIDTH, rawData_, and SIMD_WORD_WIDTH.

◆ deepCopy()

void SimValue::deepCopy ( const SimValue source)

Copies the source SimValue completely.

Parameters
sourceThe source value.

Definition at line 307 of file SimValue.cc.

307  {
308 
309  const size_t BYTE_COUNT =
310  (source.bitWidth_ + (BYTE_BITWIDTH - 1)) / BYTE_BITWIDTH;
311 
312  memcpy(rawData_, source.rawData_, BYTE_COUNT);
313  bitWidth_ = source.bitWidth_;
314  mask_ = source.mask_;
315 }

References bitWidth_, BYTE_BITWIDTH, mask_, and rawData_.

Referenced by OperationDAGBehavior::areValid(), OperationDAGBehavior::simulateTrigger(), and SimValue().

◆ doubleFloatElement()

SimValue::DoubleFloatWord SimValue::doubleFloatElement ( size_t  elementIndex) const

Definition at line 1266 of file SimValue.cc.

1266  {
1267  return vectorElement<DoubleWord>(elementIndex);
1268 }

◆ doubleWordValue()

DoubleWord SimValue::doubleWordValue ( ) const

Returns the SimValue as a host endian DoubleWord value.

Returns
DoubleWord value.

Definition at line 1052 of file SimValue.cc.

1052  {
1053 
1054  const size_t BYTE_COUNT = sizeof(DoubleWord);
1055 
1056  union CastUnion {
1057  Byte bytes[BYTE_COUNT];
1058  DoubleWord value;
1059  };
1060 
1061  CastUnion cast;
1062 
1063 #if HOST_BIGENDIAN == 1
1064  swapByteOrder(rawData_, BYTE_COUNT, cast.bytes);
1065 #else
1066  memcpy(cast.bytes, rawData_, BYTE_COUNT);
1067 #endif
1068  return cast.value;
1069 }

References rawData_, and swapByteOrder().

Referenced by ExecutionTrace::addBusActivity(), SimulateDialog::formattedValue(), operator*(), operator+(), operator-(), operator/(), operator==(), and TesterContext::toOutputFormat().

Here is the call graph for this function:

◆ dump()

TCEString SimValue::dump ( ) const

Dumps raw data encoded in the SimValue in hexadecimal format.

Definition at line 1593 of file SimValue.cc.

1593  {
1594  TCEString result = "width=";
1595  result += Conversion::toString(width());
1596  result += " mask=";
1597  result += Conversion::toBinary(mask_, 64);
1598  result += " data=0x";
1599 
1600  // Convert the raw data buffer to hex string values one byte at a time.
1601  // Also, remove "0x" from the front of the hex string for each hex value.
1602  for (int i = SIMVALUE_MAX_BYTE_SIZE - 1; i >= 0; --i) {
1603  unsigned int value =
1604  static_cast<unsigned int>(rawData_[i]);
1605  result += Conversion::toHexString(value, 2).substr(2);
1606  }
1607 
1608  return result;
1609 }

References mask_, rawData_, SIMVALUE_MAX_BYTE_SIZE, Conversion::toBinary(), Conversion::toHexString(), Conversion::toString(), and width().

Here is the call graph for this function:

◆ element()

Word SimValue::element ( size_t  elementIndex,
size_t  elementWidth 
) const

Get element function for arbitrary element width.

Values by width are stored in power of 2 byte boundaries (1, 2 or 4). elementWidth must be in range of (0, 32].

Definition at line 1311 of file SimValue.cc.

1311  {
1312  // TODO: support 64-bit elements!
1313 
1314  assert(elementWidth != 0);
1315  assert(elementWidth <= 32);
1316 
1317  if (elementWidth == 1) {
1318  return bitElement(elementIndex);
1319  } else {
1320  const size_t BYTE_COUNT = elementWidth >= 8u ?
1321  MathTools::roundUpToPowerTwo((unsigned int)elementWidth)/8 : 1;
1322  const size_t OFFSET = elementIndex * BYTE_COUNT;
1323  const Word BITMASK =
1324  elementWidth < 32 ? ~(~Word(0) << elementWidth) : ~(Word(0));
1325  Word tmp;
1326 
1327 #if HOST_BIGENDIAN == 1
1328  swapByteOrder(rawData_ + OFFSET, BYTE_COUNT, &tmp);
1329 #else
1330  memcpy(&tmp, rawData_ + OFFSET, BYTE_COUNT);
1331 #endif
1332  tmp &= BITMASK;
1333  return tmp;
1334  }
1335 }

References assert, bitElement(), rawData_, MathTools::roundUpToPowerTwo(), and swapByteOrder().

Here is the call graph for this function:

◆ floatElement()

FloatWord SimValue::floatElement ( size_t  elementIndex) const

Definition at line 1261 of file SimValue.cc.

1261  {
1262  return vectorElement<FloatWord>(elementIndex);
1263 }

◆ floatWordValue()

FloatWord SimValue::floatWordValue ( ) const

Returns the SimValue as a host endian FloatWord value.

Definition at line 1075 of file SimValue.cc.

1075  {
1076 
1077  const size_t BYTE_COUNT = sizeof(FloatWord);
1078 
1079  union CastUnion {
1080  Byte bytes[BYTE_COUNT];
1081  FloatWord value;
1082  };
1083 
1084  CastUnion cast;
1085 
1086 #if HOST_BIGENDIAN == 1
1087  swapByteOrder(rawData_, BYTE_COUNT, cast.bytes);
1088 #else
1089  memcpy(cast.bytes, rawData_, BYTE_COUNT);
1090 #endif
1091  return cast.value;
1092 }

References rawData_, and swapByteOrder().

Referenced by SimulateDialog::formattedValue(), operator*(), operator+(), operator-(), operator/(), operator==(), and TesterContext::toOutputFormat().

Here is the call graph for this function:

◆ halfFloatElement()

HalfFloatWord SimValue::halfFloatElement ( size_t  elementIndex) const

Definition at line 1254 of file SimValue.cc.

1254  {
1255  // Uses the same implementation as the integer version as
1256  // there is no native 'half' in C/C++.
1257  return HalfFloatWord(vectorElement<HalfWord>(elementIndex));
1258 }

◆ halfFloatWordValue()

HalfFloatWord SimValue::halfFloatWordValue ( ) const

Returns the SimValue as a host endian HalfFloatWord value.

Definition at line 1098 of file SimValue.cc.

1098  {
1099 
1100  const size_t BYTE_COUNT = sizeof(uint16_t);
1101 
1102  union CastUnion {
1103  Byte bytes[BYTE_COUNT];
1104  uint16_t value;
1105  };
1106 
1107  CastUnion cast;
1108 
1109 #if HOST_BIGENDIAN == 1
1110  swapByteOrder(rawData_, BYTE_COUNT, cast.bytes);
1111 #else
1112  memcpy(cast.bytes, rawData_, BYTE_COUNT);
1113 #endif
1114  return HalfFloatWord(cast.value);
1115 }

References rawData_, and swapByteOrder().

Referenced by operator*(), operator+(), operator-(), operator/(), operator==(), and TesterContext::toOutputFormat().

Here is the call graph for this function:

◆ halfWordElement()

HalfWord SimValue::halfWordElement ( size_t  elementIndex) const

Returns desired 16-bit short integer word element in host endianness.

Definition at line 1249 of file SimValue.cc.

1249  {
1250  return vectorElement<HalfWord>(elementIndex);
1251 }

◆ hexValue()

TCEString SimValue::hexValue ( bool  noHexIdentifier = false) const

Returns the value as a big endian ordered (C-literal style) hex ascii string.

Parameters
noHexIdentifierLeaves "0x" prefix out if set to true.
Returns
SimValue bytes in hex format.

Definition at line 1150 of file SimValue.cc.

1150  {
1151  size_t hexNumbers = (bitWidth_ + 3) / 4;
1152  if (bitWidth_ <= 32) {
1153  if (noHexIdentifier) {
1154  return Conversion::toHexString(
1155  uIntWordValue(), hexNumbers).substr(2);
1156  } else {
1157  // TODO: what about SIMD? this only prints one word?
1158  return Conversion::toHexString(uLongWordValue(), hexNumbers);
1159  }
1160  }
1161 
1162  const size_t BYTE_COUNT =
1164  const unsigned MSB_MASK = ~(0xfffffffffffffffful << (8-(BYTE_COUNT*8-bitWidth_)));
1165 
1166  TCEString hexStr;
1167  // Convert the raw data buffer to hex string values one byte at a time.
1168  // Also, remove "0x" from the front of the hex string for each hex value.
1169  for (int i = BYTE_COUNT - 1; i >= 0; --i) {
1170  unsigned int value = static_cast<unsigned int>(rawData_[i]);
1171  if (i == static_cast<int>(BYTE_COUNT - 1)) {
1172  value &= MSB_MASK;
1173  }
1174  hexStr += Conversion::toHexString(value, 2).substr(2);
1175  }
1176 
1177  // Remove extraneous zero digit from the front.
1178  hexStr = hexStr.substr(hexStr.size() - hexNumbers);
1179 
1180  if (!noHexIdentifier) hexStr.insert(0, "0x");
1181 
1182  return hexStr;
1183 }

References bitWidth_, BYTE_BITWIDTH, rawData_, Conversion::toHexString(), uIntWordValue(), and uLongWordValue().

Referenced by BusTracker::handleEvent(), InfoRegistersCommand::registerDescription(), SimulationController::registerFileValue(), CompiledSimController::registerFileValue(), setValue(), and TesterContext::toOutputFormat().

Here is the call graph for this function:

◆ intValue()

int SimValue::intValue ( ) const

Returns SimValue as a sign extended host integer.

Definition at line 895 of file SimValue.cc.

895  {
896 
897  const size_t BYTE_COUNT = sizeof(int);
898 
899  union CastUnion {
900  Byte bytes[BYTE_COUNT];
901  int value;
902  };
903 
904  CastUnion cast;
905 
906 #if HOST_BIGENDIAN == 1
907  swapByteOrder(rawData_ , BYTE_COUNT, cast.bytes);
908 #else
909  memcpy(cast.bytes, rawData_, BYTE_COUNT);
910 #endif
911  int bitWidth = (bitWidth_ > 32) ? 32 : bitWidth_;
912  return MathTools::fastSignExtendTo(cast.value, bitWidth);
913 }

References bitWidth_, MathTools::fastSignExtendTo(), rawData_, and swapByteOrder().

Referenced by LoopAnalyzer::analyze(), OffsetAliasAnalyzer::analyze(), ITemplateBroker::assign(), ITemplateBroker::assignImmediate(), ControlFlowGraph::buildMBBFromBB(), POMValidator::checkLongImmediates(), SimulatorFrontend::compareState(), BF2Scheduler::countLoopInvariantValueUsages(), MemoryAliasAnalyzer::detectConstantScale(), InfoImmediatesCommand::execute(), InfoPortsCommand::execute(), InfoSegmentsCommand::execute(), LoopAnalyzer::findEndCond(), MemoryAliasAnalyzer::findIncrement(), LoopAnalyzer::findInitAndUpdate(), DataDependenceGraph::findLoopIndexUpdate(), CompiledSimCodeGenerator::generateInstruction(), StackAliasAnalyzer::getStackOffset(), ProximRegisterWindow::loadImmediateUnit(), ProximRegisterWindow::loadRegisterFile(), main(), FUTestbenchGenerator::readValuesFromOutPorts(), MemoryAliasAnalyzer::searchLoopIndexBasedIncrement(), PreOptimizer::tryToRemoveEq(), PreOptimizer::tryToRemoveXor(), LoopAnalyzer::tryTrackCommonAncestor(), and ProximPortWindow::update().

Here is the call graph for this function:

◆ operator*() [1/7]

const SimValue SimValue::operator* ( const DoubleWord rightHand)

Explicit multiplication operator to DoubleWord type.

These operators are defined to avoid ambiguous overload because of built-in operators.

Parameters
rightHandThe right hand side of the addition.
Returns
The SimValue with the result of the operation.

Definition at line 760 of file SimValue.cc.

760  {
761  SimValue copy(*this);
762  copy = doubleWordValue() * rightHand;
763  return copy;
764 }

References doubleWordValue().

Here is the call graph for this function:

◆ operator*() [2/7]

const SimValue SimValue::operator* ( const FloatWord rightHand)

Explicit multiplication operator to FloatWord type.

These operators are defined to avoid ambiguous overload because of built-in operators.

Parameters
rightHandThe right hand side of the addition.
Returns
The SimValue with the result of the operation.

Definition at line 744 of file SimValue.cc.

744  {
745  SimValue copy(*this);
746  copy = floatWordValue() * rightHand;
747  return copy;
748 }

References floatWordValue().

Here is the call graph for this function:

◆ operator*() [3/7]

const SimValue SimValue::operator* ( const HalfFloatWord rightHand)

Explicit multiply operator to HalfFloatWord type.

These operators are defined to avoid ambiguous overload because of built-in operators.

Parameters
rightHandThe right hand side of the addition.
Returns
The SimValue with the result of the operation.

Definition at line 664 of file SimValue.cc.

664  {
665  SimValue copy(*this);
666  copy = halfFloatWordValue() * rightHand;
667  return copy;
668 }

References halfFloatWordValue().

Here is the call graph for this function:

◆ operator*() [4/7]

const SimValue SimValue::operator* ( const SIntWord rightHand)

Explicit multiplication operator to SIntWord type.

These operators are defined to avoid ambiguous overload because of built-in operators.

Parameters
rightHandThe right hand side of the addition.
Returns
The SimValue with the result of the operation.

Definition at line 680 of file SimValue.cc.

680  {
681  SimValue copy(*this);
682  copy = sIntWordValue() * rightHand;
683  return copy;
684 }

References sIntWordValue().

Here is the call graph for this function:

◆ operator*() [5/7]

const SimValue SimValue::operator* ( const SLongWord rightHand)

Explicit multiplication operator to SLongWord type.

These operators are defined to avoid ambiguous overload because of built-in operators.

Parameters
rightHandThe right hand side of the addition.
Returns
The SimValue with the result of the operation.

Definition at line 712 of file SimValue.cc.

712  {
713  SimValue copy(*this);
714  copy = sLongWordValue() * rightHand;
715  return copy;
716 }

References sLongWordValue().

Here is the call graph for this function:

◆ operator*() [6/7]

const SimValue SimValue::operator* ( const UIntWord rightHand)

Explicit multiplication operator to UIntWord type.

These operators are defined to avoid ambiguous overload because of built-in operators.

Parameters
rightHandThe right hand side of the addition.
Returns
The SimValue with the result of the operation.

Definition at line 696 of file SimValue.cc.

696  {
697  SimValue copy(*this);
698  copy = uIntWordValue() * rightHand;
699  return copy;
700 }

References uIntWordValue().

Here is the call graph for this function:

◆ operator*() [7/7]

const SimValue SimValue::operator* ( const ULongWord rightHand)

Explicit multiplication operator to UIntWord type.

These operators are defined to avoid ambiguous overload because of built-in operators.

Parameters
rightHandThe right hand side of the addition.
Returns
The SimValue with the result of the operation.

Definition at line 728 of file SimValue.cc.

728  {
729  SimValue copy(*this);
730  copy = uLongWordValue() * rightHand;
731  return copy;
732 }

References uLongWordValue().

Here is the call graph for this function:

◆ operator+() [1/7]

const SimValue SimValue::operator+ ( const DoubleWord rightHand)

Explicit addition operator to DoubleWord type.

These operators are defined to avoid ambiguous overload because of built-in operators.

Parameters
rightHandThe right hand side of the addition.
Returns
The SimValue with the result of the operation.

Definition at line 423 of file SimValue.cc.

423  {
424  SimValue copy(*this);
425  copy = doubleWordValue() + rightHand;
426  return copy;
427 }

References doubleWordValue().

Here is the call graph for this function:

◆ operator+() [2/7]

const SimValue SimValue::operator+ ( const FloatWord rightHand)

Explicit addition operator to FloatWord type.

These operators are defined to avoid ambiguous overload because of built-in operators.

Parameters
rightHandThe right hand side of the addition.
Returns
The SimValue with the result of the operation.

Definition at line 407 of file SimValue.cc.

407  {
408  SimValue copy(*this);
409  copy = floatWordValue() + rightHand;
410  return copy;
411 }

References floatWordValue().

Here is the call graph for this function:

◆ operator+() [3/7]

const SimValue SimValue::operator+ ( const HalfFloatWord rightHand)

Explicit addition operator to HalfFloatWord type.

These operators are defined to avoid ambiguous overload because of built-in operators.

Parameters
rightHandThe right hand side of the addition.
Returns
The SimValue with the result of the operation.

Definition at line 391 of file SimValue.cc.

391  {
392  SimValue copy(*this);
393  copy = halfFloatWordValue() + rightHand;
394  return copy;
395 }

References halfFloatWordValue().

Here is the call graph for this function:

◆ operator+() [4/7]

const SimValue SimValue::operator+ ( const SIntWord rightHand)

Explicit addition operator to SIntWord type.

These operators are defined to avoid ambiguous overload because of built-in operators.

Parameters
rightHandThe right hand side of the addition.
Returns
The SimValue with the result of the operation.

Definition at line 327 of file SimValue.cc.

327  {
328  SimValue copy(*this);
329  copy = sIntWordValue() + rightHand;
330  return copy;
331 }

References sIntWordValue().

Here is the call graph for this function:

◆ operator+() [5/7]

const SimValue SimValue::operator+ ( const SLongWord rightHand)

Explicit addition operator to SlongWord type.

These operators are defined to avoid ambiguous overload because of built-in operators.

Parameters
rightHandThe right hand side of the addition.
Returns
The SimValue with the result of the operation.

Definition at line 359 of file SimValue.cc.

359  {
360  SimValue copy(*this);
361  copy = sLongWordValue() + rightHand;
362  return copy;
363 }

References sLongWordValue().

Here is the call graph for this function:

◆ operator+() [6/7]

const SimValue SimValue::operator+ ( const UIntWord rightHand)

Explicit addition operator to UIntWord type.

These operators are defined to avoid ambiguous overload because of built-in operators.

Parameters
rightHandThe right hand side of the addition.
Returns
The SimValue with the result of the operation.

Definition at line 343 of file SimValue.cc.

343  {
344  SimValue copy(*this);
345  copy = uIntWordValue() + rightHand;
346  return copy;
347 }

References uIntWordValue().

Here is the call graph for this function:

◆ operator+() [7/7]

const SimValue SimValue::operator+ ( const ULongWord rightHand)

Explicit addition operator to ULongWord type.

These operators are defined to avoid ambiguous overload because of built-in operators.

Parameters
rightHandThe right hand side of the addition.
Returns
The SimValue with the result of the operation.

Definition at line 375 of file SimValue.cc.

375  {
376  SimValue copy(*this);
377  copy = uLongWordValue() + rightHand;
378  return copy;
379 }

References uLongWordValue().

Here is the call graph for this function:

◆ operator-() [1/7]

const SimValue SimValue::operator- ( const DoubleWord rightHand)

Explicit subtraction operator to DoubleWord type.

These operators are defined to avoid ambiguous overload because of built-in operators.

Parameters
rightHandThe right hand side of the addition.
Returns
The SimValue with the result of the operation.

Definition at line 536 of file SimValue.cc.

536  {
537  SimValue copy(*this);
538  copy = doubleWordValue() - rightHand;
539  return copy;
540 }

References doubleWordValue().

Here is the call graph for this function:

◆ operator-() [2/7]

const SimValue SimValue::operator- ( const FloatWord rightHand)

Explicit subtraction operator to FloatWord type.

These operators are defined to avoid ambiguous overload because of built-in operators.

Parameters
rightHandThe right hand side of the addition.
Returns
The SimValue with the result of the operation.

Definition at line 520 of file SimValue.cc.

520  {
521  SimValue copy(*this);
522  copy = floatWordValue() - rightHand;
523  return copy;
524 }

References floatWordValue().

Here is the call graph for this function:

◆ operator-() [3/7]

const SimValue SimValue::operator- ( const HalfFloatWord rightHand)

Explicit subtraction operator to HalfFloatWord type.

These operators are defined to avoid ambiguous overload because of built-in operators.

Parameters
rightHandThe right hand side of the addition.
Returns
The SimValue with the result of the operation.

Definition at line 440 of file SimValue.cc.

440  {
441  SimValue copy(*this);
442  copy = halfFloatWordValue() - rightHand;
443  return copy;
444 }

References halfFloatWordValue().

Here is the call graph for this function:

◆ operator-() [4/7]

const SimValue SimValue::operator- ( const SIntWord rightHand)

Explicit subtraction operator to SIntWord type.

These operators are defined to avoid ambiguous overload because of built-in operators.

Parameters
rightHandThe right hand side of the addition.
Returns
The SimValue with the result of the operation.

Definition at line 456 of file SimValue.cc.

456  {
457  SimValue copy(*this);
458  copy = sIntWordValue() - rightHand;
459  return copy;
460 }

References sIntWordValue().

Here is the call graph for this function:

◆ operator-() [5/7]

const SimValue SimValue::operator- ( const SLongWord rightHand)

Explicit subtraction operator to SLongWord type.

These operators are defined to avoid ambiguous overload because of built-in operators.

Parameters
rightHandThe right hand side of the addition.
Returns
The SimValue with the result of the operation.

Definition at line 488 of file SimValue.cc.

488  {
489  SimValue copy(*this);
490  copy = sLongWordValue() - rightHand;
491  return copy;
492 }

References sLongWordValue().

Here is the call graph for this function:

◆ operator-() [6/7]

const SimValue SimValue::operator- ( const UIntWord rightHand)

Explicit subtraction operator to UIntWord type.

These operators are defined to avoid ambiguous overload because of built-in operators.

Parameters
rightHandThe right hand side of the addition.
Returns
The SimValue with the result of the operation.

Definition at line 472 of file SimValue.cc.

472  {
473  SimValue copy(*this);
474  copy = uIntWordValue() - rightHand;
475  return copy;
476 }

References uIntWordValue().

Here is the call graph for this function:

◆ operator-() [7/7]

const SimValue SimValue::operator- ( const ULongWord rightHand)

Explicit subtraction operator to ULongWord type.

These operators are defined to avoid ambiguous overload because of built-in operators.

Parameters
rightHandThe right hand side of the addition.
Returns
The SimValue with the result of the operation.

Definition at line 504 of file SimValue.cc.

504  {
505  SimValue copy(*this);
506  copy = uLongWordValue() - rightHand;
507  return copy;
508 }

References uLongWordValue().

Here is the call graph for this function:

◆ operator/() [1/7]

const SimValue SimValue::operator/ ( const DoubleWord rightHand)

Explicit division operator to DoubleWord type.

These operators are defined to avoid ambiguous overload because of built-in operators.

Parameters
rightHandThe right hand side of the addition.
Returns
The SimValue with the result of the operation.

Definition at line 648 of file SimValue.cc.

648  {
649  SimValue copy(*this);
650  copy = doubleWordValue() / rightHand;
651  return copy;
652 }

References doubleWordValue().

Here is the call graph for this function:

◆ operator/() [2/7]

const SimValue SimValue::operator/ ( const FloatWord rightHand)

Explicit division operator to FloatWord type.

These operators are defined to avoid ambiguous overload because of built-in operators.

Parameters
rightHandThe right hand side of the addition.
Returns
The SimValue with the result of the operation.

Definition at line 632 of file SimValue.cc.

632  {
633  SimValue copy(*this);
634  copy = floatWordValue() / rightHand;
635  return copy;
636 }

References floatWordValue().

Here is the call graph for this function:

◆ operator/() [3/7]

const SimValue SimValue::operator/ ( const HalfFloatWord rightHand)

Explicit division operator to HalfFloatWord type.

These operators are defined to avoid ambiguous overload because of built-in operators.

Parameters
rightHandThe right hand side of the addition.
Returns
The SimValue with the result of the operation.

Definition at line 552 of file SimValue.cc.

552  {
553  SimValue copy(*this);
554  copy = halfFloatWordValue() / rightHand;
555  return copy;
556 }

References halfFloatWordValue().

Here is the call graph for this function:

◆ operator/() [4/7]

const SimValue SimValue::operator/ ( const SIntWord rightHand)

Explicit division operator to SIntWord type.

These operators are defined to avoid ambiguous overload because of built-in operators.

Parameters
rightHandThe right hand side of the addition.
Returns
The SimValue with the result of the operation.

Definition at line 568 of file SimValue.cc.

568  {
569  SimValue copy(*this);
570  copy = sIntWordValue() / rightHand;
571  return copy;
572 }

References sIntWordValue().

Here is the call graph for this function:

◆ operator/() [5/7]

const SimValue SimValue::operator/ ( const SLongWord rightHand)

Explicit division operator to SLongWord type.

These operators are defined to avoid ambiguous overload because of built-in operators.

Parameters
rightHandThe right hand side of the addition.
Returns
The SimValue with the result of the operation.

Definition at line 600 of file SimValue.cc.

600  {
601  SimValue copy(*this);
602  copy = sLongWordValue() / rightHand;
603  return copy;
604 }

References sLongWordValue().

Here is the call graph for this function:

◆ operator/() [6/7]

const SimValue SimValue::operator/ ( const UIntWord rightHand)

Explicit division operator to UIntWord type.

These operators are defined to avoid ambiguous overload because of built-in operators.

Parameters
rightHandThe right hand side of the addition.
Returns
The SimValue with the result of the operation.

Definition at line 584 of file SimValue.cc.

584  {
585  SimValue copy(*this);
586  copy = uIntWordValue() / rightHand;
587  return copy;
588 }

References uIntWordValue().

Here is the call graph for this function:

◆ operator/() [7/7]

const SimValue SimValue::operator/ ( const ULongWord rightHand)

Explicit division operator to UIntWord type.

These operators are defined to avoid ambiguous overload because of built-in operators.

Parameters
rightHandThe right hand side of the addition.
Returns
The SimValue with the result of the operation.

Definition at line 616 of file SimValue.cc.

616  {
617  SimValue copy(*this);
618  copy = uLongWordValue() / rightHand;
619  return copy;
620 }

References uLongWordValue().

Here is the call graph for this function:

◆ operator=() [1/8]

SimValue & SimValue::operator= ( const DoubleWord source)

Assignment operator for source value of type DoubleWord.

Parameters
sourceThe source value.
Returns
Reference to itself.

Definition at line 258 of file SimValue.cc.

258  {
259 
260  const size_t BYTE_COUNT = sizeof(DoubleWord);
261 
262  setBitWidth(BYTE_COUNT * BYTE_BITWIDTH);
263 
264 #if HOST_BIGENDIAN == 1
265  swapByteOrder((const Byte*)&source, BYTE_COUNT, rawData_);
266 #else
267  memcpy(rawData_, &source, BYTE_COUNT);
268 #endif
269  return (*this);
270 }

References BYTE_BITWIDTH, rawData_, setBitWidth(), and swapByteOrder().

Here is the call graph for this function:

◆ operator=() [2/8]

SimValue & SimValue::operator= ( const FloatWord source)

Assignment operator for source value of type FloatWord.

Parameters
sourceThe source value.
Returns
Reference to itself.

Definition at line 237 of file SimValue.cc.

237  {
238 
239  const size_t BYTE_COUNT = sizeof(FloatWord);
240 
241  setBitWidth(BYTE_COUNT * BYTE_BITWIDTH);
242 
243 #if HOST_BIGENDIAN == 1
244  swapByteOrder((const Byte*)&source, BYTE_COUNT, rawData_);
245 #else
246  memcpy(rawData_, &source, BYTE_COUNT);
247 #endif
248  return (*this);
249 }

References BYTE_BITWIDTH, rawData_, setBitWidth(), and swapByteOrder().

Here is the call graph for this function:

◆ operator=() [3/8]

SimValue & SimValue::operator= ( const HalfFloatWord source)

Assignment operator for source value of type HalfFloatWord.

Parameters
sourceThe source value.
Returns
Reference to itself.

Definition at line 215 of file SimValue.cc.

215  {
216 
217  const size_t BYTE_COUNT = sizeof(uint16_t);
218  uint16_t data = source.getBinaryRep();
219 
220  setBitWidth(BYTE_COUNT * BYTE_BITWIDTH);
221 
222 #if HOST_BIGENDIAN == 1
223  swapByteOrder((const Byte*)&data, BYTE_COUNT, rawData_);
224 #else
225  memcpy(rawData_, &data, BYTE_COUNT);
226 #endif
227  return (*this);
228 }

References BYTE_BITWIDTH, HalfFloatWord::getBinaryRep(), rawData_, setBitWidth(), and swapByteOrder().

Here is the call graph for this function:

◆ operator=() [4/8]

SimValue & SimValue::operator= ( const SimValue source)

Assignment operator for source value of type SimValue.

Note
No sign extension is done in case the destination width differs from the source width.
Parameters
sourceThe source value.
Returns
Reference to itself.

Definition at line 282 of file SimValue.cc.

282  {
283 
284  const size_t DST_BYTE_COUNT =
286  const size_t SRC_BYTE_COUNT =
287  (source.bitWidth_ + (BYTE_BITWIDTH - 1)) / BYTE_BITWIDTH;
288 
289  memcpy(rawData_, source.rawData_, SRC_BYTE_COUNT);
290  if (SRC_BYTE_COUNT < DST_BYTE_COUNT) {
291  memset(rawData_+SRC_BYTE_COUNT, 0, DST_BYTE_COUNT-SRC_BYTE_COUNT);
292  } else if (bitWidth_ % BYTE_BITWIDTH) {
293  const unsigned bitsInMSB = bitWidth_ % BYTE_BITWIDTH;
294  const Byte msbBitMask = static_cast<Byte>((1 << bitsInMSB) - 1);
295  rawData_[DST_BYTE_COUNT-1] &= msbBitMask;
296  }
297 
298  return (*this);
299 }

References bitWidth_, BYTE_BITWIDTH, and rawData_.

◆ operator=() [5/8]

SimValue & SimValue::operator= ( const SIntWord source)

Assignment operator for source value of type SIntWord.

Parameters
sourceThe source value.
Returns
Reference to itself.

Definition at line 138 of file SimValue.cc.

138  {
139 
140  const size_t BYTE_COUNT = sizeof(SIntWord);
141 
142 #if HOST_BIGENDIAN == 1
143  swapByteOrder((const Byte*)&source, BYTE_COUNT, rawData_);
144 #else
145  memcpy(rawData_, &source, BYTE_COUNT);
146 #endif
147  return (*this);
148 }

References rawData_, and swapByteOrder().

Here is the call graph for this function:

◆ operator=() [6/8]

SimValue & SimValue::operator= ( const SLongWord source)

Assignment operator for source value of type SLongWord.

Parameters
sourceThe source value.
Returns
Reference to itself.

Definition at line 176 of file SimValue.cc.

176  {
177 
178  const size_t BYTE_COUNT = sizeof(SLongWord);
179 
180 #if HOST_BIGENDIAN == 1
181  swapByteOrder((const Byte*)&source, BYTE_COUNT, rawData_);
182 #else
183  memcpy(rawData_, &source, BYTE_COUNT);
184 #endif
185  return (*this);
186 }

References rawData_, and swapByteOrder().

Here is the call graph for this function:

◆ operator=() [7/8]

SimValue & SimValue::operator= ( const UIntWord source)

Assignment operator for source value of type UIntWord.

Parameters
sourceThe source value.
Returns
Reference to itself.

Definition at line 157 of file SimValue.cc.

157  {
158 
159  const size_t BYTE_COUNT = sizeof(UIntWord);
160 
161 #if HOST_BIGENDIAN == 1
162  swapByteOrder((const Byte*)&source, BYTE_COUNT, rawData_);
163 #else
164  memcpy(rawData_, &source, BYTE_COUNT);
165 #endif
166  return (*this);
167 }

References rawData_, and swapByteOrder().

Here is the call graph for this function:

◆ operator=() [8/8]

SimValue & SimValue::operator= ( const ULongWord source)

Assignment operator for source value of type ULongWord.

Parameters
sourceThe source value.
Returns
Reference to itself.

Definition at line 195 of file SimValue.cc.

195  {
196 
197  const size_t BYTE_COUNT = sizeof(ULongWord);
198 
199 #if HOST_BIGENDIAN == 1
200  swapByteOrder((const Byte*)&source, BYTE_COUNT, rawData_);
201 #else
202  memcpy(rawData_, &source, BYTE_COUNT);
203 #endif
204  return (*this);
205 }

References rawData_, and swapByteOrder().

Here is the call graph for this function:

◆ operator==() [1/8]

int SimValue::operator== ( const DoubleWord rightHand) const

Explicit equality operator for DoubleWord type.

These operators are defined to avoid ambiguous overload because of built-in operators.

Parameters
rightHandThe right hand side of the comparison.
Returns
Reference to itself.

Definition at line 887 of file SimValue.cc.

887  {
888  return doubleWordValue() == rightHand;
889 }

References doubleWordValue().

Here is the call graph for this function:

◆ operator==() [2/8]

int SimValue::operator== ( const FloatWord rightHand) const

Explicit equality operator for FloatWord type.

These operators are defined to avoid ambiguous overload because of built-in operators.

Parameters
rightHandThe right hand side of the comparison.
Returns
Reference to itself.

Definition at line 872 of file SimValue.cc.

872  {
873  return floatWordValue() == rightHand;
874 }

References floatWordValue().

Here is the call graph for this function:

◆ operator==() [3/8]

int SimValue::operator== ( const HalfFloatWord rightHand) const

Explicit equality operator for HalfFloatWord type.

These operators are defined to avoid ambiguous overload because of built-in operators.

Parameters
rightHandThe right hand side of the comparison.
Returns
Reference to itself.

Definition at line 857 of file SimValue.cc.

857  {
858  return halfFloatWordValue().getBinaryRep() == rightHand.getBinaryRep();
859 }

References HalfFloatWord::getBinaryRep(), and halfFloatWordValue().

Here is the call graph for this function:

◆ operator==() [4/8]

int SimValue::operator== ( const SimValue rightHand) const

Explicit equality operator for SimValue type.

These operators are defined to avoid ambiguous overload because of built-in operators.

Note
This compares only the first value as a 32bit uintword, thus does not work for vectors that exceed that width.
Parameters
rightHandThe right hand side of the comparison.
Returns
Reference to itself.
Todo:
Should this be changed to comparison between bytes from the whole bitwidth?

Definition at line 780 of file SimValue.cc.

780  {
781  /// @todo Should this be changed to comparison between bytes from the
782  /// whole bitwidth?
783  return uIntWordValue() == rightHand.uIntWordValue();
784 }

References uIntWordValue().

Here is the call graph for this function:

◆ operator==() [5/8]

int SimValue::operator== ( const SIntWord rightHand) const

Explicit equality operator for SIntWord type.

These operators are defined to avoid ambiguous overload because of built-in operators.

Parameters
rightHandThe right hand side of the comparison.
Returns
Reference to itself.

Definition at line 797 of file SimValue.cc.

797  {
798  return sIntWordValue() == rightHand;
799 }

References sIntWordValue().

Here is the call graph for this function:

◆ operator==() [6/8]

int SimValue::operator== ( const SLongWord rightHand) const

Explicit equality operator for SLongWord type.

These operators are defined to avoid ambiguous overload because of built-in operators.

Parameters
rightHandThe right hand side of the comparison.
Returns
Reference to itself.

Definition at line 827 of file SimValue.cc.

827  {
828  return sLongWordValue() == rightHand;
829 }

References sLongWordValue().

Here is the call graph for this function:

◆ operator==() [7/8]

int SimValue::operator== ( const UIntWord rightHand) const

Explicit equality operator for UIntWord type.

These operators are defined to avoid ambiguous overload because of built-in operators.

Parameters
rightHandThe right hand side of the comparison.
Returns
Reference to itself.

Definition at line 812 of file SimValue.cc.

812  {
813  return uIntWordValue() == rightHand;
814 }

References uIntWordValue().

Here is the call graph for this function:

◆ operator==() [8/8]

int SimValue::operator== ( const ULongWord rightHand) const

Explicit equality operator for ULongWord type.

These operators are defined to avoid ambiguous overload because of built-in operators.

Parameters
rightHandThe right hand side of the comparison.
Returns
Reference to itself.

Definition at line 842 of file SimValue.cc.

842  {
843  return uLongWordValue() == rightHand;
844 }

References uLongWordValue().

Here is the call graph for this function:

◆ setBitElement()

void SimValue::setBitElement ( size_t  elementIndex,
UIntWord  data 
)

Sets bit element at a certain index to given value.

Parameters
elementIndexBit element index.
dataBit element data.

Definition at line 1397 of file SimValue.cc.

1397  {
1398  // Element index must not cross SimValue's bitwidth.
1399  assert((elementIndex+1) <= SIMD_WORD_WIDTH);
1400 
1401  const size_t OFFSET = elementIndex / BYTE_BITWIDTH;
1402  const size_t LEFT_SHIFTS = elementIndex % BYTE_BITWIDTH;
1403 
1404  Byte byte = rawData_[OFFSET];
1405 
1406  if (data == 0) {
1407  byte = byte & (~(1 << LEFT_SHIFTS));
1408  } else {
1409  byte = byte | (1 << LEFT_SHIFTS);
1410  }
1411 
1412  rawData_[OFFSET] = byte;
1413 }

References assert, BYTE_BITWIDTH, rawData_, and SIMD_WORD_WIDTH.

Referenced by setElement().

◆ setBitWidth()

void SimValue::setBitWidth ( int  width)

Sets SimValue's bitwidth and clears bytes to 0 for the whole width.

Parameters
widthThe new bit width.

Definition at line 113 of file SimValue.cc.

113  {
115 
116  bitWidth_ = width;
117  if (BYTE_BITWIDTH * sizeof(mask_) > static_cast<size_t>(width)) {
118  mask_ = ~((~ULongWord(0)) << bitWidth_);
119  }
120 
121  const int BYTE_COUNT = (width + (BYTE_BITWIDTH - 1)) / BYTE_BITWIDTH;
122 
123  if (static_cast<size_t>(BYTE_COUNT) > sizeof(DoubleWord)) {
125  } else {
127  }
128 }

References assert, bitWidth_, BYTE_BITWIDTH, clearToZero(), mask_, SIMD_WORD_WIDTH, and width().

Referenced by CmdMem::execute(), operator=(), SimValue(), and SimpleOperationExecutor::startOperation().

Here is the call graph for this function:

◆ setByteElement()

void SimValue::setByteElement ( size_t  elementIndex,
Byte  data 
)

Definition at line 1386 of file SimValue.cc.

1386  {
1387  setVectorElement(elementIndex, data);
1388 }

References setVectorElement().

Here is the call graph for this function:

◆ setDoubleFloatElement()

void SimValue::setDoubleFloatElement ( size_t  elementIndex,
DoubleFloatWord  data 
)

Definition at line 1381 of file SimValue.cc.

1381  {
1382  setVectorElement(elementIndex, data);
1383 }

References setVectorElement().

Here is the call graph for this function:

◆ setElement()

void SimValue::setElement ( size_t  elementIndex,
size_t  elementWidth,
Word  data 
)

Set element function for arbitrary element width.

Values by width are stored in power of 2 byte boundaries (1, 2 or 4). elementWidth must be in range of (0, 32].

Definition at line 1422 of file SimValue.cc.

1422  {
1423  assert(elementWidth != 0);
1424  if (elementWidth == 1) {
1425  setBitElement(elementIndex, data);
1426  } else {
1427  const size_t BYTE_COUNT =
1428  elementWidth >= 8u ?
1429  MathTools::roundUpToPowerTwo((unsigned int)elementWidth)/8 : 1;
1430  const size_t OFFSET = elementIndex * BYTE_COUNT;
1431 
1432  // Element index must not cross SimValue's bitwidth.
1433  assert((elementIndex+1) <= (SIMVALUE_MAX_BYTE_SIZE / BYTE_COUNT));
1434  // Cut excess bits from data
1435  Word BITMASK = ~Word(0);
1436  if (elementWidth < sizeof(Word)*8) {
1437  BITMASK = ~(~Word(0) << elementWidth);
1438  }
1439 
1440  Word tmp_data = data & BITMASK;
1441 #if HOST_BIGENDIAN == 1
1442  swapByteOrder((Byte*)&tmp_data, BYTE_COUNT, rawData_ + OFFSET);
1443 #else
1444  memcpy(rawData_ + OFFSET, &tmp_data, BYTE_COUNT);
1445 #endif
1446  }
1447 }

References assert, rawData_, MathTools::roundUpToPowerTwo(), setBitElement(), SIMVALUE_MAX_BYTE_SIZE, and swapByteOrder().

Here is the call graph for this function:

◆ setFloatElement()

void SimValue::setFloatElement ( size_t  elementIndex,
FloatWord  data 
)

Definition at line 1376 of file SimValue.cc.

1376  {
1377  setVectorElement(elementIndex, data);
1378 }

References setVectorElement().

Here is the call graph for this function:

◆ setHalfFloatElement()

void SimValue::setHalfFloatElement ( size_t  elementIndex,
HalfFloatWord  data 
)

Definition at line 1371 of file SimValue.cc.

1371  {
1372  setVectorElement(elementIndex, data);
1373 }

References setVectorElement().

Here is the call graph for this function:

◆ setHalfWordElement()

void SimValue::setHalfWordElement ( size_t  elementIndex,
HalfWord  data 
)

Sets half word (a.k.a. short 16-bit integer) element at a certain index to given value.

Parameters
elementIndexHalf word element index.
dataHalf word element data.

Definition at line 1366 of file SimValue.cc.

1366  {
1367  setVectorElement(elementIndex, data);
1368 }

References setVectorElement().

Here is the call graph for this function:

◆ setValue()

void SimValue::setValue ( TCEString  hexValue)

Sets SimValue to correspond the hex value.

Given hex string must be in big-endian order when it is given. For instance, if the user wants to set integer value 5 through this function, the function should be called "setValue("0x00000005");". Add leading zeroes if you want to clear bytes before the byte that has value 5.

Parameters
hexValueNew value in hex format.

Definition at line 1460 of file SimValue.cc.

1460  {
1461  if (hexValue.size() > 2 && hexValue[0] == '0' && hexValue[1] == 'x') {
1462  hexValue = hexValue.substr(2); // Remove "0x."
1463  }
1464 
1465  const size_t VALUE_BITWIDTH = hexValue.size() * 4;
1466 
1467  // stretch the SimValue to the hex value bit width in case
1468  // this is an initialization
1469  if (bitWidth_ == 0) bitWidth_ = VALUE_BITWIDTH;
1470 
1471  size_t paddingBytes = 0;
1472  // Check the hex string value is legal.
1473  if (VALUE_BITWIDTH > SIMD_WORD_WIDTH) {
1474  throw NumberFormatException(
1475  __FILE__, __LINE__, __func__, "Too wide value.");
1476  } else if (VALUE_BITWIDTH == 0) {
1477  throw NumberFormatException(
1478  __FILE__, __LINE__, __func__, "Input value is empty.");
1479  } else if (VALUE_BITWIDTH > (size_t)bitWidth_) {
1480  // Add padding zero bytes in case the hexValue defines less
1481  // bytes than the width of the value.
1482  paddingBytes = (VALUE_BITWIDTH - bitWidth_) / 8;
1483  for (size_t i = 0; i < paddingBytes; ++i)
1484  rawData_[VALUE_BITWIDTH / 8 + i] = 0;
1485  }
1486  Byte bigEndianData[SIMVALUE_MAX_BYTE_SIZE];
1487  Conversion::toRawData(hexValue, bigEndianData);
1488 
1489  // because the hexValues are 4bits each they might not fill exact
1490  // bytes, thus we need to round up to consume an extra byte for
1491  // remaining 4bits
1492  int byteWidth = VALUE_BITWIDTH / 8;
1493  if (VALUE_BITWIDTH % 8 != 0) ++byteWidth;
1494 
1495  swapByteOrder(bigEndianData, byteWidth, rawData_);
1496 }

References __func__, bitWidth_, hexValue(), rawData_, SIMD_WORD_WIDTH, SIMVALUE_MAX_BYTE_SIZE, swapByteOrder(), and Conversion::toRawData().

Here is the call graph for this function:

◆ setVectorElement()

template<typename T >
void SimValue::setVectorElement ( size_t  elementIndex,
data 
)
private

Definition at line 1339 of file SimValue.cc.

1339  {
1340  const size_t BYTE_COUNT = sizeof(T);
1341  const size_t OFFSET = elementIndex * BYTE_COUNT;
1342 
1343  // Element index must not cross SimValue's bitwidth.
1344  assert((elementIndex+1) <= (SIMVALUE_MAX_BYTE_SIZE / BYTE_COUNT));
1345 
1346 #if HOST_BIGENDIAN == 1
1347  swapByteOrder((Byte*)&data, BYTE_COUNT, rawData_ + OFFSET);
1348 #else
1349  memcpy(rawData_ + OFFSET, &data, BYTE_COUNT);
1350 #endif
1351 }

References assert, rawData_, SIMVALUE_MAX_BYTE_SIZE, and swapByteOrder().

Referenced by setByteElement(), setDoubleFloatElement(), setFloatElement(), setHalfFloatElement(), setHalfWordElement(), and setWordElement().

Here is the call graph for this function:

◆ setWordElement()

void SimValue::setWordElement ( size_t  elementIndex,
Word  data 
)

Definition at line 1354 of file SimValue.cc.

1354  {
1355  setVectorElement(elementIndex, data);
1356 }

References setVectorElement().

Here is the call graph for this function:

◆ signExtendTo()

void SimValue::signExtendTo ( int  bitWidth)

Overwrites all bits that do not fit in the given bit width with the sign bit (the bit at position width - 1).

This operation corresponds to reinterpreting the value as a signed word of given bit width.

Parameters
bitWidthNumber of meaningful bits in the given integer.
Exceptions
OutOfRangeIf width > value size

Definition at line 1531 of file SimValue.cc.

1531  {
1532  if (bitWidth > SIMD_WORD_WIDTH) {
1533  throw OutOfRange(__FILE__, __LINE__, __func__);
1534  }
1535 
1536  if (bitWidth <= 0) {
1537  clearToZero();
1538  return;
1539  }
1540 
1541  const size_t FIRST_BYTE = (bitWidth + (BYTE_BITWIDTH - 1)) / BYTE_BITWIDTH;
1542  const size_t BYTE_COUNT = (bitWidth_ + (BYTE_BITWIDTH - 1)) / BYTE_BITWIDTH;
1543 
1544  rawData_[FIRST_BYTE-1] = MathTools::fastSignExtendTo(
1545  static_cast<int>(rawData_[FIRST_BYTE-1]),
1546  ((bitWidth-1)%BYTE_BITWIDTH)+1);
1547 
1548  if (BYTE_COUNT > FIRST_BYTE) { // Fill remaining bytes with sign bit
1549  if (bitElement(bitWidth-1) == 0) {
1550  memset(rawData_+FIRST_BYTE, 0, BYTE_COUNT-FIRST_BYTE);
1551  } else {
1552  memset(rawData_+FIRST_BYTE, -1, BYTE_COUNT-FIRST_BYTE);
1553  }
1554  }
1555 }

References __func__, bitElement(), bitWidth_, BYTE_BITWIDTH, clearToZero(), MathTools::fastSignExtendTo(), rawData_, and SIMD_WORD_WIDTH.

Referenced by SimProgramBuilder::processMove().

Here is the call graph for this function:

◆ sIntWordElement()

SIntWord SimValue::sIntWordElement ( size_t  elementIndex) const

Returns desired element at given index as signed integer.

Definition at line 1227 of file SimValue.cc.

1227  {
1228  union CastUnion {
1229  Word uWord;
1230  SIntWord sWord;
1231  } cast;
1232  cast.uWord = wordElement(elementIndex);
1233  return cast.sWord;
1234 }

References wordElement().

Here is the call graph for this function:

◆ sIntWordValue()

SIntWord SimValue::sIntWordValue ( ) const

Returns the SimValue as SIntWord value.

Definition at line 944 of file SimValue.cc.

944  {
945 
946  const size_t BYTE_COUNT = sizeof(SIntWord);
947 
948  union CastUnion {
949  Byte bytes[BYTE_COUNT];
950  SIntWord value;
951  };
952 
953  CastUnion cast;
954 
955 #if HOST_BIGENDIAN == 1
956  swapByteOrder(rawData_, BYTE_COUNT, cast.bytes);
957 #else
958  memcpy(cast.bytes, rawData_, BYTE_COUNT);
959 #endif
960 
961  if ((unsigned)bitWidth_ >= sizeof(SIntWord) * BYTE_BITWIDTH) {
962  return cast.value;
963  } else {
964  return MathTools::fastSignExtendTo(cast.value, bitWidth_);
965  }
966 }

References bitWidth_, BYTE_BITWIDTH, MathTools::fastSignExtendTo(), rawData_, and swapByteOrder().

Referenced by ProximBusDetailsCmd::Do(), ProximIUDetailsCmd::Do(), ExecutableMove::evaluateGuard(), SimulateDialog::formattedValue(), ProgramImageGenerator::generateProgramImage(), operator*(), operator+(), operator-(), operator/(), and operator==().

Here is the call graph for this function:

◆ sLongWordValue()

SLongWord SimValue::sLongWordValue ( ) const

Returns the SimValue as SIntWord value.

Returns
SIntWord value.

Definition at line 997 of file SimValue.cc.

997  {
998 
999  const size_t BYTE_COUNT = sizeof(SLongWord);
1000 
1001  union CastUnion {
1002  Byte bytes[BYTE_COUNT];
1003  SLongWord value;
1004  };
1005 
1006  CastUnion cast;
1007 
1008 #if HOST_BIGENDIAN == 1
1009  swapByteOrder(rawData_, BYTE_COUNT, cast.bytes);
1010 #else
1011  memcpy(cast.bytes, rawData_, BYTE_COUNT);
1012 #endif
1013 
1014  if ((unsigned)bitWidth_ >= sizeof(SLongWord) * BYTE_BITWIDTH) {
1015  return cast.value;
1016  } else {
1017  return MathTools::fastSignExtendTo(cast.value, bitWidth_);
1018  }
1019 }

References bitWidth_, BYTE_BITWIDTH, MathTools::fastSignExtendTo(), rawData_, and swapByteOrder().

Referenced by TTAProgram::ProgramWriter::createCodeSection(), BuslessExecutableMove::executeWrite(), operator*(), operator+(), operator-(), operator/(), operator==(), SimProgramBuilder::processMove(), InfoRegistersCommand::registerDescription(), MachineConnectivityCheck::requiredImmediateWidth(), LongImmediateRegisterState::setValue(), TesterContext::toOutputFormat(), DisassemblyImmediate::toString(), and DisassemblyImmediateAssignment::toString().

Here is the call graph for this function:

◆ swapByteOrder()

void SimValue::swapByteOrder ( const Byte from,
size_t  byteCount,
Byte to 
) const
private
Todo:
This currently works, but there could be more optimal 8-byte, 4-byte and 2-byte swapper functions for 2/4/8 byte swaps. The more optimal swappers would load all bytes to 8, 4 or 2-byte values and shift invidivual bytes to their correct places, which would reduce memory accesses. Or use some intrincs for optimal execution and better code density.

Copies the byte order from source array in opposite order to target array.

Note
Caller is responsible for making sure both input pointers have enough allocated memory.
Parameters
fromArray from which the bytes are copied.
byteCountHow many bytes are copied.
toArray to which the bytes are copied in opposite order.

Definition at line 1621 of file SimValue.cc.

1622  {
1623 
1624  assert (from != to);
1625  for (size_t i = 0; i < byteCount; ++i) {
1626  to[byteCount - 1 - i] = from[i];
1627  }
1628 }

References assert.

Referenced by doubleWordValue(), element(), floatWordValue(), halfFloatWordValue(), intValue(), operator=(), setElement(), setValue(), setVectorElement(), SimValue(), sIntWordValue(), sLongWordValue(), uIntWordValue(), uLongWordValue(), unsignedValue(), and vectorElement().

◆ uIntWordElement()

UIntWord SimValue::uIntWordElement ( size_t  elementIndex) const

Returns desired element at given index as unsigned integer.

Definition at line 1240 of file SimValue.cc.

1240  {
1241  return wordElement(elementIndex);
1242 }

References wordElement().

Here is the call graph for this function:

◆ uIntWordValue()

UIntWord SimValue::uIntWordValue ( ) const

Returns the SimValue as host endian UIntWord value.

Definition at line 972 of file SimValue.cc.

972  {
973 
974  const size_t BYTE_COUNT = sizeof(UIntWord);
975 
976  union CastUnion {
977  Byte bytes[BYTE_COUNT];
978  UIntWord value;
979  };
980 
981  CastUnion cast;
982 
983 #if HOST_BIGENDIAN == 1
984  swapByteOrder(rawData_, BYTE_COUNT, cast.bytes);
985 #else
986  memcpy(cast.bytes, rawData_, BYTE_COUNT);
987 #endif
988  return cast.value & mask_;
989 }

References mask_, rawData_, and swapByteOrder().

Referenced by ExecutionTrace::addBusActivity(), ProximFUDetailsCmd::Do(), CodeCompressorPlugin::encodeImmediateTerminal(), CodeCompressorPlugin::encodeLongImmediate(), SimulateDialog::formattedValue(), hexValue(), operator*(), operator+(), operator-(), operator/(), operator==(), and SimulationInfoDialog::updateList().

Here is the call graph for this function:

◆ uLongWordValue()

ULongWord SimValue::uLongWordValue ( ) const

Returns the SimValue as an ULongWord.

Returns
UIntWord value.

Definition at line 1027 of file SimValue.cc.

1027  {
1028 
1029  const size_t BYTE_COUNT = sizeof(ULongWord);
1030 
1031  union CastUnion {
1032  Byte bytes[BYTE_COUNT];
1033  ULongWord value;
1034  };
1035 
1036  CastUnion cast;
1037 
1038 #if HOST_BIGENDIAN == 1
1039  swapByteOrder(rawData_, BYTE_COUNT, cast.bytes);
1040 #else
1041  memcpy(cast.bytes, rawData_, BYTE_COUNT);
1042 #endif
1043  return cast.value & mask_;
1044 }

References mask_, rawData_, and swapByteOrder().

Referenced by TTAProgram::ProgramWriter::createCodeSection(), POMDisassembler::createMove(), hexValue(), operator*(), operator+(), operator-(), operator/(), operator==(), SimProgramBuilder::processMove(), MachineConnectivityCheck::requiredImmediateWidth(), LongImmediateRegisterState::setValue(), TesterContext::toOutputFormat(), DisassemblyImmediate::toString(), and DisassemblyImmediateAssignment::toString().

Here is the call graph for this function:

◆ unsignedValue()

unsigned int SimValue::unsignedValue ( ) const

Returns SimValue as a zero extended unsigned host integer.

Definition at line 919 of file SimValue.cc.

919  {
920 
921  const size_t BYTE_COUNT = sizeof(unsigned int);
922 
923  union CastUnion {
924  Byte bytes[BYTE_COUNT];
925  unsigned int value;
926  };
927 
928  CastUnion cast;
929 
930 #if HOST_BIGENDIAN == 1
931  swapByteOrder(rawData_, BYTE_COUNT, cast.bytes);
932 #else
933  memcpy(cast.bytes, rawData_, BYTE_COUNT);
934 #endif
935 
936  int bitWidth = (bitWidth_ > 32) ? 32 : bitWidth_;
937  return MathTools::fastZeroExtendTo(cast.value, bitWidth);
938 }

References bitWidth_, MathTools::fastZeroExtendTo(), rawData_, and swapByteOrder().

Referenced by StaticProgramAnalyzer::addProgram(), TTAProgram::TerminalAddress::address(), ITemplateBroker::assign(), ITemplateBroker::assignImmediate(), POMValidator::checkLongImmediates(), TTAProgram::ProgramWriter::createCodeSection(), RFTestbenchGenerator::createStimulus(), ProximFUPortDetailsCmd::Do(), ProximRFDetailsCmd::Do(), CompiledSimCodeGenerator::generateInstruction(), ConstantAliasAnalyzer::getConstantAddress(), BUBasicBlockScheduler::handleLoopDDG(), ProximRegisterWindow::loadImmediateUnit(), ProximRegisterWindow::loadRegisterFile(), CompiledSimSymbolGenerator::moveOperandSymbol(), BasicBlockScheduler::scheduleMove(), and ProximPortWindow::update().

Here is the call graph for this function:

◆ vectorElement()

template<typename T >
T SimValue::vectorElement ( size_t  elementIndex) const
private

Definition at line 1187 of file SimValue.cc.

1187  {
1188  const size_t BYTE_COUNT = sizeof(T);
1189  const size_t OFFSET = elementIndex * BYTE_COUNT;
1190 
1191  // Element index must not cross SimValue's bitwidth.
1192  assert((elementIndex+1) <= (SIMVALUE_MAX_BYTE_SIZE / BYTE_COUNT));
1193 
1194  union CastUnion {
1195  Byte bytes[sizeof(T)];
1196  T value;
1197  };
1198 
1199  CastUnion cast;
1200 
1201 #if HOST_BIGENDIAN == 1
1202  swapByteOrder(rawData_ + OFFSET, BYTE_COUNT, cast.bytes);
1203 #else
1204  memcpy(cast.bytes, rawData_ + OFFSET, BYTE_COUNT);
1205 #endif
1206  return cast.value;
1207 }

References assert, rawData_, SIMVALUE_MAX_BYTE_SIZE, and swapByteOrder().

Here is the call graph for this function:

◆ width()

int SimValue::width ( ) const

◆ wordElement()

Word SimValue::wordElement ( size_t  elementIndex) const

Returns the desired 32-bit word element in host endianness.

The element ordering of SimValue storage is always the memory order, first vector elements in the first locations.

Parameters
elementIndexIndex of the element (from 0 upwards).
Returns
Word element.

Definition at line 1219 of file SimValue.cc.

1219  {
1220  return vectorElement<Word>(elementIndex);
1221 }

Referenced by sIntWordElement(), and uIntWordElement().

◆ zeroExtendTo()

void SimValue::zeroExtendTo ( int  bitWidth)

Overwrites all bits that do not fit in the given bit width with 0

This operation corresponds to reinterpreting the value as an unsigned word of given bit width.

Parameters
bitWidthNumber of meaningful bits in the given integer.
Exceptions
OutOfRangeIf width > value size

Definition at line 1567 of file SimValue.cc.

1567  {
1568  if (bitWidth > SIMD_WORD_WIDTH) {
1569  throw OutOfRange(__FILE__, __LINE__, __func__);
1570  }
1571 
1572  if (bitWidth <= 0) {
1573  clearToZero();
1574  return;
1575  }
1576 
1577  const size_t FIRST_BYTE = (bitWidth + (BYTE_BITWIDTH - 1)) / BYTE_BITWIDTH;
1578  const size_t BYTE_COUNT = (bitWidth_ + (BYTE_BITWIDTH - 1)) / BYTE_BITWIDTH;
1579 
1580  rawData_[FIRST_BYTE-1] = MathTools::fastZeroExtendTo(
1581  static_cast<int>(rawData_[FIRST_BYTE-1]),
1582  ((bitWidth-1)%BYTE_BITWIDTH)+1);
1583 
1584  if (BYTE_COUNT > FIRST_BYTE) { // Fill remaining bytes with 0
1585  memset(rawData_+FIRST_BYTE, 0, BYTE_COUNT-FIRST_BYTE);
1586  }
1587 }

References __func__, bitWidth_, BYTE_BITWIDTH, clearToZero(), MathTools::fastZeroExtendTo(), rawData_, and SIMD_WORD_WIDTH.

Referenced by SimProgramBuilder::processMove().

Here is the call graph for this function:

Member Data Documentation

◆ bitWidth_

int SimValue::bitWidth_

◆ mask_

ULongWord SimValue::mask_
private

Mask for masking extra bits when returning unsigned value.

Definition at line 223 of file SimValue.hh.

Referenced by deepCopy(), dump(), setBitWidth(), uIntWordValue(), and uLongWordValue().

◆ rawData_

Byte SimValue::rawData_[SIMVALUE_MAX_BYTE_SIZE]

The documentation for this class was generated from the following files:
UIntWord
Word UIntWord
Definition: BaseType.hh:144
SimValue::setBitWidth
void setBitWidth(int width)
Definition: SimValue.cc:113
NumberFormatException
Definition: Exception.hh:421
SimValue::doubleWordValue
DoubleWord doubleWordValue() const
Definition: SimValue.cc:1052
SimValue::sLongWordValue
SLongWord sLongWordValue() const
Definition: SimValue.cc:997
SimValue::bitElement
UIntWord bitElement(size_t elementIndex) const
Definition: SimValue.cc:1288
OutOfRange
Definition: Exception.hh:320
SimValue::setVectorElement
void setVectorElement(size_t elementIndex, T data)
Definition: SimValue.cc:1339
HalfFloatWord
Definition: HalfFloatWord.hh:41
MathTools::fastSignExtendTo
static SLongWord fastSignExtendTo(SLongWord value, int width)
Byte
unsigned char Byte
Definition: BaseType.hh:116
SimValue::uIntWordValue
UIntWord uIntWordValue() const
Definition: SimValue.cc:972
SimValue::wordElement
Word wordElement(size_t elementIndex) const
Definition: SimValue.cc:1219
Conversion::toString
static std::string toString(const T &source)
SimValue
Definition: SimValue.hh:96
assert
#define assert(condition)
Definition: Application.hh:86
Conversion::toBinary
static std::string toBinary(unsigned int source, unsigned int stringWidth=0)
Definition: Conversion.cc:155
SIMVALUE_MAX_BYTE_SIZE
#define SIMVALUE_MAX_BYTE_SIZE
Definition: SimValue.hh:43
HalfFloatWord::getBinaryRep
uint16_t getBinaryRep() const
Definition: HalfFloatWord.hh:60
SimValue::rawData_
Byte rawData_[SIMVALUE_MAX_BYTE_SIZE]
Array that contains SimValue's underlaying bytes in little endian.
Definition: SimValue.hh:202
MathTools::fastZeroExtendTo
static ULongWord fastZeroExtendTo(ULongWord value, int width)
SimValue::mask_
ULongWord mask_
Mask for masking extra bits when returning unsigned value.
Definition: SimValue.hh:223
SimValue::swapByteOrder
void swapByteOrder(const Byte *from, size_t byteCount, Byte *to) const
Definition: SimValue.cc:1621
FloatWord
float FloatWord
Definition: BaseType.hh:160
SimValue::floatWordValue
FloatWord floatWordValue() const
Definition: SimValue.cc:1075
__func__
#define __func__
Definition: Application.hh:67
SimValue::setBitElement
void setBitElement(size_t elementIndex, UIntWord data)
Definition: SimValue.cc:1397
SimValue::uLongWordValue
ULongWord uLongWordValue() const
Definition: SimValue.cc:1027
SIntWord
SignedWord SIntWord
Definition: BaseType.hh:149
SimValue::clearToZero
void clearToZero()
Definition: SimValue.cc:1516
DoubleWord
double DoubleWord
Definition: BaseType.hh:166
Conversion::toRawData
static void toRawData(const std::string &hexSource, unsigned char *target)
Definition: Conversion.cc:201
Conversion::toHexString
static std::string toHexString(T source, std::size_t digits=0, bool include0x=true)
SimValue::hexValue
TCEString hexValue(bool noHexIdentifier=false) const
Definition: SimValue.cc:1150
SimValue::sIntWordValue
SIntWord sIntWordValue() const
Definition: SimValue.cc:944
SimValue::width
int width() const
Definition: SimValue.cc:103
BYTE_BITWIDTH
const Byte BYTE_BITWIDTH
Definition: BaseType.hh:136
TCEString
Definition: TCEString.hh:53
SIMULATOR_MAX_LONGWORD_BITWIDTH
#define SIMULATOR_MAX_LONGWORD_BITWIDTH
Definition: SimValue.hh:249
ULongWord
unsigned long ULongWord
Definition: BaseType.hh:51
MathTools::roundUpToPowerTwo
static unsigned int roundUpToPowerTwo(unsigned int number)
SimValue::bitWidth_
int bitWidth_
The bitwidth of the value.
Definition: SimValue.hh:205
SIMD_WORD_WIDTH
#define SIMD_WORD_WIDTH
Definition: SimValue.hh:42
SLongWord
long SLongWord
Definition: BaseType.hh:52
SimValue::halfFloatWordValue
HalfFloatWord halfFloatWordValue() const
Definition: SimValue.cc:1098
SimValue::deepCopy
void deepCopy(const SimValue &source)
Definition: SimValue.cc:307