torc::bitstream::Bitstream Class Reference

Xilinx bitstream base class. More...

#include <Bitstream.hpp>

Inheritance diagram for torc::bitstream::Bitstream:

Inheritance graph
[legend]
Collaboration diagram for torc::bitstream::Bitstream:

Collaboration graph
[legend]

List of all members.

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 stringgetDesignName (void) const
 Return the design name.
const stringgetDeviceName (void) const
 Return the device name.
const stringgetDesignDate (void) const
 Return the design date.
const stringgetDesignTime (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


Detailed Description

Xilinx bitstream base class.

Definition at line 40 of file Bitstream.hpp.


Member Typedef Documentation

Todo:
Bitstream access needs to be changed from public back to protected.
Imported type name.

Definition at line 45 of file Bitstream.hpp.

typedef boost::uint8_t torc::bitstream::Bitstream::uint8_t

Imported type name.

Definition at line 46 of file Bitstream.hpp.

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

typedef torc::common::EDevice torc::bitstream::Bitstream::EDevice

Imported type name.

Definition at line 49 of file Bitstream.hpp.

Mapping from tile type names to column types.

Definition at line 236 of file Bitstream.hpp.

Mapping from tile indexes to column types.

Definition at line 239 of file Bitstream.hpp.


Constructor & Destructor Documentation

torc::bitstream::Bitstream::Bitstream ( void   )  [inline]

Basic constructor.

Definition at line 246 of file Bitstream.hpp.

virtual torc::bitstream::Bitstream::~Bitstream ( void   )  [inline, virtual]

Virtual destructor.

Definition at line 248 of file Bitstream.hpp.


Member Function Documentation

void torc::bitstream::Bitstream::write ( std::ostream &  inStream,
uint8_t  inVal 
) [inline]

Write a uint8_t to the stream.

Definition at line 52 of file Bitstream.hpp.

void torc::bitstream::Bitstream::write ( std::ostream &  inStream,
uint16_t  inVal 
) [inline]

Write a uint16_t to the stream.

Definition at line 57 of file Bitstream.hpp.

void torc::bitstream::Bitstream::write ( std::ostream &  inStream,
uint32_t  inVal 
) [inline]

Write a uint32_t to the stream.

Definition at line 62 of file Bitstream.hpp.

void torc::bitstream::Bitstream::writeHeaderString ( std::ostream &  inStream,
const string inString 
) [inline]

Write a Xilinx-style header string to the stream.

Definition at line 67 of file Bitstream.hpp.

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]

Read and return a bitstream header string.

Definition at line 109 of file Bitstream.hpp.

static bool torc::bitstream::Bitstream::readHeader ( std::istream &  inStream,
string outDesignName,
string outDeviceName,
string outDesignDate,
string outDesignTime,
uint32_t outBitstreamLength,
uint32_t outHeaderLength 
) [inline, static]

Read a bitstream header, and return its fields.

Definition at line 127 of file Bitstream.hpp.

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]

Insert 32 bit subfield settings into an output stream.

Definition at line 26 of file Bitstream.cpp.

void torc::bitstream::Bitstream::writeSubfieldSettings ( std::ostream &  inStream,
uint16_t  inWord,
const Subfield *  inSubfields 
) [static]

Insert 16 bit subfield settings into an output stream.

Definition at line 50 of file Bitstream.cpp.

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.

Todo:
This function should be made pure virtual.

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]

Read the bitstream header and packets from a stream.

Definition at line 251 of file Bitstream.hpp.

virtual void torc::bitstream::Bitstream::readPackets ( std::istream &  inStream  )  [inline, virtual]

virtual void torc::bitstream::Bitstream::readHeader ( std::istream &  inStream  )  [inline, virtual]

Read the bitstream header.

Definition at line 259 of file Bitstream.hpp.

virtual void torc::bitstream::Bitstream::write ( std::ostream &  inStream  )  [inline, virtual]

Write the bitstream header and packets to a stream.

Definition at line 265 of file Bitstream.hpp.

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]

virtual void torc::bitstream::Bitstream::writeHeader ( std::ostream &  inStream  )  [inline, virtual]

Write the bitstream header to the stream.

Definition at line 278 of file Bitstream.hpp.

void torc::bitstream::Bitstream::setDesignName ( const string inDesignName  )  [inline]

Set the design name.

Definition at line 308 of file Bitstream.hpp.

void torc::bitstream::Bitstream::setDeviceName ( const string inDeviceName  )  [inline]

Set the device name.

Definition at line 310 of file Bitstream.hpp.

void torc::bitstream::Bitstream::setDesignDate ( const string inDesignDate  )  [inline]

Set the design date.

Definition at line 312 of file Bitstream.hpp.

void torc::bitstream::Bitstream::setDesignTime ( const string inDesignTime  )  [inline]

Set the design time.

Definition at line 314 of file Bitstream.hpp.

const string& torc::bitstream::Bitstream::getDesignName ( void   )  const [inline]

Return the design name.

Definition at line 316 of file Bitstream.hpp.

const string& torc::bitstream::Bitstream::getDeviceName ( void   )  const [inline]

Return the device name.

Definition at line 318 of file Bitstream.hpp.

const string& torc::bitstream::Bitstream::getDesignDate ( void   )  const [inline]

Return the design date.

Definition at line 320 of file Bitstream.hpp.

const string& torc::bitstream::Bitstream::getDesignTime ( void   )  const [inline]

Return the design time.

Definition at line 322 of file Bitstream.hpp.

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]

Return the bitstream header length in bytes.

Definition at line 327 of file Bitstream.hpp.

virtual uint32_t torc::bitstream::Bitstream::getFrameLength ( void   )  const [inline, virtual]


Friends And Related Function Documentation

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.


Member Data Documentation

Bitstream device enumeration.

Definition at line 215 of file Bitstream.hpp.

Header design name.

Definition at line 217 of file Bitstream.hpp.

Header device name.

Definition at line 219 of file Bitstream.hpp.

Header design date.

Definition at line 221 of file Bitstream.hpp.

Header design time.

Definition at line 223 of file Bitstream.hpp.

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.

Column type widths.

Definition at line 234 of file Bitstream.hpp.

Device information.

Definition at line 242 of file Bitstream.hpp.


The documentation for this class was generated from the following files:

Generated on Thu Oct 13 16:49:46 2011 for TORC by  doxygen 1.5.6