Browse Source

Sram filling is fixed

master
Arash Aletayeb 4 years ago
parent
commit
1fdc1d0243
  1. 2
      developHw.pro.user
  2. 7
      include/model/hardware/core/TrxBoard.h
  3. 6
      include/model/hardware/core/register/Register.h
  4. 2
      include/model/hardware/core/register/afe/Afe.h
  5. 10
      include/model/hardware/core/register/boardsCtrlMngt/BoardsCtrlMngt.h
  6. 3
      include/model/hardware/core/register/sram/Sram.h
  7. 4
      include/model/hardware/core/register/sram/registerDefinition/Index.h
  8. 2
      include/model/hardware/core/register/sram/registerDefinition/RxParamsPos.h
  9. 2
      include/model/hardware/core/register/sram/registerDefinition/TxParams.h
  10. 2
      include/model/scenarioGenerator/dto/hardware/HardwareOutput.h
  11. 236
      mainwindow.cpp
  12. 13
      mainwindow.h
  13. 29
      src/model/hardware/core/TrxBoard.cpp
  14. 53
      src/model/hardware/core/register/Register.cpp
  15. 18
      src/model/hardware/core/register/fpgaProgram/FpgaProgram.cpp
  16. 31
      src/model/hardware/core/register/sram/Sram.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-07T16:10:21. -->
<!-- Written by QtCreator 4.10.0, 2021-06-12T08:44:12. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>

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

@ -63,7 +63,7 @@ private:
qint32 _swCounter;
qint32 _hwCounter;
SonoDevice _device;
SonoDevice _device;
AdcVoltages* _adc;
VoltagesPg* _pg;
@ -128,8 +128,6 @@ private:
* scenParams;
HardwarePacketEngine packetEngine;
void setScenario(ScenGenHardwareOutput* scenParams);
void sram_clear (void);
@ -143,6 +141,9 @@ signals:
void sendFramePacket(QByteArray newPacket);
public:
HardwarePacketEngine packetEngine;
TrxBoard();
~TrxBoard();

6
include/model/hardware/core/register/Register.h

@ -15,6 +15,8 @@ private:
{
}
quint32 cumulativeValue;
protected:
quint32 _bar;
quint32 _offset;
@ -43,11 +45,13 @@ public:
bool isUpdated();
void clearCumulative(void);
void update();
void updateLong();
void updateArray(bool isVariable = false, quint8 arrayLength = 0);
void updateArrayLong(quint8 interval, quint32 arrayLength);
void updateArrayLong(quint8 interval, quint32 arrayLength, bool _isCumulative=false);
void sync();
void syncArray();

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

@ -128,7 +128,7 @@ struct AfeConfig
eLnaHpfProg lnaHpfProg;
};
Q_DECLARE_METATYPE(AfeConfig)
class Afe
{

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

@ -208,12 +208,6 @@ private:
quint8 prbSel,
BoardsCtrlMngt* boards);
void timerShot(quint16 ms) const;
void timerStop(void) const;
//private slots:
bool checkTimeout(void) const;
public:
explicit BoardsCtrlMngt(SonoDevice* device) : BoardsSpecs(device)
{
@ -229,6 +223,10 @@ public:
delete _mpsDacs;
}
void timerShot(quint16 ms) const;
void timerStop(void) const;
bool checkTimeout(void) const;
quint32 getPid(void) const;
quint32 getVid(void) const;

3
include/model/hardware/core/register/sram/Sram.h

@ -11,7 +11,8 @@
#include "registerDefinition/SoftwareMetaData.h"
#define INDEX_INTERVAL 1U
#define TX_RX_INTERVAL 27U
#define TX_INTERVAL 27U
#define RX_INTERVAL 27*8
#define INNER_RX_INTERVAL 3U
#define META_DATA_INTERVAL 1U
#define META_DATA_LENGTH 16U

4
include/model/hardware/core/register/sram/registerDefinition/Index.h

@ -44,9 +44,9 @@ private:
value = _index->lastLineInFrame[static_cast<qint32>(index)] ? 1 : 0;
lastLineInFrame->setValueLong(value);
dLineNum->setValueLong(_index->dLineNum[static_cast<qint32>(index)] - 1);
dLineNum->setValueLong(_index->dLineNum[static_cast<qint32>(index)]);
dEnsembleNum->setValueLong(_index->dEnsembleNum[static_cast<qint32>(index)] - 1);
dEnsembleNum->setValueLong(_index->dEnsembleNum[static_cast<qint32>(index)]);
if (index==0)
frameType->setValueLong(_index->frameType);

2
include/model/hardware/core/register/sram/registerDefinition/RxParamsPos.h

