19 #ifndef TORC_BITSTREAM_SPARTAN6BITSTREAM_HPP
20 #define TORC_BITSTREAM_SPARTAN6BITSTREAM_HPP
22 #include <boost/cstdint.hpp>
29 namespace bitstream {
class Spartan6BitstreamUnitTest; }
58 for(int32_t i = 21, mask = 0x20; i >= 16; i--, mask >>= 1)
59 input[i] = (inAddress & mask) ? 1 : 0;
60 for(int32_t i = 15, mask = 0x8000; i >= 0; i--, mask >>= 1)
61 input[i] = (inWord & mask) ? 1 : 0;
63 for(int32_t i = 21; i >= 16; i--) next[i] =
mBits[i - 1] ^ input[i];
65 for(int32_t i = 14; i >= 13; i--) next[i] = mBits[i - 1] ^ input[i];
66 next[12] = mBits[11] ^ input[12] ^ mBits[21];
67 for(int32_t i = 11; i >= 8; i--) next[i] = mBits[i - 1] ^ input[i];
68 next[7] = mBits[6] ^ input[7] ^ mBits[21];
69 for(int32_t i = 6; i >= 1; i--) next[i] = mBits[i - 1] ^ input[i];
70 next[0] = input[0] ^ mBits[21];
73 for(int32_t i = 0, mask = 1; i <
eLen; i++, mask <<= 1) {
75 mValue |= mBits[i] ? mask : 0;
103 #endif // TORC_BITSTREAM_SPARTAN6BITSTREAM_HPP
boost::uint16_t uint16_t
Imported type name.
virtual void preflightPackets(void)
Preflight the packets.
virtual void writePackets(std::ostream &inStream)
Write bitstream packets to a stream.
void reset(void)
Function to clear the CRC calculation.
void update(uint32_t inAddress, uint32_t inWord)
Update the CRC with new data.
Spartan6Bitstream(void)
Basic constructor.
virtual void updatePacketLength(void)
Update the header packet length.
friend class torc::bitstream::bitstream::Spartan6BitstreamUnitTest
boost::uint8_t uint8_t
Imported type name.
Bitstream packet constants for Spartan 16 bit class architectures.
boost::uint32_t uint32_t
Imported type name.
virtual void readPackets(std::istream &inStream)
Read bitstream packets from a stream.
std::vector< Spartan6Packet > Spartan6PacketVector
Vector of Spartan 16 bit packets.
Xilinx bitstream base class.
CRC class for the Spartan6 architecture.
Header for the Bitstream class.
Header for the Spartan6Packet class.
uint32_t mValue
CRC calculation value.
uint8_t & operator[](int i)
Index operator.
uint8_t mBits[eLen]
CRC calculation bits.
CRC(void)
Default constructor.