torc::bitstream::SpartanPacket Class Reference

Bitstream packet for Spartan class architectures. More...

#include <SpartanPacket.hpp>

Inheritance diagram for torc::bitstream::SpartanPacket:

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

Collaboration graph
[legend]

List of all members.

Public Member Functions

 SpartanPacket (void)
 Null constructor.
 SpartanPacket (uint32_t inHeader, uint32_t inCount, uint32_t inWord, uint32_t *inWords)
 Full constructor.
 SpartanPacket (uint32_t inHeader, uint32_t inWord)
 Header plus single word constructor.
 SpartanPacket (uint32_t inHeader)
 Header only constructor.
 SpartanPacket (const SpartanPacket &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.
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 SpartanPacket read (std::istream &inStream)
 Read a packet.
static SpartanPacket makeNullType1Write (uint32_t inAddress)
 Construct a null type 1 write packet.
static SpartanPacket makeType1Write (uint32_t inAddress, uint32_t inWord)
 Construct a type 1 write packet.
static SpartanPacket 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::SpartanPacketUnitTest


Detailed Description

Bitstream packet for Spartan class architectures.

Definition at line 69 of file SpartanPacket.hpp.


Member Typedef Documentation

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

Imported type name.

Definition at line 74 of file SpartanPacket.hpp.

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

Word shared array type.

Definition at line 76 of file SpartanPacket.hpp.


Constructor & Destructor Documentation

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

Null constructor.

Definition at line 101 of file SpartanPacket.hpp.

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

Full constructor.

Definition at line 104 of file SpartanPacket.hpp.

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

Header plus single word constructor.

Definition at line 110 of file SpartanPacket.hpp.

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

Header only constructor.

Definition at line 115 of file SpartanPacket.hpp.

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

Copy constructor.

Definition at line 120 of file SpartanPacket.hpp.


Member Function Documentation

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

Read a packet.

Todo:
we should throw an exception on invalid packet types

Definition at line 127 of file SpartanPacket.hpp.

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

Write a packet.

Definition at line 175 of file SpartanPacket.hpp.

static SpartanPacket torc::bitstream::SpartanPacket::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 187 of file SpartanPacket.hpp.

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

Construct a type 1 write packet.

Definition at line 191 of file SpartanPacket.hpp.

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

Construct a type 2 write packet.

Definition at line 195 of file SpartanPacket.hpp.

static uint32_t torc::bitstream::SpartanPacket::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 208 of file SpartanPacket.hpp.

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

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

Definition at line 239 of file SpartanPacket.hpp.

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

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

Definition at line 241 of file SpartanPacket.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 95 of file SpartanPacket.hpp.

Initial value:

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

Definition at line 97 of file SpartanPacket.hpp.


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

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