@ -28,7 +28,7 @@ private:
void prepareData(quint32 index) override
{
rxR0CenterActiveElementNumber->setValueLong(_rx->rxR0CenterActiveElementNumber[static_cast<qint32>(index)] - 1);
rxR0CenterActiveElementNumber->setValueLong(_rx->rxR0CenterActiveElementNumber[static_cast<qint32>(index)]);
interceptXPos->setValueLong(static_cast<quint64>(interceptXPosQ[static_cast<qint32>(index)]));

2
include/model/hardware/core/register/sram/registerDefinition/TxParams.h

@ -24,7 +24,7 @@ private:
void prepareData(quint32 index) override
{
txStartActiveElementNumber->setValueLong(_tx->txStartActiveElementNumber[static_cast<qint32>(index)] - 1);
txStartActiveElementNumber->setValueLong(_tx->txStartActiveElementNumber[static_cast<qint32>(index)]);
txActiveElementNumber->setValueLong(_tx->txActiveElementNumber[static_cast<qint32>(index)]);

2
include/model/scenarioGenerator/dto/hardware/HardwareOutput.h

@ -11,7 +11,7 @@
struct ScenGenHardwareOutput_t {
quint32 focusTypeNumber;
quint32 totalTxShotNumber;
QVector<quint8> rxBeamFormerNumber;
QList<quint8> rxBeamFormerNumber;
QVector<float> pulseInterval;
quint8 frameType;

236
mainwindow.cpp

@ -2545,7 +2545,7 @@ void MainWindow::on_btn_getFpgaVersion_clicked()
/*************************************************************************************************/
template<class T>
void MainWindow::datasetBranch(const string &branchPath, T datasetValue[][3057])
void MainWindow::datasetBranch(const string &branchPath, T datasetValue[MAX_ARRAY_DEPTH])
{
const H5std_string datasetPath(branchPath);
DataSet datasetType = _file.openDataSet(datasetPath);
@ -2565,213 +2565,218 @@ void MainWindow::setScenario(const string &h5Path)
{
/****************** /sramParameters/frameType ******************/
datasetBranch <float_t>("/sramParameters/frameType", floatArray);
scenParams.frameType = static_cast<quint8>(floatArray[0][0]);
scenParams.frameType = static_cast<quint8>(floatArray[0]);
/****************** /sramParameters/totalTxShotNo ******************/
datasetBranch <float_t>("/sramParameters/totalTxShotNo", floatArray);
scenParams.totalTxShotNumber = static_cast<quint32>(floatArray[0][0]);
scenParams.totalTxShotNumber = static_cast<quint32>(floatArray[0]);
/******************* /sramParameters/focusTypeNo *******************/
datasetBranch <float_t>("/sramParameters/focusTypeNo", floatArray);
scenParams.focusTypeNumber = static_cast<quint32>(floatArray[0][0]);
scenParams.focusTypeNumber = static_cast<quint32>(floatArray[0]);
/******************* /sramParameters/rxBeamformerNo *******************/
datasetBranch <float_t>("/sramParameters/rxBeamformerNo", floatArray);
scenParams.rxBeamFormerNumber.clear();
for (quint32 var = 0; var < scenParams.focusTypeNumber; var++)
scenParams.rxBeamFormerNumber.push_back(static_cast<quint8>(floatArray[0][var]));
scenParams.rxBeamFormerNumber.push_back(static_cast<quint8>(floatArray[var]));
// for(auto j=0; j<scenParams.focusTypeNumber; j++)
// {
// qDebug() << scenParams.rxBeamFormerNumber[j];
// }
/**************** /sramParameters/pulseInterval ********************/
datasetBranch <float_t>("/sramParameters/pulseInterval", floatArray);
scenParams.pulseInterval.clear();
for (quint32 var = 0; var < scenParams.focusTypeNumber; var++)
scenParams.pulseInterval.push_back(floatArray[0][var]);
scenParams.pulseInterval.push_back(floatArray[var]);
/**************** /sramParameters/indexParameters/shotPropertiesIndex ********************/
datasetBranch <float_t>("/sramParameters/indexParameters/shotPropertiesIndex", floatArray);
scenParams.indexParams.shotPropertiesIndex.clear();
for (quint32 var = 0; var < scenParams.focusTypeNumber; var++)
scenParams.indexParams.shotPropertiesIndex.push_back(static_cast<quint32>(floatArray[0][var]));
scenParams.indexParams.shotPropertiesIndex.push_back(static_cast<quint32>(floatArray[var]));
/**************** /sramParameters/indexParameters/pulsePropertiesIndex ********************/
datasetBranch <float_t>("/sramParameters/indexParameters/pulsePropertiesIndex", floatArray);
scenParams.indexParams.pulsePropertiesIndex.clear();
for (quint32 var = 0; var < scenParams.focusTypeNumber; var++)
scenParams.indexParams.pulsePropertiesIndex.push_back(static_cast<quint32>(floatArray[0][var]));
scenParams.indexParams.pulsePropertiesIndex.push_back(static_cast<quint32>(floatArray[var]));
/**************** /sramParameters/indexParameters/receiverConfigurationIndex ********************/
datasetBranch <float_t>("/sramParameters/indexParameters/receiverConfigurationIndex", floatArray);
scenParams.indexParams.receiverConfigurationIndex.clear();
for (quint32 var = 0; var < scenParams.focusTypeNumber; var++)
scenParams.indexParams.receiverConfigurationIndex.push_back(static_cast<quint32>(floatArray[0][var]));
scenParams.indexParams.receiverConfigurationIndex.push_back(static_cast<quint32>(floatArray[var]));
/**************** /sramParameters/indexParameters/firstLineInFrame ********************/
datasetBranch <float_t>("/sramParameters/indexParameters/firstLineInFrame", floatArray);
scenParams.indexParams.firstLineInFrame.clear();
for (quint32 var = 0; var < scenParams.focusTypeNumber; var++)
scenParams.indexParams.firstLineInFrame.push_back(static_cast<bool>(floatArray[0][var]));
scenParams.indexParams.firstLineInFrame.push_back(static_cast<bool>(floatArray[var]));
/**************** /sramParameters/indexParameters/lastLineInFrame ********************/
datasetBranch <float_t>("/sramParameters/indexParameters/lastLineInFrame", floatArray);
scenParams.indexParams.lastLineInFrame.clear();
for (quint32 var = 0; var < scenParams.focusTypeNumber; var++)
scenParams.indexParams.lastLineInFrame.push_back(static_cast<bool>(floatArray[0][var]));
scenParams.indexParams.lastLineInFrame.push_back(static_cast<bool>(floatArray[var]));
/**************** /sramParameters/indexParameters/dLineNum ********************/
datasetBranch <float_t>("/sramParameters/indexParameters/dLineNum", floatArray);
scenParams.indexParams.dLineNum.clear();
for (quint32 var = 0; var < scenParams.focusTypeNumber; var++)
scenParams.indexParams.dLineNum.push_back(static_cast<quint32>(floatArray[0][var]));
scenParams.indexParams.dLineNum.push_back(static_cast<quint32>(floatArray[var]));
/**************** /sramParameters/indexParameters/dEnsembleNum ********************/
datasetBranch <float_t>("/sramParameters/indexParameters/dEnsembleNum", floatArray);
scenParams.indexParams.dEnsembleNum.clear();
for (quint32 var = 0; var < scenParams.focusTypeNumber; var++)
scenParams.indexParams.dEnsembleNum.push_back(static_cast<quint32>(floatArray[0][var]));
scenParams.indexParams.dEnsembleNum.push_back(static_cast<quint32>(floatArray[var]));
/**************** /sramParameters/txParameters/txFocusXPos ********************/
datasetBranch <float_t>("/sramParameters/txParameters/txFocusXPos", floatArray);
scenParams.txParams.txFocusXPos.clear();
for (quint32 var = 0; var < scenParams.focusTypeNumber; var++)
scenParams.txParams.txFocusXPos.push_back(floatArray[0][var]);
scenParams.txParams.txFocusXPos.push_back(floatArray[var]);
/**************** /sramParameters/txParameters/txFocusYPos ********************/
datasetBranch <float_t>("/sramParameters/txParameters/txFocusYPos", floatArray);
scenParams.txParams.txFocusYPos.clear();
for (quint32 var = 0; var < scenParams.focusTypeNumber; var++)
scenParams.txParams.txFocusYPos.push_back(floatArray[0][var]);
scenParams.txParams.txFocusYPos.push_back(floatArray[var]);
/**************** /sramParameters/txParameters/txFocusZPos ********************/
datasetBranch <float_t>("/sramParameters/txParameters/txFocusZPos", floatArray);
scenParams.txParams.txFocusZPos.clear();
for (quint32 var = 0; var < scenParams.focusTypeNumber; var++)
scenParams.txParams.txFocusZPos.push_back(floatArray[0][var]);
scenParams.txParams.txFocusZPos.push_back(floatArray[var]);
/**************** /sramParameters/txParameters/txStartActiveElementNo ********************/
datasetBranch <float_t>("/sramParameters/txParameters/txStartActiveElementNo", floatArray);
scenParams.txParams.txStartActiveElementNumber.clear();
for (quint32 var = 0; var < scenParams.focusTypeNumber; var++)
scenParams.txParams.txStartActiveElementNumber.push_back(static_cast<quint32>(floatArray[0][var]));
scenParams.txParams.txStartActiveElementNumber.push_back(static_cast<quint32>(floatArray[var]));
/**************** /sramParameters/txParameters/txActiveElementNo ********************/
datasetBranch <float_t>("/sramParameters/txParameters/txActiveElementNo", floatArray);
scenParams.txParams.txActiveElementNumber.clear();
for (quint32 var = 0; var < scenParams.focusTypeNumber; var++)
scenParams.txParams.txActiveElementNumber.push_back(static_cast<quint32>(floatArray[0][var]));
scenParams.txParams.txActiveElementNumber.push_back(static_cast<quint32>(floatArray[var]));
/**************** /sramParameters/txParameters/maxDelayQ ********************/
datasetBranch <float_t>("/sramParameters/txParameters/maxDelayQ", floatArray);
scenParams.txParams.maxDelayQ.clear();
for (quint32 var = 0; var < scenParams.focusTypeNumber; var++)
scenParams.txParams.maxDelayQ.push_back(static_cast<quint32>(floatArray[0][var]));
scenParams.txParams.maxDelayQ.push_back(static_cast<quint32>(floatArray[var]));
/**************** /sramParameters/rxParameters/rxR0CenterActiveElementNo ********************/
datasetBranch <float_t>("/sramParameters/rxParameters/rxR0CenterActiveElementNo", floatArray);
scenParams.rxParams.rxR0CenterActiveElementNumber.clear();
for (quint32 var = 0; var < scenParams.focusTypeNumber; var++)
scenParams.rxParams.rxR0CenterActiveElementNumber.push_back(static_cast<quint32>(floatArray[0][var]));
scenParams.rxParams.rxR0CenterActiveElementNumber.push_back(static_cast<quint32>(floatArray[var]));
/**************** /sramParameters/rxParameters/rxR0ActiveElementNo ********************/
datasetBranch <float_t>("/sramParameters/rxParameters/rxR0ActiveElementNo", floatArray);
scenParams.rxParams.rxR0ActiveElementNumber.clear();
for (quint32 var = 0; var < scenParams.focusTypeNumber; var++)
scenParams.rxParams.rxR0ActiveElementNumber.push_back(static_cast<quint32>(floatArray[0][var]));
scenParams.rxParams.rxR0ActiveElementNumber.push_back(static_cast<quint32>(floatArray[var]));
/**************** /sramParameters/rxParameters/rxActiveElementStep ********************/
datasetBranch <float_t>("/sramParameters/rxParameters/rxActiveElementStep", floatArray);
scenParams.rxParams.rxActiveElementStep.clear();
for (quint32 var = 0; var < scenParams.focusTypeNumber; var++)
scenParams.rxParams.rxActiveElementStep.push_back(floatArray[0][var]);
scenParams.rxParams.rxActiveElementStep.push_back(floatArray[var]);
/**************** /sramParameters/rxParameters/interceptPointFiringTime ********************/
datasetBranch <float_t>("/sramParameters/rxParameters/interceptPointFiringTime", floatArray);
scenParams.rxParams.interceptPointFiringTime.clear();
for (quint32 var = 0; var < scenParams.focusTypeNumber; var++)
scenParams.rxParams.interceptPointFiringTime.push_back(static_cast<quint32>(floatArray[0][var]));
scenParams.rxParams.interceptPointFiringTime.push_back(static_cast<quint32>(floatArray[var]));
/**************** /sramParameters/rxParameters/rxFocusPointNo ********************/
datasetBranch <float_t>("/sramParameters/rxParameters/rxFocusPointNo", floatArray);
scenParams.rxParams.rxFocusPointNumber.clear();
for (quint32 var = 0; var < scenParams.focusTypeNumber; var++)
scenParams.rxParams.rxFocusPointNumber.push_back(static_cast<quint32>(floatArray[0][var]));
scenParams.rxParams.rxFocusPointNumber.push_back(static_cast<quint32>(floatArray[var]));
/**************** /sramParameters/rxParameters/r0Position ********************/
datasetBranch <float_t>("/sramParameters/rxParameters/r0Position", floatArray);
scenParams.rxParams.r0Position.clear();
for (quint32 var = 0; var < scenParams.focusTypeNumber; var++)
scenParams.rxParams.r0Position.push_back(floatArray[0][var]);
scenParams.rxParams.r0Position.push_back(floatArray[var]);
/**************** /sramParameters/rxParameters/thetaCos ********************/
datasetBranch <float_t>("/sramParameters/rxParameters/thetaCos", floatArray);
scenParams.rxParams.thetaCos.clear();
for (quint32 var = 0; var < scenParams.focusTypeNumber; var++)
scenParams.rxParams.thetaCos.push_back(floatArray[0][var]);
scenParams.rxParams.thetaCos.push_back(floatArray[var]);
/**************** /sramParameters/rxParameters/thetaSin ********************/
datasetBranch <float_t>("/sramParameters/rxParameters/thetaSin", floatArray);
scenParams.rxParams.thetaSin.clear();
for (quint32 var = 0; var < scenParams.focusTypeNumber; var++)
scenParams.rxParams.thetaSin.push_back(floatArray[0][var]);
scenParams.rxParams.thetaSin.push_back(floatArray[var]);
/**************** /sramParameters/rxParameters/phiCos ********************/
datasetBranch <float_t>("/sramParameters/rxParameters/phiCos", floatArray);
scenParams.rxParams.phiCos.clear();
for (quint32 var = 0; var < scenParams.focusTypeNumber; var++)
scenParams.rxParams.phiCos.push_back(floatArray[0][var]);
scenParams.rxParams.phiCos.push_back(floatArray[var]);
/**************** /sramParameters/rxParameters/phiSin ********************/
datasetBranch <float_t>("/sramParameters/rxParameters/phiSin", floatArray);
scenParams.rxParams.phiSin.clear();
for (quint32 var = 0; var < scenParams.focusTypeNumber; var++)
scenParams.rxParams.phiSin.push_back(floatArray[0][var]);
scenParams.rxParams.phiSin.push_back(floatArray[var]);
/**************** /sramParameters/rxParameters/interceptXPos ********************/
datasetBranch <float_t>("/sramParameters/rxParameters/interceptXPos", floatArray);
scenParams.rxParams.interceptXPos.clear();
for (quint32 var = 0; var < scenParams.focusTypeNumber; var++)
scenParams.rxParams.interceptXPos.push_back(floatArray[0][var]);
scenParams.rxParams.interceptXPos.push_back(floatArray[var]);
/**************** /sramParameters/rxParameters/interceptYPos ********************/
datasetBranch <float_t>("/sramParameters/rxParameters/interceptYPos", floatArray);
scenParams.rxParams.interceptYPos.clear();
for (quint32 var = 0; var < scenParams.focusTypeNumber; var++)
scenParams.rxParams.interceptYPos.push_back(floatArray[0][var]);
scenParams.rxParams.interceptYPos.push_back(floatArray[var]);
/**************** /sramParameters/rxParameters/interceptZPos ********************/
datasetBranch <float_t>("/sramParameters/rxParameters/interceptZPos", floatArray);
scenParams.rxParams.interceptZPos.clear();
for (quint32 var = 0; var < scenParams.focusTypeNumber; var++)
scenParams.rxParams.interceptZPos.push_back(floatArray[0][var]);
scenParams.rxParams.interceptZPos.push_back(floatArray[var]);
/**************** /sramParameters/rxParameters/txR0MinDelayQ ********************/
datasetBranch <float_t>("/sramParameters/rxParameters/txR0MinDelayQ", floatArray);
scenParams.rxParams.txR0MinDelayQ.clear();
for (quint32 var = 0; var < scenParams.focusTypeNumber; var++)
scenParams.rxParams.txR0MinDelayQ.push_back(static_cast<quint32>(floatArray[0][var]));
scenParams.rxParams.txR0MinDelayQ.push_back(static_cast<quint32>(floatArray[var]));
/**************** /sramParameters/rxParameters/rxR0MinDelayQ ********************/
datasetBranch <float_t>("/sramParameters/rxParameters/rxR0MinDelayQ", floatArray);
scenParams.rxParams.rxR0MinDelayQ.clear();
for (quint32 var = 0; var < scenParams.focusTypeNumber; var++)
scenParams.rxParams.rxR0MinDelayQ.push_back(static_cast<quint32>(floatArray[0][var]));
scenParams.rxParams.rxR0MinDelayQ.push_back(static_cast<quint32>(floatArray[var]));
/**************** /sramParameters/rxParameters/rxR0MaxDelayQ ********************/
datasetBranch <float_t>("/sramParameters/rxParameters/rxR0MaxDelayQ", floatArray);
scenParams.rxParams.rxR0MaxDelayQ.clear();
for (quint32 var = 0; var < scenParams.focusTypeNumber; var++)
scenParams.rxParams.rxR0MaxDelayQ.push_back(static_cast<quint32>(floatArray[0][var]));
scenParams.rxParams.rxR0MaxDelayQ.push_back(static_cast<quint32>(floatArray[var]));
/**************** /registerParameters/pulseTypeNo ********************/
datasetBranch <float_t>("/registerParameters/pulseTypeNo", floatArray);
scenParams.hwRegister.pulseTypeNumber = static_cast<quint8>(floatArray[0][0]);
scenParams.hwRegister.pulseTypeNumber = static_cast<quint8>(floatArray[0]);
/**************** /registerParameters/rxBeamformerTypeNo ********************/
datasetBranch <float_t>("/registerParameters/rxBeamformerTypeNo", floatArray);
scenParams.hwRegister.rxBeamFormerTypeNumber = static_cast<quint8>(floatArray[0][0]);
scenParams.hwRegister.rxBeamFormerTypeNumber = static_cast<quint8>(floatArray[0]);
/**************** /registerParameters/receiverConfigTypeNo ********************/
datasetBranch <float_t>("/registerParameters/receiverConfigTypeNo", floatArray);
scenParams.hwRegister.receiverConfigTypeNumber = static_cast<quint8>(floatArray[0][0]);
scenParams.hwRegister.receiverConfigTypeNumber = static_cast<quint8>(floatArray[0]);
/**************** /registerParameters/blendWeight ********************/
datasetBranch <float_t>("/registerParameters/blendWeight", floatArray);
@ -2783,7 +2788,7 @@ void MainWindow::setScenario(const string &h5Path)
tempBlendWeight.clear();
for (quint32 j = 0; j < 512; j++)
{
tempBlendWeight.push_back(floatArray[i][j]);
tempBlendWeight.push_back(floatArray[j + i * 512]);
}
scenParams.hwRegister.blendWeight.push_back(tempBlendWeight);
}
@ -2792,39 +2797,39 @@ void MainWindow::setScenario(const string &h5Path)
datasetBranch <float_t>("/registerParameters/freqLut", floatArray);
scenParams.hwRegister.freqLut.clear();
for (quint32 var = 0; var < 8; var++)
scenParams.hwRegister.freqLut.push_back(floatArray[0][var]);
scenParams.hwRegister.freqLut.push_back(floatArray[var]);
/**************** /registerParameters/dTgcLut ********************/
datasetBranch <float_t>("/registerParameters/dTgcLut", floatArray);
scenParams.hwRegister.dtgcLut.clear();
for (quint32 var = 0; var < 1024; var++)
scenParams.hwRegister.dtgcLut.push_back(floatArray[0][var]);
scenParams.hwRegister.dtgcLut.push_back(floatArray[var]);
/**************** /registerParameters/elementXPositions ********************/
datasetBranch <float_t>("/registerParameters/elementXPositions", floatArray);
scenParams.hwRegister.elementXPosition.clear();
for (quint32 var = 0; var < 192; var++)
scenParams.hwRegister.elementXPosition.push_back(floatArray[0][var]);
scenParams.hwRegister.elementXPosition.push_back(floatArray[var]);
/**************** /registerParameters/elementYPositions ********************/
datasetBranch <float_t>("/registerParameters/elementYPositions", floatArray);
scenParams.hwRegister.elementYPosition.clear();
for (quint32 var = 0; var < 192; var++)
scenParams.hwRegister.elementYPosition.push_back(floatArray[0][var]);
scenParams.hwRegister.elementYPosition.push_back(floatArray[var]);
/**************** /registerParameters/elementZPositions ********************/
datasetBranch <float_t>("/registerParameters/elementZPositions", floatArray);
scenParams.hwRegister.elementZPosition.clear();
for (quint32 var = 0; var < 192; var++)
scenParams.hwRegister.elementZPosition.push_back(floatArray[0][var]);
scenParams.hwRegister.elementZPosition.push_back(floatArray[var]);
/**************** /registerParameters/scenarioStartIndex ********************/
datasetBranch <float_t>("/registerParameters/scenarioStartIndex", floatArray);
scenParams.hwRegister.scenarioStartIndex = static_cast<quint32>(floatArray[0][0]);
scenParams.hwRegister.scenarioStartIndex = static_cast<quint32>(floatArray[0]);
/**************** /registerParameters/scenarioEndIndex ********************/
datasetBranch <float_t>("/registerParameters/scenarioEndIndex", floatArray);
scenParams.hwRegister.scenarioEndIndex = static_cast<quint32>(floatArray[0][0]);
scenParams.hwRegister.scenarioEndIndex = static_cast<quint32>(floatArray[0]);
/**************** /registerParameters/apodizationLut ********************/
datasetBranch <float_t>("/registerParameters/apodizationLut", floatArray);
@ -2836,7 +2841,7 @@ void MainWindow::setScenario(const string &h5Path)
tempApodization.clear();
for (quint32 j = 0; j < 3057; j++)
{
tempApodization.push_back(static_cast<quint32>(floatArray[i][j]));
tempApodization.push_back(static_cast<quint32>(floatArray[j + i * 3057]));
}
scenParams.hwRegister.apodizationLut.push_back(tempApodization);
}
@ -2851,7 +2856,7 @@ void MainWindow::setScenario(const string &h5Path)
tempAtgc.clear();
for (quint32 j = 0; j < 128; j++)
{
tempAtgc.push_back(static_cast<quint32>(floatArray[i][j]));
tempAtgc.push_back(static_cast<quint32>(floatArray[j + i * 128]));
}
scenParams.hwRegister.atgcLut.push_back(tempAtgc);
}
@ -2866,7 +2871,7 @@ void MainWindow::setScenario(const string &h5Path)
tempLpf.clear();
for (quint32 j = 0; j < 48; j++)
{
tempLpf.push_back(static_cast<quint32>(floatArray[i][j]));
tempLpf.push_back(static_cast<quint32>(floatArray[j + i * 48]));
}
scenParams.hwRegister.lpfLut.push_back(tempLpf);
}
@ -2877,7 +2882,7 @@ void MainWindow::setScenario(const string &h5Path)
for (quint32 j = 0; j < scenParams.hwRegister.pulseTypeNumber; j++)
{
halfPeriod.push_back(static_cast<quint32>(floatArray[0][j]));
halfPeriod.push_back(static_cast<quint32>(floatArray[j]));
}
@ -2887,7 +2892,7 @@ void MainWindow::setScenario(const string &h5Path)
for (quint32 j = 0; j < scenParams.hwRegister.pulseTypeNumber; j++)
{
halfCycleNo.push_back(static_cast<quint32>(floatArray[0][j]));
halfCycleNo.push_back(static_cast<quint32>(floatArray[j]));
}
/**************** /registerParameters/pulseProperties/pulseVoltSel ********************/
@ -2896,7 +2901,7 @@ void MainWindow::setScenario(const string &h5Path)
for (quint32 j = 0; j < scenParams.hwRegister.pulseTypeNumber; j++)
{
pulseVoltSel.push_back(static_cast<bool>(floatArray[0][j]));
pulseVoltSel.push_back(static_cast<bool>(floatArray[j]));
}
/**************** /registerParameters/pulseProperties/startPhase ********************/
@ -2905,7 +2910,7 @@ void MainWindow::setScenario(const string &h5Path)
for (quint32 j = 0; j < scenParams.hwRegister.pulseTypeNumber; j++)
{
startPhase.push_back(static_cast<bool>(floatArray[0][j]));
startPhase.push_back(static_cast<bool>(floatArray[j]));
}
/**************** /registerParameters/pulseProperties/dampingPulseWidth ********************/
@ -2914,7 +2919,7 @@ void MainWindow::setScenario(const string &h5Path)
for (quint32 j = 0; j < scenParams.hwRegister.pulseTypeNumber; j++)
{
dampingPulseWidth.push_back(static_cast<quint32>(floatArray[0][j]));
dampingPulseWidth.push_back(static_cast<quint32>(floatArray[j]));
}
/**************** /registerParameters/pulseProperties ********************/
@ -2939,7 +2944,7 @@ void MainWindow::setScenario(const string &h5Path)
for (quint32 j = 0; j < scenParams.hwRegister.rxBeamFormerTypeNumber; j++)
{
mla.push_back(static_cast<quint32>(floatArray[0][j]));
mla.push_back(static_cast<quint32>(floatArray[j]));
}
/**************** /registerParameters/rxBeamformerProperties/lag ********************/
@ -2948,7 +2953,7 @@ void MainWindow::setScenario(const string &h5Path)
for (quint32 j = 0; j < scenParams.hwRegister.rxBeamFormerTypeNumber; j++)
{
lag.push_back(static_cast<quint32>(floatArray[0][j]));
lag.push_back(static_cast<quint32>(floatArray[j]));
}
/**************** /registerParameters/rxBeamformerProperties/apodizationSel ********************/
@ -2957,7 +2962,7 @@ void MainWindow::setScenario(const string &h5Path)
for (quint32 j = 0; j < scenParams.hwRegister.rxBeamFormerTypeNumber; j++)
{
apodizationSel.push_back(static_cast<quint32>(floatArray[0][j]));
apodizationSel.push_back(static_cast<quint32>(floatArray[j]));
}
/**************** /registerParameters/rxBeamformerProperties ********************/
@ -2980,7 +2985,7 @@ void MainWindow::setScenario(const string &h5Path)
for (quint32 j = 0; j < scenParams.hwRegister.receiverConfigTypeNumber; j++)
{
receiverCfgMla.push_back(static_cast<quint32>(floatArray[0][j]));
receiverCfgMla.push_back(static_cast<quint32>(floatArray[j]));
}
/**************** /registerParameters/receiverConfigProperties/lineMode ********************/
@ -2989,7 +2994,7 @@ void MainWindow::setScenario(const string &h5Path)
for (quint32 j = 0; j < scenParams.hwRegister.receiverConfigTypeNumber; j++)
{
lineMode.push_back(static_cast<quint32>(floatArray[0][j]));
lineMode.push_back(static_cast<quint32>(floatArray[j]));
}
/**************** /registerParameters/receiverConfigProperties/aTgcSel ********************/
@ -2998,7 +3003,7 @@ void MainWindow::setScenario(const string &h5Path)
for (quint32 j = 0; j < scenParams.hwRegister.receiverConfigTypeNumber; j++)
{
aTgcSel.push_back(static_cast<quint32>(floatArray[0][j]));
aTgcSel.push_back(static_cast<quint32>(floatArray[j]));
}
/**************** /registerParameters/receiverConfigProperties/stbEn ********************/
@ -3007,7 +3012,7 @@ void MainWindow::setScenario(const string &h5Path)
for (quint32 j = 0; j < scenParams.hwRegister.receiverConfigTypeNumber; j++)
{
stbEn.push_back(static_cast<quint32>(floatArray[0][j]));
stbEn.push_back(static_cast<quint32>(floatArray[j]));
}
/**************** /registerParameters/receiverConfigProperties/stb ********************/
@ -3016,7 +3021,7 @@ void MainWindow::setScenario(const string &h5Path)
for (quint32 j = 0; j < scenParams.hwRegister.receiverConfigTypeNumber; j++)
{
stb.push_back(static_cast<quint32>(floatArray[0][j]));
stb.push_back(static_cast<quint32>(floatArray[j]));
}
/**************** /registerParameters/receiverConfigProperties/subtractFilterEn ********************/
@ -3025,7 +3030,7 @@ void MainWindow::setScenario(const string &h5Path)
for (quint32 j = 0; j < scenParams.hwRegister.receiverConfigTypeNumber; j++)
{
subtractFilterEn.push_back(static_cast<quint32>(floatArray[0][j]));
subtractFilterEn.push_back(static_cast<quint32>(floatArray[j]));
}
/**************** /registerParameters/receiverConfigProperties/dcCancelEn ********************/
@ -3034,7 +3039,7 @@ void MainWindow::setScenario(const string &h5Path)
for (quint32 j = 0; j < scenParams.hwRegister.receiverConfigTypeNumber; j++)
{
dcCancelEn.push_back(static_cast<quint32>(floatArray[0][j]));
dcCancelEn.push_back(static_cast<quint32>(floatArray[j]));
}
/**************** /registerParameters/receiverConfigProperties/ncoFreqSel ********************/
@ -3043,7 +3048,7 @@ void MainWindow::setScenario(const string &h5Path)
for (quint32 j = 0; j < scenParams.hwRegister.receiverConfigTypeNumber; j++)
{
ncoFreqSel.push_back(static_cast<quint32>(floatArray[0][j]));
ncoFreqSel.push_back(static_cast<quint32>(floatArray[j]));
}
/**************** /registerParameters/receiverConfigProperties/lpfSel ********************/
@ -3052,7 +3057,7 @@ void MainWindow::setScenario(const string &h5Path)
for (quint32 j = 0; j < scenParams.hwRegister.receiverConfigTypeNumber; j++)
{
lpfSel.push_back(static_cast<quint32>(floatArray[0][j]));
lpfSel.push_back(static_cast<quint32>(floatArray[j]));
}
/**************** /registerParameters/receiverConfigProperties/absEn ********************/
@ -3061,7 +3066,7 @@ void MainWindow::setScenario(const string &h5Path)
for (quint32 j = 0; j < scenParams.hwRegister.receiverConfigTypeNumber; j++)
{
absEn.push_back(static_cast<quint32>(floatArray[0][j]));
absEn.push_back(static_cast<quint32>(floatArray[j]));
}
/**************** /registerParameters/receiverConfigProperties/focusNo ********************/
@ -3070,7 +3075,7 @@ void MainWindow::setScenario(const string &h5Path)
for (quint32 j = 0; j < scenParams.hwRegister.receiverConfigTypeNumber; j++)
{
focusNo.push_back(static_cast<quint32>(floatArray[0][j]));
focusNo.push_back(static_cast<quint32>(floatArray[j]));
}
/**************** /registerParameters/receiverConfigProperties/lineFilterEn ********************/
@ -3079,35 +3084,35 @@ void MainWindow::setScenario(const string &h5Path)
for (quint32 j = 0; j < scenParams.hwRegister.receiverConfigTypeNumber; j++)
{
lineFilterEn.push_back(static_cast<quint32>(floatArray[0][j]));
lineFilterEn.push_back(static_cast<quint32>(floatArray[j]));
}
// /**************** /registerParameters/receiverConfigProperties/dpeEn ********************/
// datasetBranch <float_t>("/registerParameters/receiverConfigProperties/dpeEn", floatArray);
// QList<quint32> dpeEn;
/**************** /registerParameters/receiverConfigProperties/dpeEn ********************/
datasetBranch <float_t>("/registerParameters/receiverConfigProperties/dpeEn", floatArray);
QList<quint32> dpeEn;
// for (quint32 j = 0; j < scenParams.hwRegister.receiverConfigTypeNumber; j++)
// {
// dpeEn.push_back(static_cast<quint32>(floatArray[0][j]));
// }
for (quint32 j = 0; j < scenParams.hwRegister.receiverConfigTypeNumber; j++)
{
dpeEn.push_back(static_cast<quint32>(floatArray[j]));
}
// /**************** /registerParameters/receiverConfigProperties/ddcEn ********************/
// datasetBranch <float_t>("/registerParameters/receiverConfigProperties/ddcEn", floatArray);
// QList<quint32> ddcEn;
/**************** /registerParameters/receiverConfigProperties/ddcEn ********************/
datasetBranch <float_t>("/registerParameters/receiverConfigProperties/ddcEn", floatArray);
QList<quint32> ddcEn;
// for (quint32 j = 0; j < scenParams.hwRegister.receiverConfigTypeNumber; j++)
// {
// ddcEn.push_back(static_cast<quint32>(floatArray[0][j]));
// }
for (quint32 j = 0; j < scenParams.hwRegister.receiverConfigTypeNumber; j++)
{
ddcEn.push_back(static_cast<quint32>(floatArray[j]));
}
// /**************** /registerParameters/receiverConfigProperties/wmfEn ********************/
// datasetBranch <float_t>("/registerParameters/receiverConfigProperties/wmfEn", floatArray);
// QList<quint32> wmfEn;
/**************** /registerParameters/receiverConfigProperties/wmfEn ********************/
datasetBranch <float_t>("/registerParameters/receiverConfigProperties/wmfEn", floatArray);
QList<quint32> wmfEn;
// for (quint32 j = 0; j < scenParams.hwRegister.receiverConfigTypeNumber; j++)
// {
// wmfEn.push_back(static_cast<quint32>(floatArray[0][j]));
// }
for (quint32 j = 0; j < scenParams.hwRegister.receiverConfigTypeNumber; j++)
{
wmfEn.push_back(static_cast<quint32>(floatArray[j]));
}
/**************** /registerParameters/receiverConfigProperties ********************/
ReceiverConfig_t receiverCfgObj;
@ -3117,11 +3122,11 @@ void MainWindow::setScenario(const string &h5Path)
{
receiverCfgObj.mla = receiverCfgMla.at(j);
receiverCfgObj.stb = stb.at(j);
receiverCfgObj.ddcn = 1;
receiverCfgObj.ddcn = ddcEn.at(j);
receiverCfgObj.absEn = absEn.at(j);
receiverCfgObj.dpeEn = 0;
receiverCfgObj.dpeEn = dpeEn.at(j);
receiverCfgObj.stbEn = stbEn.at(j);
receiverCfgObj.wmfEn = 0;
receiverCfgObj.wmfEn = wmfEn.at(j);
receiverCfgObj.lpfSel = lpfSel.at(j);
receiverCfgObj.aTgcSel = aTgcSel.at(j);
receiverCfgObj.focusNo = focusNo.at(j);
@ -3134,13 +3139,7 @@ void MainWindow::setScenario(const string &h5Path)
scenParams.hwRegister.receiverConfigProps.push_back(receiverCfgObj);
}
// for (auto i=0; i<1; i++)
// {
// for(auto j=0; j<20; j++)
// {
// qDebug() << scenParams.hwRegister.atgcLut[3][j];
// }
// }
_trx.setScenario(scenParams);
@ -3150,6 +3149,29 @@ void MainWindow::setScenario(const string &h5Path)
qDebug() << e.what();
}
//QString saveFile = QFileDialog::getSaveFileName(this, "Save");
QString saveFile = "/home/hasis/Desktop/Develop_HardwareTest/saveSram.bin";
QFile sramFile(saveFile);
if (!sramFile.open(QIODevice::WriteOnly)){
QMessageBox::warning(this, "Warning", "Cann't save the file: " + sramFile.errorString());
return;
}
quint32 num(0);
quint64 value(0);
while (num < SRAM_SIZE/4)
{
value = _usd->device->device.readLong(BAR_SRAM, static_cast<quint32>(num));
sramFile.write(Uint2ByteArray<quint64>(value));
num += sizeof (quint64);
}
sramFile.flush();
sramFile.close();
ui->l_scenFillingDone->setText("done");
changeLabelTextColor(ui->l_scenFillingDone, Qt::green);
}
@ -3183,8 +3205,6 @@ void MainWindow::on_btn_setScenario_clicked()
}
/*************************************************************************************************/
void MainWindow::on_btn_setAtgcMode_clicked()
{
auto aTgcMode = ui->cb_aTgcMode->currentIndex();
@ -3197,6 +3217,18 @@ void MainWindow::on_btn_setAtgcMode_clicked()
_trx.setAtgcMode(Manual, static_cast<quint16>(aTgcValue));
}
/*************************************************************************************************/
template<class T>
QByteArray MainWindow::Uint2ByteArray(T data)
{
QByteArray byte;
QDataStream out (&byte, QIODevice::WriteOnly);
out.setByteOrder(QDataStream::LittleEndian);
out << data;
return byte;
}
/*************************************************************************************************/
/**************************************** EEPROM *************************************************/
/*************************************************************************************************/

