|
μHAL (v2.7.9)
Part of the IPbus software repository
|
Go to the documentation of this file.
32 #ifndef _uhal_tests_PerfTester_hpp_
33 #define _uhal_tests_PerfTester_hpp_
72 int run (
int argc,
char* argv[] );
172 static bool runValidationTest(
const std::vector<ClientInterface*>& aClients,
const uint32_t aBaseAddr,
const uint32_t aDepth,
const size_t aNrIterations,
const bool aDispatchEachIteration,
const bool aVerbose);
std::map< std::string, PtrToTestFunc > TestFuncMap
Typedef for a map that links the name of a test to the function that performs it.
A class which wraps a block of data and marks whether or not it is valid.
void outputHelpText(const std::string &argDescriptions) const
Outputs the standard help text to screen.
std::vector< std::string > StringVec
A vector of strings.
boost::uint32_t m_baseAddr
The m_baseAddrStr as converted into an actual unsigned value.
TestDescMap m_testDescMap
Maps test name to test description.
void outputStandardResults(double totalSeconds) const
Outputs a standard result set to screen - provide it with the number of seconds the test took.
static U32Vec getRandomBuffer(unsigned size)
Returns a buffer of random numbers.
virtual bool check_values()
void validationTest()
Historic basic firmware/software validation test.
bool badInput() const
Returns true if the user has entered bad command line arguments.
void(PerfTester::* PtrToTestFunc)()
Function pointer typedef to a test function.
const uint32_t m_expected
bool m_perIterationDispatch
Perform a network dispatch every iteration flag.
QueuedRmwSum(const uint32_t addr, const uint32_t a, const ValWord< uint32_t > &valWord, const uint32_t expected)
std::vector< uint32_t > m_expected
An abstract base class for defining the interface to the various IPbus clients as well as providing t...
ClientVec m_clients
Vector of low-level uHAL clients.
uhal::ValVector< U32 > U32ValVec
A Validated Vector of U32.
static bool runValidationTest(const std::vector< ClientInterface * > &aClients, const uint32_t aBaseAddr, const uint32_t aDepth, const size_t aNrIterations, const bool aDispatchEachIteration, const bool aVerbose)
virtual bool check_values()
std::string m_baseAddrStr
Base addr of reg/ram the test will use. Use a string as workaround for hex input via boost::program_o...
QueuedBlockRead(const uint32_t addr, const ValVector< uint32_t > &valVector, std::vector< uint32_t >::const_iterator expectedValuesIt)
ValVector< uint32_t > m_valVector
void outputTestDescriptionsList() const
Outputs the test names and descriptions to screen.
PerfTester()
Constructor - takes no arguments, does nothing.
static bool validation_test_write_rmwbits_read(uhal::ClientInterface &c, const uint32_t addr, const bool perTransactionDispatch, const bool aVerbose)
Validation test – write, RMW bits, read.
static bool validation_test_block_write_read(uhal::ClientInterface &c, const uint32_t addr, const uint32_t depth, const bool perTransactionDispatch, const bool aVerbose)
Validation test – block write/read-back.
std::vector< U32 > U32Vec
A vector of unsigned 32-bit words.
virtual bool check_values()
QueuedBlockWrite(const uint32_t addr, const uint32_t depth, const ValHeader &valHeader)
std::map< std::string, std::string > TestDescMap
Typedef for a map that links the name of a test to its description.
static bool validation_test_single_write_read(uhal::ClientInterface &c, const uint32_t addr, const bool perTransactionDispatch, const bool aVerbose)
Validation test – single-register write/read-back.
uint64_t m_iterations
Number of test iterations.
static bool validation_test_write_rmwsum_read(uhal::ClientInterface &c, const uint32_t addr, const bool perTransactionDispatch, const bool aVerbose)
Validation test – write, RMW sum, read.
QueuedRmwBits(const uint32_t addr, const uint32_t a, const uint32_t b, const ValWord< uint32_t > &valWord, const uint32_t expected)
boost::shared_ptr< uhal::ClientInterface > ClientPtr
Typedef for a ClientInterface shared_ptr.
void sandbox()
An area for a user-definable test.
TestFuncMap m_testFuncMap
Maps test name to test function.
const uint32_t m_expected
bool m_includeConnect
Include (e.g. TCP) connect time in reported bandwidth/latency.
int run(int argc, char *argv[])
Pass in the two command-line parameter variables, this will define the test that then gets run.
virtual bool check_values()
uint32_t U32
An unsigned 32-bit word.
ValWord< uint32_t > m_valWord
static uint32_t getRandomBlockSize(const uint32_t maxSize)
Returns a random uint32_t in the range [0,maxSize], with 1/x probability distribution – so that p(x=0...
bool m_verbose
Verbosity true/false flag.
boost::uint32_t m_bandwidthTestDepth
The depth of read/write used in bandwidth tests.
ValWord< uint32_t > m_valWord
void outputUserChoices() const
Outputs the user's choices to screen.
void bandwidthRxTest()
Read bandwidth test.
void bandwidthTxTest()
Write bandwidth test.
StringVec m_deviceURIs
Vector of individual connection URI strings.
void buildClients()
Constructs and sets up the appropriate IPbusClient for use in the test.
bool buffersEqual(const U32Vec &writeBuffer, const U32ValVec &readBuffer) const
Compares a write buffer with one or more ValVec read responses.
std::vector< ClientPtr > ClientVec
Typedef for a vector of raw client interfaces.
virtual ~QueuedTransaction()
virtual bool check_values()=0
std::string m_testName
Holds the test name.