Browse Source

The adcs of afe is synchronized after slave fpga programming

The mps reset bug is fixed
The dacs of supervisory bug is fixed
The preprocessors of compiler are added to switch between some fitures
master
Arash Aletayeb 3 years ago
parent
commit
b15a64cc30
  1. 2
      developHw.pro
  2. 2
      developHw.pro.user
  3. 4
      hdf5Scenario/hdf5Scenario.cpp
  4. 16
      include/model/hardware/core/TrxBoard.h
  5. 6
      include/model/hardware/core/TrxBoardUtils/PreProcessorDef.h
  6. 7
      include/model/hardware/core/register/afe/Afe.h
  7. 30
      include/model/hardware/core/register/afe/registerDefinition/AdcSyncStatus.h
  8. 2
      include/model/hardware/core/register/beamFormer/registerDefinition/RxBeamformerLut.h
  9. 8
      include/model/hardware/core/register/boardsCtrlMngt/BoardsCtrlMngt.h
  10. 3
      include/model/hardware/core/register/boardsCtrlMngt/registerDefinition/mps/SupervisorSetupCmd.h
  11. 2
      include/model/hardware/core/register/dsp/registerDefinition/LpfLut.h
  12. 25
      include/model/hardware/core/register/fpgaProgram/FpgaProgram.h
  13. 7
      include/model/hardware/core/register/misc/Misc.h
  14. 30
      include/model/hardware/core/register/misc/registerDefinition/FrameLostCount.h
  15. 4
      include/model/hardware/core/register/misc/registerDefinition/StatusVector.h
  16. 27
      main.cpp
  17. 2322
      mainwindow.cpp
  18. 22
      mainwindow.h
  19. 115
      mainwindow.ui
  20. 434
      src/model/hardware/core/TrxBoard.cpp
  21. 36
      src/model/hardware/core/register/afe/Afe.cpp
  22. 599
      src/model/hardware/core/register/boardsCtrlMngt/BoardsCtrlMngt.cpp
  23. 80
      src/model/hardware/core/register/fpgaProgram/FpgaProgram.cpp
  24. 38
      src/model/hardware/core/register/misc/Misc.cpp

2
developHw.pro

@ -25,7 +25,7 @@ SOURCES += \
$$files(hdf5Scenario/*.cpp, true) \
HEADERS += \
include/model/hardware/core/register/afe/registerDefinition/AdcSyncStatus.h \
include/model/hardware/core/register/misc/registerDefinition/FrameLostCount.h \
mainwindow.h \
qcustomplot.h \
api.h \

2
developHw.pro.user

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 4.10.0, 2021-06-20T10:23:31. -->
<!-- Written by QtCreator 4.10.0, 2021-06-23T14:01:29. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>

4
hdf5Scenario/hdf5Scenario.cpp

@ -667,8 +667,8 @@ QVector<quint32> Hdf5::stbRead()
QVector<float> Hdf5::lineFilterRead()
{
/**************** /registerParameters/lineFilterLutQ ********************/
datasetBranch <float_t>("/registerParameters/lineFilterLutQ", floatArray);
/**************** /registerParameters/lineFilterLut ********************/
datasetBranch <float_t>("/registerParameters/lineFilterLut", floatArray);
QVector<float> lineFilter;
for (quint8 var = 0; var < 3; var++)
lineFilter.push_back(floatArray[var]);

16
include/model/hardware/core/TrxBoard.h

@ -77,7 +77,6 @@ private:
BeamFormer* _beamFormerSlave1;
BeamFormer* _beamFormerSlave2;
BoardsCtrlMngt* _bCtrlMngt;
FpgaProgram* _fpgaProgram;
ScenPalyer* _scenPlayer;
BpiFlash* _bpiFlash;
Afe* _afeSlave0;
@ -87,6 +86,9 @@ private:
Misc* _misc;
Sram* _sram;
Dsp* _dsp;
#ifndef DEVELOP_UI
FpgaProgram* _fpgaProgram;
#endif
enum eScenParams : quint8
{
@ -140,6 +142,8 @@ private:
void scenParamsFilling(eScenParams cmd);
//QList<quint32> signedVector2unsignedList(QVector<qint32>& sgnVec);
void afeAdcsSync (void) const;
template<class T>
QByteArray uintLittleEndian2ByteArray(T& data) const;
@ -154,8 +158,6 @@ signals:
public:
HardwarePacketEngine packetEngine;
TrxBoard();
~TrxBoard();
@ -227,9 +229,17 @@ public:
void getTrxStatus(StatusVec* status) const;
void getFpgasCodeVersion(FpgaCodeVersion* version) const;
void sramParityClear();
quint32 getFrameLostCounter(void) const;
/////////////////////////////// DMA Data Packet ////////////////////////////////////
void readData();
#ifdef DEVELOP_UI
FpgaProgram* _fpgaProgram;
#endif
#ifndef DEVELOP_UI
HardwarePacketEngine packetEngine;
#endif
};
#endif //TRXBOARD_H

6
include/model/hardware/core/TrxBoardUtils/PreProcessorDef.h

@ -2,9 +2,9 @@
#define PREPROCESSORDEF_H
#define MPS_BOARD
//#undef MPS_BOARD
#undef MPS_BOARD
#define DEVELOP_UI
#undef DEVELOP_UI
//#undef DEVELOP_UI
#endif // PREPROCESSORDEF_H
#endif //PREPROCESSORDEF_H

7
include/model/hardware/core/register/afe/Afe.h

@ -1,6 +1,7 @@
#ifndef AFE_H
#define AFE_H
#include "registerDefinition/AdcSyncStatus.h"
#include "registerDefinition/ActiveTerm.h"
#include "registerDefinition/LnaHpf.h"
#include "registerDefinition/Global.h"
@ -133,6 +134,7 @@ Q_DECLARE_METATYPE(AfeConfig)
class Afe
{
private:
AdcSyncStatus* _adcSync;
ActiveTerm* _actTerm;
LnaHpf* _lnaHpf;
Global* _global;
@ -151,6 +153,11 @@ public:
void setAfeParams(const AfeConfig afe) const;
void setAfeGblPwr(const bool pwrdn) const;
void setReadRegEnable(const bool rdEn) const;
bool getAfeSyncDone(void) const;
quint32 getAfeSyncError(void) const;
quint32 getAfeSyncAddress(void) const;
quint32 getAfeDataValid(void) const;
};
#endif // AFE_H

30
include/model/hardware/core/register/afe/registerDefinition/AdcSyncStatus.h

@ -6,30 +6,36 @@
#undef BAR
#define GEN_SYNC_CHECKER_MASK 0x0000000C
#define SYNC_CHECK_DONE_MASK 0x0000000C
#define SYNC_CHECK_ERROR_MASK 0x0000000C
#define LNA_HPF_PROG_MASK 0x0000000C
#define SYNC_DONE_MASK 0x00000001
#define SYNC_ERROR_MASK 0x000000FE
#define SYNC_ADDRESS_MASK 0x00003F00
#define DATA_VALID_OFFSET_MASK 0x0000C000
#define BAR 0U
#define OFFSET 0x43C384
#define BAR 0U
#define OFFSET 0x43C384
class AdcSyncStatus : public Register
{
public:
Field* lnaHpfProg;
Field* syncDone;
Field* syncError;
Field* syncAddress;
Field* dataValidOffset;
AdcSyncStatus(SonoDevice* device, quint32 offset) : Register(BAR, OFFSET + offset, device)
{
ADD_UNSIGNED_FIELD(lnaHpfProg, LNA_HPF_PROG_MASK);
ADD_UNSIGNED_FIELD(lnaHpfProg, LNA_HPF_PROG_MASK);
ADD_UNSIGNED_FIELD(lnaHpfProg, LNA_HPF_PROG_MASK);
ADD_UNSIGNED_FIELD(lnaHpfProg, LNA_HPF_PROG_MASK);
ADD_UNSIGNED_FIELD(syncDone, SYNC_DONE_MASK);
ADD_UNSIGNED_FIELD(syncError, SYNC_ERROR_MASK);
ADD_UNSIGNED_FIELD(syncAddress, SYNC_ADDRESS_MASK);
ADD_UNSIGNED_FIELD(dataValidOffset, DATA_VALID_OFFSET_MASK);
}
};
#undef LNA_HPF_PROG_MASK
#undef SYNC_DONE_MASK
#undef SYNC_ERROR_MASK
#undef SYNC_ADDRESS_MASK
#undef DATA_VALID_OFFSET_MASK
#undef BAR
#undef OFFSET

2
include/model/hardware/core/register/beamFormer/registerDefinition/RxBeamformerLut.h

@ -34,7 +34,7 @@ private:
void prepareData(quint32 index) override
{
lagPrp->setValue(_rxBfLut->lag.at(static_cast<qint32>(index)));
lagPrp->setValue(_rxBfLut->lag.at(static_cast<qint32>(index)) - 1);
apodizationSelPrp->setValue(_rxBfLut->apodization.at(static_cast<qint32>(index)) - 1);

8
include/model/hardware/core/register/boardsCtrlMngt/BoardsCtrlMngt.h

@ -195,18 +195,20 @@ private:
bool getI2cBusy(void) const;
void getSupervisorI2cTimeout(void) const;
void getSupervisorI2cDone(void) const;
bool getSetupCmdP24vOnOff(void) const;
void setSetupCmdP24vOnOff(bool p24vOnOff) const;
void setSetupCmdJmp(bool jmpDacCmd) const;
void setSetupCmdDacsOnOff(bool cwd, bool hvb, bool hva) const;
void setPwrDacsValid(bool pwrValid) const;
void setMpsDacsValue(MpsDacs* _mpsDacs) const;
friend void trxEepromWrite(QByteArray arr, quint32 address, BoardsCtrlMngt* boards);
friend void mpsEepromWrite(QByteArray arr, quint32 address, BoardsCtrlMngt* boards);
friend void prbCtrlEepromWrite(QByteArray arr, quint32 address, BoardsCtrlMngt* boards);
friend void prbEepromWrite(QByteArray arr,
quint32 address,
quint8 prbSel,
BoardsCtrlMngt* boards);
quint32 address,
quint8 prbSel,
BoardsCtrlMngt* boards);
public:
explicit BoardsCtrlMngt(SonoDevice* device) : BoardsSpecs(device)

3
include/model/hardware/core/register/boardsCtrlMngt/registerDefinition/mps/SupervisorSetupCmd.h

@ -11,6 +11,7 @@
#define CWD_ON_OFF_MASK 0x00000004
#define HVB_ON_OFF_MASK 0x00000008
#define HVA_ON_OFF_MASK 0x00000010
#define PWR_DAC_VALID_MASK 0x00000020
#define BAR 0
#define OFFSET 0X26030
@ -23,6 +24,7 @@ public:
Field* cwdOnOff;
Field* hvbOnOff;
Field* hvaOnOff;
Field* pwrDacValid;
SupervisorSetupCmd(SonoDevice* device) : Register(BAR, OFFSET, device)
@ -32,6 +34,7 @@ public:
ADD_UNSIGNED_FIELD(cwdOnOff, CWD_ON_OFF_MASK);
ADD_UNSIGNED_FIELD(hvbOnOff, HVB_ON_OFF_MASK);
ADD_UNSIGNED_FIELD(hvaOnOff, HVA_ON_OFF_MASK);
ADD_UNSIGNED_FIELD(pwrDacValid, PWR_DAC_VALID_MASK);
}
};

