|
|
|
#ifndef TRXBOARD_H
|
|
|
|
#define TRXBOARD_H
|
|
|
|
|
|
|
|
#include <QVector>
|
|
|
|
#include <QString>
|
|
|
|
#include <QByteArray>
|
|
|
|
#include <QDebug>
|
|
|
|
|
|
|
|
#include "model/hardware/core/register/clockDistributer/ClockDistributer.h"
|
|
|
|
#include "model/hardware/core/register/boardsCtrlMngt/BoardsCtrlMngt.h"
|
|
|
|
#include "model/hardware/core/register/fpgaProgram/FpgaProgram.h"
|
|
|
|
#include "model/hardware/core/register/builtInTest/BuiltInTest.h"
|
|
|
|
#include "model/hardware/core/register/beamFormer/BeamFormer.h"
|
|
|
|
#include "model/hardware/core/register/scenPlayer/ScenPlayer.h"
|
|
|
|
#include "model/hardware/core/register/bpiFlash/BpiFlash.h"
|
|
|
|
#include "model/hardware/core/register/emulator/Emulator.h"
|
|
|
|
#include "model/hardware/core/register/misc/Misc.h"
|
|
|
|
#include "model/hardware/core/register/sram/Sram.h"
|
|
|
|
#include "model/hardware/core/register/dsp/Dsp.h"
|
|
|
|
#include "model/hardware/device/SonoDevice.h"
|
|
|
|
|
|
|
|
#define SLAVE_ELEMENT_SEGMENT 64U
|
|
|
|
#define TOTAL_SCEN_LUT_SRAM 5U
|
|
|
|
#define SLAVE_FPGA_NUMBER 1U
|
|
|
|
#define CLOCK_DIVISION 0x55
|
|
|
|
|
|
|
|
#define EEPROM_ID_BYTE_BEGIN 19U
|
|
|
|
#define EEPROM_ID_BYTE_NUMBER 2U
|
|
|
|
#define EEPROM_INFO_BYTE_BEGIN 0U
|
|
|
|
#define EEPROM_INFO_BYTE_NUMBER 19U
|
|
|
|
|
|
|
|
enum eEmulatorOption : bool
|
|
|
|
{
|
|
|
|
performance = false,
|
|
|
|
functionality = true
|
|
|
|
};
|
|
|
|
|
|
|
|
enum eEmulatorMode : bool
|
|
|
|
{
|
|
|
|
dynamically = false,
|
|
|
|
statically = true
|
|
|
|
};
|
|
|
|
|
|
|
|
enum eAfePwrdnMode : bool
|
|
|
|
{
|
|
|
|
disable = false,
|
|
|
|
enable = true
|
|
|
|
};
|
|
|
|
|
|
|
|
enum eSelectProbe : quint8
|
|
|
|
{
|
|
|
|
prbA = 1,
|
|
|
|
prbB,
|
|
|
|
prbC,
|
|
|
|
prbD,
|
|
|
|
};
|
|
|
|
|
|
|
|
struct EmulatorProperties
|
|
|
|
{
|
|
|
|
quint32 ramBufAddress;
|
|
|
|
quint32 transferLength;
|
|
|
|
float transferRate;
|
|
|
|
eEmulatorMode emulMode;
|
|
|
|
eEmulatorOption emulOption;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct ProbeElementPosition
|
|
|
|
{
|
|
|
|
QVector<float> xPosition;
|
|
|
|
QVector<float> yPosition;
|
|
|
|
QVector<float> zPosition;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct HealthStatus
|
|
|
|
{
|
|
|
|
float systemTemperature;
|
|
|
|
float criticalComponentTemperature;
|
|
|
|
AdcVoltages* adcMon;
|
|
|
|
VoltagesPg* voltsPg;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct ConnectedPrbId
|
|
|
|
{
|
|
|
|
quint32 prbA;
|
|
|
|
quint32 prbB;
|
|
|
|
quint32 prbC;
|
|
|
|
quint32 prbD;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct ConnectedPrbInfo
|
|
|
|
{
|
|
|
|
QByteArray prbA;
|
|
|
|
QByteArray prbB;
|
|
|
|
QByteArray prbC;
|
|
|
|
QByteArray prbD;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct Pulse_t {
|
|
|
|
quint32 halfPeriod;
|
|
|
|
quint32 halfCycleNo;
|
|
|
|
bool pulseVoltSel;
|
|
|
|
bool startPhase;
|
|
|
|
quint32 dampingPulseWidth;
|
|
|
|
}Pulse_t;
|
|
|
|
|
|
|
|
struct RxBeamFormer_t {
|
|
|
|
quint32 mla;
|
|
|
|
quint32 lag;
|
|
|
|
quint32 apodizationSel;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct ReceiverConfig_t {
|
|
|
|
quint32 mla;
|
|
|
|
quint32 lineMode;
|
|
|
|
quint32 aTgcSel;
|
|
|
|
quint32 stbEn;
|
|
|
|
quint32 stb;
|
|
|
|
quint32 subtractFilterEn;
|
|
|
|
quint32 dcCancelEn;
|
|
|
|
quint32 ncoFreqSel;
|
|
|
|
quint32 lpfSel;
|
|
|
|
quint32 absEn;
|
|
|
|
quint32 focusNo;
|
|
|
|
quint32 lineFilterEn;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
struct SramIndex_t {
|
|
|
|
QVector<quint32> shotPropertiesIndex;
|
|
|
|
QVector<quint32> pulsePropertiesIndex;
|
|
|
|
QVector<quint32> receiverConfigurationIndex;
|
|
|
|
QVector<bool> firstLineInFrame;
|
|
|
|
QVector<bool> lastLineInFrame;
|
|
|
|
QVector<quint32> dLineNum;
|
|
|
|
QVector<quint32> dEnsembleNum;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct SramTx_t {
|
|
|
|
QVector<float> txFocusXPos;
|
|
|
|
QVector<float> txFocusYPos;
|
|
|
|
QVector<float> txFocusZPos;
|
|
|
|
QVector<quint32> txStartActiveElementNumber;
|
|
|
|
QVector<quint32> txActiveElementNumber;
|
|
|
|
QVector<float> minDelay;
|
|
|
|
QVector<float> maxDelay;
|
|
|
|
QVector<quint32> maxDelayQ;
|
|
|
|
QVector<float> interceptXPos;
|
|
|
|
QVector<float> interceptYPos;
|
|
|
|
QVector<float> interceptZPos;
|
|
|
|
|
|
|
|
void clear()
|
|
|
|
{
|
|
|
|
txFocusXPos.clear();
|
|
|
|
txFocusYPos.clear();
|
|
|
|
txFocusZPos.clear();
|
|
|
|
txStartActiveElementNumber.clear();
|
|
|
|
txActiveElementNumber.clear();
|
|
|
|
minDelay.clear();
|
|
|
|
maxDelay.clear();
|
|
|
|
maxDelayQ.clear();
|
|
|
|
interceptXPos.clear();
|
|
|
|
interceptYPos.clear();
|
|
|
|
interceptZPos.clear();
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
struct SramRx_t {
|
|
|
|
QVector<quint32> rxR0CenterActiveElementNumber;
|
|
|
|
QVector<quint32> rxR0ActiveElementNumber;
|
|
|
|
QVector<float> rxActiveElementStep;
|
|
|
|
QVector<quint32> interceptPointFiringTime;
|
|
|
|
QVector<float> r0Position;
|
|
|
|
QVector<quint32> rxFocusPointNumber;
|
|
|
|
QVector<float> thetaCos;
|
|
|
|
QVector<float> thetaSin;
|
|
|
|
QVector<float> phiCos;
|
|
|
|
QVector<float> phiSin;
|
|
|
|
QVector<float> interceptXPos;
|
|
|
|
QVector<float> interceptYPos;
|
|
|
|
QVector<float> interceptZPos;
|
|
|
|
QVector<float> txR0MinDelay;
|
|
|
|
QVector<float> rxR0MinDelay;
|
|
|
|
QVector<float> rxR0MaxDelay;
|
|
|
|
QVector<quint32> txR0MinDelayQ;
|
|
|
|
QVector<quint32> rxR0MinDelayQ;
|
|
|
|
QVector<quint32> rxR0MaxDelayQ;
|
|
|
|
QVector<quint32> rxR0StartActiveElementNumber;
|
|
|
|
QVector<float> r0XPosition;
|
|
|
|
QVector<float> r0YPosition;
|
|
|
|
QVector<float> r0ZPosition;
|
|
|
|
|
|
|
|
void clear()
|
|
|
|
{
|
|
|
|
rxR0CenterActiveElementNumber.clear();
|
|
|
|
rxR0ActiveElementNumber.clear();
|
|
|
|
rxActiveElementStep.clear();
|
|
|
|
interceptPointFiringTime.clear();
|
|
|
|
r0Position.clear();
|
|
|
|
rxFocusPointNumber.clear();
|
|
|
|
thetaCos.clear();
|
|
|
|
thetaSin.clear();
|
|
|
|
phiCos.clear();
|
|
|
|
phiSin.clear();
|
|
|
|
interceptXPos.clear();
|
|
|
|
interceptYPos.clear();
|
|
|
|
interceptZPos.clear();
|
|
|
|
txR0MinDelay.clear();
|
|
|
|
rxR0MinDelay.clear();
|
|
|
|
rxR0MaxDelay.clear();
|
|
|
|
txR0MinDelayQ.clear();
|
|
|
|
rxR0MinDelayQ.clear();
|
|
|
|
rxR0MaxDelayQ.clear();
|
|
|
|
rxR0StartActiveElementNumber.clear();
|
|
|
|
r0XPosition.clear();
|
|
|
|
r0YPosition.clear();
|
|
|
|
r0ZPosition.clear();
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
struct HwRegister_t {
|
|
|
|
QVector<float> dtgcLut;
|
|
|
|
QVector<QVector<float> > blendWeight;
|
|
|
|
QVector<float> elementXPosition;
|
|
|
|
QVector<float> elementYPosition;
|
|
|
|
QVector<float> elementZPosition;
|
|
|
|
QVector<float> freqLut;
|
|
|
|
quint32 scenarioStartIndex;
|
|
|
|
quint32 scenarioEndIndex;
|
|
|
|
QList<Pulse_t> pulseProps;
|
|
|
|
quint8 pulseTypeNumber;
|
|
|
|
quint8 rxBeamFormerTypeNumber;
|
|
|
|
QList<RxBeamFormer_t> rxBeamFormerProps;
|
|
|
|
quint8 receiverConfigTypeNumber;
|
|
|
|
QList<ReceiverConfig_t> receiverConfigProps;
|
|
|
|
QList<QVector<float>> lpfLut;
|
|
|
|
QList<QVector<float>> atgcLut;
|
|
|
|
QList<QVector<int> > apodizationLut;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct ScenGenHardwareOutput_t
|
|
|
|
{
|
|
|
|
quint32 focusTypeNumber;
|
|
|
|
quint32 totalTxShotNumber;
|
|
|
|
QVector<quint8> rxBeamFormerNumber;
|
|
|
|
QVector<float> pulseInterval;
|
|
|
|
|
|
|
|
HwRegister_t hwRegister;
|
|
|
|
SramIndex_t indexParams;
|
|
|
|
SramRx_t rxParams;
|
|
|
|
SramTx_t txParams;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class TrxBoard
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
QVector<quint8> _swapVec;
|
|
|
|
QVector<quint32> _unsignedQntzrVec;
|
|
|
|
QList<quint32>* _mcsList;
|
|
|
|
const quint32 _offsetSlave0;
|
|
|
|
const quint32 _offsetSlave1;
|
|
|
|
const quint32 _offsetSlave2;
|
|
|
|
bool _allow;
|
|
|
|
|
|
|
|
int _swCounter;
|
|
|
|
int _hwCounter;
|
|
|
|
bool _run;
|
|
|
|
|
|
|
|
SonoDevice _device;
|
|
|
|
AdcVoltages* _adc;
|
|
|
|
VoltagesPg* _pg;
|
|
|
|
|
|
|
|
ClockDistributer* _clkDistributer;
|
|
|
|
BoardsCtrlMngt* _bCtrlMngt;
|
|
|
|
FpgaProgram* _fpgaProgram;
|
|
|
|
BeamFormer* _beamFormerSlave0;
|
|
|
|
BeamFormer* _beamFormerSlave1;
|
|
|
|
BeamFormer* _beamFormerSlave2;
|
|
|
|
ScenPalyer* _scenPlayer;
|
|
|
|
BpiFlash* _bpiFlash;
|
|
|
|
Emulator* _emul;
|
|
|
|
Misc* _misc;
|
|
|
|
Sram* _sram;
|
|
|
|
Dsp* _dsp;
|
|
|
|
|
|
|
|
enum eScenParams : quint8
|
|
|
|
{
|
|
|
|
clear,
|
|
|
|
set
|
|
|
|
};
|
|
|
|
|
|
|
|
struct HwRegister
|
|
|
|
{
|
|
|
|
///////////// BeamFormer /////////////
|
|
|
|
RxBeamformerProperties* rxBeamformer;
|
|
|
|
QList<QVector<quint32>> apodization;
|
|
|
|
ProbeElementPosition* elementPosition;
|
|
|
|
PulseProperties* pulse;
|
|
|
|
//AfeProperties* afe;
|
|
|
|
quint8 pulseTypeNumber;
|
|
|
|
quint8 rxBeamFormerTypeNumber;
|
|
|
|
|
|
|
|
//////////////// DSP ////////////////
|
|
|
|
QVector<float> freqLut;
|
|
|
|
QVector<float> dtgcLut;
|
|
|
|
QList<QVector<quint32>> lpfLut;
|
|
|
|
QList<QVector<quint32>> atgcLut;
|
|
|
|
ReceiverConfiguration* configLut;
|
|
|
|
QVector<QVector<float>> blendWeight;
|
|
|
|
quint8 receiverConfigTypeNumber;
|
|
|
|
HwRegister();
|
|
|
|
~HwRegister();
|
|
|
|
};
|
|
|
|
|
|
|
|
struct ScenGenHardwareOutput {
|
|
|
|
quint32 focusTypeNumber;
|
|
|
|
quint32 totalTxShotNumber;
|
|
|
|
QVector<quint8> rxBeamFormerNumber;
|
|
|
|
quint32 scenarioStartIndex;
|
|
|
|
quint32 scenarioEndIndex;
|
|
|
|
|
|
|
|
HwRegister* hwRegister;
|
|
|
|
SramIndex* indexParams;
|
|
|
|
SramRx* rxParams;
|
|
|
|
SramTx* txParams;
|
|
|
|
ScenGenHardwareOutput();
|
|
|
|
~ScenGenHardwareOutput();
|
|
|
|
}*scenParams;
|
|
|
|
|
|
|
|
void setScenario (ScenGenHardwareOutput* scenParams);
|
|
|
|
|
|
|
|
void scenParamsFilling(eScenParams cmd);
|
|
|
|
void setSwapVector (void);
|
|
|
|
//QList<quint32> signedVector2unsignedList (QVector<qint32>& sgnVec);
|
|
|
|
|
|
|
|
public:
|
|
|
|
TrxBoard();
|
|
|
|
~TrxBoard();
|
|
|
|
|
|
|
|
////////////////////////////////// Scenario API ///////////////////////////////
|
|
|
|
void setLineFilterCoefficient (QVector<float>& lineFilterLut);
|
|
|
|
void setStbCoefficient (QVector<quint32>& stbLut);
|
|
|
|
void setDtgcLut (QVector<float>& dtgcLut);
|
|
|
|
|
|
|
|
void setAtgcMode (eAtgcMode mode, quint16 value) const;
|
|
|
|
|
|
|
|
void setScenario (ScenGenHardwareOutput_t scenGenHw);
|
|
|
|
|
|
|
|
void setAfePwrdnMode (eAfePwrdnMode cmd) const;
|
|
|
|
void setAfeConfig (AfeProperties* afe) const;
|
|
|
|
|
|
|
|
void scenPlayerStart (void) const;
|
|
|
|
//void scenPlayerPause (bool pause) const;
|
|
|
|
void scenPlayerStop (void) const;
|
|
|
|
|
|
|
|
////////////////////////////// Slave Programming API ///////////////////////////
|
|
|
|
void slaveFpgaProgram (QString path);
|
|
|
|
|
|
|
|
/////////////////////////////// BeamFormer Mode API ////////////////////////////
|
|
|
|
void setBeamFormerMode (eClkMode mode) const;
|
|
|
|
|
|
|
|
///////////////////////////////// Emulator API /////////////////////////////////
|
|
|
|
void emulatorInit(EmulatorProperties* config) const;
|
|
|
|
void emulatorEnable(void) const;
|
|
|
|
void emulatorDisable(void) const;
|
|
|
|
|
|
|
|
////////////////////////////// BoardCtrlMngt API ///////////////////////////////
|
|
|
|
quint32 deviceId (void) const;
|
|
|
|
quint32 vendorId (void) const;
|
|
|
|
|
|
|
|
quint32 trxId (void) const;
|
|
|
|
quint32 mpsId (void) const;
|
|
|
|
quint32 prbCtrlId (void) const;
|
|
|
|
quint32 prbId (quint8 prbSel) const;
|
|
|
|
void getConnectedPrbId (ConnectedPrbId* prbId) const;
|
|
|
|
|
|
|
|
QString trxInfo (void) const;
|
|
|
|
QString mpsInfo (void) const;
|
|
|
|
QString prbCtrlInfo (void) const;
|
|
|
|
QByteArray prbInfo (quint8 prbSel) const;
|
|
|
|
void getConnectedPrbInfo (ConnectedPrbInfo* prbInfo) const;
|
|
|
|
|
|
|
|
void supervisorRbValue(SupervisorRbValue* sValue) const;
|
|
|
|
void mpsFaultStatus (MpsFaultStatus* faultStatus) const;
|
|
|
|
void mpsReset (void) const;
|
|
|
|
void mpsSetAo (float voltA, float voltB) const;
|
|
|
|
|
|
|
|
void selectProbe (eSelectProbe prbSel) const;
|
|
|
|
void getHealthStatus (HealthStatus* healStat) const;
|
|
|
|
void init (void) const;
|
|
|
|
|
|
|
|
//////////////////////////////// BPI Flash API /////////////////////////////////
|
|
|
|
void mcsProgram (QString path);
|
|
|
|
void mcsVerify (QString path) const;
|
|
|
|
|
|
|
|
//////////////////////////////// Miscellaneous API /////////////////////////////////
|
|
|
|
void getTrxStatus (StatusVec* status) const;
|
|
|
|
void getFpgasCodeVersion (FpgaCodeVersion* version) const;
|
|
|
|
|
|
|
|
///////////////////////////////// Old TRX //////////////////////////////////////
|
|
|
|
void readData();
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // TRXBOARD_H
|