19 #include <boost/test/unit_test.hpp>
30 BOOST_AUTO_TEST_SUITE(bitstream)
36 /
"torc" /
"bitstream" /
"Spartan3EUnitTest.reference.bit";
38 /
"regression" /
"SpartanPacketUnitTest.generated.bit";
41 std::fstream fileStream(referencePath.string().c_str(), std::ios::binary | std::ios::in);
42 BOOST_REQUIRE(fileStream.good());
49 uint32_t bitstreamWordLength = bitstream.getBitstreamByteLength() >> 2;
50 std::cout << bitstream << std::endl;
53 uint32_t cumulativeWordLength = 0;
54 std::vector<SpartanPacket> packets;
55 while(cumulativeWordLength < bitstreamWordLength) {
57 packets.push_back(packet);
61 cumulativeWordLength = 0;
62 std::vector<SpartanPacket>::iterator p = packets.begin();
63 std::vector<SpartanPacket>::iterator e = packets.end();
71 BOOST_AUTO_TEST_SUITE_END()
Header for the SpartanPacket class.
static bool readHeader(std::istream &inStream, string &outDesignName, string &outDeviceName, string &outDesignDate, string &outDesignTime, uint32_t &outBitstreamLength, uint32_t &outHeaderLength)
Read a bitstream header, and return its fields.
Header for the DirectoryTree class.
boost::filesystem::path path
Header for the Spartan3E class.
Bitstream packet for Spartan class architectures.
BOOST_AUTO_TEST_CASE(hexCharacterToDec)
static SpartanPacket read(std::istream &inStream)
Read a packet.
uint32_t getWordSize(void) const
Returns the total number of words in the packet, including the header word.
static const boost::filesystem::path & getExecutablePath(void)
Returns the absolute path to the executable directory.