16 #include <boost/test/unit_test.hpp>
20 #include <boost/filesystem.hpp>
25 BOOST_AUTO_TEST_SUITE(bitstream)
63 int& argc = boost::unit_test::framework::master_test_suite().argc;
64 char**& argv = boost::unit_test::framework::master_test_suite().argv;
66 BOOST_REQUIRE(argc >= 1);
77 std::fstream xdlFileStream(xdlFilePath.string().c_str());
78 BOOST_REQUIRE(xdlFileStream.good());
82 importer(xdlFileStream,
"XdlDesignExample");
92 bitAssemblerPtr->generateBitstream(designPtr, customBitFile);
99 using namespace torc::bitstream;
101 bool returnCode =
false;
102 const int crcWordIndex = 20;
109 BOOST_REQUIRE(bitstreamPtr1 != NULL);
110 BOOST_REQUIRE(bitstreamPtr2 != NULL);
113 boost::shared_ptr<Virtex> virtexBitstreamPtr1 = boost::dynamic_pointer_cast<
Virtex>(
116 boost::shared_ptr<Virtex> virtexBitstreamPtr2 = boost::dynamic_pointer_cast<
Virtex>(
118 BOOST_REQUIRE(virtexBitstreamPtr1 != NULL);
119 BOOST_REQUIRE(virtexBitstreamPtr2 != NULL);
122 virtexBitstreamPtr1->initializeDeviceInfo(bitstreamPtr1->getDesignName());
123 virtexBitstreamPtr1->initializeFrameMaps();
124 virtexBitstreamPtr1->initializeFullFrameBlocks();
126 virtexBitstreamPtr2->initializeDeviceInfo(bitstreamPtr2->getDesignName());
127 virtexBitstreamPtr2->initializeFrameMaps();
128 virtexBitstreamPtr2->initializeFullFrameBlocks();
140 BOOST_CHECK_EQUAL(frameSet1.size(), frameSet2.size());
142 int usedFrameCount = 0;
143 size_t frameIndex = 0;
145 for(; frameIndex < frameSet1.size(); frameIndex++) {
158 BOOST_CHECK_EQUAL(framePtr1->getLength(), framePtr2->getLength());
160 if(framePtr1->isUsed())
167 while(pWords1 < eWords1) {
170 if(*pWords1 != *pWords2 && wordIndex != crcWordIndex) {
181 std::cout <<
"Found mis-match frame. Block: " << blockIndex <<
", Frame Index: " <<
Hex32(
182 frameIndex) << std::endl;
185 std::cout <<
" Frame 1: ";
186 while(pWords1 < eWords1) {
187 std::cout <<
Hex32(*pWords1++) <<
" ";
189 std::cout << std::endl;
192 std::cout <<
" Frame 2: ";
193 while(pWords2 < eWords2) {
194 std::cout <<
Hex32(*pWords2++) <<
" ";
196 std::cout << std::endl;
200 std::cout << std::endl;
204 BOOST_CHECK_EQUAL(returnCode,
true);
208 BOOST_AUTO_TEST_SUITE_END()
Device database, including complete wiring and logic support.
static int hexCharacterToDec(char inDigit)
Convert a hex ASCII character to a decimal value.
static AssemblerSharedPtr newAssemblerPtr(torc::physical::DesignSharedPtr xdlDesignPtr, torc::architecture::DDB &inDB)
Header for the Factory class.
bool CompareVirtexBitstreams(boost::filesystem::path bitFile1, boost::filesystem::path bitFile2)
Encapsulation of filesystem paths that are used by the library.
void GenerateBitstreamAndCompare(boost::filesystem::path &xdlFilePath)
boost::filesystem::path path
boost::shared_ptr< Design > DesignSharedPtr
Shared pointer encapsulation of a Design.
static BitstreamSharedPtr newBitstreamPtr(const boost::filesystem::path &inPath)
boost::shared_ptr< VirtexFrame > VirtexFrameSharedPtr
Virtex frame type.
Importer from XDL format into a physical design.
BOOST_AUTO_TEST_CASE(hexCharacterToDec)
boost::shared_ptr< Bitstream > BitstreamSharedPtr
static const boost::filesystem::path & getExecutablePath(void)
Returns the absolute path to the executable directory.
WORD_TYPE word_t
Frame word type.
boost::shared_ptr< Assembler > AssemblerSharedPtr
Typedef for shared pointer of Assembler class.