Classes | |
| struct | AbstractFixture |
| class | DummyChildNode |
| Class further derived from Level1. More... | |
| class | DummyHardware |
| Abstract base class to emulate IPbus hardware. More... | |
| struct | DummyHardwareFixture |
| class | DummyHardwareInterface |
| Common abstract base class for IPbus 1.3 and 2.0 dummy hardware. More... | |
| struct | DummyHardwareOptions |
| Struct to store the dummy hardware command line options. More... | |
| class | DummyHardwareRunner |
| class | DummyParentNode |
| struct | MinimalFixture |
| struct | MinimalFixture< IPBUS_2_0_PCIE > |
| class | PCIeDummyHardware |
| class | PerfTester |
| class | TCPDummyHardware |
| Concrete implementation of emulator of hardware using TCP. More... | |
| class | Timer |
| A very simple timer. More... | |
| class | UDPDummyHardware |
| Concrete implementation of emulator of hardware using UDP. More... | |
Typedefs | |
| typedef boost::unordered_map< std::string, std::string > | UnorderedStringMap_t |
Enumerations | |
| enum | DeviceType { IPBUS_1_3_UDP, IPBUS_1_3_TCP, IPBUS_1_3_CONTROLHUB, IPBUS_2_0_UDP, IPBUS_2_0_TCP, IPBUS_2_0_CONTROLHUB, IPBUS_2_0_PCIE } |
Functions | |
| double | measureReadLatency (ClientInterface &aClient, uint32_t aBaseAddr, uint32_t aDepth, size_t aNrIterations, bool aDispatchEachIteration, bool aVerbose) |
| double | measureReadLatency (const std::vector< ClientInterface *> &aClients, uint32_t aBaseAddr, uint32_t aDepth, size_t aNrIterations, bool aDispatchEachIteration, bool aVerbose) |
| double | measureWriteLatency (ClientInterface &aClient, uint32_t aBaseAddr, uint32_t aDepth, size_t aNrIterations, bool aDispatchEachIteration, bool aVerbose) |
| double | measureWriteLatency (const std::vector< ClientInterface *> &aClients, uint32_t aBaseAddr, uint32_t aDepth, size_t aNrIterations, bool aDispatchEachIteration, bool aVerbose) |
| double | measureFileReadLatency (const std::string &aFilePath, uint32_t aBaseAddr, uint32_t aDepth, size_t aNrIterations, bool aVerbose) |
| double | measureFileWriteLatency (const std::string &aFilePath, uint32_t aBaseAddr, uint32_t aDepth, size_t aNrIterations, bool aVerbose) |
| std::vector< size_t > | getBlockUnitTestDepths () |
| UHAL_TESTS_DEFINE_CLIENT_TEST_CASES (BlockReadWriteTestSuite, block_write_read, DummyHardwareFixture, { std::vector< size_t > lDepths=getBlockUnitTestDepths();for(size_t i=0;i< lDepths.size();i++) { const size_t N=lDepths.at(i);BOOST_TEST_MESSAGE(" N = "<< N);HwInterface hw=getHwInterface();std::vector< uint32_t > xx;xx.reserve(N);for(size_t i=0;i!=N;++i) { xx.push_back(static_cast< uint32_t >(rand()));} hw.getNode("LARGE_MEM").writeBlock(xx);ValVector< uint32_t > mem=hw.getNode("LARGE_MEM").readBlock(N);BOOST_CHECK(!mem.valid());BOOST_CHECK_EQUAL(mem.size(), N);if(N > 0) { BOOST_CHECK_THROW(mem.at(0), uhal::exception::NonValidatedMemory);} BOOST_CHECK_THROW(mem.value(), uhal::exception::NonValidatedMemory);BOOST_CHECK_NO_THROW(hw.dispatch());BOOST_CHECK(mem.valid());BOOST_CHECK_EQUAL(mem.size(), N);if(N< N_10MB) { bool correct_block_write_read=true;std::vector< uint32_t >::const_iterator j=xx.begin();for(ValVector< uint32_t >::const_iterator i(mem.begin());i!=mem.end();++i,++j) { correct_block_write_read=correct_block_write_read &&(*i== *j);} BOOST_CHECK(correct_block_write_read);} } }) UHAL_TESTS_DEFINE_CLIENT_TEST_CASES(BlockReadWriteTestSuite | |
| lDepths | push_back (N_200MB) |
| for (size_t i=0;i< lDepths.size();i++) | |
| UHAL_TESTS_DEFINE_CLIENT_TEST_CASES (BlockReadWriteTestSuite, block_offset_write_read, DummyHardwareFixture, { std::vector< size_t > lDepths=getBlockUnitTestDepths();for(size_t i=0;i< lDepths.size();i++) { const size_t N=lDepths.at(i);BOOST_TEST_MESSAGE(" N = "<< N);HwInterface hw=getHwInterface();std::vector< uint32_t > xx;xx.reserve(N);std::vector< uint32_t > yy;yy.reserve(N);for(size_t i=0;i!=N;++i) { xx.push_back(static_cast< uint32_t >(rand()));yy.push_back(static_cast< uint32_t >(rand()));} hw.getNode("LARGE_MEM").writeBlockOffset(xx, 0);ValVector< uint32_t > mem=hw.getNode("LARGE_MEM").readBlockOffset(N, 0);BOOST_CHECK(!mem.valid());BOOST_CHECK_EQUAL(mem.size(), N);if(N > 0) { BOOST_CHECK_THROW(mem.at(0), uhal::exception::NonValidatedMemory);} BOOST_CHECK_THROW(mem.value(), uhal::exception::NonValidatedMemory);hw.getNode("LARGE_MEM").writeBlockOffset(yy, N);ValVector< uint32_t > mem2=hw.getNode("LARGE_MEM").readBlockOffset(N, N);BOOST_CHECK(!mem2.valid());BOOST_CHECK_EQUAL(mem2.size(), N);if(N > 0) { BOOST_CHECK_THROW(mem2.at(0), uhal::exception::NonValidatedMemory);} BOOST_CHECK_THROW(mem2.value(), uhal::exception::NonValidatedMemory);BOOST_CHECK_NO_THROW(hw.dispatch());BOOST_CHECK(mem.valid());BOOST_CHECK_EQUAL(mem.size(), N);BOOST_CHECK(mem2.valid());BOOST_CHECK_EQUAL(mem2.size(), N);if(N< N_10MB) { bool correct_block_write_read=true;std::vector< uint32_t >::const_iterator j=xx.begin();for(ValVector< uint32_t >::const_iterator i(mem.begin());i!=mem.end();++i,++j) { correct_block_write_read=correct_block_write_read &&(*i== *j);} j=yy.begin();for(ValVector< uint32_t >::const_iterator i(mem2.begin());i!=mem2.end();++i,++j) { correct_block_write_read=correct_block_write_read &&(*i== *j);} BOOST_CHECK(correct_block_write_read);} } }) UHAL_TESTS_DEFINE_CLIENT_TEST_CASES(BlockReadWriteTestSuite | |
| xx | resize (N_4B) |
| BOOST_CHECK_NO_THROW (hw.getNode("REG").writeBlock(xx)) | |
| BOOST_CHECK_NO_THROW (ValVector< uint32_t > mem=hw.getNode("REG").readBlock(N_4B)) | |
| BOOST_CHECK_THROW (hw.getNode("REG").writeBlockOffset(xx, 0), uhal::exception::BulkTransferOffsetRequestedForSingleRegister) | |
| BOOST_CHECK_THROW (ValVector< uint32_t > mem=hw.getNode("REG").readBlockOffset(N_1kB, 0), uhal::exception::BulkTransferOffsetRequestedForSingleRegister) | |
| xx | resize (N_1kB) |
| BOOST_CHECK_THROW (hw.getNode("REG").writeBlock(xx), uhal::exception::BulkTransferOnSingleRegister) | |
| BOOST_CHECK_THROW (ValVector< uint32_t > mem=hw.getNode("REG").readBlock(N_1kB), uhal::exception::BulkTransferOnSingleRegister) | |
| BOOST_CHECK_THROW (hw.getNode("FIFO").writeBlockOffset(xx, 1), uhal::exception::BulkTransferOffsetRequestedForFifo) | |
| BOOST_CHECK_THROW (ValVector< uint32_t > mem=hw.getNode("FIFO").readBlockOffset(N_1kB, 1), uhal::exception::BulkTransferOffsetRequestedForFifo) | |
| UHAL_TESTS_DEFINE_CLIENT_TEST_CASES (BlockReadWriteTestSuite, block_bigger_than_size_attribute, MinimalFixture, { HwInterface hw=getHwInterface();std::vector< uint32_t > xx;xx.resize(N_1MB);BOOST_CHECK_THROW(hw.getNode("SMALL_MEM").writeBlock(xx), uhal::exception::BulkTransferRequestedTooLarge);BOOST_CHECK_THROW(ValVector< uint32_t > mem=hw.getNode("SMALL_MEM").readBlock(N_1MB), uhal::exception::BulkTransferRequestedTooLarge);}) UHAL_TESTS_DEFINE_CLIENT_TEST_CASES(BlockReadWriteTestSuite | |
| BOOST_CHECK_THROW (hw.getNode("SMALL_MEM").writeBlockOffset(xx, 256), uhal::exception::BulkTransferRequestedTooLarge) | |
| BOOST_CHECK_THROW (ValVector< uint32_t > mem=hw.getNode("SMALL_MEM").readBlockOffset(N_4B, 256), uhal::exception::BulkTransferRequestedTooLarge) | |
| BOOST_CHECK_THROW (hw.getNode("SMALL_MEM").writeBlockOffset(xx, 1), uhal::exception::BulkTransferRequestedTooLarge) | |
| UHAL_TESTS_DEFINE_CLIENT_TEST_CASES (ConfigSpaceTestSuite, read_fullWord, DummyHardwareFixture, { HwInterface hw=getHwInterface();IPbusCore &client=dynamic_cast< IPbusCore &>(hw.getClient());for(size_t i=0;i< 10;i++) { const uint32_t expectedValue=uint16_t(getpid())<< 16|i;switch(deviceType) { case IPBUS_1_3_UDP :case IPBUS_1_3_TCP :case IPBUS_1_3_CONTROLHUB :BOOST_CHECK_THROW(client.readConfigurationSpace(i), exception::ValidationError);break;default:ValWord< uint32_t > x=client.readConfigurationSpace(i);client.dispatch();BOOST_CHECK_EQUAL(x.value(), expectedValue);} } }) UHAL_TESTS_DEFINE_CLIENT_TEST_CASES(ConfigSpaceTestSuite | |
| UHAL_TESTS_DEFINE_CLIENT_TEST_CASES (EmptyDispatchTestSuite, empty_dispatch, MinimalFixture, { HwInterface hw=getHwInterface();BOOST_CHECK_NO_THROW(hw.dispatch());}) UHAL_TESTS_DEFINE_CLIENT_TEST_CASES(EmptyDispatchTestSuite | |
| BOOST_CHECK_NO_THROW (ValWord< uint32_t > r=hw.getNode("REG").read()) | |
| BOOST_CHECK_NO_THROW (hw.dispatch()) | |
| void | job_multiple (const std::string &connection, const std::string &id) |
| UHAL_TESTS_DEFINE_CLIENT_TEST_CASES (MultithreadedTestSuite, multiple_hwinterfaces, DummyHardwareFixture, { if(deviceType !=IPBUS_2_0_PCIE) { std::vector< boost::thread *> jobs;for(size_t i=0;i!=N_THREADS;++i) { log(Warning(), ThisLocation(), ":", Integer(i));jobs.push_back(new boost::thread(job_multiple, connectionFileURI, deviceId));} for(size_t i=0;i!=N_THREADS;++i) { log(Warning(), ThisLocation(), ":", Integer(i));jobs[i]->join();delete jobs[i];} log(Warning(), ThisLocation());} else std::cout<< " ** Skipping multiple HwInterface test for PCIe **"<< std::endl;}) void job_single(HwInterface &hw) | |
| UHAL_TESTS_DEFINE_CLIENT_TEST_CASES (MultithreadedTestSuite, single_hwinterface, DummyHardwareFixture, { for(size_t iter=0;iter!=N_ITERATIONS ;++iter) { HwInterface hw=getHwInterface();std::vector< boost::thread *> jobs;for(size_t i=0;i!=N_THREADS;++i) { jobs.push_back(new boost::thread(job_single, hw));} for(size_t i=0;i!=N_THREADS;++i) { jobs[i]->join();delete jobs[i];} } }) void job_single_copied(HwInterface hw) | |
| void | iteration (const uhal::Node &parentNode) |
| UHAL_TESTS_DEFINE_CLIENT_TEST_CASES (NodeNavigationTestSuite, navigation_and_traversal, MinimalFixture, { HwInterface hw=getHwInterface();std::vector< std::string > ids=hw.getNodes();BOOST_CHECK(std::find(ids.begin(), ids.end(),"REG") !=ids.end());BOOST_CHECK(std::find(ids.begin(), ids.end(),"MEM") !=ids.end());BOOST_CHECK(std::find(ids.begin(), ids.end(),"SUBSYSTEM1.REG") !=ids.end());BOOST_CHECK(std::find(ids.begin(), ids.end(),"SUBSYSTEM1.MEM") !=ids.end());BOOST_CHECK(std::find(ids.begin(), ids.end(),"SUBSYSTEM1.SUBMODULE.REG") !=ids.end());BOOST_CHECK(std::find(ids.begin(), ids.end(),"SUBSYSTEM1.SUBMODULE.MEM") !=ids.end());BOOST_CHECK(std::find(ids.begin(), ids.end(),"SUBSYSTEM2.REG") !=ids.end());BOOST_CHECK(std::find(ids.begin(), ids.end(),"SUBSYSTEM2.MEM") !=ids.end());BOOST_CHECK(std::find(ids.begin(), ids.end(),"SUBSYSTEM2.SUBMODULE.REG") !=ids.end());BOOST_CHECK(std::find(ids.begin(), ids.end(),"SUBSYSTEM2.SUBMODULE.MEM") !=ids.end());ids=hw.getNodes(".*MEM.*");BOOST_CHECK(std::find(ids.begin(), ids.end(),"MEM") !=ids.end());BOOST_CHECK(std::find(ids.begin(), ids.end(),"LARGE_MEM") !=ids.end());BOOST_CHECK(std::find(ids.begin(), ids.end(),"SMALL_MEM") !=ids.end());BOOST_CHECK(std::find(ids.begin(), ids.end(),"SUBSYSTEM1.MEM") !=ids.end());BOOST_CHECK(std::find(ids.begin(), ids.end(),"SUBSYSTEM2.MEM") !=ids.end());BOOST_CHECK(std::find(ids.begin(), ids.end(),"SUBSYSTEM1.SUBMODULE.MEM") !=ids.end());BOOST_CHECK(std::find(ids.begin(), ids.end(),"SUBSYSTEM2.SUBMODULE.MEM") !=ids.end());ids=hw.getNode("SUBSYSTEM1").getNodes();BOOST_CHECK(std::find(ids.begin(), ids.end(),"REG") !=ids.end());BOOST_CHECK(std::find(ids.begin(), ids.end(),"MEM") !=ids.end());BOOST_CHECK(std::find(ids.begin(), ids.end(),"SUBMODULE.REG") !=ids.end());BOOST_CHECK(std::find(ids.begin(), ids.end(),"SUBMODULE.MEM") !=ids.end());BOOST_CHECK_NO_THROW(iteration(hw.getNode()));BOOST_CHECK_NO_THROW(iteration(hw.getNode("SUBSYSTEM1")));}) UHAL_TESTS_DEFINE_CLIENT_TEST_CASES(NodeNavigationTestSuite | |
| BOOST_CHECK_EQUAL (hw.getNode("SUBSYSTEM1.SUBMODULE.REG").getAddress(), hw.getNode("SUBSYSTEM1").getNode("SUBMODULE").getNode("REG").getAddress()) | |
| BOOST_CHECK_EQUAL (hw.getNode("SUBSYSTEM1.SUBMODULE.REG").getMask(), hw.getNode("SUBSYSTEM1").getNode("SUBMODULE").getNode("REG").getMask()) | |
| BOOST_CHECK_EQUAL (hw.getNode("SUBSYSTEM1.SUBMODULE.REG").getId(), hw.getNode("SUBSYSTEM1").getNode("SUBMODULE").getNode("REG").getId()) | |
| BOOST_CHECK_EQUAL (hw.getNode("SUBSYSTEM1.SUBMODULE.REG").getTags(), hw.getNode("SUBSYSTEM1").getNode("SUBMODULE").getNode("REG").getTags()) | |
| BOOST_CHECK_EQUAL (hw.getNode("SUBSYSTEM1.SUBMODULE.MEM").getMode(), hw.getNode("SUBSYSTEM1").getNode("SUBMODULE").getNode("MEM").getMode()) | |
| BOOST_CHECK_EQUAL (hw.getNode("SUBSYSTEM1.SUBMODULE.MEM").getSize(), hw.getNode("SUBSYSTEM1").getNode("SUBMODULE").getNode("MEM").getSize()) | |
| hw | getNode ("SUBSYSTEM1.SUBMODULE.REG").write(x) |
| hw | dispatch () |
| BOOST_CHECK_EQUAL (reg.value(), x) | |
| UHAL_TESTS_DEFINE_CLIENT_TEST_CASES (NonreachableTestSuite, check_nonreachable_device, MinimalFixture, { for(size_t i=0;i< 10;i++) { HwInterface hw=getHwInterface();if((hw.uri().find("ipbustcp") !=std::string::npos)||(hw.uri().find("ipbuspcie") !=std::string::npos)) { BOOST_CHECK_THROW({ hw.getNode("REG").read();hw.dispatch();}, uhal::exception::TransportLayerError);} else { BOOST_CHECK_THROW({ hw.getNode("REG").read();hw.dispatch();}, uhal::exception::ClientTimeout);} } }) HwInterface getHwWithModifiedControlHubPort(const std | |
| UHAL_TESTS_DEFINE_CLIENT_TEST_CASES (RawClientTestSuite, single_write_read, DummyHardwareFixture, { HwInterface hw=getHwInterface();ClientInterface *c=&hw.getClient();uint32_t x=static_cast< uint32_t >(rand());uint32_t addr=hw.getNode("REG").getAddress();c->write(addr, x);ValWord< uint32_t > reg=c->read(addr);BOOST_CHECK(!reg.valid());BOOST_CHECK_THROW(reg.value(), uhal::exception::NonValidatedMemory);c->dispatch();BOOST_CHECK(reg.valid());BOOST_CHECK_EQUAL(reg.value(), x);BOOST_CHECK_THROW(c->write(addr, 0xF0000000, 0xF0), uhal::exception::BitsSetWhichAreForbiddenByBitMask);BOOST_CHECK_THROW(c->write(addr, 0xFF, 0x0F), uhal::exception::BitsSetWhichAreForbiddenByBitMask);uint32_t y=static_cast< uint32_t >(rand()) &0xF;c->write(addr, y, 0xF);ValWord< uint32_t > reg2=c->read(addr);BOOST_CHECK(!reg2.valid());BOOST_CHECK_THROW(reg2.value(), uhal::exception::NonValidatedMemory);c->dispatch();BOOST_CHECK(reg2.valid());BOOST_CHECK_EQUAL(reg2.value(),((x &~0xF)|y));ValWord< uint32_t > reg3=c->read(addr, 0xF);BOOST_CHECK(!reg3.valid());BOOST_CHECK_THROW(reg3.value(), uhal::exception::NonValidatedMemory);c->dispatch();BOOST_CHECK(reg3.valid());BOOST_CHECK_EQUAL(reg3.value(), y);}) UHAL_TESTS_DEFINE_CLIENT_TEST_CASES(RawClientTestSuite | |
| for (size_t i=0;i!=N;++i) | |
| c | writeBlock (addr, xx) |
| BOOST_CHECK (!mem.valid()) | |
| BOOST_CHECK_EQUAL (mem.size(), N) | |
| BOOST_CHECK_THROW (mem.at(0), uhal::exception::NonValidatedMemory) | |
| BOOST_CHECK (mem.valid()) | |
| for (ValVector< uint32_t >::const_iterator i(mem.begin());i!=mem.end();++i,++j) | |
| BOOST_CHECK (correct_block_write_read) | |
| UHAL_TESTS_DEFINE_CLIENT_TEST_CASES (RawClientTestSuite, mem_rmw_bits, DummyHardwareFixture, { HwInterface hw=getHwInterface();ClientInterface *c=&hw.getClient();uint32_t addr=hw.getNode("REG_UPPER_MASK").getAddress();uint32_t x1=static_cast< uint32_t >(rand());uint32_t x2=static_cast< uint32_t >(rand());uint32_t x3=static_cast< uint32_t >(rand());c->write(addr, x1);ValWord< uint32_t > reg1=c->rmw_bits(addr, x2, x3);ValWord< uint32_t > reg2=c->read(addr);c->dispatch();BOOST_CHECK_EQUAL(((x1 &x2)|x3), reg2.value());if(hw.uri().find("ipbusudp-1.3://") !=std::string::npos||hw.uri().find("ipbustcp-1.3://") !=std::string::npos||hw.uri().find("chtcp-1.3://") !=std::string::npos) { BOOST_CHECK_EQUAL(reg1.value(),((x1 &x2)|x3));} else { BOOST_CHECK_EQUAL(reg1.value(), x1);} }) UHAL_TESTS_DEFINE_CLIENT_TEST_CASES(RawClientTestSuite | |
| if (hw.uri().find("ipbusudp-1.3://") !=std::string::npos||hw.uri().find("ipbustcp-1.3://") !=std::string::npos||hw.uri().find("chtcp-1.3://") !=std::string::npos) | |
| uint32_t | x (0x00000000) |
| c | write (addr, xx[0]) |
| BOOST_CHECK_EQUAL (reg.value(), total) | |
| UHAL_TESTS_DEFINE_CLIENT_TEST_CASES (SingleReadWriteTestSuite, connect_write_read, DummyHardwareFixture, { HwInterface hw=getHwInterface();uint32_t x1=static_cast< uint32_t >(rand());uint32_t x2=static_cast< uint32_t >(rand());hw.getNode("SUBSYSTEM1.REG").write(x1);hw.getNode("SUBSYSTEM2.REG").write(x2);ValWord< uint32_t > mem1=hw.getNode("SUBSYSTEM1.REG").read();ValWord< uint32_t > mem2=hw.getNode("SUBSYSTEM2.REG").read();BOOST_CHECK(!mem1.valid());BOOST_CHECK(!mem2.valid());BOOST_CHECK_THROW(mem1.value(), uhal::exception::NonValidatedMemory);BOOST_CHECK_THROW(mem2.value(), uhal::exception::NonValidatedMemory);BOOST_CHECK_NO_THROW(hw.dispatch());BOOST_CHECK(mem1.valid());BOOST_CHECK_EQUAL(mem1.value(), x1);BOOST_CHECK_EQUAL(mem2.value(), x2);}) UHAL_TESTS_DEFINE_CLIENT_TEST_CASES(SingleReadWriteTestSuite | |
| boost::filesystem::path | fn ("dummy_address.xml") |
| hw | getNode ("REG").write(x) |
| BOOST_CHECK_THROW (mem.value(), uhal::exception::NonValidatedMemory) | |
| BOOST_CHECK_EQUAL (mem.value(), x) | |
| void | report_rx_performance (ClientInterface &aClient, const uint32_t aBaseAddr, const uint32_t aDepth, const size_t aNrIterations, const bool aDispatchEachIteration) |
| void | report_tx_performance (ClientInterface &aClient, const uint32_t aBaseAddr, const uint32_t aDepth, const size_t aNrIterations, const bool aDispatchEachIteration) |
| UHAL_TESTS_DEFINE_CLIENT_TEST_CASES (SoakTestSuite, bandwidth_rx, DummyHardwareFixture, { HwInterface hw=getHwInterface();BOOST_CHECK_NO_THROW(report_rx_performance(hw.getClient(), 0x01, 1, 100, true));BOOST_CHECK_NO_THROW(report_rx_performance(hw.getClient(), 0x01, 262144, 100, true));}) UHAL_TESTS_DEFINE_CLIENT_TEST_CASES(SoakTestSuite | |
| BOOST_CHECK_NO_THROW (report_tx_performance(hw.getClient(), 0x01, 1, 100, true)) | |
| BOOST_CHECK_NO_THROW (report_tx_performance(hw.getClient(), 0x01, 262144, 100, true)) | |
| URI | parseURI (const std::string &aUri) |
| BOOST_AUTO_TEST_CASE (udp) | |
| BOOST_AUTO_TEST_CASE (controlhub) | |
| BOOST_AUTO_TEST_CASE (pcie) | |
Variables | |
| static const uint32_t | ADDRESSMASK = 0x00FFFFFF |
| The mask for the address space (size of the address space in one larger than this) More... | |
| static const uint32_t | REPLY_HISTORY_DEPTH = 5 |
| The size of the reply history for IPbus 2.0. More... | |
| static const uint32_t | BUFFER_SIZE = 100000 |
| Size of the receive and reply buffers. More... | |
| fifo_write_read | |
| DummyHardwareFixture | |
| block_access_type_violations | |
| std::vector< uint32_t > | xx |
| block_offset_bigger_than_size_attribute | |
| MinimalFixture | |
| read_masked | |
| IPbusCore & | client = dynamic_cast<IPbusCore&>(hw.getClient()) |
| empty_dispatch_after_read | |
| write_read | |
| uint32_t | x = static_cast<uint32_t> ( rand() ) |
| ValWord< uint32_t > | reg = hw.getNode ( "SUBSYSTEM1" ).getNode ( "SUBMODULE" ).getNode ( "REG" ).read() |
| mem_write_read | |
| HwInterface | hw = getHwInterface() |
| ClientInterface * | c = &hw.getClient() |
| uint32_t | addr = hw.getNode ( "MEM" ).getAddress() |
| ValVector< uint32_t > | mem = c->readBlock ( addr, N ) |
| bool | correct_block_write_read = true |
| std::vector< uint32_t >::const_iterator | j =xx.begin() |
| mem_rmw_sum | |
| uint32_t | total = 0 |
| bool | IPbus1_3 |
| else | |
| on_the_fly_connect_write_read | |
| address_file = ( conn_fn.parent_path() /fn ).string() | |
| std::string | uri = getHwInterface().uri() |
| bandwidth_tx | |
| typedef boost::unordered_map<std::string, std::string> uhal::tests::UnorderedStringMap_t |
Definition at line 51 of file test_metainfo.cpp.
| Enumerator | |
|---|---|
| IPBUS_1_3_UDP | |
| IPBUS_1_3_TCP | |
| IPBUS_1_3_CONTROLHUB | |
| IPBUS_2_0_UDP | |
| IPBUS_2_0_TCP | |
| IPBUS_2_0_CONTROLHUB | |
| IPBUS_2_0_PCIE | |
Definition at line 39 of file definitions.hpp.
| uhal::tests::BOOST_AUTO_TEST_CASE | ( | udp | ) |
Definition at line 55 of file test_uri.cpp.
References BOOST_CHECK(), BOOST_CHECK_EQUAL(), uhal::URI::mArguments, uhal::URI::mExtension, uhal::URI::mHostname, uhal::URI::mPath, uhal::URI::mPort, uhal::URI::mProtocol, and parseURI().
| uhal::tests::BOOST_AUTO_TEST_CASE | ( | controlhub | ) |
Definition at line 67 of file test_uri.cpp.
References BOOST_CHECK_EQUAL(), uhal::URI::mArguments, uhal::URI::mExtension, uhal::URI::mHostname, uhal::URI::mPath, uhal::URI::mPort, uhal::URI::mProtocol, and parseURI().
| uhal::tests::BOOST_AUTO_TEST_CASE | ( | pcie | ) |
Definition at line 81 of file test_uri.cpp.
References BOOST_CHECK(), BOOST_CHECK_EQUAL(), uhal::URI::mArguments, uhal::URI::mExtension, uhal::URI::mHostname, uhal::URI::mPath, uhal::URI::mPort, uhal::URI::mProtocol, and parseURI().
| uhal::tests::BOOST_CHECK | ( | !mem. | valid() | ) |
Referenced by BOOST_AUTO_TEST_CASE(), for(), getBlockUnitTestDepths(), iteration(), job_multiple(), and UHAL_TESTS_DEFINE_CLIENT_TEST_CASES().
| uhal::tests::BOOST_CHECK | ( | mem. | valid() | ) |
| uhal::tests::BOOST_CHECK | ( | correct_block_write_read | ) |
| uhal::tests::BOOST_CHECK_EQUAL | ( | mem. | value(), |
| x | |||
| ) |
| uhal::tests::BOOST_CHECK_EQUAL | ( | hw. | getNode"SUBSYSTEM1.SUBMODULE.REG").getAddress(, |
| hw. | getNode"SUBSYSTEM1").getNode("SUBMODULE").getNode("REG").getAddress( | ||
| ) |
Referenced by BOOST_AUTO_TEST_CASE(), for(), getBlockUnitTestDepths(), job_multiple(), and UHAL_TESTS_DEFINE_CLIENT_TEST_CASES().
| uhal::tests::BOOST_CHECK_EQUAL | ( | mem. | size(), |
| N | |||
| ) |
| uhal::tests::BOOST_CHECK_EQUAL | ( | hw. | getNode"SUBSYSTEM1.SUBMODULE.REG").getMask(, |
| hw. | getNode"SUBSYSTEM1").getNode("SUBMODULE").getNode("REG").getMask( | ||
| ) |
| uhal::tests::BOOST_CHECK_EQUAL | ( | hw. | getNode"SUBSYSTEM1.SUBMODULE.REG").getId(, |
| hw. | getNode"SUBSYSTEM1").getNode("SUBMODULE").getNode("REG").getId( | ||
| ) |
| uhal::tests::BOOST_CHECK_EQUAL | ( | hw. | getNode"SUBSYSTEM1.SUBMODULE.REG").getTags(, |
| hw. | getNode"SUBSYSTEM1").getNode("SUBMODULE").getNode("REG").getTags( | ||
| ) |
| uhal::tests::BOOST_CHECK_EQUAL | ( | hw. | getNode"SUBSYSTEM1.SUBMODULE.MEM").getMode(, |
| hw. | getNode"SUBSYSTEM1").getNode("SUBMODULE").getNode("MEM").getMode( | ||
| ) |
| uhal::tests::BOOST_CHECK_EQUAL | ( | hw. | getNode"SUBSYSTEM1.SUBMODULE.MEM").getSize(, |
| hw. | getNode"SUBSYSTEM1").getNode("SUBMODULE").getNode("MEM").getSize( | ||
| ) |
| uhal::tests::BOOST_CHECK_EQUAL | ( | reg. | value(), |
| x | |||
| ) |
| uhal::tests::BOOST_CHECK_EQUAL | ( | reg. | value(), |
| total | |||
| ) |
| uhal::tests::BOOST_CHECK_NO_THROW | ( | ValWord< uint32_t > | r = hw.getNode("REG").read() | ) |
| uhal::tests::BOOST_CHECK_NO_THROW | ( | hw. | dispatch() | ) |
| uhal::tests::BOOST_CHECK_NO_THROW | ( | report_tx_performance(hw.getClient(), 0x01, 1, 100, true) | ) |
| uhal::tests::BOOST_CHECK_NO_THROW | ( | report_tx_performance(hw.getClient(), 0x01, 262144, 100, true) | ) |
| uhal::tests::BOOST_CHECK_NO_THROW | ( | hw. | getNode"REG").writeBlock(xx | ) |
Referenced by for(), getBlockUnitTestDepths(), iteration(), job_multiple(), report_tx_performance(), and UHAL_TESTS_DEFINE_CLIENT_TEST_CASES().
| uhal::tests::BOOST_CHECK_THROW | ( | mem. | value(), |
| uhal::exception::NonValidatedMemory | |||
| ) |
| uhal::tests::BOOST_CHECK_THROW | ( | mem. | at0, |
| uhal::exception::NonValidatedMemory | |||
| ) |
| uhal::tests::BOOST_CHECK_THROW | ( | hw. | getNode"REG").writeBlockOffset(xx, 0, |
| uhal::exception::BulkTransferOffsetRequestedForSingleRegister | |||
| ) |
Referenced by for(), getBlockUnitTestDepths(), and UHAL_TESTS_DEFINE_CLIENT_TEST_CASES().
| uhal::tests::BOOST_CHECK_THROW | ( | ValVector< uint32_t > | mem = hw.getNode("REG").readBlockOffset(N_1kB, 0), |
| uhal::exception::BulkTransferOffsetRequestedForSingleRegister | |||
| ) |
| uhal::tests::BOOST_CHECK_THROW | ( | hw. | getNode"REG").writeBlock(xx, |
| uhal::exception::BulkTransferOnSingleRegister | |||
| ) |
| uhal::tests::BOOST_CHECK_THROW | ( | ValVector< uint32_t > | mem = hw.getNode("REG").readBlock(N_1kB), |
| uhal::exception::BulkTransferOnSingleRegister | |||
| ) |
| uhal::tests::BOOST_CHECK_THROW | ( | hw. | getNode"FIFO").writeBlockOffset(xx, 1, |
| uhal::exception::BulkTransferOffsetRequestedForFifo | |||
| ) |
| uhal::tests::BOOST_CHECK_THROW | ( | ValVector< uint32_t > | mem = hw.getNode("FIFO").readBlockOffset(N_1kB, 1), |
| uhal::exception::BulkTransferOffsetRequestedForFifo | |||
| ) |
| uhal::tests::BOOST_CHECK_THROW | ( | hw. | getNode"SMALL_MEM").writeBlockOffset(xx, 256, |
| uhal::exception::BulkTransferRequestedTooLarge | |||
| ) |
| uhal::tests::BOOST_CHECK_THROW | ( | ValVector< uint32_t > | mem = hw.getNode("SMALL_MEM").readBlockOffset(N_4B, 256), |
| uhal::exception::BulkTransferRequestedTooLarge | |||
| ) |
| uhal::tests::BOOST_CHECK_THROW | ( | hw. | getNode"SMALL_MEM").writeBlockOffset(xx, 1, |
| uhal::exception::BulkTransferRequestedTooLarge | |||
| ) |
| c uhal::tests::dispatch | ( | ) |
| boost::filesystem::path uhal::tests::fn | ( | "dummy_address.xml" | ) |
| uhal::tests::for | ( | size_t | i = 0; i!= N; ++i | ) |
Definition at line 97 of file test_rawclient.cpp.
| uhal::tests::for | ( | ValVector< uint32_t >::const_iterator i(mem.begin());i! | = mem.end(); ++i, |
| ++ | j | ||
| ) |
Definition at line 114 of file test_rawclient.cpp.
References BOOST_CHECK(), BOOST_CHECK_EQUAL(), uhal::ClientInterface::dispatch(), uhal::Node::getAddress(), uhal::HwInterface::getClient(), uhal::HwInterface::getNode(), j, uhal::ClientInterface::read(), uhal::ClientInterface::rmw_bits(), UHAL_TESTS_DEFINE_CLIENT_TEST_CASES(), uhal::HwInterface::uri(), uhal::ValWord< T >::value(), and uhal::ClientInterface::write().
| uhal::tests::for | ( | ) |
Definition at line 126 of file test_block.cpp.
References uhal::ValVector< T >::at(), uhal::ValVector< T >::begin(), BOOST_CHECK(), BOOST_CHECK_EQUAL(), BOOST_CHECK_NO_THROW(), BOOST_CHECK_THROW(), correct_block_write_read, uhal::HwInterface::dispatch(), uhal::ValVector< T >::end(), getBlockUnitTestDepths(), uhal::HwInterface::getNode(), hw, j, mem, N_10MB, uhal::Node::readBlock(), uhal::Node::readBlockOffset(), uhal::ValVector< T >::size(), UHAL_TESTS_DEFINE_CLIENT_TEST_CASES(), uhal::ValVector< T >::valid(), uhal::ValVector< T >::value(), uhal::Node::writeBlock(), uhal::Node::writeBlockOffset(), and xx.
| std::vector<size_t> uhal::tests::getBlockUnitTestDepths | ( | ) |
Definition at line 61 of file test_block.cpp.
References uhal::ValVector< T >::at(), uhal::ValVector< T >::begin(), BOOST_CHECK(), BOOST_CHECK_EQUAL(), BOOST_CHECK_NO_THROW(), BOOST_CHECK_THROW(), correct_block_write_read, uhal::HwInterface::dispatch(), uhal::ValVector< T >::end(), uhal::HwInterface::getNode(), hw, j, mem, N_10MB, N_1kB, N_1MB, N_4B, uhal::Node::readBlock(), uhal::ValVector< T >::size(), UHAL_TESTS_DEFINE_CLIENT_TEST_CASES(), uhal::ValVector< T >::valid(), uhal::ValVector< T >::value(), uhal::Node::writeBlock(), and xx.
Referenced by for().
| hw uhal::tests::getNode | ( | "REG" | ) |
| hw uhal::tests::getNode | ( | "SUBSYSTEM1.SUBMODULE.REG" | ) |
| uhal::tests::if | ( | hw.uri().find("ipbusudp-1.3://") ! | = std::string::npos || hw.uri().find ( "ipbustcp-1.3://" ) != std::string::npos || hw.uri().find ( "chtcp-1.3://" ) != std::string::npos | ) |
Definition at line 163 of file test_rawclient.cpp.
Referenced by uhal::ClientInterface::uri().
| void uhal::tests::iteration | ( | const uhal::Node & | parentNode | ) |
Definition at line 55 of file test_navigation.cpp.
References uhal::Node::begin(), BOOST_CHECK(), BOOST_CHECK_NO_THROW(), uhal::Node::end(), uhal::HwInterface::getNode(), uhal::HwInterface::getNodes(), uhal::Node::getNodes(), hw, and UHAL_TESTS_DEFINE_CLIENT_TEST_CASES().
| void uhal::tests::job_multiple | ( | const std::string & | connection, |
| const std::string & | id | ||
| ) |
Definition at line 65 of file test_multithreaded.cpp.
References BOOST_CHECK(), BOOST_CHECK_EQUAL(), BOOST_CHECK_NO_THROW(), uhal::HwInterface::dispatch(), uhal::ConnectionManager::getDevice(), uhal::HwInterface::getNode(), hw, uhal::Info, uhal::Integer(), mem, N_ITERATIONS, N_SIZE, uhal::Node::read(), uhal::Node::readBlock(), reg, uhal::HwInterface::setTimeoutPeriod(), uhal::ValVector< T >::size(), ThisLocation, TIMEOUT_S, uhal::ValWord< T >::valid(), uhal::ValVector< T >::valid(), uhal::Warning, uhal::Node::write(), uhal::Node::writeBlock(), x, and xx.
Referenced by UHAL_TESTS_DEFINE_CLIENT_TEST_CASES().
| double uhal::tests::measureFileReadLatency | ( | const std::string & | aFilePath, |
| uint32_t | aBaseAddr, | ||
| uint32_t | aDepth, | ||
| size_t | aNrIterations, | ||
| bool | aVerbose | ||
| ) |
Definition at line 159 of file tools.cpp.
References uhal::tests::Timer::elapsedSeconds(), uhal::PCIe::File::open(), and uhal::PCIe::File::read().
| double uhal::tests::measureFileWriteLatency | ( | const std::string & | aFilePath, |
| uint32_t | aBaseAddr, | ||
| uint32_t | aDepth, | ||
| size_t | aNrIterations, | ||
| bool | aVerbose | ||
| ) |
Definition at line 184 of file tools.cpp.
References uhal::tests::Timer::elapsedSeconds(), and uhal::PCIe::File::write().
| double uhal::tests::measureReadLatency | ( | ClientInterface & | aClient, |
| uint32_t | aBaseAddr, | ||
| uint32_t | aDepth, | ||
| size_t | aNrIterations, | ||
| bool | aDispatchEachIteration, | ||
| bool | aVerbose | ||
| ) |
Definition at line 67 of file tools.cpp.
Referenced by uhal::tests::PerfTester::bandwidthRxTest(), and report_rx_performance().
| double uhal::tests::measureReadLatency | ( | const std::vector< ClientInterface *> & | aClients, |
| uint32_t | aBaseAddr, | ||
| uint32_t | aDepth, | ||
| size_t | aNrIterations, | ||
| bool | aDispatchEachIteration, | ||
| bool | aVerbose | ||
| ) |
Definition at line 73 of file tools.cpp.
References uhal::tests::Timer::elapsedSeconds(), and uhal::defs::NON_INCREMENTAL.
| double uhal::tests::measureWriteLatency | ( | ClientInterface & | aClient, |
| uint32_t | aBaseAddr, | ||
| uint32_t | aDepth, | ||
| size_t | aNrIterations, | ||
| bool | aDispatchEachIteration, | ||
| bool | aVerbose | ||
| ) |
Definition at line 111 of file tools.cpp.
Referenced by uhal::tests::PerfTester::bandwidthTxTest(), and report_tx_performance().
| double uhal::tests::measureWriteLatency | ( | const std::vector< ClientInterface *> & | aClients, |
| uint32_t | aBaseAddr, | ||
| uint32_t | aDepth, | ||
| size_t | aNrIterations, | ||
| bool | aDispatchEachIteration, | ||
| bool | aVerbose | ||
| ) |
Definition at line 117 of file tools.cpp.
References uhal::tests::Timer::elapsedSeconds(), and uhal::defs::NON_INCREMENTAL.
| URI uhal::tests::parseURI | ( | const std::string & | aUri | ) |
| lDepths uhal::tests::push_back | ( | N_200MB | ) |
| void uhal::tests::report_rx_performance | ( | ClientInterface & | aClient, |
| const uint32_t | aBaseAddr, | ||
| const uint32_t | aDepth, | ||
| const size_t | aNrIterations, | ||
| const bool | aDispatchEachIteration | ||
| ) |
Definition at line 57 of file test_soak.cpp.
References measureReadLatency().
Referenced by report_tx_performance().
| void uhal::tests::report_tx_performance | ( | ClientInterface & | aClient, |
| const uint32_t | aBaseAddr, | ||
| const uint32_t | aDepth, | ||
| const size_t | aNrIterations, | ||
| const bool | aDispatchEachIteration | ||
| ) |
Definition at line 68 of file test_soak.cpp.
References BOOST_CHECK_NO_THROW(), uhal::HwInterface::getClient(), hw, measureWriteLatency(), report_rx_performance(), and UHAL_TESTS_DEFINE_CLIENT_TEST_CASES().
| uhal::tests::UHAL_TESTS_DEFINE_CLIENT_TEST_CASES | ( | EmptyDispatchTestSuite | , |
| empty_dispatch | , | ||
| MinimalFixture | , | ||
| { HwInterface hw=getHwInterface();BOOST_CHECK_NO_THROW(hw.dispatch());} | |||
| ) |
| uhal::tests::UHAL_TESTS_DEFINE_CLIENT_TEST_CASES | ( | ConfigSpaceTestSuite | , |
| read_fullWord | , | ||
| DummyHardwareFixture | , | ||
| { HwInterface hw=getHwInterface();IPbusCore &client=dynamic_cast< IPbusCore &>(hw.getClient());for(size_t i=0;i< 10;i++) { const uint32_t expectedValue=uint16_t(getpid())<< 16|i;switch(deviceType) { case IPBUS_1_3_UDP :case IPBUS_1_3_TCP :case IPBUS_1_3_CONTROLHUB :BOOST_CHECK_THROW(client.readConfigurationSpace(i), exception::ValidationError);break;default:ValWord< uint32_t > x=client.readConfigurationSpace(i);client.dispatch();BOOST_CHECK_EQUAL(x.value(), expectedValue);} } } | |||
| ) |
| uhal::tests::UHAL_TESTS_DEFINE_CLIENT_TEST_CASES | ( | NonreachableTestSuite | , |
| check_nonreachable_device | , | ||
| MinimalFixture | , | ||
| { for(size_t i=0;i< 10;i++) { HwInterface hw=getHwInterface();if((hw.uri().find("ipbustcp") !=std::string::npos)||(hw.uri().find("ipbuspcie") !=std::string::npos)) { BOOST_CHECK_THROW({ hw.getNode("REG").read();hw.dispatch();}, uhal::exception::TransportLayerError);} else { BOOST_CHECK_THROW({ hw.getNode("REG").read();hw.dispatch();}, uhal::exception::ClientTimeout);} } } | |||
| ) | const |
Definition at line 52 of file test_nonreachable.cpp.
References BOOST_CHECK_THROW(), uhal::HwInterface::dispatch(), uhal::HwInterface::getClient(), uhal::ConnectionManager::getDevice(), uhal::HwInterface::getNode(), hw, IPBUS_1_3_CONTROLHUB, IPBUS_2_0_CONTROLHUB, uhal::Node::read(), UHAL_TESTS_DEFINE_CLIENT_TEST_CASES(), uhal::HwInterface::uri(), and uhal::ClientInterface::uri().
| uhal::tests::UHAL_TESTS_DEFINE_CLIENT_TEST_CASES | ( | SingleReadWriteTestSuite | , |
| connect_write_read | , | ||
| DummyHardwareFixture | , | ||
| { HwInterface hw=getHwInterface();uint32_t x1=static_cast< uint32_t >(rand());uint32_t x2=static_cast< uint32_t >(rand());hw.getNode("SUBSYSTEM1.REG").write(x1);hw.getNode("SUBSYSTEM2.REG").write(x2);ValWord< uint32_t > mem1=hw.getNode("SUBSYSTEM1.REG").read();ValWord< uint32_t > mem2=hw.getNode("SUBSYSTEM2.REG").read();BOOST_CHECK(!mem1.valid());BOOST_CHECK(!mem2.valid());BOOST_CHECK_THROW(mem1.value(), uhal::exception::NonValidatedMemory);BOOST_CHECK_THROW(mem2.value(), uhal::exception::NonValidatedMemory);BOOST_CHECK_NO_THROW(hw.dispatch());BOOST_CHECK(mem1.valid());BOOST_CHECK_EQUAL(mem1.value(), x1);BOOST_CHECK_EQUAL(mem2.value(), x2);} | |||
| ) |
| uhal::tests::UHAL_TESTS_DEFINE_CLIENT_TEST_CASES | ( | RawClientTestSuite | , |
| single_write_read | , | ||
| DummyHardwareFixture | , | ||
| { HwInterface hw=getHwInterface();ClientInterface *c=&hw.getClient();uint32_t x=static_cast< uint32_t >(rand());uint32_t addr=hw.getNode("REG").getAddress();c->write(addr, x);ValWord< uint32_t > reg=c->read(addr);BOOST_CHECK(!reg.valid());BOOST_CHECK_THROW(reg.value(), uhal::exception::NonValidatedMemory);c->dispatch();BOOST_CHECK(reg.valid());BOOST_CHECK_EQUAL(reg.value(), x);BOOST_CHECK_THROW(c->write(addr, 0xF0000000, 0xF0), uhal::exception::BitsSetWhichAreForbiddenByBitMask);BOOST_CHECK_THROW(c->write(addr, 0xFF, 0x0F), uhal::exception::BitsSetWhichAreForbiddenByBitMask);uint32_t y=static_cast< uint32_t >(rand()) &0xF;c->write(addr, y, 0xF);ValWord< uint32_t > reg2=c->read(addr);BOOST_CHECK(!reg2.valid());BOOST_CHECK_THROW(reg2.value(), uhal::exception::NonValidatedMemory);c->dispatch();BOOST_CHECK(reg2.valid());BOOST_CHECK_EQUAL(reg2.value(),((x &~0xF)|y));ValWord< uint32_t > reg3=c->read(addr, 0xF);BOOST_CHECK(!reg3.valid());BOOST_CHECK_THROW(reg3.value(), uhal::exception::NonValidatedMemory);c->dispatch();BOOST_CHECK(reg3.valid());BOOST_CHECK_EQUAL(reg3.value(), y);} | |||
| ) |
| uhal::tests::UHAL_TESTS_DEFINE_CLIENT_TEST_CASES | ( | NodeNavigationTestSuite | , |
| navigation_and_traversal | , | ||
| MinimalFixture | , | ||
| { HwInterface hw=getHwInterface();std::vector< std::string > ids=hw.getNodes();BOOST_CHECK(std::find(ids.begin(), ids.end(),"REG") !=ids.end());BOOST_CHECK(std::find(ids.begin(), ids.end(),"MEM") !=ids.end());BOOST_CHECK(std::find(ids.begin(), ids.end(),"SUBSYSTEM1.REG") !=ids.end());BOOST_CHECK(std::find(ids.begin(), ids.end(),"SUBSYSTEM1.MEM") !=ids.end());BOOST_CHECK(std::find(ids.begin(), ids.end(),"SUBSYSTEM1.SUBMODULE.REG") !=ids.end());BOOST_CHECK(std::find(ids.begin(), ids.end(),"SUBSYSTEM1.SUBMODULE.MEM") !=ids.end());BOOST_CHECK(std::find(ids.begin(), ids.end(),"SUBSYSTEM2.REG") !=ids.end());BOOST_CHECK(std::find(ids.begin(), ids.end(),"SUBSYSTEM2.MEM") !=ids.end());BOOST_CHECK(std::find(ids.begin(), ids.end(),"SUBSYSTEM2.SUBMODULE.REG") !=ids.end());BOOST_CHECK(std::find(ids.begin(), ids.end(),"SUBSYSTEM2.SUBMODULE.MEM") !=ids.end());ids=hw.getNodes(".*MEM.*");BOOST_CHECK(std::find(ids.begin(), ids.end(),"MEM") !=ids.end());BOOST_CHECK(std::find(ids.begin(), ids.end(),"LARGE_MEM") !=ids.end());BOOST_CHECK(std::find(ids.begin(), ids.end(),"SMALL_MEM") !=ids.end());BOOST_CHECK(std::find(ids.begin(), ids.end(),"SUBSYSTEM1.MEM") !=ids.end());BOOST_CHECK(std::find(ids.begin(), ids.end(),"SUBSYSTEM2.MEM") !=ids.end());BOOST_CHECK(std::find(ids.begin(), ids.end(),"SUBSYSTEM1.SUBMODULE.MEM") !=ids.end());BOOST_CHECK(std::find(ids.begin(), ids.end(),"SUBSYSTEM2.SUBMODULE.MEM") !=ids.end());ids=hw.getNode("SUBSYSTEM1").getNodes();BOOST_CHECK(std::find(ids.begin(), ids.end(),"REG") !=ids.end());BOOST_CHECK(std::find(ids.begin(), ids.end(),"MEM") !=ids.end());BOOST_CHECK(std::find(ids.begin(), ids.end(),"SUBMODULE.REG") !=ids.end());BOOST_CHECK(std::find(ids.begin(), ids.end(),"SUBMODULE.MEM") !=ids.end());BOOST_CHECK_NO_THROW(iteration(hw.getNode()));BOOST_CHECK_NO_THROW(iteration(hw.getNode("SUBSYSTEM1")));} | |||
| ) |
| uhal::tests::UHAL_TESTS_DEFINE_CLIENT_TEST_CASES | ( | BlockReadWriteTestSuite | , |
| block_write_read | , | ||
| DummyHardwareFixture | , | ||
| { std::vector< size_t > lDepths=getBlockUnitTestDepths();for(size_t i=0;i< lDepths.size();i++) { const size_t N=lDepths.at(i);BOOST_TEST_MESSAGE(" N = "<< N);HwInterface hw=getHwInterface();std::vector< uint32_t > xx;xx.reserve(N);for(size_t i=0;i!=N;++i) { xx.push_back(static_cast< uint32_t >(rand()));} hw.getNode("LARGE_MEM").writeBlock(xx);ValVector< uint32_t > mem=hw.getNode("LARGE_MEM").readBlock(N);BOOST_CHECK(!mem.valid());BOOST_CHECK_EQUAL(mem.size(), N);if(N > 0) { BOOST_CHECK_THROW(mem.at(0), uhal::exception::NonValidatedMemory);} BOOST_CHECK_THROW(mem.value(), uhal::exception::NonValidatedMemory);BOOST_CHECK_NO_THROW(hw.dispatch());BOOST_CHECK(mem.valid());BOOST_CHECK_EQUAL(mem.size(), N);if(N< N_10MB) { bool correct_block_write_read=true;std::vector< uint32_t >::const_iterator j=xx.begin();for(ValVector< uint32_t >::const_iterator i(mem.begin());i!=mem.end();++i,++j) { correct_block_write_read=correct_block_write_read &&(*i== *j);} BOOST_CHECK(correct_block_write_read);} } } | |||
| ) |
Referenced by for(), getBlockUnitTestDepths(), iteration(), report_tx_performance(), and UHAL_TESTS_DEFINE_CLIENT_TEST_CASES().
| uhal::tests::UHAL_TESTS_DEFINE_CLIENT_TEST_CASES | ( | SoakTestSuite | , |
| bandwidth_rx | , | ||
| DummyHardwareFixture | , | ||
| { HwInterface hw=getHwInterface();BOOST_CHECK_NO_THROW(report_rx_performance(hw.getClient(), 0x01, 1, 100, true));BOOST_CHECK_NO_THROW(report_rx_performance(hw.getClient(), 0x01, 262144, 100, true));} | |||
| ) |
| uhal::tests::UHAL_TESTS_DEFINE_CLIENT_TEST_CASES | ( | MultithreadedTestSuite | , |
| multiple_hwinterfaces | , | ||
| DummyHardwareFixture | , | ||
| { if(deviceType !=IPBUS_2_0_PCIE) { std::vector< boost::thread *> jobs;for(size_t i=0;i!=N_THREADS;++i) { log(Warning(), ThisLocation(), ":", Integer(i));jobs.push_back(new boost::thread(job_multiple, connectionFileURI, deviceId));} for(size_t i=0;i!=N_THREADS;++i) { log(Warning(), ThisLocation(), ":", Integer(i));jobs[i]->join();delete jobs[i];} log(Warning(), ThisLocation());} else std::cout<< " ** Skipping multiple HwInterface test for PCIe **"<< std::endl;} | |||
| ) | & |
Definition at line 100 of file test_multithreaded.cpp.
References BOOST_CHECK(), BOOST_CHECK_EQUAL(), BOOST_CHECK_NO_THROW(), uhal::HwInterface::dispatch(), uhal::HwInterface::getNode(), hw, uhal::Integer(), IPBUS_2_0_PCIE, job_multiple(), mem, N_SIZE, N_THREADS, uhal::Node::read(), uhal::Node::readBlock(), reg, uhal::ValVector< T >::size(), ThisLocation, uhal::ValWord< T >::valid(), uhal::ValVector< T >::valid(), uhal::Warning, uhal::Node::write(), uhal::Node::writeBlock(), x, and xx.
| uhal::tests::UHAL_TESTS_DEFINE_CLIENT_TEST_CASES | ( | RawClientTestSuite | , |
| mem_rmw_bits | , | ||
| DummyHardwareFixture | , | ||
| { HwInterface hw=getHwInterface();ClientInterface *c=&hw.getClient();uint32_t addr=hw.getNode("REG_UPPER_MASK").getAddress();uint32_t x1=static_cast< uint32_t >(rand());uint32_t x2=static_cast< uint32_t >(rand());uint32_t x3=static_cast< uint32_t >(rand());c->write(addr, x1);ValWord< uint32_t > reg1=c->rmw_bits(addr, x2, x3);ValWord< uint32_t > reg2=c->read(addr);c->dispatch();BOOST_CHECK_EQUAL(((x1 &x2)|x3), reg2.value());if(hw.uri().find("ipbusudp-1.3://") !=std::string::npos||hw.uri().find("ipbustcp-1.3://") !=std::string::npos||hw.uri().find("chtcp-1.3://") !=std::string::npos) { BOOST_CHECK_EQUAL(reg1.value(),((x1 &x2)|x3));} else { BOOST_CHECK_EQUAL(reg1.value(), x1);} } | |||
| ) |
| uhal::tests::UHAL_TESTS_DEFINE_CLIENT_TEST_CASES | ( | MultithreadedTestSuite | , |
| single_hwinterface | , | ||
| DummyHardwareFixture | , | ||
| { for(size_t iter=0;iter!=N_ITERATIONS ;++iter) { HwInterface hw=getHwInterface();std::vector< boost::thread *> jobs;for(size_t i=0;i!=N_THREADS;++i) { jobs.push_back(new boost::thread(job_single, hw));} for(size_t i=0;i!=N_THREADS;++i) { jobs[i]->join();delete jobs[i];} } } | |||
| ) |
Definition at line 153 of file test_multithreaded.cpp.
References BOOST_CHECK(), BOOST_CHECK_EQUAL(), BOOST_CHECK_NO_THROW(), uhal::HwInterface::dispatch(), uhal::HwInterface::getNode(), mem, N_ITERATIONS, N_SIZE, N_THREADS, uhal::Node::read(), uhal::Node::readBlock(), reg, uhal::ValVector< T >::size(), UHAL_TESTS_DEFINE_CLIENT_TEST_CASES(), uhal::ValWord< T >::valid(), uhal::ValVector< T >::valid(), uhal::Node::write(), uhal::Node::writeBlock(), x, and xx.
| uhal::tests::UHAL_TESTS_DEFINE_CLIENT_TEST_CASES | ( | BlockReadWriteTestSuite | , |
| block_offset_write_read | , | ||
| DummyHardwareFixture | , | ||
| { std::vector< size_t > lDepths=getBlockUnitTestDepths();for(size_t i=0;i< lDepths.size();i++) { const size_t N=lDepths.at(i);BOOST_TEST_MESSAGE(" N = "<< N);HwInterface hw=getHwInterface();std::vector< uint32_t > xx;xx.reserve(N);std::vector< uint32_t > yy;yy.reserve(N);for(size_t i=0;i!=N;++i) { xx.push_back(static_cast< uint32_t >(rand()));yy.push_back(static_cast< uint32_t >(rand()));} hw.getNode("LARGE_MEM").writeBlockOffset(xx, 0);ValVector< uint32_t > mem=hw.getNode("LARGE_MEM").readBlockOffset(N, 0);BOOST_CHECK(!mem.valid());BOOST_CHECK_EQUAL(mem.size(), N);if(N > 0) { BOOST_CHECK_THROW(mem.at(0), uhal::exception::NonValidatedMemory);} BOOST_CHECK_THROW(mem.value(), uhal::exception::NonValidatedMemory);hw.getNode("LARGE_MEM").writeBlockOffset(yy, N);ValVector< uint32_t > mem2=hw.getNode("LARGE_MEM").readBlockOffset(N, N);BOOST_CHECK(!mem2.valid());BOOST_CHECK_EQUAL(mem2.size(), N);if(N > 0) { BOOST_CHECK_THROW(mem2.at(0), uhal::exception::NonValidatedMemory);} BOOST_CHECK_THROW(mem2.value(), uhal::exception::NonValidatedMemory);BOOST_CHECK_NO_THROW(hw.dispatch());BOOST_CHECK(mem.valid());BOOST_CHECK_EQUAL(mem.size(), N);BOOST_CHECK(mem2.valid());BOOST_CHECK_EQUAL(mem2.size(), N);if(N< N_10MB) { bool correct_block_write_read=true;std::vector< uint32_t >::const_iterator j=xx.begin();for(ValVector< uint32_t >::const_iterator i(mem.begin());i!=mem.end();++i,++j) { correct_block_write_read=correct_block_write_read &&(*i== *j);} j=yy.begin();for(ValVector< uint32_t >::const_iterator i(mem2.begin());i!=mem2.end();++i,++j) { correct_block_write_read=correct_block_write_read &&(*i== *j);} BOOST_CHECK(correct_block_write_read);} } } | |||
| ) |
| uhal::tests::UHAL_TESTS_DEFINE_CLIENT_TEST_CASES | ( | BlockReadWriteTestSuite | , |
| block_bigger_than_size_attribute | , | ||
| MinimalFixture | , | ||
| { HwInterface hw=getHwInterface();std::vector< uint32_t > xx;xx.resize(N_1MB);BOOST_CHECK_THROW(hw.getNode("SMALL_MEM").writeBlock(xx), uhal::exception::BulkTransferRequestedTooLarge);BOOST_CHECK_THROW(ValVector< uint32_t > mem=hw.getNode("SMALL_MEM").readBlock(N_1MB), uhal::exception::BulkTransferRequestedTooLarge);} | |||
| ) |
| uint32_t uhal::tests::x | ( | 0x00000000 | ) |
| uint32_t uhal::tests::addr = hw.getNode ( "MEM" ).getAddress() |
| uhal::tests::address_file = ( conn_fn.parent_path() /fn ).string() |
Definition at line 86 of file test_single.cpp.
|
static |
The mask for the address space (size of the address space in one larger than this)
Definition at line 58 of file DummyHardware.hpp.
Referenced by uhal::tests::DummyHardware< 2, 0 >::GetEndpoint(), and uhal::tests::DummyHardware< 2, 0 >::SetEndpoint().
| uhal::tests::bandwidth_tx |
Definition at line 90 of file test_soak.cpp.
| uhal::tests::block_access_type_violations |
Definition at line 237 of file test_block.cpp.
| uhal::tests::block_offset_bigger_than_size_attribute |
Definition at line 273 of file test_block.cpp.
|
static |
Size of the receive and reply buffers.
Definition at line 62 of file DummyHardware.hpp.
Referenced by uhal::tests::DummyHardware< 2, 0 >::status_packet_header().
| ClientInterface * uhal::tests::c = &hw.getClient() |
Definition at line 94 of file test_rawclient.cpp.
Definition at line 79 of file test_config_space.cpp.
Referenced by uhal::tests::PerfTester::runValidationTest(), and uhal::tests::PerfTester::validation_test_write_rmwsum_read().
| bool uhal::tests::correct_block_write_read = true |
Definition at line 111 of file test_rawclient.cpp.
Referenced by for(), and getBlockUnitTestDepths().
Definition at line 121 of file test_block.cpp.
| uhal::tests::else |
Definition at line 170 of file test_rawclient.cpp.
| uhal::tests::empty_dispatch_after_read |
Definition at line 55 of file test_empty_dispatch.cpp.
| uhal::tests::fifo_write_read |
Definition at line 121 of file test_block.cpp.
| HwInterface uhal::tests::hw = getHwInterface() |
Definition at line 93 of file test_rawclient.cpp.
Referenced by uhal::tests::DummyHardwareFixture< type >::DummyHardwareFixture(), for(), getBlockUnitTestDepths(), iteration(), job_multiple(), report_tx_performance(), and UHAL_TESTS_DEFINE_CLIENT_TEST_CASES().
| bool uhal::tests::IPbus1_3 |
Definition at line 160 of file test_rawclient.cpp.
| std::vector< uint32_t >::const_iterator uhal::tests::j =xx.begin() |
Definition at line 113 of file test_rawclient.cpp.
Referenced by for(), getBlockUnitTestDepths(), and uhal::tests::DummyHardware< 2, 0 >::status_packet_header().
Definition at line 104 of file test_rawclient.cpp.
Referenced by for(), getBlockUnitTestDepths(), job_multiple(), and UHAL_TESTS_DEFINE_CLIENT_TEST_CASES().
| uhal::tests::mem_rmw_sum |
Definition at line 153 of file test_rawclient.cpp.
| uhal::tests::mem_write_read |
Definition at line 90 of file test_rawclient.cpp.
Definition at line 273 of file test_block.cpp.
| uhal::tests::on_the_fly_connect_write_read |
Definition at line 79 of file test_single.cpp.
| uhal::tests::read_masked |
Definition at line 75 of file test_config_space.cpp.
| ValWord< uint32_t > uhal::tests::reg = hw.getNode ( "SUBSYSTEM1" ).getNode ( "SUBMODULE" ).getNode ( "REG" ).read() |
Definition at line 119 of file test_navigation.cpp.
Referenced by job_multiple(), UHAL_TESTS_DEFINE_CLIENT_TEST_CASES(), and uhal::tests::PerfTester::validation_test_single_write_read().
|
static |
The size of the reply history for IPbus 2.0.
Definition at line 60 of file DummyHardware.hpp.
Referenced by uhal::tests::DummyHardware< 2, 0 >::status_packet_header().
| uint32_t uhal::tests::total = 0 |
Definition at line 158 of file test_rawclient.cpp.
| std::string uhal::tests::uri = getHwInterface().uri() |
Definition at line 89 of file test_single.cpp.
Referenced by uhal::UDP< InnerProtocol >::CheckDeadline(), uhal::TCP< InnerProtocol, nr_buffers_per_send >::CheckDeadline(), uhal::TCP< InnerProtocol, nr_buffers_per_send >::connect(), uhal::UDP< InnerProtocol >::connect(), uhal::PCIe::disconnect(), uhal::TCP< InnerProtocol, nr_buffers_per_send >::dispatchExceptionHandler(), uhal::Mmap::dispatchExceptionHandler(), uhal::Mmap::Flush(), uhal::Mmap::implementDispatch(), uhal::Mmap::Mmap(), parseURI(), uhal::PCIe::PCIe(), uhal::Mmap::read(), uhal::UDP< InnerProtocol >::read_callback(), uhal::TCP< InnerProtocol, nr_buffers_per_send >::read_callback(), uhal::ControlHub< InnerProtocol >::validate(), uhal::IPbus< 2, IPbus_minor >::validate(), uhal::Mmap::write(), uhal::UDP< InnerProtocol >::write_callback(), and uhal::TCP< InnerProtocol, nr_buffers_per_send >::write_callback().
| uhal::tests::write_read |
Definition at line 101 of file test_navigation.cpp.
| uint32_t uhal::tests::x = static_cast<uint32_t> ( rand() ) |
Definition at line 117 of file test_navigation.cpp.
Referenced by job_multiple(), UHAL_TESTS_DEFINE_CLIENT_TEST_CASES(), and uhal::tests::PerfTester::validation_test_single_write_read().
| std::vector< uint32_t > uhal::tests::xx |
Definition at line 238 of file test_block.cpp.
Referenced by for(), getBlockUnitTestDepths(), job_multiple(), UHAL_TESTS_DEFINE_CLIENT_TEST_CASES(), and uhal::tests::PerfTester::validation_test_block_write_read().
1.8.13