gem5 v24.0.0.0
Loading...
Searching...
No Matches
sat_counter.test.cc File Reference
#include <gtest/gtest-spi.h>
#include <gtest/gtest.h>
#include <utility>
#include "base/gtest/logging.hh"
#include "base/sat_counter.hh"

Go to the source code of this file.

Functions

 TEST (SatCounterDeathTest, BitCountExceeds)
 Test that an error is triggered when the number of bits exceeds the counter's capacity.
 
 TEST (SatCounterDeathTest, InitialValueExceeds)
 Test that an error is triggered when the initial value is higher than the maximum possible value.
 
 TEST (SatCounterTest, MaximumValue)
 Test if the maximum value is indeed the maximum value reachable.
 
 TEST (SatCounterTest, MinimumValue)
 Test if the minimum value is indeed the mimimum value reachable.
 
 TEST (SatCounterTest, InitialValue)
 Test initializing the counter with a value, updating it and then resetting.
 
 TEST (SatCounterTest, SaturationPercentile)
 Test calculating saturation percentile.
 
 TEST (SatCounterTest, Saturate)
 Test abrupt saturation.
 
 TEST (SatCounterTest, Saturate16)
 
 TEST (SatCounterTest, IntComparison)
 Test back and forth against an int.
 
 TEST (SatCounterTest, Shift)
 Test shift operators.
 
 TEST (SatCounterDeathTest, RightShiftNegative)
 Make sure the counters cannot be right-shifted by negative numbers, since that is undefined behaviour.
 
 TEST (SatCounterDeathTest, LeftShiftNegative)
 Make sure the counters cannot be left-shifted by negative numbers, since that is undefined behaviour.
 
 TEST (SatCounterTest, PrePostOperators)
 Test both pre and post operators.
 
 TEST (SatCounterTest, CopyMove)
 Test copy and move for both constructor and assignment.
 
 TEST (SatCounterTest, AddSubAssignment)
 Test add-assignment and subtract assignment.
 
 TEST (SatCounterTest, NegativeAddSubAssignment)
 Test add-assignment and subtract assignment using negative numbers.
 
 TEST (SatCounterTest, Size16)
 Test max and min when using SatCounter16.
 
 TEST (SatCounterTest, Size32)
 Test max and min when using SatCounter32.
 
 TEST (SatCounterTest, Size64)
 Test max and min when using SatCounter64.
 

Function Documentation

◆ TEST() [1/19]

TEST ( SatCounterDeathTest ,
BitCountExceeds  )

Test that an error is triggered when the number of bits exceeds the counter's capacity.

Definition at line 43 of file sat_counter.test.cc.

References gem5::gtestLogOutput.

◆ TEST() [2/19]

TEST ( SatCounterDeathTest ,
InitialValueExceeds  )

Test that an error is triggered when the initial value is higher than the maximum possible value.

Definition at line 60 of file sat_counter.test.cc.

References gem5::gtestLogOutput.

◆ TEST() [3/19]

TEST ( SatCounterDeathTest ,
LeftShiftNegative  )

Make sure the counters cannot be left-shifted by negative numbers, since that is undefined behaviour.

Definition at line 258 of file sat_counter.test.cc.

◆ TEST() [4/19]

TEST ( SatCounterDeathTest ,
RightShiftNegative  )

Make sure the counters cannot be right-shifted by negative numbers, since that is undefined behaviour.

Definition at line 243 of file sat_counter.test.cc.

◆ TEST() [5/19]

TEST ( SatCounterTest ,
AddSubAssignment  )

Test add-assignment and subtract assignment.

Definition at line 355 of file sat_counter.test.cc.

References gem5::bits().

◆ TEST() [6/19]

TEST ( SatCounterTest ,
CopyMove  )

Test copy and move for both constructor and assignment.

Definition at line 301 of file sat_counter.test.cc.

References gem5::bits(), gem5::ArmISA::i, and gem5::GenericSatCounter< T >::reset().

◆ TEST() [7/19]

TEST ( SatCounterTest ,
InitialValue  )

Test initializing the counter with a value, updating it and then resetting.

Definition at line 107 of file sat_counter.test.cc.

References gem5::bits(), and gem5::GenericSatCounter< T >::reset().

◆ TEST() [8/19]

TEST ( SatCounterTest ,
IntComparison  )

Test back and forth against an int.

Definition at line 169 of file sat_counter.test.cc.

References gem5::bits().

◆ TEST() [9/19]

TEST ( SatCounterTest ,
MaximumValue  )

Test if the maximum value is indeed the maximum value reachable.

Definition at line 76 of file sat_counter.test.cc.

References gem5::bits(), and gem5::ArmISA::i.

◆ TEST() [10/19]

TEST ( SatCounterTest ,
MinimumValue  )

Test if the minimum value is indeed the mimimum value reachable.

Definition at line 92 of file sat_counter.test.cc.

References gem5::bits(), and gem5::ArmISA::i.

◆ TEST() [11/19]

TEST ( SatCounterTest ,
NegativeAddSubAssignment  )

Test add-assignment and subtract assignment using negative numbers.

Definition at line 405 of file sat_counter.test.cc.

References gem5::bits().

◆ TEST() [12/19]

TEST ( SatCounterTest ,
PrePostOperators  )

Test both pre and post operators.

Definition at line 272 of file sat_counter.test.cc.

References gem5::bits(), and gem5::ArmISA::i.

◆ TEST() [13/19]

TEST ( SatCounterTest ,
Saturate  )

◆ TEST() [14/19]

TEST ( SatCounterTest ,
Saturate16  )

◆ TEST() [15/19]

TEST ( SatCounterTest ,
SaturationPercentile  )

Test calculating saturation percentile.

Definition at line 121 of file sat_counter.test.cc.

References gem5::bits(), gem5::GenericSatCounter< T >::calcSaturation(), and gem5::GenericSatCounter< T >::isSaturated().

◆ TEST() [16/19]

TEST ( SatCounterTest ,
Shift  )

Test shift operators.

Definition at line 193 of file sat_counter.test.cc.

References gem5::bits(), and gem5::GenericSatCounter< T >::reset().

◆ TEST() [17/19]

TEST ( SatCounterTest ,
Size16  )

Test max and min when using SatCounter16.

Definition at line 436 of file sat_counter.test.cc.

◆ TEST() [18/19]

TEST ( SatCounterTest ,
Size32  )

Test max and min when using SatCounter32.

Definition at line 468 of file sat_counter.test.cc.

◆ TEST() [19/19]

TEST ( SatCounterTest ,
Size64  )

Test max and min when using SatCounter64.

Definition at line 500 of file sat_counter.test.cc.


Generated on Tue Jun 18 2024 16:24:08 for gem5 by doxygen 1.11.0