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