|
| 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_DEFINE_CLIENT_TEST_CASES(RawClientTestSuite |
|
| uhal::tests::for (size_t i=0;i!=N;++i) |
|
c | uhal::tests::writeBlock (addr, xx) |
|
| uhal::tests::BOOST_CHECK (!mem.valid()) |
|
| uhal::tests::BOOST_CHECK_EQUAL (mem.size(), N) |
|
| uhal::tests::BOOST_CHECK_THROW (mem.at(0), uhal::exception::NonValidatedMemory) |
|
c | uhal::tests::dispatch () |
|
| uhal::tests::BOOST_CHECK (mem.valid()) |
|
| uhal::tests::for (ValVector< uint32_t >::const_iterator i(mem.begin());i!=mem.end();++i,++j) |
|
| uhal::tests::BOOST_CHECK (correct_block_write_read) |
|
| 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_DEFINE_CLIENT_TEST_CASES(RawClientTestSuite |
|
| 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) |
|
uint32_t | uhal::tests::x (0x00000000) |
|
c | uhal::tests::write (addr, xx[0]) |
|
| uhal::tests::BOOST_CHECK_EQUAL (reg.value(), total) |
|