Browse Source

The afe global power down is delayed 20ms to fix corrupted first frame of scenario.

The eeproms reading timeout are increased to 5ms to fix the receiving of done flag.
The scenPlayerStart/Stop functions are modified by adding flag as boolean arguman.
master v2.1
Arash Aletayeb 3 years ago
parent
commit
77a7ac6c90
  1. 2
      developHw.pro.user
  2. 12
      include/model/hardware/core/TrxBoard.h
  3. 5
      include/model/hardware/core/TrxBoardUtils/PreProcessorDef.h
  4. 127
      mainwindow.cpp
  5. 19
      mainwindow.h
  6. 206
      mainwindow.ui
  7. 111
      src/model/hardware/core/TrxBoard.cpp
  8. 12
      src/model/hardware/core/register/boardsCtrlMngt/BoardsCtrlMngt.cpp

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-26T16:14:08. -->
<!-- Written by QtCreator 4.10.0, 2021-07-05T13:05:02. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>

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

@ -130,6 +130,7 @@ private:
* scenParams;
void fpgaProgram(const QString path) const;
void setScenario(ScenGenHardwareParam* scenParams);
void sramClear (eSramClear clearMode);
@ -140,7 +141,7 @@ private:
void scenParamsFilling(eScenParams cmd);
//QList<quint32> signedVector2unsignedList(QVector<qint32>& sgnVec);
void afeAdcsSync (void) const;
void afeAdcsSync(void) const;
template<class T>
QByteArray uintLittleEndian2ByteArray(T& data) const;
@ -150,8 +151,8 @@ private:
signals:
void sendFramePacket(QByteArray newPacket);
void sramBinaryCreateFlag (void);
void registerCsvCompareFlag (void);
void sramBinaryCreateFlag(void);
void registerCsvCompareFlag(void);
void sramVerifyMessage(QString message);
public:
@ -174,8 +175,8 @@ public:
void setStbCoefficient(QVector<quint32>& stbLut);
void setDtgcLut(QVector<float>& dtgcLut);
void scenPlayerStart(void);
void scenPlayerStop(void);
void scenPlayerStart(bool afeHvPwrOn = false);
void scenPlayerStop(bool afeHvPwrOff = false);
//void scenPlayerPause (bool pause) const;
void setFramesMetaData(const QByteArray &metaData) const;
@ -235,7 +236,6 @@ public:
/////////////////////////////// DMA Data Packet ////////////////////////////////////
void readData();
};
#endif //TRXBOARD_H

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

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

127
mainwindow.cpp

