torc::bitstream::VirtexPacket Class Reference

Bitstream packet for Virtex class architectures. More...

#include <VirtexPacket.hpp>

Inheritance diagram for torc::bitstream::VirtexPacket:

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

Collaboration graph
[legend]

List of all members.

Public Member Functions

 VirtexPacket (void)
 Null constructor.
 VirtexPacket (uint32_t inHeader, uint32_t inCount, uint32_t inWord, uint32_t *inWords)
 Full constructor.
 VirtexPacket (uint32_t inHeader, uint32_t inWord)
 Header plus single word constructor.
 VirtexPacket (uint32_t inHeader)
 Header only constructor.
 VirtexPacket (const VirtexPacket &rhs)
 Copy constructor.
void write (std::ostream &inStream) const
 Write a packet.
uint32_t operator[] (size_t inIndex) const
EPacketType getType (void) const
EOpcode getOpcode (void) const
int getAddress (void) const
uint32_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.
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 isSyncWord (void) const
bool isBusWidthSyncWord (void) const
bool isBusWidthDetectWord (void) const

Static Public Member Functions

static VirtexPacket read (std::istream &inStream)
 Read a packet.
static VirtexPacket makeNullType1Write (uint32_t inAddress)
 Construct a null type 1 write packet.
static VirtexPacket makeType1Write (uint32_t inAddress, uint32_t inWord)
 Construct a type 1 write packet.
static VirtexPacket makeType2Write (uint32_t inCount, uint32_t *inWords)
 Construct a type 2 write packet.
static uint32_t makeHeader (EPacketType inType, EOpcode inOpcode, uint32_t inAddress, uint32_t inCount)
 Construct a packet header.

Public Attributes

uint32_t mHeader
uint32_t mCount
uint32_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::uint32_t uint32_t
 Imported type name.
typedef boost::shared_array
< uint32_t
WordSharedArray
 Word shared array type.

Protected Member Functions

void initialize (void)

Friends

class torc::bitstream::bitstream::VirtexPacketUnitTest


Detailed Description

Bitstream packet for Virtex class architectures.

Definition at line 76 of file VirtexPacket.hpp.


Member Typedef Documentation

typedef boost::uint32_t torc::bitstream::VirtexPacket::uint32_t [protected]

Imported type name.

Definition at line 81 of file VirtexPacket.hpp.

typedef boost::shared_array<uint32_t> torc::bitstream::VirtexPacket::WordSharedArray [protected]

Word shared array type.

Definition at line 83 of file VirtexPacket.hpp.


Constructor & Destructor Documentation

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

Null constructor.

Definition at line 108 of file VirtexPacket.hpp.

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

Full constructor.

Definition at line 111 of file VirtexPacket.hpp.

torc::bitstream::VirtexPacket::VirtexPacket ( uint32_t  inHeader,
uint32_t  inWord 
) [inline]

Header plus single word constructor.

Definition at line 117 of file VirtexPacket.hpp.

torc::bitstream::VirtexPacket::VirtexPacket ( uint32_t  inHeader  )  [inline]

Header only constructor.

Definition at line 122 of file VirtexPacket.hpp.

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

Copy constructor.

Definition at line 127 of file VirtexPacket.hpp.


Member Function Documentation

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

Read a packet.

Todo:
we should throw an exception on invalid packet types

Definition at line 134 of file VirtexPacket.hpp.

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

Write a packet.

Definition at line 176 of file VirtexPacket.hpp.

static VirtexPacket torc::bitstream::VirtexPacket::makeNullType1Write ( uint32_t  inAddress  )  [inline, static]

Construct a null type 1 write packet.

A type 1 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 1 packet.

Definition at line 188 of file VirtexPacket.hpp.

static VirtexPacket torc::bitstream::VirtexPacket::makeType1Write ( uint32_t  inAddress,
uint32_t  inWord 
) [inline, static]

Construct a type 1 write packet.

Definition at line 192 of file VirtexPacket.hpp.

static VirtexPacket torc::bitstream::VirtexPacket::makeType2Write ( uint32_t  inCount,
uint32_t inWords 
) [inline, static]

Construct a type 2 write packet.

Definition at line 196 of file VirtexPacket.hpp.

static uint32_t torc::bitstream::VirtexPacket::makeHeader ( EPacketType  inType,
EOpcode  inOpcode,
uint32_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 209 of file VirtexPacket.hpp.

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

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

Definition at line 240 of file VirtexPacket.hpp.

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

Returns the total number of words in the packet, including the header word.

Definition at line 242 of file VirtexPacket.hpp.

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

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

Definition at line 244 of file VirtexPacket.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 102 of file VirtexPacket.hpp.

Initial value:

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

Definition at line 104 of file VirtexPacket.hpp.


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

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