46#include <boost/test/unit_test.hpp>
62 uint32_t
x =
static_cast<uint32_t
> ( rand() );
73 uint32_t y =
static_cast<uint32_t
> ( rand() ) & 0xF;
93 const uint32_t N =1024*1024/4;
96 std::vector<uint32_t>
xx;
98 for (
size_t i=0; i!= N; ++i )
100 xx.push_back (
static_cast<uint32_t
> ( rand() ) );
114 std::vector< uint32_t >::const_iterator
j=
xx.begin();
130 uint32_t x1 =
static_cast<uint32_t
> ( rand() );
131 uint32_t x2 =
static_cast<uint32_t
> ( rand() );
132 uint32_t x3 =
static_cast<uint32_t
> ( rand() );
140 if (
hw.
uri().find (
"ipbusudp-1.3://" ) != std::string::npos ||
141 hw.
uri().find (
"ipbustcp-1.3://" ) != std::string::npos ||
142 hw.
uri().find (
"chtcp-1.3://" ) != std::string::npos )
156 const uint32_t N =1024;
160 std::vector<uint32_t>
xx;
164 if (
hw.
uri().find (
"ipbusudp-1.3://" ) != std::string::npos ||
165 hw.
uri().find (
"ipbustcp-1.3://" ) != std::string::npos ||
166 hw.
uri().find (
"chtcp-1.3://" ) != std::string::npos )
175 uint32_t
x ( 0x00000000 );
177 for (
size_t i=0; i!= N; ++i )
182 x =
static_cast<uint32_t
> ( rand() );
186 x =
static_cast<uint32_t
> ( rand() );
197 for (
size_t i=1; i!= N; ++i )
An abstract base class for defining the interface to the various IPbus clients as well as providing t...
ValHeader write(const uint32_t &aAddr, const uint32_t &aValue)
Write a single, unmasked word to a register.
ValHeader writeBlock(const uint32_t &aAddr, const std::vector< uint32_t > &aValues, const defs::BlockReadWriteMode &aMode=defs::INCREMENTAL)
Write a block of data to a block of registers or a block-write port.
void dispatch()
Method to dispatch all queued transactions, and wait until all corresponding responses have been rece...
ValWord< uint32_t > rmw_bits(const uint32_t &aAddr, const uint32_t &aANDterm, const uint32_t &aORterm)
Read the value of a register, apply the AND-term, apply the OR-term, set the register to this new val...
ValWord< uint32_t > rmw_sum(const uint32_t &aAddr, const int32_t &aAddend)
Read the value of a register, add the addend, set the register to this new value and return a copy of...
ValVector< uint32_t > readBlock(const uint32_t &aAddr, const uint32_t &aSize, const defs::BlockReadWriteMode &aMode=defs::INCREMENTAL)
Read a block of unsigned data from a block of registers or a block-read port.
ValWord< uint32_t > read(const uint32_t &aAddr)
Read a single, unmasked, unsigned word.
A class which bundles a node tree and an IPbus client interface together providing everything you nee...
const Node & getNode() const
Retrieve the top-level node.
ClientInterface & getClient()
Get the underlying IPbus client.
const std::string & uri() const
Return the url of the target for this client.
const uint32_t & getAddress() const
Return the register address with which this node is associated.
const_iterator begin() const
If the memory has previously been marked as valid, return a const iterator to the beginning of the un...
bool valid()
Return whether the Validated memory is marked as valid.
const T & at(std::size_t aIndex) const
If the memory has previously been marked as valid, give random access into memory.
const_iterator end() const
If the memory has previously been marked as valid, return a const iterator to the end (one past last ...
std::size_t size() const
Return the size of the underlying memory.
T value() const
Return the value of the validated memory with check on validity.
bool valid()
Return whether the Validated memory is marked as valid.
None tests(nox.Session session)
BOOST_CHECK_THROW(hw.getNode("REG").writeBlockOffset(xx, 0), uhal::exception::BulkTransferOffsetRequestedForSingleRegister)
BOOST_CHECK_EQUAL(mem.size(), N)
std::vector< uint32_t >::const_iterator j
ValVector< uint32_t > mem
BOOST_CHECK(!mem.valid())
std::vector< uint32_t > xx
bool correct_block_write_read
#define UHAL_TESTS_DEFINE_CLIENT_TEST_CASES(test_suite_name, test_case_name, test_fixture, test_case_contents)