Bitstream Interpretation Library (BIL)  0.1
Public Member Functions | Protected Member Functions
bil::V5BitstreamDeviceDetector Class Reference

Visitor for determining target device type of a Virtex-5 bitstream. More...

#include <bitstream/V5BitstreamDeviceDetector.hpp>

Inheritance diagram for bil::V5BitstreamDeviceDetector:
Inheritance graph
[legend]
Collaboration diagram for bil::V5BitstreamDeviceDetector:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 V5BitstreamDeviceDetector ()
DeviceID::ID_t deviceID () const
 Gets the detected device ID.
virtual void reset ()
 Resets the syntax checker and the device ID.
virtual void visit (const Type1Packet &type1Packet)
 Checks a Type1Packet packet for device ID data.
virtual void visit (const Type2Packet &type2Packet)
 Checks a Type2Packet packet for device ID data.
- Public Member Functions inherited from bil::V5BitstreamSyntaxChecker
 V5BitstreamSyntaxChecker ()
bool behindSyncWord () const
 Tells, if sync word was passed.
bool lastPacketWasType1 () const
 Tells, if the last packet processed was a type 1 packet.
RegisterAddress::address_t lastType1Address () const
 Gets the register address of the last processed type 1 packet.
virtual void visit (const BuswidthPattern &buswidthPattern)
 Visits a BuswidthPattern packet.
virtual void visit (const DummyWord &dummyWord)
 Visits a DummyWord packet.
virtual void visit (const SyncWord &syncWord)
 Visits a SyncWord packet.
- Public Member Functions inherited from bil::V5PacketVisitor
virtual void visit (const Packet &packet)
 Irrelevant visit() method for Virtex-5 bitstreams.
- Public Member Functions inherited from bil::PacketVisitor
virtual ~PacketVisitor ()

Protected Member Functions

void checkDeviceID (const Type2Packet &type2Packet)
 Tests if packet contains a device ID. If so, the ID is tested against previous written IDs (if there are previous writes, all IDs must be equal) and stored.

Detailed Description

Visitor for determining target device type of a Virtex-5 bitstream.

This visitor is derived from V5BitstreamSyntaxChecker, because when visiting a bitstream and trying to detect its target device type this bitstream has to be at least syntactical correct. The detection itself relies on the presence of a write into the IDCODE register, which tells the ID of the device the bitstream is for. If multiple IDCODE writes are present, thats no problem, unless they all write the same device ID; otherwise an exception will be thrown.

Definition at line 30 of file V5BitstreamDeviceDetector.hpp.


Constructor & Destructor Documentation

V5BitstreamDeviceDetector::V5BitstreamDeviceDetector ( )

Definition at line 14 of file V5BitstreamDeviceDetector.cpp.


Member Function Documentation

DeviceID::ID_t V5BitstreamDeviceDetector::deviceID ( ) const

Gets the detected device ID.

This method will return 0, if reset() was called directly before; or if no IDCODE command was found in the visited bitstream.

Returns:
The device ID.

Definition at line 20 of file V5BitstreamDeviceDetector.cpp.

void V5BitstreamDeviceDetector::reset ( )
virtual

Resets the syntax checker and the device ID.

Reimplemented from bil::V5BitstreamSyntaxChecker.

Definition at line 26 of file V5BitstreamDeviceDetector.cpp.

void V5BitstreamDeviceDetector::visit ( const Type1Packet type1Packet)
virtual

Checks a Type1Packet packet for device ID data.

Parameters:
type1PacketType1Packet instance to be visited.
Exceptions:
.

Reimplemented from bil::V5BitstreamSyntaxChecker.

Definition at line 33 of file V5BitstreamDeviceDetector.cpp.

void V5BitstreamDeviceDetector::visit ( const Type2Packet type2Packet)
virtual

Checks a Type2Packet packet for device ID data.

Parameters:
type2PacketType2Packet instance to be visited.
Exceptions:
.

Reimplemented from bil::V5BitstreamSyntaxChecker.

Definition at line 40 of file V5BitstreamDeviceDetector.cpp.

void V5BitstreamDeviceDetector::checkDeviceID ( const Type2Packet type2Packet)
protected

Tests if packet contains a device ID. If so, the ID is tested against previous written IDs (if there are previous writes, all IDs must be equal) and stored.

If the packet is a one word write to the IDCODE register, this word is the device ID.

Parameters:
type2PacketThe packet.
Exceptions:
.

Definition at line 47 of file V5BitstreamDeviceDetector.cpp.


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