torc-master
|
#include <Spartan3E.hpp>
Data Structures | |
class | FrameAddress |
Public Types | |
enum | ERegister { eRegisterCRC = 0, eRegisterFAR, eRegisterFDRI, eRegisterFDRO, eRegisterCMD, eRegisterCTL, eRegisterMASK, eRegisterSTAT, eRegisterLOUT, eRegisterCOR, eRegisterMFWR, eRegisterFLR, eRegisterIDCODE = 14, eRegisterCount } |
Configuration register enumeration. More... | |
enum | ECommand { eCommandNULL = 0, eCommandWCFG, eCommandMFWR, eCommandLFRM, eCommandRCFG, eCommandSTART, eCommandRCAP, eCommandRCRC, eCommandAGHIGH, eCommandSWITCH, eCommandGRESTORE, eCommandSHUTDOWN, eCommandGCAPTURE, eCommandDESYNCH, eCommandCount } |
Configuration command enumeration for eRegisterCMD. More... | |
enum | EFar { eFarMaskColumn = 0x06000000, eFarShiftColumn = 25, eFarMaskMajor = 0x01fe0000, eFarShiftMajor = 17, eFarMaskMinor = 0x0001fe00, eFarShiftMinor = 9 } |
Frame Address Register subfields. More... | |
enum | EFarTopBottom { eFarTop = 0, eFarBottom = 1 } |
Frame Address Register top and bottom constants. More... | |
enum | EFarBlockType { eFarBlockType0 = 0, eFarBlockType1, eFarBlockType2, eFarBlockType3, eFarBlockType4, eFarBlockType5, eFarBlockType6, eFarBlockType7, eFarBlockTypeCount } |
Frame Address Register block type constants. More... | |
enum | EColumnType { eColumnTypeEmpty = 0, eColumnTypeBram, eColumnTypeBramInt, eColumnTypeClb, eColumnTypeClock, eColumnTypeClockLL, eColumnTypeTerm, eColumnTypeIob, eColumnTypeCount } |
Major column types. More... | |
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 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... | |
enum | EPacketType { ePacketType1 = 1, ePacketType2, ePacketTypeCount = 8 } |
Packet type enumeration. More... | |
enum | EOpcode { eOpcodeNOP = 0, eOpcodeRead, eOpcodeWrite, eOpcodeReserved, eOpcodeCount } |
Packet opcode enumeration. More... | |
enum | EPacket { ePacketMaskType = 0xe0000000, ePacketShiftType = 29, ePacketMaskOpcode = 0x18000000, ePacketShiftOpcode = 27, ePacketMaskType1Address = 0x07ffe000, ePacketShiftType1Address = 13, ePacketMaskType1Reserved = 0x00001800, ePacketShiftType1Reserved = 11, ePacketMaskType1Count = 0x000007ff, ePacketShiftType1Count = 0, ePacketMaskType2Count = 0x07ffffff, ePacketShiftType2Count = 0 } |
Packet subfields. More... | |
enum | ESynchronization { eSynchronizationDummy = 0xffffffff, eSynchronizationSync = 0xaa995566, eSynchronizationBusWidthSync = 0x000000bb, eSynchronizationBusWidthDetect = 0x11220044 } |
Synchronization words. More... | |
Public Member Functions | |
Spartan3E (void) | |
Basic constructor. More... | |
virtual void | initializeDeviceInfo (const std::string &inDeviceName) |
Initialize the device information. More... | |
virtual void | initializeFrameMaps (void) |
Initialize the maps between frame indexes and frame addresses. This is generally only useful for internal purposes. More... | |
virtual uint32_t | getFrameLength (void) const |
virtual void | readPackets (std::istream &inStream) |
Read bitstream packets from a stream. More... | |
virtual void | writePackets (std::ostream &inStream) |
Write bitstream packets to a stream. More... | |
virtual void | preflightPackets (void) |
Preflight the packets. More... | |
virtual void | updatePacketLength (void) |
Update the header packet length. More... | |
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... | |
virtual void | write (std::ostream &inStream) |
Write the bitstream header and packets to a stream. More... | |
void | writeHeaderString (std::ostream &inStream, const string &inString) |
Write a Xilinx-style header string to the stream. More... | |
virtual void | readHeader (std::istream &inStream) |
Read the bitstream header. More... | |
void | cleanDateAndTime (void) |
Clean up the header date and time by replacing embedded spaces with zeros. 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... | |
virtual void | read (std::istream &inStream, bool inCleanDateAndTime=true) |
Read the bitstream header and packets from a stream. 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... | |
Static Public Member Functions | |
static uint32_t | makeSubfield (ERegister inRegister, const std::string &inSubfield, const std::string &inSetting) |
Return the masked value for a subfield of the specified register. More... | |
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... | |
Protected Types | |
typedef boost::uint32_t | uint32_t |
Imported type name. More... | |
typedef std::map< uint32_t, Spartan3E::FrameAddress > | FrameIndexToAddress |
Map from frame index to frame address. More... | |
typedef std::map < Spartan3E::FrameAddress, uint32_t > | FrameAddressToIndex |
Map from frame address to frame index. More... | |
typedef std::vector< uint32_t > | ColumnIndexVector |
Array of vectors to store frame indexes of each block type. More... | |
Protected Attributes | |
FrameIndexToAddress | mFrameIndexToAddress |
Map of frame indexes to frame addresses. More... | |
FrameAddressToIndex | mFrameAddressToIndex |
Map of frame addressee to frame indexes. More... | |
ColumnIndexVector | mBitColumnIndexes [Spartan3E::eFarBlockTypeCount] |
Vector to store frame indexes of XDL columns. More... | |
ColumnIndexVector | mXdlColumnIndexes [Spartan3E::eFarBlockTypeCount] |
Vector to store frame indexes of Bitstream columns. More... | |
Static Protected Attributes | |
static const char * | sPacketTypeName [ePacketTypeCount] |
Packet type names. More... | |
static const char * | sOpcodeName [eOpcodeCount] |
Packet opcode names. More... | |
static const char * | sRegisterName [eRegisterCount] |
Configuration register names. More... | |
static const char * | sCommandName [eCommandCount] |
Configuration command names. More... | |
static const Subfield | sCOR [] |
Configuration Options Register (COR) subfields. More... | |
static const Subfield | sSTAT [] |
Status Register (STAT) subfields. More... | |
static const Subfield | sCTL [] |
Control Register (CTL) subfields. More... | |
static const Subfield | sMASK [] |
Control Mask Register (MASK) subfields. More... | |
Friends | |
class | torc::bitstream::bitstream::Spartan3EUnitTest |
class | torc::bitstream::bitstream::Spartan3EFarUnitTest |
void | torc::bitstream::bitstream::testSpartan3EDevice (const std::string &inDeviceName, const boost::filesystem::path &inWorkingPath) |
std::ostream & | operator<< (std::ostream &os, const Spartan3E &rhs) |
Insert the bitstream header into an output stream. More... | |
Spartan3E bitstream.
Definition at line 38 of file Spartan3E.hpp.
|
protected |
Array of vectors to store frame indexes of each block type.
Definition at line 189 of file Spartan3E.hpp.
|
inherited |
Imported type name.
Definition at line 64 of file bitstream/Bitstream.hpp.
|
protected |
Map from frame address to frame index.
Definition at line 187 of file Spartan3E.hpp.
|
protected |
Map from frame index to frame address.
Definition at line 185 of file Spartan3E.hpp.
|
inherited |
Imported type name.
Definition at line 60 of file bitstream/Bitstream.hpp.
|
inherited |
Mapping from tile indexes to column types.
Definition at line 254 of file bitstream/Bitstream.hpp.
|
inherited |
Mapping from tile type names to column types.
Definition at line 251 of file bitstream/Bitstream.hpp.
|
inherited |
Imported type name.
Definition at line 62 of file bitstream/Bitstream.hpp.
|
protected |
Imported type name.
Definition at line 46 of file Spartan3E.hpp.
|
inherited |
Imported type name.
Definition at line 61 of file bitstream/Bitstream.hpp.
|
inherited |
The block type count is fixed at eight across all Xilinx architectures.
Enumerator | |
---|---|
eBlockTypeCount |
Definition at line 44 of file bitstream/Bitstream.hpp.
|
inherited |
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.
Major column types.
These are defined and used for internal purposes only, and are not derived from any Xilinx documentation.
Enumerator | |
---|---|
eColumnTypeEmpty | |
eColumnTypeBram | |
eColumnTypeBramInt | |
eColumnTypeClb | |
eColumnTypeClock | |
eColumnTypeClockLL | |
eColumnTypeTerm | |
eColumnTypeIob | |
eColumnTypeCount |
Definition at line 78 of file Spartan3E.hpp.
Configuration command enumeration for eRegisterCMD.
Definition at line 58 of file Spartan3E.hpp.
Frame Address Register subfields.
Enumerator | |
---|---|
eFarMaskColumn | |
eFarShiftColumn | |
eFarMaskMajor | |
eFarShiftMajor | |
eFarMaskMinor | |
eFarShiftMinor |
Definition at line 64 of file Spartan3E.hpp.
Frame Address Register block type constants.
Enumerator | |
---|---|
eFarBlockType0 | |
eFarBlockType1 | |
eFarBlockType2 | |
eFarBlockType3 | |
eFarBlockType4 | |
eFarBlockType5 | |
eFarBlockType6 | |
eFarBlockType7 | |
eFarBlockTypeCount |
Definition at line 73 of file Spartan3E.hpp.
Frame Address Register top and bottom constants.
Enumerator | |
---|---|
eFarTop | |
eFarBottom |
Definition at line 71 of file Spartan3E.hpp.
|
inherited |
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.
|
inherited |
Packet opcode enumeration.
Enumerator | |
---|---|
eOpcodeNOP | |
eOpcodeRead | |
eOpcodeWrite | |
eOpcodeReserved | |
eOpcodeCount |
Definition at line 42 of file SpartanPacket.hpp.
|
inherited |
Packet subfields.
Definition at line 46 of file SpartanPacket.hpp.
|
inherited |
Packet type enumeration.
Enumerator | |
---|---|
ePacketType1 | |
ePacketType2 | |
ePacketTypeCount |
Definition at line 39 of file SpartanPacket.hpp.
Configuration register enumeration.
Definition at line 52 of file Spartan3E.hpp.
|
inherited |
Synchronization words.
Enumerator | |
---|---|
eSynchronizationDummy | |
eSynchronizationSync | |
eSynchronizationBusWidthSync | |
eSynchronizationBusWidthDetect |
Definition at line 60 of file SpartanPacket.hpp.
|
inline |
Basic constructor.
Definition at line 103 of file Spartan3E.hpp.
|
inlineinherited |
Clean up the header date and time by replacing embedded spaces with zeros.
Definition at line 183 of file bitstream/Bitstream.hpp.
|
inlinestaticinherited |
Look for the expected uint8_t in the stream and return true if it matches.
Definition at line 89 of file bitstream/Bitstream.hpp.
|
inlinestaticinherited |
Look for the expected uint16_t in the stream and return true if it matches.
Definition at line 97 of file bitstream/Bitstream.hpp.
|
inlinestaticinherited |
Look for the expected uint32_t in the stream and return true if it matches.
Definition at line 105 of file bitstream/Bitstream.hpp.
|
inlineinherited |
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.
|
inlineinherited |
Return the design date.
Definition at line 335 of file bitstream/Bitstream.hpp.
|
inlineinherited |
Return the design name.
Definition at line 331 of file bitstream/Bitstream.hpp.
|
inlineinherited |
Return the design time.
Definition at line 337 of file bitstream/Bitstream.hpp.
|
inlineinherited |
Return the device name.
Definition at line 333 of file bitstream/Bitstream.hpp.
|
inlinevirtual |
Reimplemented from torc::bitstream::Bitstream.
Definition at line 170 of file Spartan3E.hpp.
|
inlineinherited |
Return the bitstream header length in bytes.
Definition at line 342 of file bitstream/Bitstream.hpp.
|
virtual |
Initialize the device information.
Reimplemented from torc::bitstream::Bitstream.
Definition at line 218 of file Spartan3E.cpp.
|
virtual |
Initialize the maps between frame indexes and frame addresses. This is generally only useful for internal purposes.
Reimplemented from torc::bitstream::Bitstream.
Definition at line 313 of file Spartan3E.cpp.
|
static |
Return the masked value for a subfield of the specified register.
Definition at line 186 of file Spartan3E.cpp.
|
virtualinherited |
Preflight the packets.
Reimplemented from torc::bitstream::Bitstream.
Definition at line 50 of file SpartanBitstream.cpp.
|
inlinevirtualinherited |
Read the bitstream header and packets from a stream.
Definition at line 266 of file bitstream/Bitstream.hpp.
|
inlinestaticinherited |
Read a bitstream header, and return its fields.
Definition at line 142 of file bitstream/Bitstream.hpp.
|
inlinevirtualinherited |
Read the bitstream header.
Definition at line 274 of file bitstream/Bitstream.hpp.
|
inlinestaticinherited |
Read and return a bitstream header string.
Definition at line 124 of file bitstream/Bitstream.hpp.
|
virtualinherited |
Read bitstream packets from a stream.
Reimplemented from torc::bitstream::Bitstream.
Definition at line 27 of file SpartanBitstream.cpp.
|
inlineinherited |
Set the design date.
Definition at line 327 of file bitstream/Bitstream.hpp.
|
inlineinherited |
Set the design name.
Definition at line 323 of file bitstream/Bitstream.hpp.
|
inlineinherited |
Set the design time.
Definition at line 329 of file bitstream/Bitstream.hpp.
|
inlineinherited |
Assign the device enumeration constant for the given device name.
Definition at line 225 of file bitstream/Bitstream.hpp.
|
inlineinherited |
Assign static device information for the current bitstream.
Definition at line 223 of file bitstream/Bitstream.hpp.
|
inlineinherited |
Set the device name.
Definition at line 325 of file bitstream/Bitstream.hpp.
|
virtualinherited |
Update the header packet length.
Reimplemented from torc::bitstream::Bitstream.
Definition at line 121 of file SpartanBitstream.cpp.
|
inlineinherited |
Write a uint8_t to the stream.
Definition at line 67 of file bitstream/Bitstream.hpp.
|
inlineinherited |
Write a uint16_t to the stream.
Definition at line 72 of file bitstream/Bitstream.hpp.
|
inlineinherited |
Write a uint32_t to the stream.
Definition at line 77 of file bitstream/Bitstream.hpp.
|
inlinevirtualinherited |
Write the bitstream header and packets to a stream.
Definition at line 280 of file bitstream/Bitstream.hpp.
|
virtualinherited |
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.
|
inlinevirtualinherited |
Write the bitstream header to the stream.
Definition at line 293 of file bitstream/Bitstream.hpp.
|
inlineinherited |
Write a Xilinx-style header string to the stream.
Definition at line 82 of file bitstream/Bitstream.hpp.
|
virtualinherited |
Write bitstream packets to a stream.
Reimplemented from torc::bitstream::Bitstream.
Definition at line 44 of file SpartanBitstream.cpp.
|
staticinherited |
Insert 32 bit subfield settings into an output stream.
Definition at line 26 of file Bitstream.cpp.
|
staticinherited |
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 88 of file bitstream/OutputStreamHelpers.cpp.
|
friend |
Definition at line 40 of file Spartan3E.hpp.
|
friend |
Definition at line 39 of file Spartan3E.hpp.
|
friend |
|
protected |
Vector to store frame indexes of XDL columns.
Definition at line 197 of file Spartan3E.hpp.
|
inherited |
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.
|
inherited |
Column type widths.
Definition at line 249 of file bitstream/Bitstream.hpp.
|
inherited |
Header design date.
Definition at line 236 of file bitstream/Bitstream.hpp.
|
inherited |
Header design name.
Definition at line 232 of file bitstream/Bitstream.hpp.
|
inherited |
Header design time.
Definition at line 238 of file bitstream/Bitstream.hpp.
|
inherited |
Bitstream device enumeration.
Definition at line 230 of file bitstream/Bitstream.hpp.
|
inherited |
Device information.
Definition at line 257 of file bitstream/Bitstream.hpp.
|
inherited |
Header device name.
Definition at line 234 of file bitstream/Bitstream.hpp.
|
protected |
Map of frame addressee to frame indexes.
Definition at line 195 of file Spartan3E.hpp.
|
protected |
Map of frame indexes to frame addresses.
Definition at line 193 of file Spartan3E.hpp.
|
inherited |
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.
|
inherited |
Definition at line 255 of file bitstream/Bitstream.hpp.
|
inherited |
Definition at line 252 of file bitstream/Bitstream.hpp.
|
protected |
Vector to store frame indexes of Bitstream columns.
Definition at line 199 of file Spartan3E.hpp.
|
staticprotected |
Configuration command names.
Definition at line 91 of file Spartan3E.hpp.
|
staticprotected |
Configuration Options Register (COR) subfields.
Definition at line 93 of file Spartan3E.hpp.
|
staticprotected |
Control Register (CTL) subfields.
Definition at line 97 of file Spartan3E.hpp.
|
staticprotected |
Control Mask Register (MASK) subfields.
Definition at line 99 of file Spartan3E.hpp.
|
staticprotected |
Packet opcode names.
Definition at line 87 of file Spartan3E.hpp.
|
staticprotected |
Packet type names.
Definition at line 85 of file Spartan3E.hpp.
|
staticprotected |
Configuration register names.
Definition at line 89 of file Spartan3E.hpp.
|
staticprotected |
Status Register (STAT) subfields.
Definition at line 95 of file Spartan3E.hpp.