2
include/model/hardware/core/register/dsp/registerDefinition/LpfLut.h

@ -6,7 +6,7 @@
#undef BAR
#define LPF_LUT_MASK 0x0000FFFF
#define LPF_LUT_MASK 0x0003FFFF
#define BAR 0
#define OFFSET 0x81000

25
include/model/hardware/core/register/fpgaProgram/FpgaProgram.h

@ -1,6 +1,7 @@
#ifndef FPGAPROGRAM_H
#define FPGAPROGRAM_H
#include <QObject>
#include <QDataStream>
#include <QDebug>
#include <QByteArray>
@ -11,10 +12,6 @@
#include "registerDefinition/SerialProgramData.h"
#include "registerDefinition/SerialProgramStatus.h"
//#define FPGA_S0_DONE 1
//#define FPGA_S1_DONE 2
//#define FPGA_S2_DONE 4
#define FPGA_S0_INIT_B 1
#define FPGA_S1_INIT_B 2
#define FPGA_S2_INIT_B 4
@ -30,13 +27,15 @@ T byteArray2UintBigEndian(QByteArray& byte)
return data;
}
class FpgaProgram
class FpgaProgram : public QObject
{
Q_OBJECT
private:
SerialProgramData* _progData;
SlaveFpgaNumber* _fpgaNumber;
struct ProgramStatus {
struct ProgramStatus {
SerialProgramStatus* _progStatus;
bool getProgramBusy() const;
bool getProgramDone() const;
@ -46,18 +45,22 @@ private:
bool getFpgaS0InitB() const;
bool getFpgaS1InitB() const;
bool getFpgaS2InitB() const;
//bool getFpgaS0Done();
//bool getFpgaS1Done();
//bool getFpgaS2Done();
}* _status;
}* _status;
void setSlaveFpgaNumber(quint8& number) const;
void setSlaveFpgaNumber(quint8& number) const;
#ifdef DEVELOP_UI
signals:
void programmingProgress(qint32 progressValue, qint32 bitFileSize);
#endif
public:
explicit FpgaProgram(SonoDevice* device);
~FpgaProgram();
void program(QByteArray& bitFileData, quint8 number);
};
#endif //PROGRAM_H

7
include/model/hardware/core/register/misc/Misc.h

@ -1,9 +1,10 @@
#ifndef MISC_H
#define MISC_H
#include "registerDefinition/FrameLostCount.h"
#include "registerDefinition/StatusVector.h"
#include "registerDefinition/FpgaVersion.h"
#include "registerDefinition/GtSendMode.h"
#include "registerDefinition/StatusVector.h"
#include "registerDefinition/SyncMode.h"
struct StatusVec
@ -24,6 +25,7 @@ struct StatusVec
bool pgErr;
bool probeDisconnectErr;
bool fanFault;
bool frameLost;
bool emulDmaTransferErr;
bool dmaCtrlTransferErr;
};
@ -65,6 +67,7 @@ private:
StatusVector* _status;
GtSendMode* _gt;
SyncMode* _sync;
FrameLostCount* _lostCount;
template<class T>
quint32 getVersion (T* version) const;
@ -77,6 +80,8 @@ public:
void getFpgaVersion(FpgaCodeVersion* version) const;
void setGtSendMode (eGtSendCtrl gtMode) const;
void setSyncMode (eSyncCtrl syncMode) const;
void setManualSync (bool sync) const;
quint32 getFrameLostCount(void) const;
};

30
include/model/hardware/core/register/misc/registerDefinition/FrameLostCount.h

@ -0,0 +1,30 @@
#ifndef FRAMELOSTCOUNT_H
#define FRAMELOSTCOUNT_H
#include "model/hardware/core/register/Register.h"
#include "model/hardware/core/register/RegUtils.h"
#undef BAR
#define LOST_COUNT 0x000000FF
#define BAR 0U
#define OFFSET 0x86024
class FrameLostCount : public Register
{
public:
Field* lostCount;
FrameLostCount(SonoDevice* device) : Register(BAR, OFFSET, device)
{
ADD_UNSIGNED_FIELD(lostCount, LOST_COUNT);
}
};
#undef LOST_COUNT
#undef BAR
#undef OFFSET
#endif // FRAMELOSTCOUNT_H

4
include/model/hardware/core/register/misc/registerDefinition/StatusVector.h

@ -22,6 +22,7 @@
#define PG_Err_MASK 0x00002000
#define PROBE_DISCONNECT_Err_MASK 0x00004000
#define FAN_FAULT_MASK 0x00008000
#define FRAME_LOST_MASK 0x00020000
#define EMUL_DMA_TRANSFER_Err_MASK 0x40000000
#define DMA_CTRL_TRANSFER_Err_MASK 0x80000000
@ -47,6 +48,7 @@ public:
Field* pgErr;
Field* probeDisconnectErr;
Field* fanFault;
Field* frameLost;
Field* emulDmaTransferErr;
Field* dmaCtrlTransferErr;
@ -68,6 +70,7 @@ public:
ADD_UNSIGNED_FIELD(pgErr, PG_Err_MASK);
ADD_UNSIGNED_FIELD(probeDisconnectErr, PROBE_DISCONNECT_Err_MASK);
ADD_UNSIGNED_FIELD(fanFault, FAN_FAULT_MASK);
ADD_UNSIGNED_FIELD(frameLost, FRAME_LOST_MASK);
ADD_UNSIGNED_FIELD(emulDmaTransferErr, EMUL_DMA_TRANSFER_Err_MASK);
ADD_UNSIGNED_FIELD(dmaCtrlTransferErr, DMA_CTRL_TRANSFER_Err_MASK);
}
@ -89,6 +92,7 @@ public:
#undef PG_Err_MASK
#undef PROBE_DISCONNECT_Err_MASK
#undef FAN_FAULT_MASK
#undef FRAME_LOST_MASK
#undef EMUL_DMA_TRANSFER_Err_MASK
#undef DMA_CTRL_TRANSFER_Err_MASK

27
main.cpp

@ -7,14 +7,21 @@ int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWindow w;
w.setGeometry(
QStyle::alignedRect(
Qt::LeftToRight,
Qt::AlignCenter,
w.size(),
qApp->desktop()->availableGeometry()
)
);
w.show();
return a.exec();
try
{
w.setGeometry(
QStyle::alignedRect(
Qt::LeftToRight,
Qt::AlignCenter,
w.size(),
qApp->desktop()->availableGeometry()
)
);
w.show();
return a.exec();
}
catch(SonoException& e)
{
qDebug() << e.what();
}
}

2322
mainwindow.cpp

File diff suppressed because it is too large

22
mainwindow.h

@ -60,7 +60,7 @@
#define TRANSFER_RATE 30.0f
#define RAM_BUFFER_OFFSET 0U
#define ULTIMATE_LOG_COUNT 50
#define ULTIMATE_LOG_COUNT 1000
QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
@ -116,14 +116,8 @@ private:
AfeConfig _afeConfig;
QFutureWatcher <void> scenEndWather;
void setScenario(const string& h5Path);
void setScenarioCompare(const QString& scenPath);
void fpgaProgrammer(QString path);
void timeout();
void delay(int ms);
@ -167,6 +161,8 @@ private:
private slots:
void setScenario(const string& h5Path);
void getFramePacket (QByteArray packet);
void getSramBinaryCreateFlag (void);
@ -177,7 +173,13 @@ private slots:
void getPrbChange();
void restartTimer();
void getFrameLost();
void getProgrammingProgress(qint32 progressValue, qint32 bitFileSize);
void getLabelState(QLabel* label, QString str, QColor color);
void getFpgaProgrammer (QString path);
void on_rbtn_reg_toggled(bool checked);
@ -364,6 +366,10 @@ signals:
void twoDReady();
void sendLogCount(qint32 counter, QProgressDialog* _progress);
void connectedPrbChange();
void frameLostCall();
void labelState(QLabel* label, QString str, QColor color);
void fpgaProgrammer(QString path);
void scenarioReady(const string& h5Path);
};
#endif // MAINWINDOW_H

