19 #include <boost/test/unit_test.hpp>
34 BOOST_AUTO_TEST_SUITE(bitstream)
40 /
"torc" /
"bitstream" /
"Spartan3EUnitTest.reference.bit";
41 BOOST_CHECK(checkCRC<Spartan3E>(regressionPath,
true));
49 /
"torc" /
"bitstream" /
"Spartan3EUnitTest.reference.bit";
51 /
"regression" /
"SpartanBitstreamUnitTest.generated.bit";
88 bitstream.insert(bitstream.end(), 1, dummy);
130 size_t length = 0x0001149a;
131 uint32_t* buffer =
new uint32_t[length];
132 uint32_t* ptr = buffer + length - 1;
133 while(ptr >= buffer) *ptr-- = 0;
135 buffer[0x00000124] = 0x05500000;
136 buffer[0x000001e3] = 0x00002a80;
137 buffer[0x000001e4] = 0x18000000;
138 buffer[0x0000cbda] = 0x0000000a;
139 buffer[0x0000cbdb] = 0xa0000000;
140 buffer[0x0000cc39] = 0x00140000;
141 buffer[0x0000cc3a] = 0x05000000;
144 bitstream.push_back(nop);
152 bitstream.insert(bitstream.end(), 97, nop);
168 bitstream.insert(bitstream.end(), 4, nop);
171 std::fstream outputStream(generatedPath.string().c_str(), std::ios::binary | std::ios::out);
172 BOOST_REQUIRE(outputStream.good());
173 bitstream.
write(outputStream);
174 outputStream.flush();
189 BOOST_AUTO_TEST_SUITE_END()
void setDesignTime(const string &inDesignTime)
Set the design time.
Header for torc::bitstream output stream helpers.
Header for the SpartanPacket class.
Header for the DirectoryTree class.
Header for the DeviceDesignator class.
static SpartanPacket makeType2Write(uint32_t inCount, uint32_t *inWords)
Construct a type 2 write packet.
Header for Boost.Test helper functions.
Header for Boost.Test helper functions.
void setDesignName(const string &inDesignName)
Set the design name.
void setDesignDate(const string &inDesignDate)
Set the design date.
static uint32_t makeHeader(EPacketType inType, EOpcode inOpcode, uint32_t inAddress, uint32_t inCount)
Construct a packet header.
boost::filesystem::path path
Header for the SpartanBitstream class.
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.
void write(std::ostream &inStream, uint8_t inVal)
Write a uint8_t to the stream.
static SpartanPacket makeNullType1Write(uint32_t inAddress)
Construct a null type 1 write packet.
static SpartanPacket makeType1Write(uint32_t inAddress, uint32_t inWord)
Construct a type 1 write packet.
Header for the Spartan3E 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 Spartan class architectures.
BOOST_AUTO_TEST_CASE(hexCharacterToDec)
void setDeviceName(const string &inDeviceName)
Set the device name.
static const boost::filesystem::path & getExecutablePath(void)
Returns the absolute path to the executable directory.