#include <Bitstream.hpp>
Public Types | |
typedef std::string | string |
typedef boost::uint8_t | uint8_t |
Imported type name. | |
typedef boost::uint16_t | uint16_t |
Imported type name. | |
typedef boost::uint32_t | uint32_t |
Imported type name. | |
typedef torc::common::EDevice | EDevice |
Imported type name. | |
typedef std::map< std::string, uint32_t > | TileTypeNameToColumnType |
Mapping from tile type names to column types. | |
typedef std::map< uint16_t, uint32_t > | TileTypeIndexToColumnType |
Mapping from tile indexes to column types. | |
Public Member Functions | |
void | write (std::ostream &inStream, uint8_t inVal) |
Write a uint8_t to the stream. | |
void | write (std::ostream &inStream, uint16_t inVal) |
Write a uint16_t to the stream. | |
void | write (std::ostream &inStream, uint32_t inVal) |
Write a uint32_t to the stream. | |
void | writeHeaderString (std::ostream &inStream, const string &inString) |
Write a Xilinx-style header string to the stream. | |
void | cleanDateAndTime (void) |
Clean up the header date and time by replacing embedded spaces with zeros. | |
virtual void | initializeDeviceInfo (const std::string &inDeviceName) |
Initialize the maps between frame indexes and frame addresses. This is generally only useful for internal purposes. | |
virtual void | initializeFrameMaps (void) |
Initialize the maps between frame indexes and frame addresses. This is generally only useful for internal purposes. | |
virtual void | writeDeviceInfo (std::ostream &inStream, const std::string &inDeviceName) |
Output static device information to a stream. | |
void | setDeviceInfo (const DeviceInfo &rhs) |
Assign static device information for the current bitstream. | |
void | setDevice (const std::string &inDeviceName) |
Assign the device enumeration constant for the given device name. | |
Bitstream (void) | |
Basic constructor. | |
virtual | ~Bitstream (void) |
Virtual destructor. | |
virtual void | read (std::istream &inStream, bool inCleanDateAndTime=true) |
Read the bitstream header and packets from a stream. | |
virtual void | readPackets (std::istream &inStream) |
Read the bitstream packets. | |
virtual void | readHeader (std::istream &inStream) |
Read the bitstream header. | |
virtual void | write (std::ostream &inStream) |
Write the bitstream header and packets to a stream. | |
virtual void | preflightPackets (void) |
Preflight the packets. | |
virtual void | updatePacketLength (void) |
Update the header packet length. | |
virtual void | writePackets (std::ostream &inStream) |
Write the bitstream packets. | |
virtual void | writeHeader (std::ostream &inStream) |
Write the bitstream header to the stream. | |
void | setDesignName (const string &inDesignName) |
Set the design name. | |
void | setDeviceName (const string &inDeviceName) |
Set the device name. | |
void | setDesignDate (const string &inDesignDate) |
Set the design date. | |
void | setDesignTime (const string &inDesignTime) |
Set the design time. | |
const string & | getDesignName (void) const |
Return the design name. | |
const string & | getDeviceName (void) const |
Return the device name. | |
const string & | getDesignDate (void) const |
Return the design date. | |
const string & | getDesignTime (void) const |
Return the design time. | |
uint32_t | getBitstreamByteLength (void) const |
Return the bitstream packet length in bytes. | |
uint32_t | getHeaderByteLength (void) const |
Return the bitstream header length in bytes. | |
virtual uint32_t | getFrameLength (void) const |
Return the frame length for the current device. | |
Static Public Member Functions | |
static bool | expect (std::istream &inStream, uint8_t inExpected) |
Look for the expected uint8_t in the stream and return true if it matches. | |
static bool | expect (std::istream &inStream, uint16_t inExpected) |
Look for the expected uint16_t in the stream and return true if it matches. | |
static bool | expect (std::istream &inStream, uint32_t inExpected) |
Look for the expected uint32_t in the stream and return true if it matches. | |
static void | readHeaderString (std::istream &inStream, string &outString) |
Read and return a bitstream header string. | |
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. | |
static void | writeSubfieldSettings (std::ostream &inStream, uint32_t inWord, const Subfield *inSubfields) |
Insert 32 bit subfield settings into an output stream. | |
static void | writeSubfieldSettings (std::ostream &inStream, uint16_t inWord, const Subfield *inSubfields) |
Insert 16 bit subfield settings into an output stream. | |
Public Attributes | |
EDevice | mDevice |
Bitstream device enumeration. | |
string | mDesignName |
Header design name. | |
string | mDeviceName |
Header device name. | |
string | mDesignDate |
Header design date. | |
string | mDesignTime |
Header design time. | |
uint32_t | mBitstreamByteLength |
Bitstream packet length in bytes. | |
uint32_t | mHeaderByteLength |
Header length in bytes. | |
ColumnDefVector | mColumnDefs |
Column type widths. | |
TileTypeNameToColumnType | mTileTypeNameToColumnType |
TileTypeIndexToColumnType | mTileTypeIndexToColumnType |
DeviceInfo | mDeviceInfo |
Device information. | |
Friends | |
class | torc::bitstream::bitstream::BitstreamUnitTest |
std::ostream & | operator<< (std::ostream &os, const Bitstream &rhs) |
Insert the bitstream header into an output stream. | |
Classes | |
struct | Subfield |
Definition at line 40 of file Bitstream.hpp.
typedef std::string torc::bitstream::Bitstream::string |
Imported type name.
Definition at line 45 of file Bitstream.hpp.
typedef boost::uint8_t torc::bitstream::Bitstream::uint8_t |
typedef boost::uint16_t torc::bitstream::Bitstream::uint16_t |
Imported type name.
Reimplemented in torc::bitstream::Spartan6, and torc::bitstream::Spartan6Bitstream.
Definition at line 47 of file Bitstream.hpp.
typedef boost::uint32_t torc::bitstream::Bitstream::uint32_t |
Imported type name.
Reimplemented in torc::bitstream::Spartan3E, torc::bitstream::Spartan6, torc::bitstream::Spartan6Bitstream, torc::bitstream::SpartanBitstream, torc::bitstream::Virtex, torc::bitstream::Virtex2, torc::bitstream::Virtex4, torc::bitstream::Virtex5, torc::bitstream::Virtex6, torc::bitstream::Virtex7, and torc::bitstream::VirtexBitstream.
Definition at line 48 of file Bitstream.hpp.
typedef torc::common::EDevice torc::bitstream::Bitstream::EDevice |
typedef std::map<std::string, uint32_t> torc::bitstream::Bitstream::TileTypeNameToColumnType |
typedef std::map<uint16_t, uint32_t> torc::bitstream::Bitstream::TileTypeIndexToColumnType |
torc::bitstream::Bitstream::Bitstream | ( | void | ) | [inline] |
virtual torc::bitstream::Bitstream::~Bitstream | ( | void | ) | [inline, virtual] |
void torc::bitstream::Bitstream::write | ( | std::ostream & | inStream, | |
uint8_t | inVal | |||
) | [inline] |
void torc::bitstream::Bitstream::write | ( | std::ostream & | inStream, | |
uint16_t | inVal | |||
) | [inline] |
void torc::bitstream::Bitstream::write | ( | std::ostream & | inStream, | |
uint32_t | inVal | |||
) | [inline] |
void torc::bitstream::Bitstream::writeHeaderString | ( | std::ostream & | inStream, | |
const string & | inString | |||
) | [inline] |
static bool torc::bitstream::Bitstream::expect | ( | std::istream & | inStream, | |
uint8_t | inExpected | |||
) | [inline, static] |
Look for the expected uint8_t in the stream and return true if it matches.
Definition at line 74 of file Bitstream.hpp.
static bool torc::bitstream::Bitstream::expect | ( | std::istream & | inStream, | |
uint16_t | inExpected | |||
) | [inline, static] |
Look for the expected uint16_t in the stream and return true if it matches.
Definition at line 82 of file Bitstream.hpp.
static bool torc::bitstream::Bitstream::expect | ( | std::istream & | inStream, | |
uint32_t | inExpected | |||
) | [inline, static] |
Look for the expected uint32_t in the stream and return true if it matches.
Definition at line 90 of file Bitstream.hpp.
static void torc::bitstream::Bitstream::readHeaderString | ( | std::istream & | inStream, | |
string & | outString | |||
) | [inline, static] |
void torc::bitstream::Bitstream::cleanDateAndTime | ( | void | ) | [inline] |
Clean up the header date and time by replacing embedded spaces with zeros.
Definition at line 168 of file Bitstream.hpp.
void torc::bitstream::Bitstream::writeSubfieldSettings | ( | std::ostream & | inStream, | |
uint32_t | inWord, | |||
const Subfield * | inSubfields | |||
) | [static] |
void torc::bitstream::Bitstream::writeSubfieldSettings | ( | std::ostream & | inStream, | |
uint16_t | inWord, | |||
const Subfield * | inSubfields | |||
) | [static] |
virtual void torc::bitstream::Bitstream::initializeDeviceInfo | ( | const std::string & | inDeviceName | ) | [inline, virtual] |
Initialize the maps between frame indexes and frame addresses. This is generally only useful for internal purposes.
Reimplemented in torc::bitstream::Spartan3E, torc::bitstream::Virtex, torc::bitstream::Virtex2, torc::bitstream::Virtex2P, torc::bitstream::Virtex4, torc::bitstream::Virtex5, torc::bitstream::Virtex6, torc::bitstream::Virtex7, and torc::bitstream::VirtexE.
Definition at line 199 of file Bitstream.hpp.
virtual void torc::bitstream::Bitstream::initializeFrameMaps | ( | void | ) | [inline, virtual] |
Initialize the maps between frame indexes and frame addresses. This is generally only useful for internal purposes.
Reimplemented in torc::bitstream::Spartan3E, torc::bitstream::Virtex, torc::bitstream::Virtex2, torc::bitstream::Virtex4, torc::bitstream::Virtex5, torc::bitstream::Virtex6, and torc::bitstream::VirtexE.
Definition at line 202 of file Bitstream.hpp.
void torc::bitstream::Bitstream::writeDeviceInfo | ( | std::ostream & | inStream, | |
const std::string & | inDeviceName | |||
) | [virtual] |
Output static device information to a stream.
This is used to generate the static column maps for bitstream frame mapping.
Definition at line 74 of file Bitstream.cpp.
void torc::bitstream::Bitstream::setDeviceInfo | ( | const DeviceInfo & | rhs | ) | [inline] |
Assign static device information for the current bitstream.
Definition at line 208 of file Bitstream.hpp.
void torc::bitstream::Bitstream::setDevice | ( | const std::string & | inDeviceName | ) | [inline] |
Assign the device enumeration constant for the given device name.
Definition at line 210 of file Bitstream.hpp.
virtual void torc::bitstream::Bitstream::read | ( | std::istream & | inStream, | |
bool | inCleanDateAndTime = true | |||
) | [inline, virtual] |
virtual void torc::bitstream::Bitstream::readPackets | ( | std::istream & | inStream | ) | [inline, virtual] |
Read the bitstream packets.
Reimplemented in torc::bitstream::Spartan6Bitstream, torc::bitstream::SpartanBitstream, and torc::bitstream::VirtexBitstream.
Definition at line 257 of file Bitstream.hpp.
virtual void torc::bitstream::Bitstream::readHeader | ( | std::istream & | inStream | ) | [inline, virtual] |
virtual void torc::bitstream::Bitstream::write | ( | std::ostream & | inStream | ) | [inline, virtual] |
virtual void torc::bitstream::Bitstream::preflightPackets | ( | void | ) | [inline, virtual] |
Preflight the packets.
Reimplemented in torc::bitstream::Spartan6Bitstream, torc::bitstream::SpartanBitstream, and torc::bitstream::VirtexBitstream.
Definition at line 272 of file Bitstream.hpp.
virtual void torc::bitstream::Bitstream::updatePacketLength | ( | void | ) | [inline, virtual] |
Update the header packet length.
Reimplemented in torc::bitstream::Spartan6Bitstream, torc::bitstream::SpartanBitstream, and torc::bitstream::VirtexBitstream.
Definition at line 274 of file Bitstream.hpp.
virtual void torc::bitstream::Bitstream::writePackets | ( | std::ostream & | inStream | ) | [inline, virtual] |
Write the bitstream packets.
Reimplemented in torc::bitstream::Spartan6Bitstream, torc::bitstream::SpartanBitstream, and torc::bitstream::VirtexBitstream.
Definition at line 276 of file Bitstream.hpp.
virtual void torc::bitstream::Bitstream::writeHeader | ( | std::ostream & | inStream | ) | [inline, virtual] |
void torc::bitstream::Bitstream::setDesignName | ( | const string & | inDesignName | ) | [inline] |
void torc::bitstream::Bitstream::setDeviceName | ( | const string & | inDeviceName | ) | [inline] |
void torc::bitstream::Bitstream::setDesignDate | ( | const string & | inDesignDate | ) | [inline] |
void torc::bitstream::Bitstream::setDesignTime | ( | const string & | inDesignTime | ) | [inline] |
const string& torc::bitstream::Bitstream::getDesignName | ( | void | ) | const [inline] |
const string& torc::bitstream::Bitstream::getDeviceName | ( | void | ) | const [inline] |
const string& torc::bitstream::Bitstream::getDesignDate | ( | void | ) | const [inline] |
const string& torc::bitstream::Bitstream::getDesignTime | ( | void | ) | const [inline] |
uint32_t torc::bitstream::Bitstream::getBitstreamByteLength | ( | void | ) | const [inline] |
Return the bitstream packet length in bytes.
The length includes all packet data, but does not include the bitstream header.
Definition at line 325 of file Bitstream.hpp.
uint32_t torc::bitstream::Bitstream::getHeaderByteLength | ( | void | ) | const [inline] |
virtual uint32_t torc::bitstream::Bitstream::getFrameLength | ( | void | ) | const [inline, virtual] |
Return the frame length for the current device.
Reimplemented in torc::bitstream::Spartan3E, torc::bitstream::Virtex, torc::bitstream::Virtex2, torc::bitstream::Virtex2P, torc::bitstream::Virtex4, torc::bitstream::Virtex5, torc::bitstream::Virtex6, torc::bitstream::Virtex7, and torc::bitstream::VirtexE.
Definition at line 329 of file Bitstream.hpp.
std::ostream& operator<< | ( | std::ostream & | os, | |
const Bitstream & | rhs | |||
) | [friend] |
Insert the bitstream header into an output stream.
Definition at line 49 of file OutputStreamHelpers.cpp.
Bitstream packet length in bytes.
This is the length in bytes of all the bitstream packets, without the bitstream header.
Definition at line 227 of file Bitstream.hpp.
Header length in bytes.
This is the length of the header itself, as opposed to mBitstreamByteLength, which is the length of bitstream reported by the header.
Definition at line 231 of file Bitstream.hpp.