torc::bitstream::Spartan6Packet Class Reference

Bitstream packet for Spartan 16 bit class architectures. More...

#include <Spartan6Packet.hpp>

Inheritance diagram for torc::bitstream::Spartan6Packet:

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

Collaboration graph
[legend]

List of all members.

Public Member Functions

 Spartan6Packet (void)
 Null constructor.
 Spartan6Packet (uint16_t inHeader, uint32_t inCount, uint16_t inWord, uint16_t *inWords)
 Full constructor.
 Spartan6Packet (uint16_t inHeader, uint16_t inWord)
 Header plus single word constructor.
 Spartan6Packet (uint16_t inHeader)
 Header only constructor.
 Spartan6Packet (const Spartan6Packet &rhs)
 Copy constructor.
void write (std::ostream &inStream) const
 Write a packet.
uint16_t operator[] (size_t inIndex) const
EPacketType getType (void) const
EOpcode getOpcode (void) const
int getAddress (void) const
uint16_t getHeader (void) const
uint32_t getWordCount (void) const
 Returns the number of payload words in the packet, excluding the header word.
uint32_t getWordSize (void) const
 Returns the total number of words in the packet, including the header word. In the case of Type 2 packets, we also include the two implicity length words.
const WordSharedArray getWords (void) const
 brief Returns the raw packet words, including the header word.
bool isType1 (void) const
bool isType2 (void) const
bool isNop (void) const
bool isReserved (void) const
bool isRead (void) const
bool isWrite (void) const
bool isDummyWord (void) const
bool isSyncWord0 (void) const
bool isSyncWord1 (void) const
bool isBusWidthSyncWord0 (void) const
bool isBusWidthSyncWord1 (void) const
bool isBusWidthDetectWord0 (void) const
bool isBusWidthDetectWord1 (void) const

Static Public Member Functions

static Spartan6Packet read (std::istream &inStream)
 Read a packet.
static Spartan6Packet makeNullType2Write (uint16_t inAddress)
 Construct a null type 1 write packet.
static Spartan6Packet makeType1Write (uint16_t inAddress, uint16_t inWord)
 Construct a type 1 write packet.
static Spartan6Packet makeType1Write32 (uint16_t inAddress, uint32_t inWord)
 Construct a type 1 write packet for two words.
static Spartan6Packet makeType1Write (uint16_t inAddress, uint16_t inWord1, uint16_t inWord2)
 Construct a type 1 write packet for two words.
static Spartan6Packet makeType1Write (uint32_t inCount, uint16_t inAddress, uint16_t *inWords)
 Construct a type 1 write packet for multiple words.
static Spartan6Packet makeType2Write (uint32_t inCount, uint16_t inAddress, uint16_t *inWords)
 Construct a type 2 write packet.
static uint16_t makeHeader (EPacketType inType, EOpcode inOpcode, uint16_t inAddress, uint32_t inCount)
 Construct a packet header.

Public Attributes

uint16_t mHeader
uint32_t mCount
uint16_t mWord
WordSharedArray mWords
EPacketType mType
EOpcode mOpcode
int mAddress

Static Public Attributes

static const char * sPacketTypeName [ePacketTypeCount]
 Packet type names.
static const char * sOpcodeName [eOpcodeCount]
 Packet opcode names.

Protected Types

typedef boost::uint16_t uint16_t
 Imported type name.
typedef boost::uint32_t uint32_t
typedef boost::shared_array
< uint16_t
WordSharedArray
 Word shared array type.

Protected Member Functions

void initialize (void)

Friends

class torc::bitstream::bitstream::Spartan6PacketUnitTest


Detailed Description

Bitstream packet for Spartan 16 bit class architectures.

Definition at line 75 of file Spartan6Packet.hpp.


Member Typedef Documentation

typedef boost::uint16_t torc::bitstream::Spartan6Packet::uint16_t [protected]

Imported type name.

Definition at line 80 of file Spartan6Packet.hpp.

typedef boost::shared_array<uint16_t> torc::bitstream::Spartan6Packet::WordSharedArray [protected]

Word shared array type.

Definition at line 83 of file Spartan6Packet.hpp.


Constructor & Destructor Documentation

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

Null constructor.

Definition at line 107 of file Spartan6Packet.hpp.

torc::bitstream::Spartan6Packet::Spartan6Packet ( uint16_t  inHeader,
uint32_t  inCount,
uint16_t  inWord,
uint16_t inWords 
) [inline]

Full constructor.

Definition at line 110 of file Spartan6Packet.hpp.

