32#ifndef _uhal_tests_PerfTester_hpp_
33#define _uhal_tests_PerfTester_hpp_
72 int run (
int argc,
char* argv[] );
101 typedef std::shared_ptr<uhal::ClientInterface>
ClientPtr;
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);
An abstract base class for defining the interface to the various IPbus clients as well as providing t...
A class which wraps a block of data and marks whether or not it is valid.
A class which wraps a single word of data and marks whether or not it is valid.
ValVector< uint32_t > m_valVector
virtual bool check_values()
std::vector< uint32_t > m_expected
virtual bool check_values()
virtual bool check_values()
ValWord< uint32_t > m_valWord
const uint32_t m_expected
const uint32_t m_expected
virtual bool check_values()
ValWord< uint32_t > m_valWord
virtual bool check_values()=0
virtual ~QueuedTransaction()
bool badInput() const
Returns true if the user has entered bad command line arguments.
void sandbox()
An area for a user-definable test.
void outputUserChoices() const
Outputs the user's choices to screen.
void bandwidthTxTest()
Write bandwidth test.
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.
TestFuncMap m_testFuncMap
Maps test name to test function.
std::map< std::string, PtrToTestFunc > TestFuncMap
Typedef for a map that links the name of a test to the function that performs it.
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...
PerfTester()
Constructor - takes no arguments, does nothing.
void outputHelpText(const std::string &argDescriptions) const
Outputs the standard help text to screen.
void buildClients()
Constructs and sets up the appropriate IPbusClient for use in the test.
void bandwidthRxTest()
Read bandwidth test.
bool m_includeConnect
Include (e.g. TCP) connect time in reported bandwidth/latency.
ClientVec m_clients
Vector of low-level uHAL clients.
bool m_perIterationDispatch
Perform a network dispatch every iteration flag.
std::vector< ClientPtr > ClientVec
Typedef for a vector of raw client interfaces.
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.
std::map< std::string, std::string > TestDescMap
Typedef for a map that links the name of a test to its description.
StringVec m_deviceURIs
Vector of individual connection URI strings.
std::vector< std::string > StringVec
A vector of strings.
uint64_t m_iterations
Number of test iterations.
int run(int argc, char *argv[])
Pass in the two command-line parameter variables, this will define the test that then gets run.
std::vector< U32 > U32Vec
A vector of unsigned 32-bit words.
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.
uint32_t U32
An unsigned 32-bit word.
TestDescMap m_testDescMap
Maps test name to test description.
bool buffersEqual(const U32Vec &writeBuffer, const U32ValVec &readBuffer) const
Compares a write buffer with one or more ValVec read responses.
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.
void outputTestDescriptionsList() const
Outputs the test names and descriptions to screen.
void validationTest()
Historic basic firmware/software validation test.
static U32Vec getRandomBuffer(unsigned size)
Returns a buffer of random numbers.
std::string m_testName
Holds the test name.
void outputStandardResults(double totalSeconds) const
Outputs a standard result set to screen - provide it with the number of seconds the test took.
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...
std::shared_ptr< uhal::ClientInterface > ClientPtr
Typedef for a ClientInterface shared_ptr.
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)
boost::uint32_t m_baseAddr
The m_baseAddrStr as converted into an actual unsigned value.
uhal::ValVector< U32 > U32ValVec
A Validated Vector of U32.
bool m_verbose
Verbosity true/false flag.
boost::uint32_t m_bandwidthTestDepth
The depth of read/write used in bandwidth tests.
void(PerfTester::* PtrToTestFunc)()
Function pointer typedef to a test function.
None tests(nox.Session session)