3 #include "devices/fpga/NiFpga.h"
10 :
public std::exception {
22 :
std::exception(_msg)
33 static bool Check(
const NiFpga_Status& _st) {
34 if(NiFpga_IsError(_st))
41 template<
bool ThrowException>
52 void Assign(
const NiFpga_Status& _st) {
55 case NiFpga_Status_FifoTimeout:
56 fpga_message = L
"FIFO timeout";
58 case NiFpga_Status_InvalidParameter:
59 fpga_message = L
"Invalid parameter";
61 case NiFpga_Status_ResourceNotFound:
62 fpga_message = L
"Resource not found";
64 case NiFpga_Status_SignatureMismatch:
65 fpga_message = L
"Bitfile signature mismatch";
67 case NiFpga_Status_IncompatibleBitfile:
68 fpga_message = L
"Bitfile incompatible";
70 case NiFpga_Status_InvalidResourceName:
71 fpga_message = L
"Invalid resource name";
73 case NiFpga_Status_BitfileReadError:
74 fpga_message = L
"Bitfile read error";
76 case NiFpga_Status_CommunicationTimeout:
77 fpga_message = L
"Communication between FPGA and host timed out";
79 case NiFpga_Status_BadReadWriteCount:
80 fpga_message = L
"The number of FIFO elements is invalid. Either the number is greater than the depth of the host memory DMA FIFO, or more elements were requested for";
83 fpga_message = L
"Unknown";
87 DBOUT(L
"FPGAException " << status << L
" " << fpga_message.GetString());
108 operator NiFpga_Status ()
const {
119 typedef FPGAStatusT<true> FPGAStatus;
122 typedef FPGAStatusT<false> FPGAStatusSafe;
FPGAStatusT(const NiFpga_Status &_st=NiFpga_Status_Success)
Standard constructor.
FPGAException(const int32_t &_status)
An exception for FPGA stuff.
static bool Check(const NiFpga_Status &_st)
const int32_t fpga_status
the FPGA status
Wrapper class for the FPGA status, templatized for throwing or non-throwing.
CString fpga_message
status message
NiFpga_Status status
the FPGA status
void Assign(const NiFpga_Status &_st)
Set new status and check/throw if ThrowException.
FPGAException(const int32_t &_status, const char *const _msg)
#define DBOUT(s)
A debug output to the debug console.
FPGAStatusT & operator=(const NiFpga_Status &_st)
Assignment operator.
Helper class to check the FPGA status value returned from NI FPGA C API.
Various helper functions and classes for Scope.