19 #include <boost/test/unit_test.hpp>
43 BOOST_AUTO_TEST_SUITE(bitstream)
49 /
"torc" /
"bitstream";
50 BOOST_CHECK(checkCRC<Virtex>(regressionPath /
"VirtexUnitTest.reference.bit"));
51 BOOST_CHECK(checkCRC<VirtexE>(regressionPath /
"VirtexEUnitTest.reference.bit"));
52 BOOST_CHECK(checkCRC<Virtex2>(regressionPath /
"Virtex2UnitTest.reference.bit"));
53 BOOST_CHECK(checkCRC<Virtex2P>(regressionPath /
"Virtex2PUnitTest.reference.bit"));
54 BOOST_CHECK(checkCRC<Virtex4>(regressionPath /
"Virtex4UnitTest.reference.bit"));
55 BOOST_CHECK(checkCRC<Virtex5>(regressionPath /
"Virtex5UnitTest.reference.bit"));
56 BOOST_CHECK(checkCRC<Virtex6>(regressionPath /
"Virtex6UnitTest.reference.bit"));
57 BOOST_CHECK(checkCRC<Virtex7>(regressionPath /
"Virtex7UnitTest.reference.bit"));
65 /
"torc" /
"bitstream" /
"Virtex5UnitTest.reference.bit";
67 /
"regression" /
"VirtexBitstreamUnitTest.generated.bit";
70 std::fstream fileStream1(referencePath.string().c_str(), std::ios::binary | std::ios::in);
71 BOOST_REQUIRE(fileStream1.good());
73 bitstream1.
read(fileStream1,
false);
76 Virtex5::const_iterator p = bitstream1.begin();
77 Virtex5::const_iterator e = bitstream1.end();
79 if(p->isType2() && p->isWrite()) { frameContents = *p;
break; }
86 bitstream.
setDesignName(
"Virtex5UnitTest.reference.ncd;UserID=0xFFFFFFFF");
96 bitstream.
insert(bitstream.end(), 8, dummy);
100 bitstream.push_back(dummy);
101 bitstream.push_back(dummy);
104 bitstream.push_back(nop);
109 bitstream.push_back(nop);
112 bitstream.push_back(nop);
113 bitstream.push_back(nop);
146 bitstream.push_back(nop);
174 bitstream.
insert(bitstream.end(), 8, nop);
179 bitstream.push_back(nop);
189 bitstream.push_back(frameContents);
195 bitstream.push_back(nop);
199 bitstream.
insert(bitstream.end(), 100, nop);
203 bitstream.
insert(bitstream.end(), 30, nop);
207 bitstream.push_back(nop);
237 bitstream.
insert(bitstream.end(), 61, nop);
240 std::fstream outputStream(generatedPath.string().c_str(), std::ios::binary | std::ios::out);
241 BOOST_REQUIRE(outputStream.good());
242 bitstream.
write(outputStream);
243 outputStream.flush();
258 BOOST_AUTO_TEST_SUITE_END()
void setDesignTime(const string &inDesignTime)
Set the design time.
Header for torc::bitstream output stream helpers.
static uint32_t makeSubfield(ERegister inRegister, const std::string &inSubfield, const std::string &inSetting)
Return the masked value for a subfield of the specified register.
Header for the VirtexE class.
Header for the VirtexBitstream class.
Header for the Virtex4 class.
Header for the Virtex2P class.
Header for the DirectoryTree class.
static VirtexPacket makeNullType1Write(uint32_t inAddress)
Construct a null type 1 write packet.
Header for the Virtex6 class.
Header for the Virtex5 class.
Header for the DeviceDesignator class.
Header for Boost.Test helper functions.
iterator insert(iterator position, const value_type &val)
Regular std::vector inserter.
Header for Boost.Test helper functions.
void setDesignName(const string &inDesignName)
Set the design name.
void setDesignDate(const string &inDesignDate)
Set the design date.
boost::filesystem::path path
static VirtexPacket makeType1Write(uint32_t inAddress, uint32_t inWord)
Construct a type 1 write packet.
Header for the Virtex class.
void write(std::ostream &inStream, uint8_t inVal)
Write a uint8_t to the stream.
Header for the Virtex2 class.
bool fileContentsAreEqual(const boost::filesystem::path &inA, const boost::filesystem::path &inB)
Compare the raw contents of two files to determine whether they are identical.
Bitstream packet for Virtex class architectures.
static uint32_t makeHeader(EPacketType inType, EOpcode inOpcode, uint32_t inAddress, uint32_t inCount)
Construct a packet header.
BOOST_AUTO_TEST_CASE(hexCharacterToDec)
virtual void read(std::istream &inStream, bool inCleanDateAndTime=true)
Read the bitstream header and packets from a stream.
void setDeviceName(const string &inDeviceName)
Set the device name.
static const boost::filesystem::path & getExecutablePath(void)
Returns the absolute path to the executable directory.
Header for the Virtex7 class.