torc::bitstream::Spartan6Packet::Spartan6Packet ( uint16_t  inHeader,
uint16_t  inWord 
) [inline]

Header plus single word constructor.

Definition at line 116 of file Spartan6Packet.hpp.

torc::bitstream::Spartan6Packet::Spartan6Packet ( uint16_t  inHeader  )  [inline]

Header only constructor.

Definition at line 121 of file Spartan6Packet.hpp.

torc::bitstream::Spartan6Packet::Spartan6Packet ( const Spartan6Packet rhs  )  [inline]

Copy constructor.

Definition at line 126 of file Spartan6Packet.hpp.


Member Function Documentation

static Spartan6Packet torc::bitstream::Spartan6Packet::read ( std::istream &  inStream  )  [inline, static]

Read a packet.

Todo:
we should throw an exception on invalid packet types

Definition at line 132 of file Spartan6Packet.hpp.

void torc::bitstream::Spartan6Packet::write ( std::ostream &  inStream  )  const [inline]

Write a packet.

Definition at line 199 of file Spartan6Packet.hpp.

static Spartan6Packet torc::bitstream::Spartan6Packet::makeNullType2Write ( uint16_t  inAddress  )  [inline, static]

Construct a null type 1 write packet.

A type 2 write packet to the FDRI register is generally only useful to specify the current register in preparation for a type 2 write. The type 2 write header includes a size but specifies no target register, hence the prior null type 2 packet.

Definition at line 222 of file Spartan6Packet.hpp.

static Spartan6Packet torc::bitstream::Spartan6Packet::makeType1Write ( uint16_t  inAddress,
uint16_t  inWord 
) [inline, static]

Construct a type 1 write packet.

Definition at line 226 of file Spartan6Packet.hpp.

static Spartan6Packet torc::bitstream::Spartan6Packet::makeType1Write32 ( uint16_t  inAddress,
uint32_t  inWord 
) [inline, static]

Construct a type 1 write packet for two words.

Definition at line 230 of file Spartan6Packet.hpp.

static Spartan6Packet torc::bitstream::Spartan6Packet::makeType1Write ( uint16_t  inAddress,
uint16_t  inWord1,
uint16_t  inWord2 
) [inline, static]

Construct a type 1 write packet for two words.

Definition at line 238 of file Spartan6Packet.hpp.

static Spartan6Packet torc::bitstream::Spartan6Packet::makeType1Write ( uint32_t  inCount,
uint16_t  inAddress,
uint16_t inWords 
) [inline, static]

Construct a type 1 write packet for multiple words.

Definition at line 246 of file Spartan6Packet.hpp.

static Spartan6Packet torc::bitstream::Spartan6Packet::makeType2Write ( uint32_t  inCount,
uint16_t  inAddress,
uint16_t inWords 
) [inline, static]

Construct a type 2 write packet.

Definition at line 250 of file Spartan6Packet.hpp.

static uint16_t torc::bitstream::Spartan6Packet::makeHeader ( EPacketType  inType,
EOpcode  inOpcode,
uint16_t  inAddress,
uint32_t  inCount 
) [inline, static]

Construct a packet header.

Todo:
Generate an error or throw an exception on invalid packet types?

Definition at line 262 of file Spartan6Packet.hpp.

uint32_t torc::bitstream::Spartan6Packet::getWordCount ( void   )  const [inline]

Returns the number of payload words in the packet, excluding the header word.

Definition at line 293 of file Spartan6Packet.hpp.

uint32_t torc::bitstream::Spartan6Packet::getWordSize ( void   )  const [inline]

Returns the total number of words in the packet, including the header word. In the case of Type 2 packets, we also include the two implicity length words.

Definition at line 296 of file Spartan6Packet.hpp.

const WordSharedArray torc::bitstream::Spartan6Packet::getWords ( void   )  const [inline]

brief Returns the raw packet words, including the header word.

Definition at line 301 of file Spartan6Packet.hpp.


Member Data Documentation

Initial value:

 {
        "[UNKNOWN TYPE 0]", "TYPE1", "TYPE2", "[UNKNOWN TYPE 3]", "[UNKNOWN TYPE 4]", 
        "[UNKNOWN TYPE 5]", "[UNKNOWN TYPE 6]", "[UNKNOWN TYPE 7]"
    }
Packet type names.

Definition at line 101 of file Spartan6Packet.hpp.

Initial value:

 {
        "NOP", "READ", "WRITE", "RESERVED"
    }
Packet opcode names.

Definition at line 103 of file Spartan6Packet.hpp.


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

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