@ -38,20 +38,7 @@ MainWindow::MainWindow(QWidget* parent)
ui->plot_2->xAxis->setLabel("Line");
ui->plot_2->yAxis->setLabel("Point");
//ui->prg_adcSim->setVisible(false);
//ui->prg_scenarioUpload->setVisible(false);
//ui->prg_txDacUpload->setVisible(false);
//ui->prg_fpgaProgram->setVisible(false);
//ui->prg_adcLoggerFileWr->setVisible(false);
//ui->tb_scenarioFile->setReadOnly(true);
//ui->tb_paramFile->setReadOnly(true);
//ui->tb_txDacFile->setReadOnly(true);
ui->tb_fpgaBit->setReadOnly(true);
//ui->tb_scenarioFile->setText(_settings->value(SCENARIO_FILE_PATH).value<QString>());
//ui->tb_paramFile->setText(_settings->value(PARAM_FILE_PATH).value<QString>());
//ui->tb_txDacFile->setText(_settings->value(TX_DAC_FILE_PATH).value<QString>());
ui->rbtn_reg->setChecked(_settings->value(REG_ACCESS_SEL).value<bool>());
ui->rbtn_offset->setChecked(!_settings->value(REG_ACCESS_SEL).value<bool>());
ui->tb_fpgaBit->setText(_settings->value(FPGA_FILE_PATH).value<QString>());
@ -65,19 +52,7 @@ MainWindow::MainWindow(QWidget* parent)
ui->tb_prbCtrlRomInfo->setPlaceholderText("info");
ui->tb_prbRomIdRead->setPlaceholderText("id(hex)");
ui->tb_prbRomImpulseRead->setPlaceholderText("impulse");
//connect(this, &MainWindow::updateBlockProgressValue, this,
//&MainWindow::newBlockProgressValue);
//connect(this, &MainWindow::updateFpgaProgressValue, this, &MainWindow::newFpgaProgressValue);
//connect(this, &MainWindow::updateBlockProgressVisibility, this,
//&MainWindow::newBlockProgressVisibility);
//connect(this, &MainWindow::updateFpgaProgressVisibility, this,
//&MainWindow::newFpgaProgressVisibility);
//connect(this, &MainWindow::updateAdcLoggerProgressValue, this,
//&MainWindow::newAdcLoggerProgressValue);
//connect(this, &MainWindow::updateAdcLoggerProgressVisibility, this,
//&MainWindow::newAdcLoggerProgressVisibility);
ui->tb_scenInfo->setPlaceholderText("Scenario Information");
connect(ui->action_Exit, &QAction::triggered, this, &MainWindow::exitApp);
connect(this, &MainWindow::showMessage, this, &MainWindow::newMessage);
@ -117,7 +92,10 @@ MainWindow::MainWindow(QWidget* parent)
_dmaLog = false;
_dmaRun = false;
_fpsFlag = false;
_dmaShow = false;
_getPacket = false;
_frameCount = 0;
setAfeConfig();
@ -354,6 +332,16 @@ MainWindow::~MainWindow()
/*************************************************************************************************/
void MainWindow::timeout()
{
fps =static_cast<double_t>(float_t(_frameCount)/(float_t(_timeout->interval())/1000.0f));
if (ui->chk_continuousShowing->isChecked() || _fpsFlag)
{
ui->l_frameTime->setText(QString::number(fpsBuf,'g',3) + " fps");
}
else
ui->l_frameTime->setText(QString::number(fps,'g',3) + " fps");
_frameCount=0;
_fpsFlag = false;
auto pcie_pid = _trx.deviceId();
auto pcie_vid = _trx.vendorId();
auto pcie_id = (pcie_pid << 16) | pcie_vid;
@ -551,6 +539,7 @@ void MainWindow::timeout()
color = probeDetChanInterrupt ? Qt::red : Qt::green;
changeLabelTextColor(ui->l_prbDetChg, color);
if(probeDetChanInterrupt)
{
emit connectedPrbChange();
@ -936,7 +925,7 @@ void MainWindow::on_btn_fpgaProgram_clicked()
{
auto path = ui->tb_fpgaBit->text();
//emit programmingGif();
//QtConcurrent::run(this, &MainWindow::gifActive);
QString str = "doing";
QColor color = Qt::red;
@ -951,6 +940,10 @@ void MainWindow::on_btn_fpgaProgram_clicked()
//ui->l_programming->hide();
}
void MainWindow::gifActive()
{
//emit programmingGif();
}
/*************************************************************************************************/
void MainWindow::newMessage(QString message)
{
@ -1192,11 +1185,51 @@ void MainWindow::getFramePacket(QByteArray packet)
_dmaBuffer.push_back(packet);
_lastBuffer = packet;
_mutex.unlock();
quint16 batchId = ((static_cast<quint16>(_lastBuffer[128])) & 0x00FF) |
(((static_cast<quint16>(_lastBuffer[129])) << 8) & 0xFF00);
quint8 subBatchId = (static_cast<quint8>(_lastBuffer[130]));
// quint8 frmType = (static_cast<quint8>(_lastBuffer[131]));
// quint8 cri = (static_cast<quint8>(_lastBuffer[132]));
// quint16 bLine = ((static_cast<quint16>(_lastBuffer[136])) & 0x00FF) |
// (((static_cast<quint16>(_lastBuffer[137])) << 8) & 0xFF00);
// quint16 bPoint = ((static_cast<quint16>(_lastBuffer[138])) & 0x00FF) |
// (((static_cast<quint16>(_lastBuffer[139])) << 8) & 0xFF00);
// quint8 mLine = (static_cast<quint8>(_lastBuffer[140]));
// quint16 mPoint = ((static_cast<quint16>(_lastBuffer[141])) & 0x00FF) |
// (((static_cast<quint16>(_lastBuffer[142])) << 8) & 0xFF00);
if (subBatchId == 0)
{
_frameCount++;
if (_getPacket)
{
if (_batchIdBuff == batchId && (batchId - _batchIdBuff) > 1)
MESSAGE_BOX("The batch id error is happened.");
}
_batchIdBuff = batchId;
_getPacket = true;
}
// if(batchId < 3)
// {
// qDebug() << "batchId" << batchId;
// qDebug() << "subBatchId" << subBatchId;
// qDebug() << "bLine" << bLine;
// qDebug() << "bPoint" << bPoint;
// qDebug() << "frmType" << frmType;
// qDebug() << "cri" << cri;
// qDebug() << "mLine" << mLine;
// qDebug() << "mPoint" << mPoint;
// }
}
/*************************************************************************************************/
void MainWindow::on_chk_continuousShowing_clicked()
{
fpsBuf = fps;
_fpsFlag = true;
if(_dmaRun && ui->chk_continuousShowing->isChecked())
{
QtConcurrent::run(this, &MainWindow::on_btn_dmaShow_clicked);
@ -1221,6 +1254,7 @@ void MainWindow::fillRam(QString path)
/*************************************************************************************************/
void MainWindow::on_btn_scenStart_clicked()
{
_frameCount=0;
try
{
auto str = ui->btn_scenStart->text();
@ -1229,7 +1263,7 @@ void MainWindow::on_btn_scenStart_clicked()
ui->btn_scenStart->setText("Scenario Stop");
ui->btn_emulator->setText("Emulator Start");
ui->btn_dmaLogLast->setVisible(true);
_trx.scenPlayerStart();
_trx.scenPlayerStart(true);
_dmaLog = true;
_dmaRun = true; //flag
_dmaBuffer.clear();
@ -1243,7 +1277,7 @@ void MainWindow::on_btn_scenStart_clicked()
ui->btn_dmaLogLast->setHidden(true);
_dmaLog = false;
_dmaRun = false;
_trx.scenPlayerStop();
_trx.scenPlayerStop(true);
}
}
catch(SonoException& e)
@ -1284,7 +1318,7 @@ void MainWindow::on_btn_emulator_clicked()
_emul->transferLength = TRANSFER_LENGTH;
_emul->ramBufAddress = RAM_BUFFER_OFFSET;
_emul->transferRate = TRANSFER_RATE;
_emul->emulOption = functionality;
_emul->emulOption = performance;
_emul->emulMode = dynamically;
_trx.emulatorInit(_emul);
ui->btn_emulator->setText("Emulator Stop");
@ -1294,7 +1328,6 @@ void MainWindow::on_btn_emulator_clicked()
_dmaLog = true;
_dmaRun = true;
_dmaBuffer.clear();
//QtConcurrent::run(this, &MainWindow::logPcie);
}
else
{
@ -1369,7 +1402,7 @@ void MainWindow::logPcie()
QFile file(path);
file.open(QIODevice::WriteOnly);
//file.write(temp);
file.write(temp);
file.close();
emit sendLogCount(_dmaLogCount, progress);
@ -1455,7 +1488,7 @@ void MainWindow::show3d()
quint8 mLine = (static_cast<quint8>(temp[140]));
quint16 mPoint = ((static_cast<quint16>(temp[141])) & 0x00FF) |
(((static_cast<quint16>(temp[142])) << 8) & 0xFF00);
if(bLine > 256)
if(bLine > 256*8)
{
qDebug() << "ERROR :: (B Line)" << bLine;
@ -1474,6 +1507,7 @@ void MainWindow::show3d()
return;
}
qDebug() << "batchId" << batchId;
qDebug() << "subBatchId" << subBatchId;
qDebug() << "bLine" << bLine;
@ -1513,7 +1547,7 @@ void MainWindow::show3d()
}
//qDebug() << "indx" << indx;
//qDebug() << "max" << max;
qDebug() << ui->plot_2->plotLayout()->hasElement(0, 1);
//qDebug() << ui->plot_2->plotLayout()->hasElement(0, 1);
if(!ui->plot_2->plotLayout()->hasElement(0, 1))
{
@ -2559,9 +2593,31 @@ void MainWindow::on_btn_scenBrowse_clicked()
auto selectedPath = fileDialog.selectedFiles()[0];
ui->tb_scenFilesPath->setText(selectedPath);
_settings->setValue(SCENARIO_FILE_PATH, selectedPath);
ui->tb_scenInfo->clear();
}
}
/*************************************************************************************************/
void MainWindow::on_btn_scenInfo_clicked()
{
QString scenInfo = "/hardware/systemCheckParam.csv";
QString path = ui->tb_scenFilesPath->text() + scenInfo;
QFile sysFile(path);
if(sysFile.fileName().isEmpty())
{
throw SonoException("No file is selected");
}
if(!sysFile.open(QIODevice::ReadOnly))
{
throw SonoException("Couldn't open system check param file programming");
}
QTextStream checkParam(&sysFile);
QString systemStr = checkParam.readAll();
ui->tb_scenInfo->setPlainText(systemStr);
}
/*************************************************************************************************/
void MainWindow::on_btn_setAtgcMode_clicked()
{
@ -3108,5 +3164,8 @@ void MainWindow::setAfeConfig()
/*************************************************************************************************/
void MainWindow::exitApp()
{
auto str = ui->btn_scenStart->text();
if(str == "Scenario Stop")
on_btn_scenStart_clicked();
this->QWidget::close();
}

19
mainwindow.h

@ -20,6 +20,7 @@
#include <QFuture>
#include <QFutureWatcher>
#include <QMovie>
#include <QElapsedTimer>
#include "qcustomplot.h"
#include "include/model/hardware/core/TrxBoard.h"
@ -57,11 +58,11 @@
#define ENABLE "Enable"
#define DISABLE "Disable"
#define TRANSFER_LENGTH 4 * 1024 * 1024
#define TRANSFER_LENGTH 128 * 1024
#define TRANSFER_RATE 30.0f
#define RAM_BUFFER_OFFSET 0U
#define ULTIMATE_LOG_COUNT 100000
#define ULTIMATE_LOG_COUNT 50
QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
@ -117,7 +118,7 @@ private:
PrbCase* _prb;
AfeConfig _afeConfig;
AfeConfig _afeConfig;
void setScenarioCompare(const QString& scenPath);
@ -147,21 +148,29 @@ private:
void getProbeColor (const QBrush brush, const int item);
void gifActive(void);
QString _logFolder = "/home/hasis/Desktop/TrxBoardFile/_log/dma/";
QString _emulFolder = "/home/hasis/Desktop/Develop_HardwareTest/developHw/sram_frame.bin";
QVector<QByteArray> _dmaBuffer;
QByteArray _lastBuffer;
qint32 _dmaLogCount;
quint16 _frameCount;
quint16 _batchIdBuff;
double_t fps;
double_t fpsBuf;
bool _dmaLog;
bool _dmaRun;
bool _dmaShow;
bool _getPacket;
bool _fpsFlag;
// QString _adcloggerFolder = "/home/hasis/Desktop/TrxBoardFile/_log/adc/";
// bool _csvReadStopFlag = false;
// bool _adcLoggerDone = false;
// bool _adcLoggerTrnsDone = false;
// uncrustify off
private slots:
void exitApp();
@ -359,6 +368,8 @@ private slots:
void on_btn_prbRomIdRead_clicked();
void on_btn_scenInfo_clicked();
signals:
// void updateBlockProgressValue(int percentage, QProgressBar* prg);
// void updateFpgaProgressValue(int percentage);

206
mainwindow.ui

@ -23,13 +23,25 @@
<height>331</height>
</rect>
</property>
<property name="font">
<font>
<weight>75</weight>
<italic>true</italic>
<bold>true</bold>
<strikeout>false</strikeout>
<kerning>false</kerning>
</font>
</property>
<property name="cursor">
<cursorShape>ArrowCursor</cursorShape>
</property>
<property name="toolTip">
<string/>
</property>
<property name="currentIndex">
<number>2</number>
<number>4</number>
</property>
<widget class="QWidget" name="tab">
<widget class="QWidget" name="tab_0">
<attribute name="title">
<string>Manual Operation</string>
</attribute>
@ -60,6 +72,15 @@
<height>135</height>
</size>
</property>
<property name="font">
<font>
<weight>50</weight>
<italic>true</italic>
<bold>false</bold>
<strikeout>false</strikeout>
<kerning>false</kerning>
</font>
</property>
<property name="title">
<string>Register Rd/Wr</string>
</property>
@ -107,7 +128,7 @@
<rect>
<x>550</x>
<y>70</y>
<width>175</width>
<width>187</width>
<height>27</height>
</rect>
</property>
@ -320,8 +341,11 @@
<property name="font">
<font>
<weight>50</weight>
<italic>true</italic>
<bold>false</bold>
<underline>false</underline>
<strikeout>false</strikeout>
<kerning>false</kerning>
</font>
</property>
<property name="title">
@ -391,6 +415,12 @@
<height>23</height>
</rect>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Program</string>
</property>
@ -410,7 +440,7 @@
</widget>
</widget>
</widget>
<widget class="QWidget" name="tab_5">
<widget class="QWidget" name="tab_1">
<attribute name="title">
<string>Scen Player</string>
</attribute>
@ -418,11 +448,20 @@
<property name="geometry">
<rect>
<x>440</x>
<y>190</y>
<y>200</y>
<width>351</width>
<height>101</height>
</rect>
</property>
<property name="font">
<font>
<weight>50</weight>
<italic>true</italic>
<bold>false</bold>
<strikeout>false</strikeout>
<kerning>false</kerning>
</font>
</property>
<property name="title">
<string>Manual ATgc</string>
</property>
@ -500,11 +539,20 @@
<property name="geometry">
<rect>
<x>0</x>
<y>190</y>
<y>200</y>
<width>321</width>
<height>101</height>
</rect>
</property>
<property name="font">
<font>
<weight>50</weight>
<italic>true</italic>
<bold>false</bold>
<strikeout>false</strikeout>
<kerning>false</kerning>
</font>
</property>
<property name="title">
<string>Afe Regs Ctrl</string>
</property>
@ -588,7 +636,7 @@
<x>0</x>
<y>10</y>
<width>791</width>
<height>171</height>
<height>181</height>
</rect>
</property>
<property name="sizePolicy">
@ -612,8 +660,11 @@
<property name="font">
<font>
<weight>50</weight>
<italic>true</italic>
<bold>false</bold>
<underline>false</underline>
<strikeout>false</strikeout>
<kerning>false</kerning>
</font>
</property>
<property name="title">
@ -651,15 +702,25 @@
<widget class="QWidget" name="verticalLayoutWidget_2">
<property name="geometry">
<rect>
<x>690</x>
<x>680</x>
<y>70</y>
<width>92</width>
<width>100</width>
<height>52</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_5">
<item>
<widget class="QPushButton" name="btn_setScenario">
<property name="font">
<font>
<weight>75</weight>
<italic>true</italic>
<bold>true</bold>
<underline>false</underline>
<strikeout>false</strikeout>
<kerning>false</kerning>
</font>
</property>
<property name="text">
<string>Set Scenario</string>
</property>
@ -688,15 +749,25 @@
<widget class="QWidget" name="verticalLayoutWidget_3">
<property name="geometry">
<rect>
<x>460</x>
<x>440</x>
<y>70</y>
<width>222</width>
<width>235</width>
<height>102</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QPushButton" name="btn_setScenVerification">
<property name="font">
<font>
<weight>50</weight>
<italic>true</italic>
<bold>false</bold>
<underline>false</underline>
<strikeout>false</strikeout>
<kerning>false</kerning>
</font>
</property>
<property name="text">
<string>Scenario Verification</string>
</property>
@ -837,6 +908,37 @@
</widget>
</widget>
<widget class="QWidget" name="tab_2">
<attribute name="title">
<string>Scen Info</string>
</attribute>
<widget class="QPushButton" name="btn_scenInfo">
<property name="geometry">
<rect>
<x>10</x>
<y>20</y>
<width>153</width>
<height>23</height>
</rect>
</property>
<property name="text">
<string>Scenario Information</string>
</property>
</widget>
<widget class="QPlainTextEdit" name="tb_scenInfo">
<property name="geometry">
<rect>
<x>170</x>
<y>20</y>
<width>331</width>
<height>241</height>
</rect>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</widget>
<widget class="QWidget" name="tab_3">
<attribute name="title">
<string>Frame</string>
</attribute>
@ -849,6 +951,15 @@
<height>25</height>
</rect>
</property>
<property name="font">
<font>
<weight>50</weight>
<italic>true</italic>
<bold>false</bold>
<strikeout>false</strikeout>
<kerning>false</kerning>
</font>
</property>
<property name="text">
<string>InstantLog</string>
</property>
@ -862,6 +973,15 @@
<height>21</height>
</rect>
</property>
<property name="font">
<font>
<weight>50</weight>
<italic>true</italic>
<bold>false</bold>
<strikeout>false</strikeout>
<kerning>false</kerning>
</font>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-size:8pt; font-weight:600; font-style:italic;&quot;&gt;3D as default&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
@ -874,7 +994,7 @@
<rect>
<x>670</x>
<y>220</y>
<width>101</width>
<width>112</width>
<height>23</height>
</rect>
</property>
@ -897,7 +1017,7 @@
<rect>
<x>670</x>
<y>10</y>
<width>101</width>
<width>110</width>
<height>23</height>
</rect>
</property>
@ -914,6 +1034,15 @@
<height>25</height>
</rect>
</property>
<property name="font">
<font>
<weight>50</weight>
<italic>true</italic>
<bold>false</bold>
<strikeout>false</strikeout>
<kerning>false</kerning>
</font>
</property>
<property name="text">
<string>Show</string>
</property>
@ -927,6 +1056,15 @@
<height>25</height>
</rect>
</property>
<property name="font">
<font>
<weight>50</weight>
<italic>true</italic>
<bold>false</bold>
<strikeout>false</strikeout>
<kerning>false</kerning>
</font>
</property>
<property name="text">
<string>Log Browse</string>
</property>
@ -934,12 +1072,21 @@
<widget class="QPushButton" name="btn_emulBrowse">
<property name="geometry">
<rect>
<x>660</x>
<x>670</x>
<y>250</y>
<width>121</width>
<width>114</width>
<height>23</height>
</rect>
</property>
<property name="font">
<font>
<weight>50</weight>
<italic>true</italic>
<bold>false</bold>
<strikeout>false</strikeout>
<kerning>false</kerning>
</font>
</property>
<property name="text">
<string>Emulator Browse</string>
</property>
@ -953,6 +1100,15 @@
<height>21</height>
</rect>
</property>
<property name="font">
<font>
<weight>50</weight>
<italic>true</italic>
<bold>false</bold>
<strikeout>false</strikeout>
<kerning>false</kerning>
</font>
</property>
<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;Continuous Frame Represent&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
@ -961,7 +1117,7 @@
</property>
</widget>
</widget>
<widget class="QWidget" name="tab_3">
<widget class="QWidget" name="tab_4">
<attribute name="title">
<string>E2PROMs</string>
</attribute>
@ -2036,7 +2192,7 @@
<property name="geometry">
<rect>
<x>720</x>
<y>40</y>
<y>50</y>
<width>91</width>
<height>109</height>
</rect>
@ -2091,6 +2247,22 @@
</item>
</layout>
</widget>
<widget class="QLabel" name="l_frameTime">
<property name="geometry">
<rect>
<x>740</x>
<y>30</y>
<width>61</width>
<height>16</height>
</rect>
</property>
<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 per second&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>FPS</string>
</property>
</widget>
</widget>
<widget class="QGroupBox" name="groupBox_7">
<property name="geometry">

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

@ -24,7 +24,7 @@ T TrxBoard::byteArray2UintLittleEndian(QByteArray& byte) const
void TrxBoard::readData()
{
_swCounter = 0;
_swCounter = _device.getCounter();
while(_run)
{
auto cnt = _device.getCounter();
@ -49,11 +49,9 @@ void TrxBoard::readData()
auto temp = QByteArray::fromRawData(_device.getBufferPtr(_swCounter), BUFFER_SIZE);
#ifdef DEVELOP_UI
//packetEngine.newData(temp);
emit sendFramePacket(temp);
#else
packetEngine.newData(temp);
//emit sendFramePacket(temp);
#endif
_swCounter++;
@ -281,6 +279,33 @@ void TrxBoard::init()
sramClear(all);
}
void TrxBoard::fpgaProgram(const QString path) const
{
if(MOUNTED_SLAVE_FPGA <= 0 || MOUNTED_SLAVE_FPGA >= 8)
{
throw SonoException("Wrong mounted slave fpga is selected");
}
QByteArray bitFileData;
QFile bitFile(path);
bitFileData.clear();
if(bitFile.fileName().isEmpty())
{
throw SonoException("No file is selected");
}
if(!bitFile.open(QIODevice::ReadOnly))
{
throw SonoException("Couldn't open bit file programming");
}
bitFileData = bitFile.readAll();
bitFile.close();
this->_fpgaProgram->program(bitFileData, MOUNTED_SLAVE_FPGA);
}
void TrxBoard::setProbeDependParams(ScenPrbDepHardwareParam& prbDepParams)
{
/////////////////////////// DSP setting ///////////////////////////
@ -370,6 +395,12 @@ void TrxBoard::setScenario(ScenGenHardwareOutput_t& scenGenHw)
"The scenario end index must be greater than or equal to the scenario start index");
}
if(scenParams->scenarioEndIndex != (scenParams->totalTxShotNumber - 1))
{
throw SonoException(
"The scenario end index must be equal to the total tx shot number minus one");
}
scenParams->hwRegister->blendWeight = scenGenHw.hwRegister.blendWeight;
if(scenParams->hwRegister->blendWeight.size() != BLENDWEIGHT_LUT_MAX)
{
@ -887,29 +918,7 @@ void TrxBoard::slaveFpgaProgram(const QString path)
{
scenParamsFilling(clear);
if(MOUNTED_SLAVE_FPGA <= 0 || MOUNTED_SLAVE_FPGA >= 8)
{
throw SonoException("Wrong mounted slave fpga is selected");
}
QByteArray bitFileData;
QFile bitFile(path);
bitFileData.clear();
if(bitFile.fileName().isEmpty())
{
throw SonoException("No file is selected");
}
if(!bitFile.open(QIODevice::ReadOnly))
{
throw SonoException("Couldn't open bit file programming");
}
bitFileData = bitFile.readAll();
bitFile.close();
this->_fpgaProgram->program(bitFileData, MOUNTED_SLAVE_FPGA);
fpgaProgram (path);
afeAdcsSync();
}
@ -919,15 +928,16 @@ void TrxBoard::setBeamFormerMode(eClkMode mode) const
this->_clkDistributer->clockMode(CLOCK_DIVISION, mode);
}
void TrxBoard::scenPlayerStart(void)
/* set afeHvPwrOn true when unfreeze happen */
void TrxBoard::scenPlayerStart(bool afeHvPwrOn)
{
if(_allow)
{
_run = false;
this->_beamFormerSlave0->regValid(true);
this->_beamFormerSlave1->regValid(true);
this->_beamFormerSlave2->regValid(true);
this->_beamFormerSlave0->regValid(true);
this->_beamFormerSlave1->regValid(true);
this->_beamFormerSlave2->regValid(true);
this->_misc->setGtSendMode(BfMode);
@ -937,13 +947,21 @@ void TrxBoard::scenPlayerStart(void)
this->_device.startDma();
if(afeHvPwrOn)
{
this->_afeSlave0->setAfeGblPwr(afePwrdnDisable);
this->_afeSlave1->setAfeGblPwr(afePwrdnDisable);
this->_afeSlave2->setAfeGblPwr(afePwrdnDisable);
this->_bCtrlMngt->timerShot(20);
//uncrustify off
while(!(this->_bCtrlMngt->checkTimeout()));
//uncrustify on
#ifdef MPS_BOARD
this->_bCtrlMngt->mpsDacsOn();
this->_bCtrlMngt->mpsDacsOn();
#endif
this->_afeSlave0->setAfeGblPwr(afePwrdnDisable);
this->_afeSlave1->setAfeGblPwr(afePwrdnDisable);
this->_afeSlave2->setAfeGblPwr(afePwrdnDisable);
}
this->_scenPlayer->control.setCommand(true);
@ -957,7 +975,8 @@ void TrxBoard::scenPlayerStart(void)
}
}
void TrxBoard::scenPlayerStop(void)
/* set afeHvPwrOff true when freeze happen */
void TrxBoard::scenPlayerStop(bool afeHvPwrOff)
{
_run = false;
@ -965,13 +984,21 @@ void TrxBoard::scenPlayerStop(void)
this->_scenPlayer->control.setCommand(false);
this->_afeSlave0->setAfeGblPwr(afePwrdnEnable);
this->_afeSlave1->setAfeGblPwr(afePwrdnEnable);
this->_afeSlave2->setAfeGblPwr(afePwrdnEnable);
if(afeHvPwrOff)
{
this->_afeSlave0->setAfeGblPwr(afePwrdnEnable);
this->_afeSlave1->setAfeGblPwr(afePwrdnEnable);
this->_afeSlave2->setAfeGblPwr(afePwrdnEnable);
#ifdef MPS_BOARD
this->_bCtrlMngt->mpsDacsOff();
this->_bCtrlMngt->mpsDacsOff();
#endif
this->_bCtrlMngt->timerShot(20);
//uncrustify off
while(!(this->_bCtrlMngt->checkTimeout()));
//uncrustify on
}
}
//void TrxBoard::scenPlayerPause(bool pause) const
@ -990,7 +1017,7 @@ void TrxBoard::fillRam(QString path)
{
if(this->_scenPlayer->control.getCommand())
{
scenPlayerStop();
scenPlayerStop(true);
}
emulatorStop();
@ -1404,7 +1431,7 @@ void TrxBoard::selectProbe(eSelectProbe prbSel)
{
if(this->_scenPlayer->control.getCommand())
{
scenPlayerStop();
scenPlayerStop(true);
}
this->_bCtrlMngt->setProbeSelect(prbSel);
}

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

@ -29,8 +29,7 @@ BoardsCtrlMngt::Gain::Gain()
}
/***************************************************************************************************/
/************************************* Write Functions Template
************************************/
/************************************* Write Functions Template ************************************/
/***************************************************************************************************/
template<class T1, class T2>
void BoardsCtrlMngt::eepromWrite(QByteArray& arr,
@ -60,7 +59,7 @@ void BoardsCtrlMngt::eepromWrite(QByteArray& arr,
timerStop();
timerShot(5); //must be >= 4
timerShot(6); //must be >= 4
while(!checkTimeout())
{
;
@ -77,7 +76,7 @@ void BoardsCtrlMngt::eepromWrite(QByteArray& arr,
done = ((status->reqDone->getValue()) != 0);
error = ((status->reqError->getValue()) != 0);
timerShot(1);
timerShot(5);
while(!error && !done)
{
status->sync();
@ -112,8 +111,7 @@ void BoardsCtrlMngt::setEepromWrite(EepromReq* _rom, T3* request)
}
/***************************************************************************************************/
/************************************* Read Functions Template
*************************************/
/************************************* Read Functions Template *************************************/
/***************************************************************************************************/
template<class T4, class T5>
@ -154,7 +152,7 @@ QByteArray BoardsCtrlMngt::eepromRead(quint32 addr,
done = ((status->reqDone->getValue()) != 0);
error = ((status->reqError->getValue()) != 0);
timerShot(1);
timerShot(5);
while(!error && !done)
{
status->sync();

Loading…
Cancel
Save