115
mainwindow.ui

@ -296,7 +296,7 @@
<x>0</x>
<y>150</y>
<width>741</width>
<height>105</height>
<height>141</height>
</rect>
</property>
<property name="sizePolicy">
@ -308,13 +308,13 @@
<property name="minimumSize">
<size>
<width>0</width>
<height>105</height>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>105</height>
<height>150</height>
</size>
</property>
<property name="font">
@ -361,8 +361,8 @@
<rect>
<x>10</x>
<y>70</y>
<width>128</width>
<height>17</height>
<width>138</width>
<height>19</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_28">
@ -395,6 +395,19 @@
<string>Program</string>
</property>
</widget>
<widget class="QProgressBar" name="prg_programming">
<property name="geometry">
<rect>
<x>10</x>
<y>100</y>
<width>721</width>
<height>23</height>
</rect>
</property>
<property name="value">
<number>24</number>
</property>
</widget>
</widget>
</widget>
<widget class="QWidget" name="tab_5">
@ -488,7 +501,7 @@
<rect>
<x>0</x>
<y>190</y>
<width>331</width>
<width>321</width>
<height>101</height>
</rect>
</property>
@ -553,9 +566,9 @@
<property name="geometry">
<rect>
<x>250</x>
<y>30</y>
<y>20</y>
<width>71</width>
<height>61</height>
<height>81</height>
</rect>
</property>
<property name="toolTip">
@ -640,8 +653,8 @@
<rect>
<x>690</x>
<y>70</y>
<width>91</width>
<height>48</height>
<width>92</width>
<height>52</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_5">
@ -677,8 +690,8 @@
<rect>
<x>460</x>
<y>70</y>
<width>205</width>
<height>94</height>
<width>222</width>
<height>102</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
@ -757,7 +770,7 @@
<x>10</x>
<y>70</y>
<width>281</width>
<height>60</height>
<height>64</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_27">
@ -1435,8 +1448,8 @@
<rect>
<x>310</x>
<y>30</y>
<width>126</width>
<height>17</height>
<width>136</width>
<height>19</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_15">
@ -1461,8 +1474,8 @@
<rect>
<x>310</x>
<y>50</y>
<width>119</width>
<height>17</height>
<width>128</width>
<height>19</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_16">
@ -1487,8 +1500,8 @@
<rect>
<x>310</x>
<y>70</y>
<width>121</width>
<height>17</height>
<width>131</width>
<height>19</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_24">
@ -1513,8 +1526,8 @@
<rect>
<x>310</x>
<y>90</y>
<width>151</width>
<height>17</height>
<width>163</width>
<height>19</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_23">
@ -1539,8 +1552,8 @@
<rect>
<x>310</x>
<y>110</y>
<width>152</width>
<height>17</height>
<width>164</width>
<height>19</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_22">
@ -1565,8 +1578,8 @@
<rect>
<x>540</x>
<y>30</y>
<width>147</width>
<height>17</height>
<width>158</width>
<height>19</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_17">
@ -1591,8 +1604,8 @@
<rect>
<x>310</x>
<y>130</y>
<width>143</width>
<height>17</height>
<width>154</width>
<height>19</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_18">
@ -1617,8 +1630,8 @@
<rect>
<x>540</x>
<y>50</y>
<width>164</width>
<height>17</height>
<width>178</width>
<height>19</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_25">
@ -1643,8 +1656,8 @@
<rect>
<x>470</x>
<y>30</y>
<width>62</width>
<height>122</height>
<width>63</width>
<height>134</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_15">
@ -1715,7 +1728,7 @@
<rect>
<x>540</x>
<y>90</y>
<width>145</width>
<width>156</width>
<height>62</height>
</rect>
</property>
@ -1769,8 +1782,8 @@
<rect>
<x>0</x>
<y>60</y>
<width>285</width>
<height>67</height>
<width>302</width>
<height>98</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_8">
@ -1975,6 +1988,20 @@
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_42">
<item>
<widget class="QLabel" name="l_frameLost">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-size:7pt; font-weight:600; font-style:italic;&quot;&gt;Frame Lost&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>false</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
</layout>
@ -1984,7 +2011,7 @@
<rect>
<x>140</x>
<y>30</y>
<width>163</width>
<width>176</width>
<height>21</height>
</rect>
</property>
@ -2011,7 +2038,7 @@
<x>710</x>
<y>40</y>
<width>101</width>
<height>111</height>
<height>119</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_4">
@ -2091,8 +2118,8 @@
<rect>
<x>540</x>
<y>20</y>
<width>142</width>
<height>25</height>
<width>150</width>
<height>27</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_104">
@ -2134,8 +2161,8 @@
<rect>
<x>0</x>
<y>20</y>
<width>481</width>
<height>61</height>
<width>486</width>
<height>51</height>
</rect>
</property>
<row>
@ -3272,8 +3299,8 @@
<rect>
<x>710</x>
<y>140</y>
<width>82</width>
<height>17</height>
<width>88</width>
<height>19</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_79">
@ -3298,8 +3325,8 @@
<rect>
<x>710</x>
<y>170</y>
<width>82</width>
<height>17</height>
<width>88</width>
<height>19</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_86">

434
src/model/hardware/core/TrxBoard.cpp

