17 #define DDFAIL(__x__) AJA_sERROR (AJA_DebugUnit_Firmware, AJAFUNC << ": " << __x__) 18 #define DDWARN(__x__) AJA_sWARNING(AJA_DebugUnit_Firmware, AJAFUNC << ": " << __x__) 19 #define DDNOTE(__x__) AJA_sNOTICE (AJA_DebugUnit_Firmware, AJAFUNC << ": " << __x__) 20 #define DDINFO(__x__) AJA_sINFO (AJA_DebugUnit_Firmware, AJAFUNC << ": " << __x__) 21 #define DDDBG(__x__) AJA_sDEBUG (AJA_DebugUnit_Firmware, AJAFUNC << ": " << __x__) 34 if (!BitstreamStatus(reg))
45 if (!IsDynamicDevice())
50 const ULWord successes(counts & 0x0000FFFF);
59 if (!IsDynamicDevice())
73 result.push_back(*it);
84 if (currentDeviceID == 0)
89 if (!BitstreamStatus(reg))
95 ULWord currentUserID(0), currentDesignID(0), currentDesignVersion(0), currentBitfileID(0), currentBitfileVersion(0);
97 if (GetRunningFirmwareUserID(currentUserID) && currentUserID)
109 currentBitfileVersion = 0xff;
112 if (!currentDesignID)
119 currentDesignVersion,
121 currentBitfileVersion,
128 if (it->designID == currentDesignID)
129 if (it->designVersion == currentDesignVersion)
133 if (result.find(devID) == result.end())
134 result.insert(devID);
142 return devices.find(inDeviceID) != devices.end();
148 {
DDFAIL(
"Device not open");
return false;}
151 if (!currentDeviceID)
152 {
DDFAIL(
"Current device ID is zero");
return false;}
154 const string oldDevName (GetDisplayName());
158 if (!BitstreamStatus(regs))
159 {
DDFAIL(
"Unable to read current bitstream status for " << oldDevName);
return false;}
162 {
DDFAIL(
"Bitstream version is zero for " << oldDevName);
return false;}
164 ULWord currentUserID(0), currentDesignID(0), currentDesignVersion(0), currentBitfileID(0), currentBitfileVersion(0);
166 if (GetRunningFirmwareUserID(currentUserID) && currentUserID)
178 currentBitfileVersion = 0xff;
181 if (!currentDesignID)
182 {
DDFAIL(
"Current design ID is zero for " << oldDevName);
return false;}
188 currentDesignVersion,
190 currentBitfileVersion,
192 {
DDFAIL(
"GetBitStream 'clear' failed for " << oldDevName);
return false;}
198 currentDesignVersion,
202 {
DDFAIL(
"GetBitStream 'partial' failed for " << oldDevName);
return false;}
205 if (!BitstreamWrite (clearStream,
true,
true))
206 {
DDFAIL(
"BitstreamWrite failed writing 'clear' bitstream for " << oldDevName);
return false;}
208 if (!BitstreamWrite (partialStream,
false,
true))
209 {
DDFAIL(
"BitstreamWrite failed writing 'partial' bitstream for " << oldDevName);
return false;}
static ULWord ConvertToBitfileID(const NTV2DeviceID inDeviceID)
std::vector< NTV2BitfileInfo > NTV2BitfileInfoList
virtual bool LoadDynamicDevice(const NTV2DeviceID inDeviceID)
Quickly, dynamically loads the given device ID firmware.
Declares the AJADebug class.
static NTV2DeviceID ConvertToDeviceID(const ULWord inDesignID, const ULWord inBitfileID)
virtual bool IsDynamicDevice(void)
virtual NTV2DeviceID GetBaseDeviceID()
#define BITSTREAM_VERSION
Bitstream version register.
NTV2DeviceID
Identifies a specific AJA NTV2 device model number. The NTV2DeviceID is actually the PROM part number...
virtual NTV2DeviceIDList GetDynamicDeviceList(void)
NTV2DeviceIDSet::const_iterator NTV2DeviceIDSetConstIter
A convenient const iterator for NTV2DeviceIDSet.
std::vector< ULWord > NTV2ULWordVector
An ordered sequence of ULWords.
virtual NTV2DeviceIDSet GetDynamicDeviceIDs(void)
virtual bool AddDynamicDirectory(const std::string &inDirectory)
Adds all bitfiles found in the given host file directory to the list of available dynamic bitfiles...
virtual bool CanLoadDynamicDevice(const NTV2DeviceID inDeviceID)
virtual bool AddDirectory(const std::string &inDirectory)
Add the bitfile(s) at the given path to the list of bitfiles.
static CNTV2BitfileManager s_BitfileManager
Describes a user-space buffer on the host computer. I have an address and a length, plus some optional attributes (allocated by SDK?, page-aligned? etc.).
Declares the CNTV2BitfileManager class that manages Xilinx bitfiles.
std::string NTV2DeviceIDToString(const NTV2DeviceID inValue, const bool inForRetailDisplay=false)
virtual bool IsDynamicFirmwareLoaded(void)
Declares numerous NTV2 utility functions.
virtual const NTV2BitfileInfoList & GetBitfileInfoList(void) const
Returns an NTV2BitfileInfoList standard C++ vector.
Declares the CNTV2Bitfile class.
#define NTV2_BITFILE_FLAG_CLEAR
This is a clear bitfile.
#define xHEX0N(__x__, __n__)
Declares the CNTV2Card class.
virtual bool AddDynamicBitfile(const std::string &inBitfilePath)
Adds the given bitfile to the list of available dynamic bitfiles.
std::set< NTV2DeviceID > NTV2DeviceIDSet
A set of NTV2DeviceIDs.
NTV2BitfileInfoList::const_iterator NTV2BitfileInfoListConstIter
I manage and cache any number of bitfiles for any number of NTV2 devices/designs. ...
std::vector< NTV2DeviceID > NTV2DeviceIDList
An ordered list of NTV2DeviceIDs.
Declares device capability functions.
#define NTV2_BITFILE_FLAG_PARTIAL
This is a partial bitfile.
virtual bool GetBitStream(NTV2Buffer &outBitstream, const ULWord inDesignID, const ULWord inDesignVersion, const ULWord inBitfileID, const ULWord inBitfileVersion, const ULWord inBitfileFlags)
Retrieves the bitstream specified by design ID & version, and bitfile ID & version. It loads it into host memory, and updates/reallocates the given NTV2Buffer to access it.
virtual bool AddFile(const std::string &inBitfilePath)
Add the bitfile at the given path to the list of bitfiles.