13
mainwindow.h

@ -64,8 +64,7 @@
#define ULTIMATE_LOG_COUNT 50
#define MAX_ARRAY_LENGTH 3057U
#define MAX_ARRAY_DEPTH 4U
#define MAX_ARRAY_DEPTH 131072U
QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
@ -126,11 +125,15 @@ private:
H5File _file;
int32_t intArray [MAX_ARRAY_DEPTH][MAX_ARRAY_LENGTH];
float_t floatArray[MAX_ARRAY_DEPTH][MAX_ARRAY_LENGTH];
// int32_t intArray [MAX_ARRAY_DEPTH][MAX_ARRAY_LENGTH];
// float_t floatArray[MAX_ARRAY_DEPTH][MAX_ARRAY_LENGTH];
float_t floatArray[MAX_ARRAY_DEPTH];
template<class T>
void datasetBranch(const string& branchPath, T datasetValue[][3057]);
void datasetBranch(const string& branchPath, T datasetValue[MAX_ARRAY_DEPTH]);
template<class T>
QByteArray Uint2ByteArray(T data);
void setScenario(const string& h5Path);

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

@ -34,9 +34,9 @@ void TrxBoard::readData()
_device.copy(_hwCounter - 1, _swCounter);
auto temp = QByteArray::fromRawData(_device.getBufferPtr(_swCounter), BUFFER_SIZE);
packetEngine.newData(temp);
//packetEngine.newData(temp);
//emit sendFramePacket(temp);
emit sendFramePacket(temp);
_swCounter++;
if(_swCounter >= SW_BUFFER_NUM)
@ -136,10 +136,9 @@ TrxBoard::TrxBoard() : _offsetSlave0(0), _offsetSlave1(0x400000), _offsetSlave2(
_sram = new Sram(&_device);
_dsp = new Dsp(&_device);
_adc = new AdcVoltages;
_pg = new VoltagesPg;
scenParams = new ScenGenHardwareOutput;
scenParams = new ScenGenHardwareOutput;
_allow = false;
_run = false;
@ -181,7 +180,7 @@ TrxBoard::~TrxBoard()
delete _adc;
delete _pg;
delete scenParams;
delete scenParams;
}
TrxBoard::HwRegister::~HwRegister()
@ -211,7 +210,7 @@ void TrxBoard::setScenario(ScenGenHardwareOutput_t scenGenHw)
{
scenParams->focusTypeNumber = scenGenHw.focusTypeNumber;
scenParams->totalTxShotNumber = scenGenHw.totalTxShotNumber;
scenParams->rxBeamFormerNumber = scenGenHw.rxBeamFormerNumber;
scenParams->rxBeamFormerNumber = scenGenHw.rxBeamFormerNumber.toVector();
scenParams->scenarioStartIndex = scenGenHw.hwRegister.scenarioStartIndex;
scenParams->scenarioEndIndex = scenGenHw.hwRegister.scenarioEndIndex;
@ -527,8 +526,12 @@ QList<quint32> TrxBoard::getAfeReg(eSlaveSelect sel, quint32 afeRegAddr)
switch (sel)
{
case slave0 :
case slave0:
this->_afeSlave0->setReadRegEnable(true);
this->_bCtrlMngt->timerShot(1);
while(!(this->_bCtrlMngt->checkTimeout()));
for (quint8 i=0; i < _afeModuleOffset.size(); i++)
{
offset = (_fpgaOffset.at(slave0) + _afeModuleOffset.at(i) + afeRegAddr) * 4;
@ -537,8 +540,12 @@ QList<quint32> TrxBoard::getAfeReg(eSlaveSelect sel, quint32 afeRegAddr)
this->_afeSlave0->setReadRegEnable(false);
break;
case slave1 :
case slave1:
this->_afeSlave1->setReadRegEnable(true);
this->_bCtrlMngt->timerShot(1);
while(!(this->_bCtrlMngt->checkTimeout()));
for (quint8 i=0; i < _afeModuleOffset.size(); i++)
{
offset = (_fpgaOffset.at(slave1) + _afeModuleOffset.at(i) + afeRegAddr) * 4;
@ -547,8 +554,12 @@ QList<quint32> TrxBoard::getAfeReg(eSlaveSelect sel, quint32 afeRegAddr)
this->_afeSlave1->setReadRegEnable(false);
break;
case slave2 :
case slave2:
this->_afeSlave2->setReadRegEnable(true);
this->_bCtrlMngt->timerShot(1);
while(!(this->_bCtrlMngt->checkTimeout()));
for (quint8 i=0; i < _afeModuleOffset.size(); i++)
{
offset = (_fpgaOffset.at(slave2) + _afeModuleOffset.at(i) + afeRegAddr) * 4;

53
src/model/hardware/core/register/Register.cpp

@ -54,7 +54,13 @@ bool Register::isUpdated()
auto temp = _isUpdated;
_isUpdated = false;
return temp;
return temp;
}
/*************************************************************************************************/
void Register::clearCumulative(void)
{
cumulativeValue=0;
}
/*************************************************************************************************/
@ -106,22 +112,41 @@ void Register::updateArray(bool isVariable, quint8 arrayLength) //update arra
}
/*************************************************************************************************/
void Register::updateArrayLong(quint8 interval, quint32 arrayLength)
void Register::updateArrayLong(quint8 interval, quint32 arrayLength, bool _isCumulative)
{
quint64 value;
for(quint32 i = 0; i < arrayLength; i++)
{
prepareData(i);
value = 0;
for(auto j = 0; j < _fields.length(); j++)
{
value |= _fields[j]->getRegisterWriteValueLong();
}
_device->device.writeLong(_bar, _offset + interval * i * 8, value);
}
if (_isCumulative)
{
for(quint32 i = 0; i < arrayLength; i++)
{
prepareData(cumulativeValue);
value = 0;
for(auto j = 0; j < _fields.length(); j++)
{
value |= _fields[j]->getRegisterWriteValueLong();
}
_device->device.writeLong(_bar, _offset + interval * i * 8, value);
cumulativeValue++;
}
}
else
{
for(quint32 i = 0; i < arrayLength; i++)
{
prepareData(i);
value = 0;
for(auto j = 0; j < _fields.length(); j++)
{
value |= _fields[j]->getRegisterWriteValueLong();
}
_device->device.writeLong(_bar, _offset + interval * i * 8, value);
}
}
}
/*************************************************************************************************/

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

@ -30,12 +30,12 @@ void FpgaProgram::program(QByteArray& bitFileData, quint8 number)
setSlaveFpgaNumber(number);
// QProgressDialog progress;
// progress.setMinimumSize(300,100);
// progress.setLabelText("Please wait...");
// progress.setWindowTitle("Slaves FPGA Programming");
// progress.setRange(0,bitFileData.size());
// progress.setModal(true);
QProgressDialog progress;
progress.setMinimumSize(300,100);
progress.setLabelText("Please wait...");
progress.setWindowTitle("Slaves FPGA Programming");
progress.setRange(0,bitFileData.size());
progress.setModal(true);
while(progByte < bitFileData.size())
{
@ -70,9 +70,9 @@ void FpgaProgram::program(QByteArray& bitFileData, quint8 number)
"Timeout is happened and the programming of the slave FPGAs is failed");
}
// progress.setValue(progByte);
// if (progress.wasCanceled())
// throw SonoException("Slaves fpga programming is canceled");
progress.setValue(progByte);
if (progress.wasCanceled())
throw SonoException("Slaves fpga programming is canceled");
temp.clear();
progByte += sizeof(quint32);

31
src/model/hardware/core/register/sram/Sram.cpp

@ -33,42 +33,47 @@ void Sram::setSramIndex(quint32 &totalTxShotNumber, SramIndex *index) const
void Sram::setSramTx(quint32 &focusTypeNumber, SramTx *tx) const
{
this->_tx->setTxParams(tx);
this->_tx->updateArrayLong(TX_RX_INTERVAL, focusTypeNumber);
this->_tx->updateArrayLong(TX_INTERVAL, focusTypeNumber);
this->_txFocus->setTxParamsFocus(tx);
this->_txFocus->updateArrayLong(TX_RX_INTERVAL, focusTypeNumber);
this->_txFocus->updateArrayLong(TX_INTERVAL, focusTypeNumber);
}
void Sram::setSramRx(QVector<quint8> &rxBeamFormerNumber, quint32 &focusTypeNumber, SramRx *rx) const
{
this->_rx->setRxParams(rx);
this->_rx->updateArrayLong(TX_RX_INTERVAL, focusTypeNumber);
this->_rx->updateArrayLong(TX_INTERVAL, focusTypeNumber);
quint32 rxDegreeBaseOffset = this->_rxDegree->getCurrentOffset();
quint32 rxPosBaseOffset = this->_rxPos->getCurrentOffset();
quint32 rxDelayBaseOffset = this->_rxDelay->getCurrentOffset();
this->_rxDegree->clearCumulative();
this->_rxPos->clearCumulative();
this->_rxDelay->clearCumulative();
this->_rxDegree->setRxParamsDegree(rx);
this->_rxPos->setRxParamsPos(rx);
this->_rxDelay->setRxParamsDelay(rx);
for (quint32 i=0; i < focusTypeNumber; i++)
{
this->_rxDegree->setRxParamsDegree(rx);
this->_rxDegree->updateArrayLong(INNER_RX_INTERVAL, rxBeamFormerNumber.at(static_cast<qint32>(i)));
this->_rxDegree->updateArrayLong(INNER_RX_INTERVAL, rxBeamFormerNumber.at(static_cast<qint32>(i)), true);
quint32 rxDegreeCurOffset = this->_rxDegree->getCurrentOffset();
this->_rxDegree->changeOffset(rxDegreeCurOffset + TX_RX_INTERVAL);
this->_rxDegree->changeOffset(rxDegreeCurOffset + RX_INTERVAL);
this->_rxPos->setRxParamsPos(rx);
this->_rxPos->updateArrayLong(INNER_RX_INTERVAL, rxBeamFormerNumber.at(static_cast<qint32>(i)));
this->_rxPos->updateArrayLong(INNER_RX_INTERVAL, rxBeamFormerNumber.at(static_cast<qint32>(i)), true);
quint32 rxPosCurOffset = this->_rxPos->getCurrentOffset();
this->_rxPos->changeOffset(rxPosCurOffset + TX_RX_INTERVAL);
this->_rxPos->changeOffset(rxPosCurOffset + RX_INTERVAL);
this->_rxDelay->setRxParamsDelay(rx);
this->_rxDelay->updateArrayLong(INNER_RX_INTERVAL, rxBeamFormerNumber.at(static_cast<qint32>(i)));
this->_rxDelay->updateArrayLong(INNER_RX_INTERVAL, rxBeamFormerNumber.at(static_cast<qint32>(i)), true);
quint32 rxDelayCurOffset = this->_rxDelay->getCurrentOffset();
this->_rxDelay->changeOffset(rxDelayCurOffset + TX_RX_INTERVAL);
this->_rxDelay->changeOffset(rxDelayCurOffset + RX_INTERVAL);
}
this->_rxDegree->changeOffset(rxDegreeBaseOffset); // return to base offset address
this->_rxPos->changeOffset(rxPosBaseOffset); // return to base offset address
this->_rxDelay->changeOffset(rxDelayBaseOffset ); // return to base offset address
this->_rxDelay->changeOffset(rxDelayBaseOffset); // return to base offset address
}
void Sram::setSramMetaData(QList<quint64> &metaData) const

Loading…
Cancel
Save