@ -4,7 +4,7 @@ template<class T>
QByteArray TrxBoard::uintLittleEndian2ByteArray(T& data) const
{
QByteArray byte;
QDataStream out (&byte, QIODevice::WriteOnly);
QDataStream out(&byte, QIODevice::WriteOnly);
out.setByteOrder(QDataStream::LittleEndian);
out << data;
@ -15,7 +15,7 @@ template<class T>
T TrxBoard::byteArray2UintLittleEndian(QByteArray& byte) const
{
T data;
QDataStream in (byte);
QDataStream in(byte);
in.setByteOrder(QDataStream::LittleEndian);
in >> data;
@ -39,8 +39,10 @@ void TrxBoard::readData()
{
_hwCounter++;
if (_hwCounter > HW_BUFFER_NUM)
if(_hwCounter > HW_BUFFER_NUM)
{
_hwCounter = 1;
}
_device.copy(_hwCounter - 1, _swCounter);
@ -66,20 +68,20 @@ void TrxBoard::readData()
void TrxBoard::sramClear(eSramClear clearMode)
{
quint32 num(0);
if (clearMode == all)
if(clearMode == all)
{
while (num < SRAM_SIZE)
while(num < SRAM_SIZE)
{
this->_device.device.writeLong(BAR_SRAM, static_cast<quint32>(num), 0);
num += sizeof (quint64);
this->_device.device.writeLong(BAR_SRAM, static_cast<quint32>(num), 0);
num += sizeof(quint64);
}
}
if (clearMode == first4M)
if(clearMode == first4M)
{
while (num < SRAM_SIZE / 4)
while(num < SRAM_SIZE / 4)
{
this->_device.device.writeLong(BAR_SRAM, static_cast<quint32>(num), 0);
num += sizeof (quint64);
this->_device.device.writeLong(BAR_SRAM, static_cast<quint32>(num), 0);
num += sizeof(quint64);
}
}
}
@ -96,28 +98,66 @@ void TrxBoard::scenParamsFilling(TrxBoard::eScenParams cmd)
else
{
_allow = false;
}
}
}
void TrxBoard::afeAdcsSync() const
{
quint32 syncErr(0);
this->_bCtrlMngt->timerShot(20);
while(!(this->_bCtrlMngt->checkTimeout()))
{
;
}
this->_misc->setSyncMode(AdcSyncMode);
this->_misc->setManualSync(true);
this->_misc->setManualSync(false);
this->_misc->setManualSync(BfSyncMode);
this->_bCtrlMngt->timerShot(1);
while(!((this->_afeSlave0->getAfeSyncDone()) &&
(this->_afeSlave1->getAfeSyncDone()) &&
(this->_afeSlave2->getAfeSyncDone())))
{
if(this->_bCtrlMngt->checkTimeout())
{
throw SonoException(
"The timeout of the afe adcs sync is happend without receiving of sync done.");
}
}
this->_bCtrlMngt->timerStop();
syncErr = this->_afeSlave0->getAfeSyncError();
syncErr += this->_afeSlave1->getAfeSyncError();
syncErr += this->_afeSlave2->getAfeSyncError();
if(syncErr != 0)
{
throw SonoException("The error of the afe adcs sync is happend.");
}
}
void TrxBoard::setSwapVector()
{
_swapVec.clear();
_swapVec << 0 << 113 << 98 << 19 << 4 << 117 << 102 << 23 << 8 << 121 << 106 << 27
<< 12 << 125 << 110 << 31 << 16 << 1 << 114 << 99 << 20 << 5 << 118 << 103
<< 24 << 9 << 122 << 107 << 28 << 13 << 126 << 111 << 96 << 17 << 2 << 115
<< 100 << 21 << 6 << 119 << 104 << 25 << 10 << 123 << 108 << 29 << 14 << 127
<< 112 << 97 << 18 << 3 << 116 << 101 << 22 << 7 << 120 << 105 << 26 << 11
<< 124 << 109 << 30 << 15 << 32 << 145 << 130 << 51 << 36 << 149 << 134 << 55
<< 40 << 153 << 138 << 59 << 44 << 157 << 142 << 63 << 48 << 33 << 146 << 131
<< 52 << 37 << 150 << 135 << 56 << 41 << 154 << 139 << 60 << 45 << 158 << 143
<< 128 << 49 << 34 << 147 << 132 << 53 << 38 << 151 << 136 << 57 << 42 << 155
<< 140 << 61 << 46 << 159 << 144 << 129 << 50 << 35 << 148 << 133 << 54 << 39
<< 152 << 137 << 58 << 43 << 156 << 141 << 62 << 47 << 64 << 177 << 162 << 83
<< 68 << 181 << 166 << 87 << 72 << 185 << 170 << 91 << 76 << 189 << 174 << 95
<< 80 << 65 << 178 << 163 << 84 << 69 << 182 << 167 << 88 << 73 << 186 << 171
<< 92 << 77 << 190 << 175 << 160 << 81 << 66 << 179 << 164 << 85 << 70 << 183
<< 168 << 89 << 74 << 187 << 172 << 93 << 78 << 191 << 176 << 161 << 82 << 67
<< 180 << 165 << 86 << 71 << 184 << 169 << 90 << 75 << 188 << 173 << 94 << 79;
_swapVec << 0 << 113 << 98 << 19 << 4 << 117 << 102 << 23 << 8 << 121 << 106 << 27
<< 12 << 125 << 110 << 31 << 16 << 1 << 114 << 99 << 20 << 5 << 118 << 103
<< 24 << 9 << 122 << 107 << 28 << 13 << 126 << 111 << 96 << 17 << 2 << 115
<< 100 << 21 << 6 << 119 << 104 << 25 << 10 << 123 << 108 << 29 << 14 << 127
<< 112 << 97 << 18 << 3 << 116 << 101 << 22 << 7 << 120 << 105 << 26 << 11
<< 124 << 109 << 30 << 15 << 32 << 145 << 130 << 51 << 36 << 149 << 134 << 55
<< 40 << 153 << 138 << 59 << 44 << 157 << 142 << 63 << 48 << 33 << 146 << 131
<< 52 << 37 << 150 << 135 << 56 << 41 << 154 << 139 << 60 << 45 << 158 << 143
<< 128 << 49 << 34 << 147 << 132 << 53 << 38 << 151 << 136 << 57 << 42 << 155
<< 140 << 61 << 46 << 159 << 144 << 129 << 50 << 35 << 148 << 133 << 54 << 39
<< 152 << 137 << 58 << 43 << 156 << 141 << 62 << 47 << 64 << 177 << 162 << 83
<< 68 << 181 << 166 << 87 << 72 << 185 << 170 << 91 << 76 << 189 << 174 << 95
<< 80 << 65 << 178 << 163 << 84 << 69 << 182 << 167 << 88 << 73 << 186 << 171
<< 92 << 77 << 190 << 175 << 160 << 81 << 66 << 179 << 164 << 85 << 70 << 183
<< 168 << 89 << 74 << 187 << 172 << 93 << 78 << 191 << 176 << 161 << 82 << 67
<< 180 << 165 << 86 << 71 << 184 << 169 << 90 << 75 << 188 << 173 << 94 << 79;
}
void TrxBoard::setRomCrc()
@ -125,7 +165,9 @@ void TrxBoard::setRomCrc()
unsigned char crcArray[] = {0x4, 0x0, 0x13, 0x0, 0x27, 0x0, 0x28, 0x0, 0xEB, 0x1,
0xAC, 0x5, 0xAC, 0x6, 0x4C, 0x6, 0xB0, 0x6, 0xB2};
for(auto var : crcArray)
{
_eepromCrc.push_back(static_cast<char>(var));
}
}
void TrxBoard::setAfeModuleOffset()
@ -142,15 +184,15 @@ void TrxBoard::setFpgaOffset()
//QList<quint32> TrxBoard::signedVector2unsignedList (QVector<qint32>& sgnVec)
//{
// _unsignedQntzrList.clear();
//_unsignedQntzrList.clear();
//// std::list<uint> _usgnList (sgnVec.begin(), sgnVec.end());
//// _unsignedQntzrList.fromStdList(_usgnList);
// foreach (auto i, sgnVec)
// {
// _unsignedQntzrList.push_back(static_cast<quint32>(i));
// }
//foreach (auto i, sgnVec)
//{
//_unsignedQntzrList.push_back(static_cast<quint32>(i));
//}
// return _unsignedQntzrList;
//return _unsignedQntzrList;
//}
TrxBoard::TrxBoard() : _offsetSlave0(0), _offsetSlave1(0x400000), _offsetSlave2(0x800000)
@ -242,11 +284,13 @@ void TrxBoard::init()
sramClear(all);
}
void TrxBoard::setProbeDependParams(ScenPrbDepHardwareParam &prbDepParams)
void TrxBoard::setProbeDependParams(ScenPrbDepHardwareParam& prbDepParams)
{
/////////////////////////// DSP setting ///////////////////////////
if (prbDepParams.prbDepParams.apodizationLut.size() != APODIZATIONLUT_LUT_MAX)
if(prbDepParams.prbDepParams.apodizationLut.size() != APODIZATIONLUT_LUT_MAX)
{
throw SonoException("Apodization lut is out of range");
}
QList<QList<quint32> > apodizationQ;
foreach(auto vec, prbDepParams.prbDepParams.apodizationLut)
{
@ -257,8 +301,10 @@ void TrxBoard::setProbeDependParams(ScenPrbDepHardwareParam &prbDepParams)
this->_beamFormerSlave2->apodizationLut(apodizationQ);
scenParamsFilling(set);
if (prbDepParams.prbDepParams.atgcLut.size() != ATGC_LUT_MAX)
if(prbDepParams.prbDepParams.atgcLut.size() != ATGC_LUT_MAX)
{
throw SonoException("Atgc lut is out of range");
}
QList<QList<quint32> > atgcLutQ;
foreach(auto vec, prbDepParams.prbDepParams.atgcLut)
{
@ -266,8 +312,10 @@ void TrxBoard::setProbeDependParams(ScenPrbDepHardwareParam &prbDepParams)
}
this->_dsp->atgcLut(atgcLutQ);
if (prbDepParams.prbDepParams.lpfLut.size() != LPF_LUT_MAX)
if(prbDepParams.prbDepParams.lpfLut.size() != LPF_LUT_MAX)
{
throw SonoException("Lpf lut is out of range");
}
QList<QList<quint32> > lpfLutQ;
foreach(auto vec, prbDepParams.prbDepParams.lpfLut)
{
@ -279,73 +327,106 @@ void TrxBoard::setProbeDependParams(ScenPrbDepHardwareParam &prbDepParams)
this->_afeSlave0->setAfeParams(prbDepParams.afeCfg);
this->_afeSlave1->setAfeParams(prbDepParams.afeCfg);
this->_afeSlave2->setAfeParams(prbDepParams.afeCfg);
this->_afeSlave0->setAfeGblPwr(afePwrdnEnable);
this->_afeSlave1->setAfeGblPwr(afePwrdnEnable);
this->_afeSlave2->setAfeGblPwr(afePwrdnEnable);
}
void TrxBoard::setScenario(ScenGenHardwareOutput_t &scenGenHw)
void TrxBoard::setScenario(ScenGenHardwareOutput_t& scenGenHw)
{
if (this->_scenPlayer->control.getCommand())
if(this->_scenPlayer->control.getCommand())
{
scenPlayerStop();
}
emulatorStop();
sramClear(first4M);
scenParams->focusTypeNumber = scenGenHw.focusTypeNumber;
if (scenParams->focusTypeNumber > FOCUS_TYPE_NUMBER_MAX)
if(scenParams->focusTypeNumber > FOCUS_TYPE_NUMBER_MAX)
{
throw SonoException("Focus type number is out of range");
}
scenParams->totalTxShotNumber = scenGenHw.totalTxShotNumber;
if (scenParams->totalTxShotNumber > TOTAL_TX_SHOT_NUMBER_MAX)
if(scenParams->totalTxShotNumber > TOTAL_TX_SHOT_NUMBER_MAX)
{
throw SonoException("Total tx shot number is out of range");
}
scenParams->rxBeamFormerNumber = scenGenHw.rxBeamFormerNumber.toVector();
if (scenParams->rxBeamFormerNumber.size() > RX_BEAMFORMER_NUMBER_MAX)
if(scenParams->rxBeamFormerNumber.size() > RX_BEAMFORMER_NUMBER_MAX)
{
throw SonoException("Rx beam former number is out of range");
}
scenParams->scenarioStartIndex = scenGenHw.hwRegister.scenarioStartIndex;
scenParams->scenarioEndIndex = scenGenHw.hwRegister.scenarioEndIndex;
if (scenParams->scenarioEndIndex > SCENARIO_INDEX_MAX)
if(scenParams->scenarioEndIndex > SCENARIO_INDEX_MAX)
{
throw SonoException("Scenario end index is out of range");
}
if(scenParams->scenarioEndIndex < scenParams->scenarioStartIndex)
{
throw SonoException(
"The scenario end index must be greater than or equal to the scenario start index");
}
scenParams->hwRegister->blendWeight = scenGenHw.hwRegister.blendWeight;
if (scenParams->hwRegister->blendWeight.size() != BLENDWEIGHT_LUT_MAX)
if(scenParams->hwRegister->blendWeight.size() != BLENDWEIGHT_LUT_MAX)
{
throw SonoException("Blend weight lut is out of range");
}
scenParams->hwRegister->elementPosition->xPosition = scenGenHw.hwRegister.elementXPosition;
if (scenParams->hwRegister->elementPosition->xPosition.size() != ELEMENT_POSITION_LUT_MAX)
if(scenParams->hwRegister->elementPosition->xPosition.size() != ELEMENT_POSITION_LUT_MAX)
{
throw SonoException("Element position x is out of range");
}
scenParams->hwRegister->elementPosition->yPosition = scenGenHw.hwRegister.elementYPosition;
if (scenParams->hwRegister->elementPosition->yPosition.size() != ELEMENT_POSITION_LUT_MAX)
if(scenParams->hwRegister->elementPosition->yPosition.size() != ELEMENT_POSITION_LUT_MAX)
{
throw SonoException("Element position y is out of range");
}
scenParams->hwRegister->elementPosition->zPosition = scenGenHw.hwRegister.elementZPosition;
if (scenParams->hwRegister->elementPosition->zPosition.size() != ELEMENT_POSITION_LUT_MAX)
if(scenParams->hwRegister->elementPosition->zPosition.size() != ELEMENT_POSITION_LUT_MAX)
{
throw SonoException("Element position z is out of range");
}
scenParams->hwRegister->freqLut = scenGenHw.hwRegister.freqLut;
if (scenParams->hwRegister->freqLut.size() != FREQUENCY_LUT_MAX)
if(scenParams->hwRegister->freqLut.size() != FREQUENCY_LUT_MAX)
{
throw SonoException("Frequency lut is out of range");
}
scenParams->hwRegister->dtgcLut = scenGenHw.hwRegister.dtgcLut;
if (scenParams->hwRegister->dtgcLut.size() != DTGC_LUT_MAX)
if(scenParams->hwRegister->dtgcLut.size() != DTGC_LUT_MAX)
{
throw SonoException("Dtgc lut is out of range");
}
scenParams->hwRegister->pulseTypeNumber = scenGenHw.hwRegister.pulseTypeNumber;
if (scenParams->hwRegister->pulseTypeNumber > PULSE_LUT_MAX)
if(scenParams->hwRegister->pulseTypeNumber > PULSE_LUT_MAX)
{
throw SonoException("Pulse type number is out of range");
}
scenParams->hwRegister->rxBeamFormerTypeNumber = scenGenHw.hwRegister.rxBeamFormerTypeNumber;
if (scenParams->hwRegister->rxBeamFormerTypeNumber > RXBEAMFORMER_LUT_MAX)
if(scenParams->hwRegister->rxBeamFormerTypeNumber > RXBEAMFORMER_LUT_MAX)
{
throw SonoException("Rx beam former type number is out of range");
}
scenParams->hwRegister->receiverConfigTypeNumber =
scenGenHw.hwRegister.receiverConfigTypeNumber;
if (scenParams->hwRegister->receiverConfigTypeNumber > RRECEIVER_CONFIGURATION_LUT_MAX)
if(scenParams->hwRegister->receiverConfigTypeNumber > RRECEIVER_CONFIGURATION_LUT_MAX)
{
throw SonoException("Receiver config type number is out of range");
}
scenParams->hwRegister->pulse->clear();
foreach(auto i, scenGenHw.hwRegister.pulseProps)
@ -366,7 +447,7 @@ void TrxBoard::setScenario(ScenGenHardwareOutput_t &scenGenHw)
}
scenParams->hwRegister->configLut->clear();
foreach (auto k, scenGenHw.hwRegister.receiverConfigProps)
foreach(auto k, scenGenHw.hwRegister.receiverConfigProps)
{
scenParams->hwRegister->configLut->mla.append(k.mla);
scenParams->hwRegister->configLut->stb.append(k.stb);
@ -386,7 +467,7 @@ void TrxBoard::setScenario(ScenGenHardwareOutput_t &scenGenHw)
}
scenParams->indexParams->dLineNum = scenGenHw.indexParams.dLineNum;
scenParams->indexParams->frameType=scenGenHw.frameType;
scenParams->indexParams->frameType = scenGenHw.frameType;
scenParams->indexParams->dEnsembleNum = scenGenHw.indexParams.dEnsembleNum;
scenParams->indexParams->lastLineInFrame = scenGenHw.indexParams.lastLineInFrame;
scenParams->indexParams->firstLineInFrame = scenGenHw.indexParams.firstLineInFrame;
@ -529,7 +610,8 @@ void TrxBoard::setScenario (ScenGenHardwareParam* scenParams)
QList<quint32> freqLutQ = _unsignedQntzrVec.toList();
this->_dsp->frequencyLut(freqLutQ);
_unsignedQntzrVec = Calculation::qntzr(scenParams->hwRegister->dtgcLut, 0, 12, 8, 0, true, false);
_unsignedQntzrVec =
Calculation::qntzr(scenParams->hwRegister->dtgcLut, 0, 12, 8, 0, true, false);
QList<quint32> dtgcLutQ = _unsignedQntzrVec.toList();
this->_dsp->dtgcLut(dtgcLutQ);
@ -551,21 +633,22 @@ void TrxBoard::setScenario (ScenGenHardwareParam* scenParams)
this->_sram->setSramTx(scenParams->focusTypeNumber, scenParams->txParams);
this->_sram->setSramRx(scenParams->rxBeamFormerNumber,
scenParams->focusTypeNumber,
scenParams->rxParams);
scenParams->focusTypeNumber,
scenParams->rxParams);
scenParamsFilling(set);
////////////////////////////// Scen Index setting ////////////////////////////
this->_scenPlayer->setStartIndex(scenParams->scenarioStartIndex);
this->_scenPlayer->setEndIndex(scenParams->scenarioEndIndex);
}
void TrxBoard::setLineFilterCoefficient(QVector<float>& lineFilterLut)
{
if (lineFilterLut.size() != LINE_FILTER_LUT_MAX)
if(lineFilterLut.size() != LINE_FILTER_LUT_MAX)
{
throw SonoException("Line filter lut is out of range");
}
_unsignedQntzrVec = Calculation::qntzr(lineFilterLut, 0, 9, 8, 0, true, false);
QList<quint32> lineFilterLutQ = _unsignedQntzrVec.toList();
this->_dsp->lineFilterCoefficient(lineFilterLutQ);
@ -573,8 +656,10 @@ void TrxBoard::setLineFilterCoefficient(QVector<float>& lineFilterLut)
void TrxBoard::setStbCoefficient(QVector<quint32>& stbLut)
{
if (stbLut.size() != STB_COEFFICIENT_LUT_MAX)
if(stbLut.size() != STB_COEFFICIENT_LUT_MAX)
{
throw SonoException("Stb lut is out of range");
}
QList<quint32> stbLutQ = stbLut.toList();
this->_dsp->stbCoefficient(stbLutQ);
}
@ -586,29 +671,31 @@ void TrxBoard::setAtgcMode(eAtgcMode mode, quint16 value) const
void TrxBoard::setDtgcLut(QVector<float>& dtgcLut)
{
if (dtgcLut.size() != DTGC_LUT_MAX)
if(dtgcLut.size() != DTGC_LUT_MAX)
{
throw SonoException("Dtgc lut is out of range");
}
_unsignedQntzrVec = Calculation::qntzr(dtgcLut, 0, 12, 8, 0, true, false);
QList<quint32> dtgcLutQ = _unsignedQntzrVec.toList();
this->_dsp->dtgcLut(dtgcLutQ);
}
void TrxBoard::setFramesMetaData(const QByteArray &metaData) const
void TrxBoard::setFramesMetaData(const QByteArray& metaData) const
{
QList<quint64> data;
QByteArray temp;
qint32 num(0);
while (num < metaData.size())
while(num < metaData.size())
{
for (quint8 j=0; j < sizeof (quint64); j++)
for(quint8 j = 0; j < sizeof(quint64); j++)
{
temp.append(metaData[j+num]);
temp.append(metaData[j + num]);
}
data.push_back(byteArray2UintLittleEndian <quint64>(temp));
data.push_back(byteArray2UintLittleEndian<quint64>(temp));
temp.clear();
num += sizeof (quint64);
num += sizeof(quint64);
}
this->_sram->setSramMetaData(data);
}
@ -620,18 +707,18 @@ void TrxBoard::setScenarioCompare(const QString scenPath)
QString saveFile = scenPath + createSramBinary;
QFile sramFile(saveFile);
if (!sramFile.open(QIODevice::WriteOnly))
if(!sramFile.open(QIODevice::WriteOnly))
{
throw SonoException("Couldn't create the sram binary file due to the wrong path probably.");
}
quint32 num(0);
quint64 value(0);
while (num < SRAM_SIZE/4)
while(num < SRAM_SIZE / 4)
{
value = _device.device.readLong(BAR_SRAM, static_cast<quint32>(num));
sramFile.write(uintLittleEndian2ByteArray<quint64>(value));
num += sizeof (quint64);
value = _device.device.readLong(BAR_SRAM, static_cast<quint32>(num));
sramFile.write(uintLittleEndian2ByteArray<quint64>(value));
num += sizeof(quint64);
}
sramFile.flush();
@ -648,20 +735,22 @@ void TrxBoard::setScenarioCompare(const QString scenPath)
if(!csvReadFile.open(QFile::ReadOnly))
{
throw SonoException("Could not open the register's scenario params due to the wrong path probably.");
throw SonoException(
"Could not open the register's scenario params due to the wrong path probably.");
}
QString registerCompareScenario = "/hardware/registerCompare.csv";
QString regCompareParamsPath = scenPath + registerCompareScenario;
QFile csvWriteFile(regCompareParamsPath);
if (!csvWriteFile.open(QFile::WriteOnly))
if(!csvWriteFile.open(QFile::WriteOnly))
{
throw SonoException("Couldn't create the register compare file due to the wrong path probably.");
throw SonoException(
"Couldn't create the register compare file due to the wrong path probably.");
}
quint32 bar = 0;
qint64 readSize = 0;
qint64 readSize = 0;
QString line;
auto size = csvReadFile.size();
@ -674,16 +763,15 @@ void TrxBoard::setScenarioCompare(const QString scenPath)
auto boardValue = _device.device.readWord(bar, address);
auto res = "NOK";
if (boardValue == baseValue)
if(boardValue == baseValue)
{
res = "OK";
}
auto str = QStringLiteral("%1,%2,%3,%4")
.arg(address, 8, 16, QLatin1Char('0'))
.arg(baseValue, 8, 16, QLatin1Char('0'))
.arg(boardValue, 8, 16, QLatin1Char('0')).arg(res);
.arg(address, 8, 16, QLatin1Char('0'))
.arg(baseValue, 8, 16, QLatin1Char('0'))
.arg(boardValue, 8, 16, QLatin1Char('0')).arg(res);
csvWriteFile.write(str.toStdString().c_str(), str.length());
csvWriteFile.write("\r\n", 2);
@ -706,7 +794,8 @@ void TrxBoard::setScenarioCompare(const QString scenPath)
if(!sramReadFile.open(QFile::ReadOnly))
{
throw SonoException("Could not open the sram's scenario params due to the wrong path probably.");
throw SonoException(
"Could not open the sram's scenario params due to the wrong path probably.");
}
qint64 sramScenarioLength = sramReadFile.size();
@ -719,29 +808,28 @@ void TrxBoard::setScenarioCompare(const QString scenPath)
quint64 fileValue(0);
QByteArray temp;
while (num < sramScenarioLength)
while(num < sramScenarioLength)
{
boardValue = _device.device.readLong(BAR_SRAM, static_cast<quint32>(num));
for (quint8 j=0; j < sizeof (quint64); j++)
for(quint8 j = 0; j < sizeof(quint64); j++)
{
temp.append(fileByte[j+num]);
temp.append(fileByte[j + num]);
}
fileValue = byteArray2UintLittleEndian <quint64>(temp);
fileValue = byteArray2UintLittleEndian<quint64>(temp);
if (boardValue != fileValue)
if(boardValue != fileValue)
{
throw SonoException("The sram scenario file is different to the sram params of board.");
}
temp.clear();
num += sizeof (quint64);
num += sizeof(quint64);
}
#ifdef DEVELOP_UI
emit sramVerifyMessage("Successful comparision without any difference.");
#endif
}
QList<quint32> TrxBoard::getAfeReg(eSlaveSelect sel, quint32 afeRegAddr)
@ -750,15 +838,18 @@ QList<quint32> TrxBoard::getAfeReg(eSlaveSelect sel, quint32 afeRegAddr)
quint32 offset(0);
afeRegValue.clear();
switch (sel)
switch(sel)
{
case slave0:
this->_afeSlave0->setReadRegEnable(true);
this->_bCtrlMngt->timerShot(1);
while(!(this->_bCtrlMngt->checkTimeout()));
while(!(this->_bCtrlMngt->checkTimeout()))
{
;
}
for (quint8 i=0; i < _afeModuleOffset.size(); i++)
for(quint8 i = 0; i < _afeModuleOffset.size(); i++)
{
offset = (_fpgaOffset.at(slave0) + _afeModuleOffset.at(i) + afeRegAddr) * 4;
afeRegValue.push_back(this->_device.device.readWord(BAR_REG, offset));
@ -770,9 +861,12 @@ QList<quint32> TrxBoard::getAfeReg(eSlaveSelect sel, quint32 afeRegAddr)
this->_afeSlave1->setReadRegEnable(true);
this->_bCtrlMngt->timerShot(1);
while(!(this->_bCtrlMngt->checkTimeout()));
while(!(this->_bCtrlMngt->checkTimeout()))
{
;
}
for (quint8 i=0; i < _afeModuleOffset.size(); i++)
for(quint8 i = 0; i < _afeModuleOffset.size(); i++)
{
offset = (_fpgaOffset.at(slave1) + _afeModuleOffset.at(i) + afeRegAddr) * 4;
afeRegValue.push_back(this->_device.device.readWord(BAR_REG, offset));
@ -784,9 +878,12 @@ QList<quint32> TrxBoard::getAfeReg(eSlaveSelect sel, quint32 afeRegAddr)
this->_afeSlave2->setReadRegEnable(true);
this->_bCtrlMngt->timerShot(1);
while(!(this->_bCtrlMngt->checkTimeout()));
while(!(this->_bCtrlMngt->checkTimeout()))
{
;
}
for (quint8 i=0; i < _afeModuleOffset.size(); i++)
for(quint8 i = 0; i < _afeModuleOffset.size(); i++)
{
offset = (_fpgaOffset.at(slave2) + _afeModuleOffset.at(i) + afeRegAddr) * 4;
afeRegValue.push_back(this->_device.device.readWord(BAR_REG, offset));
@ -800,7 +897,6 @@ QList<quint32> TrxBoard::getAfeReg(eSlaveSelect sel, quint32 afeRegAddr)
void TrxBoard::slaveFpgaProgram(const QString path)
{
scenParamsFilling(clear);
if(MOUNTED_SLAVE_FPGA <= 0 || MOUNTED_SLAVE_FPGA >= 8)
@ -827,7 +923,7 @@ void TrxBoard::slaveFpgaProgram(const QString path)
this->_fpgaProgram->program(bitFileData, MOUNTED_SLAVE_FPGA);
afeAdcsSync();
}
void TrxBoard::setBeamFormerMode(eClkMode mode) const
@ -837,7 +933,6 @@ void TrxBoard::setBeamFormerMode(eClkMode mode) const
void TrxBoard::scenPlayerStart(void)
{
if(_allow)
{
_run = false;
@ -905,8 +1000,10 @@ void TrxBoard::emulatorInit(EmulatorProperties* config) const
void TrxBoard::fillRam(QString path)
{
if (this->_scenPlayer->control.getCommand())
if(this->_scenPlayer->control.getCommand())
{
scenPlayerStop();
}
emulatorStop();
QFile emulFile(path);
@ -929,16 +1026,18 @@ void TrxBoard::fillRam(QString path)
sramData = emulFile.readAll();
emulFile.close();
while (num < sramData.size())
while(num < sramData.size())
{
for (quint8 j=0; j < sizeof (quint64); j++)
for(quint8 j = 0; j < sizeof(quint64); j++)
{
temp.append(sramData[j+num]);
temp.append(sramData[j + num]);
}
this->_device.device.writeLong(BAR_SRAM, static_cast<quint32>(num), byteArray2UintLittleEndian <quint64>(temp));
this->_device.device.writeLong(BAR_SRAM,
static_cast<quint32>(num),
byteArray2UintLittleEndian<quint64>(temp));
temp.clear();
num += sizeof (quint64);
num += sizeof(quint64);
}
}
@ -980,7 +1079,7 @@ quint32 TrxBoard::vendorId() const
return vid;
}
void TrxBoard::trxState(EepromStatus &romStatus) const
void TrxBoard::trxState(EepromStatus& romStatus) const
{
QByteArray id;
QByteArray crcChk;
@ -988,16 +1087,20 @@ void TrxBoard::trxState(EepromStatus &romStatus) const
romStatus.ConnectionMode = connected;
id = this->_bCtrlMngt->trxEepromRead(EEPROM_ID_BEGIN, EEPROM_ID_NUMBER);
romStatus.id = byteArray2UintBigEndian<quint16> (id);
romStatus.id = byteArray2UintBigEndian<quint16>(id);
crcChk = this->_bCtrlMngt->trxEepromRead(EEPROM_CRC_BEGIN, EEPROM_CRC_NUMBER);
if (crcChk == _eepromCrc)
if(crcChk == _eepromCrc)
{
romStatus.errorCode = EEPROM_NO_ERROR;
}
else
{
romStatus.errorCode = EEPROM_CRC_ERROR;
}
}
void TrxBoard::mpsState(EepromStatus &romStatus) const
void TrxBoard::mpsState(EepromStatus& romStatus) const
{
QByteArray id;
QByteArray crcChk;
@ -1005,16 +1108,20 @@ void TrxBoard::mpsState(EepromStatus &romStatus) const
romStatus.ConnectionMode = connected;
id = this->_bCtrlMngt->mpsEepromRead(EEPROM_ID_BEGIN, EEPROM_ID_NUMBER);
romStatus.id = byteArray2UintBigEndian<quint16> (id);
romStatus.id = byteArray2UintBigEndian<quint16>(id);
crcChk = this->_bCtrlMngt->mpsEepromRead(EEPROM_CRC_BEGIN, EEPROM_CRC_NUMBER);
if (crcChk == _eepromCrc)
if(crcChk == _eepromCrc)
{
romStatus.errorCode = EEPROM_NO_ERROR;
}
else
{
romStatus.errorCode = EEPROM_CRC_ERROR;
}
}
void TrxBoard::prbCtrlState(EepromStatus &romStatus) const
void TrxBoard::prbCtrlState(EepromStatus& romStatus) const
{
QByteArray id;
QByteArray crcChk;
@ -1022,44 +1129,60 @@ void TrxBoard::prbCtrlState(EepromStatus &romStatus) const
romStatus.ConnectionMode = connected;
id = this->_bCtrlMngt->prbCtrlEepromRead(EEPROM_ID_BEGIN, EEPROM_ID_NUMBER);
romStatus.id = byteArray2UintBigEndian<quint16> (id);
romStatus.id = byteArray2UintBigEndian<quint16>(id);
crcChk = this->_bCtrlMngt->prbCtrlEepromRead(EEPROM_CRC_BEGIN, EEPROM_CRC_NUMBER);
if (crcChk == _eepromCrc)
if(crcChk == _eepromCrc)
{
romStatus.errorCode = EEPROM_NO_ERROR;
}
else
{
romStatus.errorCode = EEPROM_CRC_ERROR;
}
}
void TrxBoard::selectedPrbState(EepromStatus &romStatus, eSelectProbe prbSel) const
void TrxBoard::selectedPrbState(EepromStatus& romStatus, eSelectProbe prbSel) const
{
QVector<bool> vec;
QByteArray id;
QByteArray crcChk;
vec = this->_bCtrlMngt->getConnectedPrb();
if (prbSel == prbA && !vec.at(0))
if(prbSel == prbA && !vec.at(0))
{
throw SonoException("This probe is disconnected");
}
if (prbSel == prbB && !vec.at(1))
if(prbSel == prbB && !vec.at(1))
{
throw SonoException("This probe is disconnected");
}
if (prbSel == prbC && !vec.at(2))
if(prbSel == prbC && !vec.at(2))
{
throw SonoException("This probe is disconnected");
}
if (prbSel == prbD && !vec.at(3))
if(prbSel == prbD && !vec.at(3))
{
throw SonoException("This probe is disconnected");
}
romStatus.ConnectionMode = connected;
id = this->_bCtrlMngt->prbEepromRead(EEPROM_ID_BEGIN, EEPROM_ID_NUMBER, prbSel-1);
romStatus.id = byteArray2UintBigEndian<quint16> (id);
id = this->_bCtrlMngt->prbEepromRead(EEPROM_ID_BEGIN, EEPROM_ID_NUMBER, prbSel - 1);
romStatus.id = byteArray2UintBigEndian<quint16>(id);
crcChk = this->_bCtrlMngt->prbEepromRead(EEPROM_CRC_BEGIN, EEPROM_CRC_NUMBER, prbSel-1);
if (crcChk == _eepromCrc)
crcChk = this->_bCtrlMngt->prbEepromRead(EEPROM_CRC_BEGIN, EEPROM_CRC_NUMBER, prbSel - 1);
if(crcChk == _eepromCrc)
{
romStatus.errorCode = EEPROM_NO_ERROR;
}
else
{
romStatus.errorCode = EEPROM_CRC_ERROR;
}
}
void TrxBoard::prbState(PrbCase* prb) const
@ -1080,13 +1203,18 @@ void TrxBoard::prbState(PrbCase* prb) const
prb->prbA.ConnectionMode = connected;
id = this->_bCtrlMngt->prbEepromRead(EEPROM_ID_BEGIN, EEPROM_ID_NUMBER, i);
prb->prbA.id = byteArray2UintBigEndian<quint16> (id);
prb->prbA.id = byteArray2UintBigEndian<quint16>(id);
crcChk = this->_bCtrlMngt->prbEepromRead(EEPROM_CRC_BEGIN, EEPROM_CRC_NUMBER, i);
if (crcChk == _eepromCrc)
crcChk =
this->_bCtrlMngt->prbEepromRead(EEPROM_CRC_BEGIN, EEPROM_CRC_NUMBER, i);
if(crcChk == _eepromCrc)
{
prb->prbA.errorCode = EEPROM_NO_ERROR;
}
else
{
prb->prbA.errorCode = EEPROM_CRC_ERROR;
}
}
else
{
@ -1102,13 +1230,18 @@ void TrxBoard::prbState(PrbCase* prb) const
prb->prbB.ConnectionMode = connected;
id = this->_bCtrlMngt->prbEepromRead(EEPROM_ID_BEGIN, EEPROM_ID_NUMBER, i);
prb->prbB.id = byteArray2UintBigEndian<quint16> (id);
prb->prbB.id = byteArray2UintBigEndian<quint16>(id);
crcChk = this->_bCtrlMngt->prbEepromRead(EEPROM_CRC_BEGIN, EEPROM_CRC_NUMBER, i);
if (crcChk == _eepromCrc)
crcChk =
this->_bCtrlMngt->prbEepromRead(EEPROM_CRC_BEGIN, EEPROM_CRC_NUMBER, i);
if(crcChk == _eepromCrc)
{
prb->prbB.errorCode = EEPROM_NO_ERROR;
}
else
{
prb->prbB.errorCode = EEPROM_CRC_ERROR;
}
}
else
{
@ -1124,13 +1257,18 @@ void TrxBoard::prbState(PrbCase* prb) const
prb->prbC.ConnectionMode = connected;
id = this->_bCtrlMngt->prbEepromRead(EEPROM_ID_BEGIN, EEPROM_ID_NUMBER, i);
prb->prbC.id = byteArray2UintBigEndian<quint16> (id);
prb->prbC.id = byteArray2UintBigEndian<quint16>(id);
crcChk = this->_bCtrlMngt->prbEepromRead(EEPROM_CRC_BEGIN, EEPROM_CRC_NUMBER, i);
if (crcChk == _eepromCrc)
crcChk =
this->_bCtrlMngt->prbEepromRead(EEPROM_CRC_BEGIN, EEPROM_CRC_NUMBER, i);
if(crcChk == _eepromCrc)
{
prb->prbC.errorCode = EEPROM_NO_ERROR;
}
else
{
prb->prbC.errorCode = EEPROM_CRC_ERROR;
}
}
else
{
@ -1146,13 +1284,18 @@ void TrxBoard::prbState(PrbCase* prb) const
prb->prbD.ConnectionMode = connected;
id = this->_bCtrlMngt->prbEepromRead(EEPROM_ID_BEGIN, EEPROM_ID_NUMBER, i);
prb->prbD.id = byteArray2UintBigEndian<quint16> (id);
prb->prbD.id = byteArray2UintBigEndian<quint16>(id);
crcChk = this->_bCtrlMngt->prbEepromRead(EEPROM_CRC_BEGIN, EEPROM_CRC_NUMBER, i);
if (crcChk == _eepromCrc)
crcChk =
this->_bCtrlMngt->prbEepromRead(EEPROM_CRC_BEGIN, EEPROM_CRC_NUMBER, i);
if(crcChk == _eepromCrc)
{
prb->prbD.errorCode = EEPROM_NO_ERROR;
}
else
{
prb->prbD.errorCode = EEPROM_CRC_ERROR;
}
}
else
{
@ -1173,8 +1316,9 @@ QString TrxBoard::trxInfo() const
getFpgasCodeVersion(&version);
QString info = QString(this->_bCtrlMngt->trxEepromRead(EEPROM_INFO_BEGIN, EEPROM_INFO_NUMBER));
return (info + "(FPM-V " + QString::number(version.masterCode, 10)
+ ", FPS-V " + QString::number(version.slave0Code, 10) + ")");
return (info + "(FPM-V " + QString::number(version.masterCode, 10) +
", FPS-V " + QString::number(version.slave0Code, 10) + ")");
}
QString TrxBoard::mpsInfo() const
@ -1189,7 +1333,9 @@ QString TrxBoard::prbCtrlInfo() const
QByteArray TrxBoard::selectedPrbImpulseResponse(quint8 prbSel) const
{
return this->_bCtrlMngt->prbEepromRead(EEPROM_IMPULSE_RESPONSE_BEGIN, EEPROM_IMPULSE_RESPONSE_NUMBER, prbSel);
return this->_bCtrlMngt->prbEepromRead(EEPROM_IMPULSE_RESPONSE_BEGIN,
EEPROM_IMPULSE_RESPONSE_NUMBER,
prbSel);
}
void TrxBoard::prbImpulseResponse(ConnectedPrbInfo* prbInfo) const
@ -1268,7 +1414,10 @@ void TrxBoard::mpsSetAo(float voltA, float voltB) const
void TrxBoard::selectProbe(eSelectProbe prbSel)
{
scenPlayerStop();
if(this->_scenPlayer->control.getCommand())
{
scenPlayerStop();
}
this->_bCtrlMngt->setProbeSelect(prbSel);
}
@ -1348,3 +1497,8 @@ void TrxBoard::sramParityClear()
val = this->_device.device.readLong(BAR_SRAM, 0);
this->_device.device.writeLong(BAR_SRAM, 0, val);
}
quint32 TrxBoard::getFrameLostCounter() const
{
return (this->_misc->getFrameLostCount());
}

36
src/model/hardware/core/register/afe/Afe.cpp

@ -51,15 +51,17 @@ void Afe::setPga(const AfeConfig afe) const
Afe::Afe(SonoDevice *device, quint32 offset)
{
_actTerm = new ActiveTerm(device, offset);
_lnaHpf = new LnaHpf (device, offset);
_global = new Global (device, offset);
_lowNf = new LowNf (device, offset);
_pga = new Pga (device, offset);
_adcSync = new AdcSyncStatus (device, offset);
_actTerm = new ActiveTerm (device, offset);
_lnaHpf = new LnaHpf (device, offset);
_global = new Global (device, offset);
_lowNf = new LowNf (device, offset);
_pga = new Pga (device, offset);
}
Afe::~Afe()
{
delete _adcSync;
delete _actTerm;
delete _lnaHpf;
delete _global;
@ -88,3 +90,27 @@ void Afe::setReadRegEnable(const bool rdEn) const
this->_global->regReadEn->setValue(value);
this->_global->update();
}
bool Afe::getAfeSyncDone() const
{
this->_adcSync->sync();
return (this->_adcSync->syncDone->getValue() != 0);
}
quint32 Afe::getAfeSyncError() const
{
this->_adcSync->sync();
return (this->_adcSync->syncError->getValue());
}
quint32 Afe::getAfeSyncAddress() const
{
this->_adcSync->sync();
return (this->_adcSync->syncAddress->getValue());
}
quint32 Afe::getAfeDataValid() const
{
this->_adcSync->sync();
return (this->_adcSync->dataValidOffset->getValue());
}

599
src/model/hardware/core/register/boardsCtrlMngt/BoardsCtrlMngt.cpp

File diff suppressed because it is too large

80
src/model/hardware/core/register/fpgaProgram/FpgaProgram.cpp

@ -3,23 +3,23 @@
void FpgaProgram::setSlaveFpgaNumber(quint8& number) const
{
_fpgaNumber->number->setValue(number);
_fpgaNumber->update();
_fpgaNumber->update();
}
FpgaProgram::FpgaProgram(SonoDevice* device)
{
_status = new ProgramStatus();
_status = new ProgramStatus();
_progData = new SerialProgramData(device);
_status->_progStatus = new SerialProgramStatus(device);
_fpgaNumber = new SlaveFpgaNumber(device);
_status->_progStatus = new SerialProgramStatus(device);
_fpgaNumber = new SlaveFpgaNumber(device);
}
FpgaProgram::~FpgaProgram()
{
delete _progData;
delete _status->_progStatus;
delete _fpgaNumber;
delete _status;
delete _status->_progStatus;
delete _fpgaNumber;
delete _status;
}
void FpgaProgram::program(QByteArray& bitFileData, quint8 number)
@ -27,63 +27,45 @@ void FpgaProgram::program(QByteArray& bitFileData, quint8 number)
qint32 progByte(0);
quint32 progData(0);
QByteArray temp;
qint32 bitFileSize = bitFileData.size();
setSlaveFpgaNumber(number);
#ifdef DEVELOP_UI
QProgressDialog progress;
progress.setMinimumSize(300,100);
progress.setLabelText("Please wait...");
progress.setWindowTitle("Slaves FPGA Programming");
progress.setRange(0,bitFileData.size());
progress.setModal(true);
#endif
while(progByte < bitFileData.size())
while(progByte < bitFileSize)
{
for(quint8 i(0); i < sizeof(quint32); i++)
{
//temp.append(bitFileData.at(i+progByte)); assert size
temp.append(bitFileData[i + progByte]);
}
progData = byteArray2UintBigEndian<quint32>(temp);
progData = byteArray2UintBigEndian<quint32>(temp);
_progData->slaveConfigData->setValue(progData);
_progData->update();
while(_status->getProgramBusy());
if(_status->getInitFail())
if(_status->getInitFail())
{
//QString fail="";
//if (_status->getFpgaS0InitB())
//fail += "Slave0 FPGA ";
//if (_status->getFpgaS1InitB())
//fail += "Slave1 FPGA ";
//if (_status->getFpgaS2InitB())
//fail += "Slave2 FPGA ";
throw SonoException("init fail happened");
}
if(_status->getProgramTimeout())
if(_status->getProgramTimeout())
{
throw SonoException(
"Timeout is happened and the programming of the slave FPGAs is failed");
"Timeout is happened and the programming of the slave FPGAs is failed");
}
temp.clear();
progByte += sizeof(quint32);
#ifdef DEVELOP_UI
progress.setValue(progByte);
if (progress.wasCanceled())
throw SonoException("Slaves fpga programming is canceled");
emit programmingProgress(progByte, bitFileSize);
#endif
temp.clear();
progByte += sizeof(quint32);
}
while(!(_status->getProgramFail() || _status->getProgramDone()));
if(_status->getProgramFail())
if(_status->getProgramFail())
{
throw SonoException("programming was not successful");
}
@ -155,27 +137,3 @@ bool FpgaProgram::ProgramStatus::getFpgaS2InitB() const
return (fpgaInitStatus != 0);
}
//bool FpgaProgram::ProgramStatus::getFpgaS0Done()
//{
//_progStatus->sync();
//auto fpgaDoneStatus=_progStatus->slaveFpgaDone->getValue();
//fpgaDoneStatus&=FPGA_S0_DONE;
//return (fpgaDoneStatus!=0);
//}
//bool FpgaProgram::ProgramStatus::getFpgaS1Done()
//{
//_progStatus->sync();
//auto fpgaDoneStatus=_progStatus->slaveFpgaDone->getValue();
//fpgaDoneStatus&=FPGA_S1_DONE;
//return (fpgaDoneStatus!=0);
//}
//bool FpgaProgram::ProgramStatus::getFpgaS2Done()
//{
//_progStatus->sync();
//auto fpgaDoneStatus=_progStatus->slaveFpgaDone->getValue();
//fpgaDoneStatus&=FPGA_S2_DONE;
//return (fpgaDoneStatus!=0);
//}

38
src/model/hardware/core/register/misc/Misc.cpp

@ -2,13 +2,14 @@
Misc::Misc(SonoDevice *device) : _offsetMaster(0), _offsetSlave0(0x50002C), _offsetSlave1(0x90002C), _offsetSlave2(0xD0002C)
{
_s0Version = new FpgaVersion (device, _offsetSlave0);
_s1Version = new FpgaVersion (device, _offsetSlave1);
_s2Version = new FpgaVersion (device, _offsetSlave2);
_mVersion = new FpgaVersion (device, _offsetMaster);
_status = new StatusVector (device);
_gt = new GtSendMode (device);
_sync = new SyncMode (device);
_s0Version = new FpgaVersion (device, _offsetSlave0);
_s1Version = new FpgaVersion (device, _offsetSlave1);
_s2Version = new FpgaVersion (device, _offsetSlave2);
_mVersion = new FpgaVersion (device, _offsetMaster);
_lostCount = new FrameLostCount (device);
_status = new StatusVector (device);
_sync = new SyncMode (device);
_gt = new GtSendMode (device);
}
Misc::~Misc()
@ -16,6 +17,7 @@ Misc::~Misc()
delete _s0Version;
delete _s1Version;
delete _s2Version;
delete _lostCount;
delete _mVersion;
delete _status;
delete _sync;
@ -34,19 +36,20 @@ void Misc::getStatusVector(StatusVec *status) const
this->_status->sync();
status->pgErr = ((this->_status->pgErr->getValue()) != 0);
status->fanFault = ((this->_status->fanFault->getValue()) != 0);
status->mpsErr = ((this->_status->mpsErr->getValue()) != 0);
status->fanFault = ((this->_status->fanFault->getValue()) != 0);
status->frameLost = ((this->_status->frameLost->getValue()) != 0);
status->pulserThd = ((this->_status->pulserThd->getValue()) != 0);
status->scenGtErr = ((this->_status->scenGtErr->getValue()) != 0);
status->syncFifoErr = ((this->_status->syncFifoErr->getValue()) != 0);
status->scenPriErr = ((this->_status->scenPriErr->getValue()) != 0);
status->syncPointErr = ((this->_status->syncPointErr->getValue()) != 0);
status->thermalErr = ((this->_status->thermalErr->getValue()) != 0);
status->syncFifoErr = ((this->_status->syncFifoErr->getValue()) != 0);
status->scenSramErr = ((this->_status->scenSramErr->getValue()) != 0);
status->syncPointErr = ((this->_status->syncPointErr->getValue()) != 0);
status->dintrlvFifoErr = ((this->_status->dintrlvFifoErr->getValue()) != 0);
status->dintrlvPointErr = ((this->_status->dintrlvPointErr->getValue()) != 0);
status->sram1ParityErr = ((this->_status->sram1ParityErr->getValue()) != 0);
status->sram2ParityErr = ((this->_status->sram2ParityErr->getValue()) != 0);
status->dintrlvPointErr = ((this->_status->dintrlvPointErr->getValue()) != 0);
status->dmaCtrlTransferErr = ((this->_status->dmaCtrlTransferErr->getValue()) != 0);
status->emulDmaTransferErr = ((this->_status->emulDmaTransferErr->getValue()) != 0);
status->probeDisconnectErr = ((this->_status->probeDisconnectErr->getValue()) != 0);
@ -65,6 +68,19 @@ void Misc::setSyncMode(eSyncCtrl syncMode) const
this->_sync->update();
}
void Misc::setManualSync(bool sync) const
{
quint32 val = sync ? 1 : 0;
this->_sync->manualSync->setValue(val);
this->_sync->update();
}
quint32 Misc::getFrameLostCount() const
{
this->_lostCount->sync();
return (this->_lostCount->lostCount->getValue());
}
void Misc::getFpgaVersion(FpgaCodeVersion *version) const
{
version->masterCode = this->getVersion<FpgaVersion>(_mVersion);

Loading…
Cancel
Save