torc-master
|
Xilinx bitstream base class. More...
#include <Bitstream.hpp>
Data Structures | |
struct | Subfield |
Public Types | |
enum | { eBlockTypeCount = 8 } |
The block type count is fixed at eight across all Xilinx architectures. More... | |
enum | EBitstreamType { eBitstreamTypeFull, eBitstreamTypePartialActive, eBitstreamTypePartialShutdown } |
The bitstream type to generate. Use eBitstreamFull to fully reconfigure a device, eBitstreamTypePartialActive to partially reconfigure it while it continues to run, or eBitstreamTypePartialShutdown to partially recongifure it after shutting it down. More... | |
enum | EFrameInclude { eFrameIncludeOnlyDirtyFrames, eFrameIncludeAllUsedFrames } |
The frames to include in a partial bitstream. Use eFrameIncludeOnlyDirtyFrames to include only dirty frames, or eFrameStateAllUsedFrames to include all allocated frames, dirty or not. Note that if not all frames were allocated, eFrameStateAllUsedFrames is not the same as a full bitstream. More... | |
typedef std::string | string |
Imported type name. More... | |
typedef boost::uint8_t | uint8_t |
Imported type name. More... | |
typedef boost::uint16_t | uint16_t |
Imported type name. More... | |
typedef boost::uint32_t | uint32_t |
Imported type name. More... | |
typedef torc::common::EDevice | EDevice |
Imported type name. More... | |
typedef std::map< std::string, uint32_t > | TileTypeNameToColumnType |
Mapping from tile type names to column types. More... | |
typedef std::map< uint16_t, uint32_t > | TileTypeIndexToColumnType |
Mapping from tile indexes to column types. More... | |
Public Member Functions | |
void | write (std::ostream &inStream, uint8_t inVal) |
Write a uint8_t to the stream. More... | |
void | write (std::ostream &inStream, uint16_t inVal) |
Write a uint16_t to the stream. More... | |
void | write (std::ostream &inStream, uint32_t inVal) |
Write a uint32_t to the stream. More... | |
void | writeHeaderString (std::ostream &inStream, const string &inString) |
Write a Xilinx-style header string to the stream. More... | |
void | cleanDateAndTime (void) |
Clean up the header date and time by replacing embedded spaces with zeros. More... | |
virtual void | initializeDeviceInfo (const std::string &inDeviceName) |
Initialize the maps between frame indexes and frame addresses. This is generally only useful for internal purposes. More... | |
virtual void | initializeFrameMaps (void) |
Initialize the maps between frame indexes and frame addresses. This is generally only useful for internal purposes. More... | |
virtual void | writeDeviceInfo (std::ostream &inStream, const std::string &inDeviceName) |
Output static device information to a stream. More... | |
void | setDeviceInfo (const DeviceInfo &rhs) |
Assign static device information for the current bitstream. More... | |
void | setDevice (const std::string &inDeviceName) |
Assign the device enumeration constant for the given device name. More... | |
Bitstream (void) | |
Basic constructor. More... | |
virtual | ~Bitstream (void) |
Virtual destructor. More... | |
virtual void | read (std::istream &inStream, bool inCleanDateAndTime=true) |
Read the bitstream header and packets from a stream. More... | |
virtual void | readPackets (std::istream &inStream) |
Read the bitstream packets. More... | |
virtual void | readHeader (std::istream &inStream) |
Read the bitstream header. More... | |
virtual void | write (std::ostream &inStream) |
Write the bitstream header and packets to a stream. More... | |
virtual void | preflightPackets (void) |
Preflight the packets. More... | |
virtual void | updatePacketLength (void) |
Update the header packet length. More... | |
virtual void | writePackets (std::ostream &inStream) |
Write the bitstream packets. More... | |
virtual void | writeHeader (std::ostream &inStream) |
Write the bitstream header to the stream. More... | |
void | setDesignName (const string &inDesignName) |
Set the design name. More... | |
void | setDeviceName (const string &inDeviceName) |
Set the device name. More... | |
void | setDesignDate (const string &inDesignDate) |
Set the design date. More... | |
void | setDesignTime (const string &inDesignTime) |
Set the design time. More... | |
const string & | getDesignName (void) const |
Return the design name. More... | |
const string & | getDeviceName (void) const |
Return the device name. More... | |
const string & | getDesignDate (void) const |
Return the design date. More... | |
const string & | getDesignTime (void) const |
Return the design time. More... | |
uint32_t | getBitstreamByteLength (void) const |
Return the bitstream packet length in bytes. More... | |
uint32_t | getHeaderByteLength (void) const |
Return the bitstream header length in bytes. More... | |
virtual uint32_t | getFrameLength (void) const |
Return the frame length for the current device. More... | |
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. More... | |
static bool | expect (std::istream &inStream, uint16_t inExpected) |
Look for the expected uint16_t in the stream and return true if it matches. More... | |
static bool | expect (std::istream &inStream, uint32_t inExpected) |
Look for the expected uint32_t in the stream and return true if it matches. More... | |
static void | readHeaderString (std::istream &inStream, string &outString) |
Read and return a bitstream header string. More... | |
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. More... | |
static void | writeSubfieldSettings (std::ostream &inStream, uint32_t inWord, const Subfield *inSubfields) |
Insert 32 bit subfield settings into an output stream. More... | |
static void | writeSubfieldSettings (std::ostream &inStream, uint16_t inWord, const Subfield *inSubfields) |
Insert 16 bit subfield settings into an output stream. More... | |
Data Fields | |
EDevice | mDevice |
Bitstream device enumeration. More... | |
string | mDesignName |
Header design name. More... | |
string | mDeviceName |
Header device name. More... | |
string | mDesignDate |
Header design date. More... | |
string | mDesignTime |
Header design time. More... | |
uint32_t | mBitstreamByteLength |
Bitstream packet length in bytes. More... | |
uint32_t | mHeaderByteLength |
Header length in bytes. More... | |
ColumnDefVector | mColumnDefs |
Column type widths. More... | |
TileTypeNameToColumnType | mTileTypeNameToColumnType |
TileTypeIndexToColumnType | mTileTypeIndexToColumnType |
DeviceInfo | mDeviceInfo |
Device information. More... | |
Friends | |
class | torc::bitstream::bitstream::BitstreamUnitTest |
std::ostream & | operator<< (std::ostream &os, const Bitstream &rhs) |
Insert the bitstream header into an output stream. More... | |
Xilinx bitstream base class.
Definition at line 40 of file bitstream/Bitstream.hpp.
Imported type name.
Definition at line 64 of file bitstream/Bitstream.hpp.
typedef std::string torc::bitstream::Bitstream::string |
Imported type name.
Definition at line 60 of file bitstream/Bitstream.hpp.
typedef std::map<uint16_t, uint32_t> torc::bitstream::Bitstream::TileTypeIndexToColumnType |
Mapping from tile indexes to column types.
Definition at line 254 of file bitstream/Bitstream.hpp.
typedef std::map<std::string, uint32_t> torc::bitstream::Bitstream::TileTypeNameToColumnType |
Mapping from tile type names to column types.
Definition at line 251 of file bitstream/Bitstream.hpp.
typedef boost::uint16_t torc::bitstream::Bitstream::uint16_t |
Imported type name.
Definition at line 62 of file bitstream/Bitstream.hpp.
typedef boost::uint32_t torc::bitstream::Bitstream::uint32_t |
Imported type name.
Definition at line 63 of file bitstream/Bitstream.hpp.
typedef boost::uint8_t torc::bitstream::Bitstream::uint8_t |
Imported type name.
Definition at line 61 of file bitstream/Bitstream.hpp.
anonymous enum |
The block type count is fixed at eight across all Xilinx architectures.
Enumerator | |
---|---|
eBlockTypeCount |
Definition at line 44 of file bitstream/Bitstream.hpp.
The bitstream type to generate. Use eBitstreamFull to fully reconfigure a device, eBitstreamTypePartialActive to partially reconfigure it while it continues to run, or eBitstreamTypePartialShutdown to partially recongifure it after shutting it down.
Enumerator | |
---|---|
eBitstreamTypeFull | |
eBitstreamTypePartialActive | |
eBitstreamTypePartialShutdown |
Definition at line 49 of file bitstream/Bitstream.hpp.
The frames to include in a partial bitstream. Use eFrameIncludeOnlyDirtyFrames to include only dirty frames, or eFrameStateAllUsedFrames to include all allocated frames, dirty or not. Note that if not all frames were allocated, eFrameStateAllUsedFrames is not the same as a full bitstream.
Enumerator | |
---|---|
eFrameIncludeOnlyDirtyFrames | |
eFrameIncludeAllUsedFrames |
Definition at line 56 of file bitstream/Bitstream.hpp.
|
inline |
Basic constructor.
Definition at line 261 of file bitstream/Bitstream.hpp.
|
inlinevirtual |
|
inline |
Clean up the header date and time by replacing embedded spaces with zeros.
Definition at line 183 of file bitstream/Bitstream.hpp.
|
inlinestatic |
Look for the expected uint8_t in the stream and return true if it matches.
Definition at line 89 of file bitstream/Bitstream.hpp.
|
inlinestatic |
Look for the expected uint16_t in the stream and return true if it matches.
Definition at line 97 of file bitstream/Bitstream.hpp.
|
inlinestatic |
Look for the expected uint32_t in the stream and return true if it matches.
Definition at line 105 of file bitstream/Bitstream.hpp.
|
inline |
Return the bitstream packet length in bytes.
The length includes all packet data, but does not include the bitstream header.
Definition at line 340 of file bitstream/Bitstream.hpp.
|
inline |
Return the design date.
Definition at line 335 of file bitstream/Bitstream.hpp.
|
inline |
Return the design name.
Definition at line 331 of file bitstream/Bitstream.hpp.
|
inline |
Return the design time.
Definition at line 337 of file bitstream/Bitstream.hpp.
|
inline |
Return the device name.
Definition at line 333 of file bitstream/Bitstream.hpp.
|
inlinevirtual |
Return the frame length for the current device.
Reimplemented in torc::bitstream::Virtex7, torc::bitstream::Virtex5, torc::bitstream::Virtex6, torc::bitstream::Virtex4, torc::bitstream::Virtex2, torc::bitstream::Virtex, torc::bitstream::Spartan6, torc::bitstream::Spartan3E, torc::bitstream::VirtexE, and torc::bitstream::Virtex2P.
Definition at line 344 of file bitstream/Bitstream.hpp.
|
inline |
Return the bitstream header length in bytes.
Definition at line 342 of file bitstream/Bitstream.hpp.
|
inlinevirtual |
Initialize the maps between frame indexes and frame addresses. This is generally only useful for internal purposes.
Reimplemented in torc::bitstream::Virtex7, torc::bitstream::Virtex6, torc::bitstream::Virtex5, torc::bitstream::Virtex4, torc::bitstream::Spartan3E, torc::bitstream::Virtex2, torc::bitstream::Virtex, torc::bitstream::Virtex2P, and torc::bitstream::VirtexE.
Definition at line 214 of file bitstream/Bitstream.hpp.
|
inlinevirtual |
Initialize the maps between frame indexes and frame addresses. This is generally only useful for internal purposes.
Reimplemented in torc::bitstream::Virtex7, torc::bitstream::Virtex6, torc::bitstream::Virtex5, torc::bitstream::Virtex4, torc::bitstream::Spartan3E, torc::bitstream::Virtex2, torc::bitstream::Virtex, and torc::bitstream::VirtexE.
Definition at line 217 of file bitstream/Bitstream.hpp.
|
inlinevirtual |
Preflight the packets.
Reimplemented in torc::bitstream::VirtexBitstream, torc::bitstream::Spartan6Bitstream, and torc::bitstream::SpartanBitstream.
Definition at line 287 of file bitstream/Bitstream.hpp.
|
inlinevirtual |
Read the bitstream header and packets from a stream.
Definition at line 266 of file bitstream/Bitstream.hpp.
|
inlinestatic |
Read a bitstream header, and return its fields.
Definition at line 142 of file bitstream/Bitstream.hpp.
|
inlinevirtual |
Read the bitstream header.
Definition at line 274 of file bitstream/Bitstream.hpp.
|
inlinestatic |
Read and return a bitstream header string.
Definition at line 124 of file bitstream/Bitstream.hpp.
|
inlinevirtual |
Read the bitstream packets.
Reimplemented in torc::bitstream::Virtex2, torc::bitstream::Spartan6Bitstream, torc::bitstream::VirtexBitstream, and torc::bitstream::SpartanBitstream.
Definition at line 272 of file bitstream/Bitstream.hpp.
|
inline |
Set the design date.
Definition at line 327 of file bitstream/Bitstream.hpp.
|
inline |
Set the design name.
Definition at line 323 of file bitstream/Bitstream.hpp.
|
inline |
Set the design time.
Definition at line 329 of file bitstream/Bitstream.hpp.
|
inline |
Assign the device enumeration constant for the given device name.
Definition at line 225 of file bitstream/Bitstream.hpp.
|
inline |
Assign static device information for the current bitstream.
Definition at line 223 of file bitstream/Bitstream.hpp.
|
inline |
Set the device name.
Definition at line 325 of file bitstream/Bitstream.hpp.
|
inlinevirtual |
Update the header packet length.
Reimplemented in torc::bitstream::VirtexBitstream, torc::bitstream::Spartan6Bitstream, and torc::bitstream::SpartanBitstream.
Definition at line 289 of file bitstream/Bitstream.hpp.
|
inline |
Write a uint8_t to the stream.
Definition at line 67 of file bitstream/Bitstream.hpp.
|
inline |
Write a uint16_t to the stream.
Definition at line 72 of file bitstream/Bitstream.hpp.
|
inline |
Write a uint32_t to the stream.
Definition at line 77 of file bitstream/Bitstream.hpp.
|
inlinevirtual |
Write the bitstream header and packets to a stream.
Definition at line 280 of file bitstream/Bitstream.hpp.
|
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.
|
inlinevirtual |
Write the bitstream header to the stream.
Definition at line 293 of file bitstream/Bitstream.hpp.
|
inline |
Write a Xilinx-style header string to the stream.
Definition at line 82 of file bitstream/Bitstream.hpp.
|
inlinevirtual |
Write the bitstream packets.
Reimplemented in torc::bitstream::Spartan6Bitstream, torc::bitstream::VirtexBitstream, and torc::bitstream::SpartanBitstream.
Definition at line 291 of file bitstream/Bitstream.hpp.
|
static |
Insert 32 bit subfield settings into an output stream.
Definition at line 26 of file Bitstream.cpp.
|
static |
Insert 16 bit subfield settings into an output stream.
Definition at line 50 of file Bitstream.cpp.
|
friend |
Insert the bitstream header into an output stream.
Definition at line 49 of file bitstream/OutputStreamHelpers.cpp.
|
friend |
Definition at line 41 of file bitstream/Bitstream.hpp.
uint32_t torc::bitstream::Bitstream::mBitstreamByteLength |
Bitstream packet length in bytes.
This is the length in bytes of all the bitstream packets, without the bitstream header.
Definition at line 242 of file bitstream/Bitstream.hpp.
ColumnDefVector torc::bitstream::Bitstream::mColumnDefs |
Column type widths.
Definition at line 249 of file bitstream/Bitstream.hpp.
string torc::bitstream::Bitstream::mDesignDate |
Header design date.
Definition at line 236 of file bitstream/Bitstream.hpp.
string torc::bitstream::Bitstream::mDesignName |
Header design name.
Definition at line 232 of file bitstream/Bitstream.hpp.
string torc::bitstream::Bitstream::mDesignTime |
Header design time.
Definition at line 238 of file bitstream/Bitstream.hpp.
EDevice torc::bitstream::Bitstream::mDevice |
Bitstream device enumeration.
Definition at line 230 of file bitstream/Bitstream.hpp.
DeviceInfo torc::bitstream::Bitstream::mDeviceInfo |
Device information.
Definition at line 257 of file bitstream/Bitstream.hpp.
string torc::bitstream::Bitstream::mDeviceName |
Header device name.
Definition at line 234 of file bitstream/Bitstream.hpp.
uint32_t torc::bitstream::Bitstream::mHeaderByteLength |
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 246 of file bitstream/Bitstream.hpp.
TileTypeIndexToColumnType torc::bitstream::Bitstream::mTileTypeIndexToColumnType |
Definition at line 255 of file bitstream/Bitstream.hpp.
TileTypeNameToColumnType torc::bitstream::Bitstream::mTileTypeNameToColumnType |
Definition at line 252 of file bitstream/Bitstream.hpp.