Browse Source

DMA Busy is added

Scen stop calling is depend to scen start
Set scenario compare is added
Eeproms are modified to new structures
master
Arash Aletayeb 3 years ago
parent
commit
9601096c43
  1. 5
      developHw.pro
  2. 6
      developHw.pro.user
  3. 676
      hdf5Scenario/hdf5Scenario.cpp
  4. 35
      hdf5Scenario/hdf5Scenario.h
  5. 96
      include/model/hardware/core/TrxBoard.h
  6. 10
      include/model/hardware/core/TrxBoardUtils/PreProcessorDef.h
  7. 28
      include/model/hardware/core/TrxBoardUtils/ScenParamsRanges.h
  8. 12
      include/model/hardware/core/TrxBoardUtils/TrxBoardEnums.h
  9. 30
      include/model/hardware/core/TrxBoardUtils/TrxBoardStructures.h
  10. 37
      include/model/hardware/core/register/afe/registerDefinition/AdcSyncStatus.h
  11. 1
      include/model/hardware/core/register/fpgaProgram/FpgaProgram.h
  12. 3
      include/model/hardware/core/register/scenPlayer/ScenPlayer.h
  13. 2
      include/model/hardware/core/register/sram/registerDefinition/Index.h
  14. 1
      include/model/hardware/device/SonoDevice.h
  15. 15
      include/model/scenarioGenerator/dto/hardware/HardwareOutput.h
  16. 1
      include/model/scenarioGenerator/dto/hardware/HwScenarioDependent.h
  17. 1778
      mainwindow.cpp
  18. 99
      mainwindow.h
  19. 1090
      mainwindow.ui
  20. 629
      src/model/hardware/core/TrxBoard.cpp
  21. 10
      src/model/hardware/core/register/boardsCtrlMngt/BoardsCtrlMngt.cpp
  22. 23
      src/model/hardware/core/register/fpgaProgram/FpgaProgram.cpp
  23. 9
      src/model/hardware/core/register/scenPlayer/ScenPlayer.cpp
  24. 9
      src/model/hardware/device/SonoDevice.cpp

5
developHw.pro

@ -21,13 +21,16 @@ SOURCES += \
mainwindow.cpp \
qcustomplot.cpp \
api.cpp \
$$files(src/*.cpp, true)
$$files(src/*.cpp, true) \
$$files(hdf5Scenario/*.cpp, true) \
HEADERS += \
include/model/hardware/core/register/afe/registerDefinition/AdcSyncStatus.h \
mainwindow.h \
qcustomplot.h \
api.h \
$$files(include/*.h, true)
$$files(hdf5Scenario/*.h, true)
INCLUDEPATH += \
"$$PWD/include" \

6
developHw.pro.user

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 4.10.0, 2021-06-13T13:18:07. -->
<!-- Written by QtCreator 4.10.0, 2021-06-20T10:23:31. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>
@ -304,8 +304,8 @@
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">developHw</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">developHw2</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:/home/hasis/Desktop/New/Develop_HardwareTest/developHw/developHw.pro</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:/home/hasis/Desktop/Develop_HardwareTest/developHw/developHw.pro</value>
<value type="QString" key="RunConfiguration.Arguments"></value>
<value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value>
<value type="bool" key="RunConfiguration.UseCppDebugger">false</value>

676
hdf5Scenario/hdf5Scenario.cpp

@ -0,0 +1,676 @@
#include "hdf5Scenario.h"
template<class T>
void Hdf5::datasetBranch(const string &branchPath, T datasetValue[MAX_ARRAY_DEPTH])
{
const H5std_string datasetPath(branchPath);
DataSet datasetType = _file.openDataSet(datasetPath);
datasetType.read(datasetValue, PredType::NATIVE_FLOAT, H5S_ALL, H5S_ALL);
}
void Hdf5::hdf5Path(const string &h5Path)
{
const H5std_string filePath(h5Path);
H5File file (filePath, H5F_ACC_RDONLY);
_file = file;
}
void Hdf5::scenarioRead(ScenGenHardwareOutput_t &scenParams)
{
/****************** /sramParameters/frameType ******************/
datasetBranch <float_t>("/sramParameters/frameType", floatArray);
scenParams.frameType = static_cast<quint8>(floatArray[0]);
/****************** /sramParameters/totalTxShotNo ******************/
datasetBranch <float_t>("/sramParameters/totalTxShotNo", floatArray);
scenParams.totalTxShotNumber = static_cast<quint32>(floatArray[0]);
/******************* /sramParameters/focusTypeNo *******************/
datasetBranch <float_t>("/sramParameters/focusTypeNo", floatArray);
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[var]));
/**************** /sramParameters/pulseInterval ********************/
datasetBranch <float_t>("/sramParameters/pulseInterval", floatArray);
scenParams.pulseInterval.clear();
for (quint32 var = 0; var < scenParams.focusTypeNumber; 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.totalTxShotNumber; 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.totalTxShotNumber; 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.totalTxShotNumber; 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.totalTxShotNumber; 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.totalTxShotNumber; 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.totalTxShotNumber; 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.totalTxShotNumber; 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[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[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[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[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[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[var]));
/**************** /sramParameters/rxParameters/rxR0CenterActiveElementNo ********************/
datasetBranch <float_t>("/sramParameters/rxParameters/rxR0CenterActiveElementNo", floatArray);
scenParams.rxParams.rxR0CenterActiveElementNumber.clear();
quint32 accum = 0;
for (quint32 var = 0; var < scenParams.focusTypeNumber; var++)
for (quint8 var1 = 0; var1 < scenParams.rxBeamFormerNumber[static_cast<qint32>(var)]; var1++)
{
scenParams.rxParams.rxR0CenterActiveElementNumber.push_back(static_cast<quint32>(floatArray[accum]));
accum++;
}
/**************** /sramParameters/rxParameters/rxR0ActiveElementNo ********************/
datasetBranch <float_t>("/sramParameters/rxParameters/rxR0ActiveElementNo", floatArray);
scenParams.rxParams.rxR0ActiveElementNumber.clear();
accum = 0;
for (quint32 var = 0; var < scenParams.focusTypeNumber; var++)
for (quint8 var1 = 0; var1 < scenParams.rxBeamFormerNumber[static_cast<qint32>(var)]; var1++)
{
scenParams.rxParams.rxR0ActiveElementNumber.push_back(static_cast<quint32>(floatArray[accum]));
accum++;
}
/**************** /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[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[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[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[var]);
/**************** /sramParameters/rxParameters/thetaCos ********************/
datasetBranch <float_t>("/sramParameters/rxParameters/thetaCos", floatArray);
scenParams.rxParams.thetaCos.clear();
accum = 0;
for (quint32 var = 0; var < scenParams.focusTypeNumber; var++)
for (quint8 var1 = 0; var1 < scenParams.rxBeamFormerNumber[static_cast<qint32>(var)]; var1++)
{
scenParams.rxParams.thetaCos.push_back(floatArray[accum]);
accum++;
}
/**************** /sramParameters/rxParameters/thetaSin ********************/
datasetBranch <float_t>("/sramParameters/rxParameters/thetaSin", floatArray);
scenParams.rxParams.thetaSin.clear();
accum = 0;
for (quint32 var = 0; var < scenParams.focusTypeNumber; var++)
for (quint8 var1 = 0; var1 < scenParams.rxBeamFormerNumber[static_cast<qint32>(var)]; var1++)
{
scenParams.rxParams.thetaSin.push_back(floatArray[accum]);
accum++;
}
/**************** /sramParameters/rxParameters/phiCos ********************/
datasetBranch <float_t>("/sramParameters/rxParameters/phiCos", floatArray);
scenParams.rxParams.phiCos.clear();
accum = 0;
for (quint32 var = 0; var < scenParams.focusTypeNumber; var++)
for (quint8 var1 = 0; var1 < scenParams.rxBeamFormerNumber[static_cast<qint32>(var)]; var1++)
{
scenParams.rxParams.phiCos.push_back(floatArray[accum]);
accum++;
}
/**************** /sramParameters/rxParameters/phiSin ********************/
datasetBranch <float_t>("/sramParameters/rxParameters/phiSin", floatArray);
scenParams.rxParams.phiSin.clear();
accum = 0;
for (quint32 var = 0; var < scenParams.focusTypeNumber; var++)
for (quint8 var1 = 0; var1 < scenParams.rxBeamFormerNumber[static_cast<qint32>(var)]; var1++)
{
scenParams.rxParams.phiSin.push_back(floatArray[accum]);
accum++;
}
/**************** /sramParameters/rxParameters/interceptXPos ********************/
datasetBranch <float_t>("/sramParameters/rxParameters/interceptXPos", floatArray);
scenParams.rxParams.interceptXPos.clear();
accum = 0;
for (quint32 var = 0; var < scenParams.focusTypeNumber; var++)
for (quint8 var1 = 0; var1 < scenParams.rxBeamFormerNumber[static_cast<qint32>(var)]; var1++)
{
scenParams.rxParams.interceptXPos.push_back(floatArray[accum]);
accum++;
}
/**************** /sramParameters/rxParameters/interceptYPos ********************/
datasetBranch <float_t>("/sramParameters/rxParameters/interceptYPos", floatArray);
scenParams.rxParams.interceptYPos.clear();
accum = 0;
for (quint32 var = 0; var < scenParams.focusTypeNumber; var++)
for (quint8 var1 = 0; var1 < scenParams.rxBeamFormerNumber[static_cast<qint32>(var)]; var1++)
{
scenParams.rxParams.interceptYPos.push_back(floatArray[accum]);
accum++;
}
/**************** /sramParameters/rxParameters/interceptZPos ********************/
datasetBranch <float_t>("/sramParameters/rxParameters/interceptZPos", floatArray);
scenParams.rxParams.interceptZPos.clear();
accum = 0;
for (quint32 var = 0; var < scenParams.focusTypeNumber; var++)
for (quint8 var1 = 0; var1 < scenParams.rxBeamFormerNumber[static_cast<qint32>(var)]; var1++)
{
scenParams.rxParams.interceptZPos.push_back(floatArray[accum]);
accum++;
}
/**************** /sramParameters/rxParameters/txR0MinDelayQ ********************/
datasetBranch <float_t>("/sramParameters/rxParameters/txR0MinDelayQ", floatArray);
scenParams.rxParams.txR0MinDelayQ.clear();
accum = 0;
for (quint32 var = 0; var < scenParams.focusTypeNumber; var++)
for (quint8 var1 = 0; var1 < scenParams.rxBeamFormerNumber[static_cast<qint32>(var)]; var1++)
{
scenParams.rxParams.txR0MinDelayQ.push_back(static_cast<quint32>(floatArray[accum]));
accum++;
}
/**************** /sramParameters/rxParameters/rxR0MinDelayQ ********************/
datasetBranch <float_t>("/sramParameters/rxParameters/rxR0MinDelayQ", floatArray);
scenParams.rxParams.rxR0MinDelayQ.clear();
accum = 0;
for (quint32 var = 0; var < scenParams.focusTypeNumber; var++)
for (quint8 var1 = 0; var1 < scenParams.rxBeamFormerNumber[static_cast<qint32>(var)]; var1++)
{
scenParams.rxParams.rxR0MinDelayQ.push_back(static_cast<quint32>(floatArray[accum]));
accum++;
}
/**************** /sramParameters/rxParameters/rxR0MaxDelayQ ********************/
datasetBranch <float_t>("/sramParameters/rxParameters/rxR0MaxDelayQ", floatArray);
scenParams.rxParams.rxR0MaxDelayQ.clear();
accum = 0;
for (quint32 var = 0; var < scenParams.focusTypeNumber; var++)
for (quint8 var1 = 0; var1 < scenParams.rxBeamFormerNumber[static_cast<qint32>(var)]; var1++)
{
scenParams.rxParams.rxR0MaxDelayQ.push_back(static_cast<quint32>(floatArray[accum]));
accum++;
}
/**************** /registerParameters/pulseTypeNo ********************/
datasetBranch <float_t>("/registerParameters/pulseTypeNo", floatArray);
scenParams.hwRegister.pulseTypeNumber = static_cast<quint8>(floatArray[0]);
/**************** /registerParameters/rxBeamformerTypeNo ********************/
datasetBranch <float_t>("/registerParameters/rxBeamformerTypeNo", floatArray);
scenParams.hwRegister.rxBeamFormerTypeNumber = static_cast<quint8>(floatArray[0]);
/**************** /registerParameters/receiverConfigTypeNo ********************/
datasetBranch <float_t>("/registerParameters/receiverConfigTypeNo", floatArray);
scenParams.hwRegister.receiverConfigTypeNumber = static_cast<quint8>(floatArray[0]);
/**************** /registerParameters/blendWeight ********************/
datasetBranch <float_t>("/registerParameters/blendWeight", floatArray);
scenParams.hwRegister.blendWeight.clear();
QVector <float> tempBlendWeight;
for (quint32 i = 0; i < 4; i++)
{
tempBlendWeight.clear();
for (quint32 j = 0; j < 512; j++)
{
tempBlendWeight.push_back(floatArray[j + i * 512]);
}
scenParams.hwRegister.blendWeight.push_back(tempBlendWeight);
}
/**************** /registerParameters/freqLut ********************/
datasetBranch <float_t>("/registerParameters/freqLut", floatArray);
scenParams.hwRegister.freqLut.clear();
for (quint32 var = 0; var < 8; 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[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[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[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[var]);
/**************** /registerParameters/scenarioStartIndex ********************/
datasetBranch <float_t>("/registerParameters/scenarioStartIndex", floatArray);
scenParams.hwRegister.scenarioStartIndex = static_cast<quint32>(floatArray[0]);
/**************** /registerParameters/scenarioEndIndex ********************/
datasetBranch <float_t>("/registerParameters/scenarioEndIndex", floatArray);
scenParams.hwRegister.scenarioEndIndex = static_cast<quint32>(floatArray[0]);
/**************** /registerParameters/pulseProperties/halfPeriod ********************/
datasetBranch <float_t>("/registerParameters/pulseProperties/halfPeriod", floatArray);
QList<quint32> halfPeriod;
for (quint32 j = 0; j < scenParams.hwRegister.pulseTypeNumber; j++)
{
halfPeriod.push_back(static_cast<quint32>(floatArray[j]));
}
/**************** /registerParameters/pulseProperties/halfCycleNo ********************/
datasetBranch <float_t>("/registerParameters/pulseProperties/halfCycleNo", floatArray);
QList<quint32> halfCycleNo;
for (quint32 j = 0; j < scenParams.hwRegister.pulseTypeNumber; j++)
{
halfCycleNo.push_back(static_cast<quint32>(floatArray[j]));
}
/**************** /registerParameters/pulseProperties/pulseVoltSel ********************/
datasetBranch <float_t>("/registerParameters/pulseProperties/pulseVoltSel", floatArray);
QList<bool> pulseVoltSel;
for (quint32 j = 0; j < scenParams.hwRegister.pulseTypeNumber; j++)
{
pulseVoltSel.push_back(static_cast<bool>(floatArray[j]));
}
/**************** /registerParameters/pulseProperties/startPhase ********************/
datasetBranch <float_t>("/registerParameters/pulseProperties/startPhase", floatArray);
QList<bool> startPhase;
for (quint32 j = 0; j < scenParams.hwRegister.pulseTypeNumber; j++)
{
startPhase.push_back(static_cast<bool>(floatArray[j]));
}
/**************** /registerParameters/pulseProperties/dampingPulseWidth ********************/
datasetBranch <float_t>("/registerParameters/pulseProperties/dampingPulseWidth", floatArray);
QList<quint32> dampingPulseWidth;
for (quint32 j = 0; j < scenParams.hwRegister.pulseTypeNumber; j++)
{
dampingPulseWidth.push_back(static_cast<quint32>(floatArray[j]));
}
/**************** /registerParameters/pulseProperties ********************/
Pulse_t pulseObj;
scenParams.hwRegister.pulseProps.clear();
for (qint32 j = 0; j < scenParams.hwRegister.pulseTypeNumber; j++)
{
pulseObj.halfPeriod = halfPeriod.at(j);
pulseObj.startPhase = startPhase.at(j);
pulseObj.halfCycleNo = halfCycleNo.at(j);
pulseObj.pulseVoltSel = pulseVoltSel.at(j);
pulseObj.dampingPulseWidth = dampingPulseWidth.at(j);
scenParams.hwRegister.pulseProps.push_back(pulseObj);
}
/**************** /registerParameters/rxBeamformerProperties/mla ********************/
datasetBranch <float_t>("/registerParameters/rxBeamformerProperties/mla", floatArray);
QList<quint32> mla;
for (quint32 j = 0; j < scenParams.hwRegister.rxBeamFormerTypeNumber; j++)
{
mla.push_back(static_cast<quint32>(floatArray[j]));
}
/**************** /registerParameters/rxBeamformerProperties/lag ********************/
datasetBranch <float_t>("/registerParameters/rxBeamformerProperties/lag", floatArray);
QList<quint32> lag;
for (quint32 j = 0; j < scenParams.hwRegister.rxBeamFormerTypeNumber; j++)
{
lag.push_back(static_cast<quint32>(floatArray[j]));
}
/**************** /registerParameters/rxBeamformerProperties/apodizationSel ********************/
datasetBranch <float_t>("/registerParameters/rxBeamformerProperties/apodizationSel", floatArray);
QList<quint32> apodizationSel;
for (quint32 j = 0; j < scenParams.hwRegister.rxBeamFormerTypeNumber; j++)
{
apodizationSel.push_back(static_cast<quint32>(floatArray[j]));
}
/**************** /registerParameters/rxBeamformerProperties ********************/
RxBeamFormer_t rxBeamformerObj;
scenParams.hwRegister.rxBeamFormerProps.clear();
for (qint32 j = 0; j < scenParams.hwRegister.rxBeamFormerTypeNumber; j++)
{
rxBeamformerObj.mla = mla.at(j);
rxBeamformerObj.lag = lag.at(j);
rxBeamformerObj.apodizationSel = apodizationSel.at(j);
scenParams.hwRegister.rxBeamFormerProps.push_back(rxBeamformerObj);
}
/**************** /registerParameters/receiverConfigProperties/mla ********************/
datasetBranch <float_t>("/registerParameters/receiverConfigProperties/mla", floatArray);
QList<quint32> receiverCfgMla;
for (quint32 j = 0; j < scenParams.hwRegister.receiverConfigTypeNumber; j++)
{
receiverCfgMla.push_back(static_cast<quint32>(floatArray[j]));
}
/**************** /registerParameters/receiverConfigProperties/lineMode ********************/
datasetBranch <float_t>("/registerParameters/receiverConfigProperties/lineMode", floatArray);
QList<quint32> lineMode;
for (quint32 j = 0; j < scenParams.hwRegister.receiverConfigTypeNumber; j++)
{
lineMode.push_back(static_cast<quint32>(floatArray[j]));
}
/**************** /registerParameters/receiverConfigProperties/aTgcSel ********************/
datasetBranch <float_t>("/registerParameters/receiverConfigProperties/aTgcSel", floatArray);
QList<quint32> aTgcSel;
for (quint32 j = 0; j < scenParams.hwRegister.receiverConfigTypeNumber; j++)
{
aTgcSel.push_back(static_cast<quint32>(floatArray[j]));
}
/**************** /registerParameters/receiverConfigProperties/stbEn ********************/
datasetBranch <float_t>("/registerParameters/receiverConfigProperties/stbEn", floatArray);
QList<quint32> stbEn;
for (quint32 j = 0; j < scenParams.hwRegister.receiverConfigTypeNumber; j++)
{
stbEn.push_back(static_cast<quint32>(floatArray[j]));
}
/**************** /registerParameters/receiverConfigProperties/stb ********************/
datasetBranch <float_t>("/registerParameters/receiverConfigProperties/stb", floatArray);
QList<quint32> stb;
for (quint32 j = 0; j < scenParams.hwRegister.receiverConfigTypeNumber; j++)
{
stb.push_back(static_cast<quint32>(floatArray[j]));
}
/**************** /registerParameters/receiverConfigProperties/subtractFilterEn ********************/
datasetBranch <float_t>("/registerParameters/receiverConfigProperties/subtractFilterEn", floatArray);
QList<quint32> subtractFilterEn;
for (quint32 j = 0; j < scenParams.hwRegister.receiverConfigTypeNumber; j++)
{
subtractFilterEn.push_back(static_cast<quint32>(floatArray[j]));
}
/**************** /registerParameters/receiverConfigProperties/dcCancelEn ********************/
datasetBranch <float_t>("/registerParameters/receiverConfigProperties/dcCancelEn", floatArray);
QList<quint32> dcCancelEn;
for (quint32 j = 0; j < scenParams.hwRegister.receiverConfigTypeNumber; j++)
{
dcCancelEn.push_back(static_cast<quint32>(floatArray[j]));
}
/**************** /registerParameters/receiverConfigProperties/ncoFreqSel ********************/
datasetBranch <float_t>("/registerParameters/receiverConfigProperties/ncoFreqSel", floatArray);
QList<quint32> ncoFreqSel;
for (quint32 j = 0; j < scenParams.hwRegister.receiverConfigTypeNumber; j++)
{
ncoFreqSel.push_back(static_cast<quint32>(floatArray[j]));
}
/**************** /registerParameters/receiverConfigProperties/lpfSel ********************/
datasetBranch <float_t>("/registerParameters/receiverConfigProperties/lpfSel", floatArray);
QList<quint32> lpfSel;
for (quint32 j = 0; j < scenParams.hwRegister.receiverConfigTypeNumber; j++)
{
lpfSel.push_back(static_cast<quint32>(floatArray[j]));
}
/**************** /registerParameters/receiverConfigProperties/absEn ********************/
datasetBranch <float_t>("/registerParameters/receiverConfigProperties/absEn", floatArray);
QList<quint32> absEn;
for (quint32 j = 0; j < scenParams.hwRegister.receiverConfigTypeNumber; j++)
{
absEn.push_back(static_cast<quint32>(floatArray[j]));
}
/**************** /registerParameters/receiverConfigProperties/focusNo ********************/
datasetBranch <float_t>("/registerParameters/receiverConfigProperties/focusNo", floatArray);
QList<quint32> focusNo;
for (quint32 j = 0; j < scenParams.hwRegister.receiverConfigTypeNumber; j++)
{
focusNo.push_back(static_cast<quint32>(floatArray[j]));
}
/**************** /registerParameters/receiverConfigProperties/lineFilterEn ********************/
datasetBranch <float_t>("/registerParameters/receiverConfigProperties/lineFilterEn", floatArray);
QList<quint32> lineFilterEn;
for (quint32 j = 0; j < scenParams.hwRegister.receiverConfigTypeNumber; j++)
{
lineFilterEn.push_back(static_cast<quint32>(floatArray[j]));
}
/**************** /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[j]));
}
/**************** /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[j]));
}
/**************** /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[j]));
}
/**************** /registerParameters/receiverConfigProperties ********************/
ReceiverConfig_t receiverCfgObj;
scenParams.hwRegister.receiverConfigProps.clear();
for (qint32 j = 0; j < scenParams.hwRegister.receiverConfigTypeNumber; j++)
{
receiverCfgObj.mla = receiverCfgMla.at(j);
receiverCfgObj.stb = stb.at(j);
receiverCfgObj.ddcn = ddcEn.at(j);
receiverCfgObj.absEn = absEn.at(j);
receiverCfgObj.dpeEn = dpeEn.at(j);
receiverCfgObj.stbEn = stbEn.at(j);
receiverCfgObj.wmfEn = wmfEn.at(j);
receiverCfgObj.lpfSel = lpfSel.at(j);
receiverCfgObj.aTgcSel = aTgcSel.at(j);
receiverCfgObj.focusNo = focusNo.at(j);
receiverCfgObj.lineMode = lineMode.at(j);
receiverCfgObj.dcCancelEn = dcCancelEn.at(j);
receiverCfgObj.ncoFreqSel = ncoFreqSel.at(j);
receiverCfgObj.lineFilterEn = lineFilterEn.at(j);
receiverCfgObj.subtractFilterEn = subtractFilterEn.at(j);
scenParams.hwRegister.receiverConfigProps.push_back(receiverCfgObj);
}
}
void Hdf5::prbDependParamsRead(ScenPrbDepHardwareParam &prbDepParams)
{
/**************** /registerParameters/apodizationLut ********************/
datasetBranch <float_t>("/registerParameters/apodizationLut", floatArray);
prbDepParams.prbDepParams.apodizationLut.clear();
QVector <quint32> tempApodization;
for (quint32 i = 0; i < 4; i++)
{
tempApodization.clear();
for (quint32 j = 0; j < 3057; j++)
{
tempApodization.push_back(static_cast<quint32>(floatArray[j + i * 3057]));
}
prbDepParams.prbDepParams.apodizationLut.push_back(tempApodization);
}
/**************** /registerParameters/aTgcLut ********************/
datasetBranch <float_t>("/registerParameters/aTgcLut", floatArray);
prbDepParams.prbDepParams.atgcLut.clear();
QVector <quint32> tempAtgc;
for (quint32 i = 0; i < 4; i++)
{
tempAtgc.clear();
for (quint32 j = 0; j < 128; j++)
{
tempAtgc.push_back(static_cast<quint32>(floatArray[j + i * 128]));
}
prbDepParams.prbDepParams.atgcLut.push_back(tempAtgc);
}
/**************** /registerParameters/lpfLut ********************/
datasetBranch <float_t>("/registerParameters/lpfLut", floatArray);
prbDepParams.prbDepParams.lpfLut.clear();
QVector <quint32> tempLpf;
for (quint32 i = 0; i < 4; i++)
{
tempLpf.clear();
for (quint32 j = 0; j < 48; j++)
{
tempLpf.push_back(static_cast<quint32>(floatArray[j + i * 48]));
}
prbDepParams.prbDepParams.lpfLut.push_back(tempLpf);
}
}
QVector<quint32> Hdf5::stbRead()
{
/**************** /registerParameters/stbLutQ ********************/
datasetBranch <float_t>("/registerParameters/stbLutQ", floatArray);
QVector<quint32> stb;
for (quint8 var = 0; var < 8; var++)
stb.push_back(static_cast<quint32>(floatArray[var]));
return stb;
}
QVector<float> Hdf5::lineFilterRead()
{
/**************** /registerParameters/lineFilterLutQ ********************/
datasetBranch <float_t>("/registerParameters/lineFilterLutQ", floatArray);
QVector<float> lineFilter;
for (quint8 var = 0; var < 3; var++)
lineFilter.push_back(floatArray[var]);
return lineFilter;
}

35
hdf5Scenario/hdf5Scenario.h

@ -0,0 +1,35 @@
#ifndef HDF5SCENARIO_H
#define HDF5SCENARIO_H
#include "H5Cpp.h"
#include "hdf5.h"
#include "H5File.h"
#include "model/hardware/core/TrxBoard.h"
#define MAX_ARRAY_DEPTH 131072U
using namespace std;
using namespace H5;
class Hdf5
{
private:
H5File _file;
float_t floatArray[MAX_ARRAY_DEPTH];
template<class T>
void datasetBranch(const string& branchPath, T datasetValue[MAX_ARRAY_DEPTH]);
public:
void hdf5Path (const string &h5Path);
void scenarioRead (ScenGenHardwareOutput_t &scenParams);
void prbDependParamsRead (ScenPrbDepHardwareParam &prbDepParams);
QVector<quint32> stbRead (void);
QVector<float> lineFilterRead (void);
};
#endif // HDF5SCENARIO_H

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

@ -23,6 +23,7 @@
#include "model/hardware/core/register/afe/Afe.h"
#include "model/hardware/device/SonoDevice.h"
#include "TrxBoardUtils/TrxBoardStructures.h"
#include "TrxBoardUtils/ScenParamsRanges.h"
#include "TrxBoardUtils/TrxBoardEnums.h"
#include "model/scenarioGenerator/dto/hardware/HardwareOutput.h"
@ -34,14 +35,17 @@
#define MOUNTED_SLAVE_FPGA 7U
#define CLOCK_DIVISION 0x55
#define EEPROM_ID_BYTE_BEGIN 19U
#define EEPROM_ID_BYTE_NUMBER 2U
#define EEPROM_INFO_BYTE_BEGIN 0U
#define EEPROM_INFO_BYTE_NUMBER 21U
#define EEPROM_CRC_BEGIN 0U
#define EEPROM_CRC_NUMBER 19U
#define EEPROM_ID_BEGIN 19U
#define EEPROM_ID_NUMBER 2U
#define EEPROM_INFO_BEGIN 30U
#define EEPROM_INFO_NUMBER 100U
#define EEPROM_IMPULSE_RESPONSE_BEGIN 428U
#define EEPROM_IMPULSE_RESPONSE_NUMBER 1024U
template<class T>
T byteArray2UintLittleEndian(QByteArray& byte);
#define EEPROM_NO_ERROR 0x0
#define EEPROM_CRC_ERROR 0x1
class TrxBoard : public QObject
{
@ -54,6 +58,7 @@ private:
QList<quint32>* _mcsList;
QList<quint32> _afeModuleOffset;
QList<quint32> _fpgaOffset;
QByteArray _eepromCrc;
const quint32 _offsetSlave0;
const quint32 _offsetSlave1;
const quint32 _offsetSlave2;
@ -89,11 +94,10 @@ private:
set
};
struct HwRegister
struct ScenHwRegister
{
///////////// BeamFormer /////////////
RxBeamformerProperties* rxBeamformer;
QList<QVector<quint32> > apodization;
ProbeElementPosition* elementPosition;
PulseProperties* pulse;
quint8 pulseTypeNumber;
@ -102,43 +106,51 @@ private:
//////////////// DSP ////////////////
QVector<float> freqLut;
QVector<float> dtgcLut;
QList<QVector<quint32> > lpfLut;
QList<QVector<quint32> > atgcLut;
ReceiverConfiguration* configLut;
QVector<QVector<float> > blendWeight;
quint8 receiverConfigTypeNumber;
HwRegister();
~HwRegister();
ScenHwRegister();
~ScenHwRegister();
};
struct ScenGenHardwareOutput {
struct ScenGenHardwareParam {
quint32 focusTypeNumber;
quint32 totalTxShotNumber;
QVector<quint8> rxBeamFormerNumber;
quint32 scenarioStartIndex;
quint32 scenarioEndIndex;
HwRegister* hwRegister;
ScenHwRegister* hwRegister;
SramIndex* indexParams;
SramRx* rxParams;
SramTx* txParams;
ScenGenHardwareOutput();
~ScenGenHardwareOutput();
ScenGenHardwareParam();
~ScenGenHardwareParam();
}
* scenParams;
void setScenario(ScenGenHardwareOutput* scenParams);
void setScenario(ScenGenHardwareParam* scenParams);
void sram_clear (void);
void sramClear (eSramClear clearMode);
void setSwapVector(void);
void setRomCrc(void);
void setFpgaOffset(void);
void setAfeModuleOffset(void);
void scenParamsFilling(eScenParams cmd);
//QList<quint32> signedVector2unsignedList(QVector<qint32>& sgnVec);
template<class T>
QByteArray uintLittleEndian2ByteArray(T& data) const;
template<class T>
T byteArray2UintLittleEndian(QByteArray& byte) const;
signals:
void sendFramePacket(QByteArray newPacket);
void sramBinaryCreateFlag (void);
void registerCsvCompareFlag (void);
void sramVerifyMessage(QString message);
public:
@ -149,26 +161,28 @@ public:
///////////////////////////////// Initialize API //////////////////////////////
void init(void);
////////////////////////////////// Scenario API ///////////////////////////////
////////////////////////////////// Scenario API ///////////////////////////////
void setProbeDependParams(ScenPrbDepHardwareParam &prbDepParams);
void setScenario(ScenGenHardwareOutput_t &scenGenHw);
void setLineFilterCoefficient(QVector<float>& lineFilterLut);
void setStbCoefficient(QVector<quint32>& stbLut);
void setDtgcLut(QVector<float>& dtgcLut);
void setAtgcMode(eAtgcMode mode, quint16 value) const;
void setMetaData(const QByteArray metaData) const;
void setScenario(ScenGenHardwareOutput_t scenGenHw);
void setAfeConfig(AfeConfig afe);
QList<quint32> getAfeReg(eSlaveSelect sel, quint32 afeRegAddr);
void scenPlayerStart(void);
void scenPlayerStop(void);
//void scenPlayerPause (bool pause) const;
void setFramesMetaData(const QByteArray &metaData) const;
////////////////////////////////// UI Test API ///////////////////////////////
void setScenarioCompare (const QString scenPath);
void setAtgcMode(eAtgcMode mode, quint16 value) const;
QList<quint32> getAfeReg(eSlaveSelect sel, quint32 afeRegAddr);
////////////////////////////// Slave Programming API ///////////////////////////
void slaveFpgaProgram(QString path);
void slaveFpgaProgram(const QString path);
/////////////////////////////// BeamFormer Mode API ////////////////////////////
void setBeamFormerMode(eClkMode mode) const;
@ -183,17 +197,17 @@ public:
quint32 deviceId(void) const;
quint32 vendorId(void) const;
quint32 trxId(void) const;
quint32 mpsId(void) const;
quint32 prbCtrlId(void) const;
quint32 prbId(eSelectProbe prbSel) const;
void getConnectedPrbId(ConnectedPrbId* prbId) const;
QByteArray trxInfo(void) const;
QByteArray mpsInfo(void) const;
QByteArray prbCtrlInfo(void) const;
QByteArray prbInfo(quint8 prbSel) const;
void getConnectedPrbInfo(ConnectedPrbInfo* prbInfo) const;
void trxState(EepromStatus &romStatus) const;
void mpsState(EepromStatus &romStatus) const;
void prbCtrlState(EepromStatus &romStatus) const;
void selectedPrbState(EepromStatus &romStatus, eSelectProbe prbSel) const;
void prbState(PrbCase* prb) const;
QString trxInfo(void) const;
QString mpsInfo(void) const;
QString prbCtrlInfo(void) const;
QByteArray selectedPrbImpulseResponse(quint8 prbSel) const;
void prbImpulseResponse(ConnectedPrbInfo* prbInfo) const;
void supervisorRbValue(SupervisorRbValue* sValue) const;
void mpsFaultStatus(MpsFaultStatus* faultStatus) const;

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

@ -0,0 +1,10 @@
#ifndef PREPROCESSORDEF_H
#define PREPROCESSORDEF_H
#define MPS_BOARD
//#undef MPS_BOARD
#define DEVELOP_UI
#undef DEVELOP_UI
#endif // PREPROCESSORDEF_H

28
include/model/hardware/core/TrxBoardUtils/ScenParamsRanges.h

@ -0,0 +1,28 @@
#ifndef SCENPARAMSRANGE_H
#define SCENPARAMSRANGE_H
/****************** DSP ******************/
#define RRECEIVER_CONFIGURATION_LUT_MAX 8U
#define STB_COEFFICIENT_LUT_MAX 8
#define LINE_FILTER_LUT_MAX 3
#define BLENDWEIGHT_LUT_MAX 4
#define FREQUENCY_LUT_MAX 8
#define DTGC_LUT_MAX 1024
#define ATGC_LUT_MAX 4
#define LPF_LUT_MAX 4
/************** Beam Former **************/
#define ELEMENT_POSITION_LUT_MAX 192
#define APODIZATIONLUT_LUT_MAX 4
#define RXBEAMFORMER_LUT_MAX 8U
#define PULSE_LUT_MAX 8U
/****************** SRAM *****************/
#define TOTAL_TX_SHOT_NUMBER_MAX 131072U
#define RX_BEAMFORMER_NUMBER_MAX 11264
#define FOCUS_TYPE_NUMBER_MAX 11264U
/************* Scenario Index ************/
#define SCENARIO_INDEX_MAX 131072U
#endif // SCENPARAMSRANGE_H

12
include/model/hardware/core/TrxBoardUtils/TrxBoardEnums.h

@ -3,6 +3,12 @@
#include <QObject>
enum eSramClear : bool
{
all = false,
first4M = true
};
enum eEmulatorOption : bool
{
performance = false,
@ -36,4 +42,10 @@ enum eSlaveSelect : quint8
slave2
};
enum eConnectionMode : bool
{
disconnected = false,
connected = true
};
#endif // TRXBOARDENUMS_H

30
include/model/hardware/core/TrxBoardUtils/TrxBoardStructures.h

@ -28,12 +28,19 @@ struct HealthStatus
VoltagesPg* voltsPg;
};
struct ConnectedPrbId
struct EepromStatus
{
quint32 prbA;
quint32 prbB;
quint32 prbC;
quint32 prbD;
eConnectionMode ConnectionMode;
quint32 id;
quint8 errorCode;
};
struct PrbCase
{
EepromStatus prbA;
EepromStatus prbB;
EepromStatus prbC;
EepromStatus prbD;
};
struct ConnectedPrbInfo
@ -44,4 +51,17 @@ struct ConnectedPrbInfo
QByteArray prbD;
};
struct ScenPrbDepHwRegister
{
QList<QVector<quint32>> lpfLut;
QList<QVector<quint32>> atgcLut;
QList<QVector<quint32>> apodizationLut;
};
struct ScenPrbDepHardwareParam
{
AfeConfig afeCfg;
ScenPrbDepHwRegister prbDepParams;
};
#endif // TRXBOARDSTRUCTURES_H

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

@ -0,0 +1,37 @@
#ifndef ADCSYNCSTATUS_H
#define ADCSYNCSTATUS_H
#include "model/hardware/core/register/Register.h"
#include "model/hardware/core/register/RegUtils.h"
#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 BAR 0U
#define OFFSET 0x43C384
class AdcSyncStatus : public Register
{
public:
Field* lnaHpfProg;
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);
}
};
#undef LNA_HPF_PROG_MASK
#undef BAR
#undef OFFSET
#endif // ADCSYNCSTATUS_H

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

@ -6,6 +6,7 @@
#include <QByteArray>
#include <QProgressDialog>
#include "model/hardware/core/TrxBoardUtils/PreProcessorDef.h"
#include "registerDefinition/SlaveFpgaNumber.h"
#include "registerDefinition/SerialProgramData.h"
#include "registerDefinition/SerialProgramStatus.h"

3
include/model/hardware/core/register/scenPlayer/ScenPlayer.h

@ -15,7 +15,8 @@ private:
struct PlayerControl
{
ScenPlayerCtrl* _playerctrl;
void command(bool start) const;
void setCommand(bool start) const;
bool getCommand(void) const;
void pause (bool pause) const;
};

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

@ -50,6 +50,8 @@ private:
if (index==0)
frameType->setValueLong(_index->frameType);
else
frameType->setValueLong(0);
}
public:

1
include/model/hardware/device/SonoDevice.h

@ -21,6 +21,7 @@ public:
void startDma();
void stopDma();
int getCounter();
bool isDmaBusy ();
void copy(int srcIndex, int dstIndex);
const char* getBufferPtr(int index);
};

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

@ -7,18 +7,19 @@
#include "model/scenarioGenerator/dto/hardware/SramIndex.h"
#include "model/scenarioGenerator/dto/hardware/SramRx.h"
#include "model/scenarioGenerator/dto/hardware/SramTx.h"
#include "model/hardware/core/register/afe/Afe.h"
struct ScenGenHardwareOutput_t {
quint32 focusTypeNumber;
quint32 totalTxShotNumber;
quint32 focusTypeNumber;
quint32 totalTxShotNumber;
QList<quint8> rxBeamFormerNumber;
QVector<float> pulseInterval;
QVector<float> pulseInterval;
quint8 frameType;
HwRegister_t hwRegister;
SramIndex_t indexParams;
SramRx_t rxParams;
SramTx_t txParams;
HwRegister_t hwRegister;
SramIndex_t indexParams;
SramRx_t rxParams;
SramTx_t txParams;
};
#endif //HARDWAREOUTPUT_H

1
include/model/scenarioGenerator/dto/hardware/HwScenarioDependent.h

@ -26,4 +26,5 @@ struct HwRegister_t {
QList<QVector<quint32>> apodizationLut;
};
#endif //HWSCENARIODEPENDENT_H

1778
mainwindow.cpp

File diff suppressed because it is too large

99
mainwindow.h

@ -22,10 +22,8 @@
#include "qcustomplot.h"
#include "include/model/hardware/core/TrxBoard.h"
#include "hdf5Scenario/hdf5Scenario.h"
#include "api.h"
#include "H5Cpp.h"
#include "hdf5.h"
#include "H5File.h"
#define MESSAGE_BOX(M) \
emit showMessage(M)
@ -64,13 +62,10 @@
#define ULTIMATE_LOG_COUNT 50
#define MAX_ARRAY_DEPTH 131072U
QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE
using namespace H5;
using namespace std;
class MainWindow : public QMainWindow
@ -117,27 +112,15 @@ private:
StatusVec* _vec;
AfeConfig _afeConfig;
PrbCase* _prb;
ScenGenHardwareOutput_t scenParams;
AfeConfig _afeConfig;
QFutureWatcher <void> scenEndWather;
H5File _file;
float_t floatArray[MAX_ARRAY_DEPTH];
template<class T>
void datasetBranch(const string& branchPath, T datasetValue[MAX_ARRAY_DEPTH]);
template<class T>
QByteArray Uint2ByteArray(T data);
void setScenario(const string& h5Path);
void verifyRegisterParams(QString& regParamsPath);
void verifySramParams(QString& sramParamsPath);
void setScenarioCompare(const QString& scenPath);
void fpgaProgrammer(QString path);
@ -163,6 +146,10 @@ private:
QString byteArray2InfoString (QByteArray& arr);
QString releaseCodeVersion (quint32 &value);
void getProbeColor (const QBrush brush, const int item);
QString _logFolder = "/home/hasis/Desktop/TrxBoardFile/_log/dma/";
QString _emulFolder = "/home/hasis/Desktop/Develop_HardwareTest/developHw/sram_frame.bin";
@ -180,10 +167,16 @@ private:
private slots:
void getPrbChange();
void getFramePacket (QByteArray packet);
void getSramBinaryCreateFlag (void);
void getRegisterCsvCompareFlag (void);
void getSramVerifyMessage(QString message);
void getPrbChange();
void restartTimer();
void on_rbtn_reg_toggled(bool checked);
@ -299,32 +292,6 @@ private slots:
void on_btn_setAtgcMode_clicked();
void on_btn_trxRomWrite_clicked();
void on_btn_trxRomIdRead_clicked();
void on_btn_trxRomInfoRead_clicked();
void on_btn_mpsRomWrite_clicked();
void on_btn_mpsRomIdRead_clicked();
void on_btn_mpsRomInfoRead_clicked();
void on_btn_prbCtrlRomWrite_clicked();
void on_btn_prbCtrlRomIdRead_clicked();
void on_btn_prbCtrlRomInfoRead_clicked();
void on_btn_prbRomWrite_clicked();
void on_btn_prbRomIdRead_clicked();
void on_btn_prbRomInfoRead_clicked();
void on_btn_scenStart_clicked();
void on_btn_emulator_clicked();
@ -349,17 +316,41 @@ private slots:
void on_chk_mpsInit_clicked();
void on_btn_afeConfig_clicked();
void on_btn_scenBrowse_clicked();
void on_btn_setScenario_clicked();
void on_btn_sramParamsVerifying_clicked();
void on_btn_setScenVerification_clicked();
void on_btn_setIdx_clicked();
void on_btn_trxRomInfoWrite_clicked();
void on_btn_trxRomIdWrite_clicked();
void on_btn_mpsRomIdWrite_clicked();
void on_btn_mpsRomInfoWrite_clicked();
void on_btn_prbCtrlRomIdWrite_clicked();
void on_btn_registerParamsVerifying_clicked();
void on_btn_prbCtrlRomInfoWrite_clicked();
void on_btn_sramParamsGenerating_clicked();
void on_btn_prbRomImpulseRead_clicked();
void on_btn_trxRomIdRead_clicked();
void on_btn_trxRomInfoRead_clicked();
void on_btn_mpsRomIdRead_clicked();
void on_btn_mpsRomInfoRead_clicked();
void on_btn_prbCtrlRomIdRead_clicked();
void on_btn_prbCtrlRomInfoRead_clicked();
void on_btn_prbRomIdRead_clicked();
signals:
// void updateBlockProgressValue(int percentage, QProgressBar* prg);

1090
mainwindow.ui

File diff suppressed because it is too large

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

@ -1,7 +1,18 @@
#include "model/hardware/core/TrxBoard.h"
template<class T>
T byteArray2UintLittleEndian(QByteArray& byte)
QByteArray TrxBoard::uintLittleEndian2ByteArray(T& data) const
{
QByteArray byte;
QDataStream out (&byte, QIODevice::WriteOnly);
out.setByteOrder(QDataStream::LittleEndian);
out << data;
return byte;
}
template<class T>
T TrxBoard::byteArray2UintLittleEndian(QByteArray& byte) const
{
T data;
QDataStream in (byte);
@ -34,9 +45,14 @@ void TrxBoard::readData()
_device.copy(_hwCounter - 1, _swCounter);
auto temp = QByteArray::fromRawData(_device.getBufferPtr(_swCounter), BUFFER_SIZE);
packetEngine.newData(temp);
#ifdef DEVELOP_UI
//packetEngine.newData(temp);
emit sendFramePacket(temp);
#else
packetEngine.newData(temp);
//emit sendFramePacket(temp);
#endif
_swCounter++;
if(_swCounter >= SW_BUFFER_NUM)
@ -47,13 +63,24 @@ void TrxBoard::readData()
}
}
void TrxBoard::sram_clear()
void TrxBoard::sramClear(eSramClear clearMode)
{
quint32 num(0);
while (num < SRAM_SIZE)
if (clearMode == all)
{
this->_device.device.writeLong(BAR_SRAM, static_cast<quint32>(num), 0);
num += sizeof (quint64);
while (num < SRAM_SIZE)
{
this->_device.device.writeLong(BAR_SRAM, static_cast<quint32>(num), 0);
num += sizeof (quint64);
}
}
if (clearMode == first4M)
{
while (num < SRAM_SIZE / 4)
{
this->_device.device.writeLong(BAR_SRAM, static_cast<quint32>(num), 0);
num += sizeof (quint64);
}
}
}
@ -93,6 +120,14 @@ void TrxBoard::setSwapVector()
<< 180 << 165 << 86 << 71 << 184 << 169 << 90 << 75 << 188 << 173 << 94 << 79;
}
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()
{
_afeModuleOffset.clear();
@ -138,16 +173,17 @@ TrxBoard::TrxBoard() : _offsetSlave0(0), _offsetSlave1(0x400000), _offsetSlave2(
_adc = new AdcVoltages;
_pg = new VoltagesPg;
scenParams = new ScenGenHardwareOutput;
scenParams = new ScenGenHardwareParam;
_allow = false;
_run = false;
setSwapVector();
setRomCrc();
setFpgaOffset();
setAfeModuleOffset();
}
TrxBoard::HwRegister::HwRegister()
TrxBoard::ScenHwRegister::ScenHwRegister()
{
configLut = new ReceiverConfiguration;
elementPosition = new ProbeElementPosition;
@ -155,9 +191,9 @@ TrxBoard::HwRegister::HwRegister()
pulse = new PulseProperties;
}
TrxBoard::ScenGenHardwareOutput::ScenGenHardwareOutput()
TrxBoard::ScenGenHardwareParam::ScenGenHardwareParam()
{
hwRegister = new HwRegister;
hwRegister = new ScenHwRegister;
indexParams = new SramIndex;
rxParams = new SramRx;
txParams = new SramTx;
@ -183,7 +219,7 @@ TrxBoard::~TrxBoard()
delete scenParams;
}
TrxBoard::HwRegister::~HwRegister()
TrxBoard::ScenHwRegister::~ScenHwRegister()
{
delete configLut;
delete rxBeamformer;
@ -191,7 +227,7 @@ TrxBoard::HwRegister::~HwRegister()
delete pulse;
}
TrxBoard::ScenGenHardwareOutput::~ScenGenHardwareOutput()
TrxBoard::ScenGenHardwareParam::~ScenGenHardwareParam()
{
delete hwRegister;
delete indexParams;
@ -203,32 +239,113 @@ void TrxBoard::init()
{
this->_device.init();
this->_bCtrlMngt->prbCtrlInit();
sram_clear();
sramClear(all);
}
void TrxBoard::setScenario(ScenGenHardwareOutput_t scenGenHw)
void TrxBoard::setProbeDependParams(ScenPrbDepHardwareParam &prbDepParams)
{
scenPlayerStop();
/////////////////////////// DSP setting ///////////////////////////
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)
{
apodizationQ.push_back(vec.toList());
}
this->_beamFormerSlave0->apodizationLut(apodizationQ);
this->_beamFormerSlave1->apodizationLut(apodizationQ);
this->_beamFormerSlave2->apodizationLut(apodizationQ);
scenParamsFilling(set);
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)
{
atgcLutQ.push_back(vec.toList());
}
this->_dsp->atgcLut(atgcLutQ);
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)
{
lpfLutQ.push_back(vec.toList());
}
this->_dsp->lpfLut(lpfLutQ);
/////////////////////////// AFE setting ///////////////////////////
this->_afeSlave0->setAfeParams(prbDepParams.afeCfg);
this->_afeSlave1->setAfeParams(prbDepParams.afeCfg);
this->_afeSlave2->setAfeParams(prbDepParams.afeCfg);
}
void TrxBoard::setScenario(ScenGenHardwareOutput_t &scenGenHw)
{
if (this->_scenPlayer->control.getCommand())
scenPlayerStop();
emulatorStop();
sramClear(first4M);
scenParams->focusTypeNumber = scenGenHw.focusTypeNumber;
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)
throw SonoException("Total tx shot number is out of range");
scenParams->rxBeamFormerNumber = scenGenHw.rxBeamFormerNumber.toVector();
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;
scenParams->hwRegister->lpfLut = scenGenHw.hwRegister.lpfLut;
scenParams->hwRegister->atgcLut=scenGenHw.hwRegister.atgcLut;
scenParams->hwRegister->apodization=scenGenHw.hwRegister.apodizationLut;
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)
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)
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)
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)
throw SonoException("Element position z is out of range");
scenParams->hwRegister->freqLut = scenGenHw.hwRegister.freqLut;
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)
throw SonoException("Dtgc lut is out of range");
scenParams->hwRegister->pulseTypeNumber = scenGenHw.hwRegister.pulseTypeNumber;
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)
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)
throw SonoException("Receiver config type number is out of range");
scenParams->hwRegister->pulse->clear();
foreach(auto i, scenGenHw.hwRegister.pulseProps)
@ -308,7 +425,7 @@ void TrxBoard::setScenario(ScenGenHardwareOutput_t scenGenHw)
this->setScenario(scenParams);
}
void TrxBoard::setScenario (ScenGenHardwareOutput* scenParams)
void TrxBoard::setScenario (ScenGenHardwareParam* scenParams)
{
///////////////////////////////// BeamFormer setting ///////////////////////////////
QList<QList<quint32> > elementPosition;
@ -399,16 +516,6 @@ void TrxBoard::setScenario (ScenGenHardwareOutput* scenParams)
scenParams->hwRegister->pulse);
scenParamsFilling(set);
QList<QList<quint32> > apodizationQ;
foreach(auto vec, scenParams->hwRegister->apodization)
{
apodizationQ.push_back(vec.toList());
}
this->_beamFormerSlave0->apodizationLut(apodizationQ);
this->_beamFormerSlave1->apodizationLut(apodizationQ);
this->_beamFormerSlave2->apodizationLut(apodizationQ);
scenParamsFilling(set);
////this->_beamFormerSlave0->afeLut(scenParams->hwRegister->afe);
////this->_beamFormerSlave1->afeLut(scenParams->hwRegister->afe);
////this->_beamFormerSlave2->afeLut(scenParams->hwRegister->afe);
@ -438,20 +545,6 @@ void TrxBoard::setScenario (ScenGenHardwareOutput* scenParams)
}
this->_dsp->blendWeight(blendWeightQ);
QList<QList<quint32> > atgcLutQ;
foreach(auto vec, scenParams->hwRegister->atgcLut)
{
atgcLutQ.push_back(vec.toList());
}
this->_dsp->atgcLut(atgcLutQ);
QList<QList<quint32> > lpfLutQ;
foreach(auto vec, scenParams->hwRegister->lpfLut)
{
lpfLutQ.push_back(vec.toList());
}
this->_dsp->lpfLut(lpfLutQ);
///////////////////////////////// Sram setting ///////////////////////////////
this->_sram->setSramIndex(scenParams->totalTxShotNumber, scenParams->indexParams);
@ -462,21 +555,17 @@ void TrxBoard::setScenario (ScenGenHardwareOutput* scenParams)
scenParams->rxParams);
scenParamsFilling(set);
////////////////////////////// Scen Index setting ////////////////////////////
if(scenParams->scenarioEndIndex >= scenParams->scenarioStartIndex)
{
this->_scenPlayer->setStartIndex(scenParams->scenarioStartIndex);
this->_scenPlayer->setEndIndex(scenParams->scenarioEndIndex);
}
else
{
throw SonoException(
"The scenario end index must be greater than or equal to the scenario start index");
}
this->_scenPlayer->setStartIndex(scenParams->scenarioStartIndex);
this->_scenPlayer->setEndIndex(scenParams->scenarioEndIndex);
}
void TrxBoard::setLineFilterCoefficient(QVector<float>& lineFilterLut)
{
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);
@ -484,6 +573,8 @@ void TrxBoard::setLineFilterCoefficient(QVector<float>& lineFilterLut)
void TrxBoard::setStbCoefficient(QVector<quint32>& stbLut)
{
if (stbLut.size() != STB_COEFFICIENT_LUT_MAX)
throw SonoException("Stb lut is out of range");
QList<quint32> stbLutQ = stbLut.toList();
this->_dsp->stbCoefficient(stbLutQ);
}
@ -495,12 +586,14 @@ void TrxBoard::setAtgcMode(eAtgcMode mode, quint16 value) const
void TrxBoard::setDtgcLut(QVector<float>& dtgcLut)
{
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::setMetaData(const QByteArray metaData) const
void TrxBoard::setFramesMetaData(const QByteArray &metaData) const
{
QList<quint64> data;
QByteArray temp;
@ -520,6 +613,137 @@ void TrxBoard::setMetaData(const QByteArray metaData) const
this->_sram->setSramMetaData(data);
}
void TrxBoard::setScenarioCompare(const QString scenPath)
{
/******************* Create SRAM Binary File *******************/
QString createSramBinary = "/hardware/sramScenarioReadback.bin";
QString saveFile = scenPath + createSramBinary;
QFile sramFile(saveFile);
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)
{
value = _device.device.readLong(BAR_SRAM, static_cast<quint32>(num));
sramFile.write(uintLittleEndian2ByteArray<quint64>(value));
num += sizeof (quint64);
}
sramFile.flush();
sramFile.close();
#ifdef DEVELOP_UI
emit sramBinaryCreateFlag();
#endif
/******************* Compare Register CSV File *******************/
QString registerScenario = "/hardware/register.csv";
QString regReadParamsPath = scenPath + registerScenario;
QFile csvReadFile(regReadParamsPath);
if(!csvReadFile.open(QFile::ReadOnly))
{
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))
{
throw SonoException("Couldn't create the register compare file due to the wrong path probably.");
}
quint32 bar = 0;
qint64 readSize = 0;
QString line;
auto size = csvReadFile.size();
while(readSize < size)
{
line = csvReadFile.readLine();
auto sl = line.split(',');
auto address = sl[0].toUInt(Q_NULLPTR, 16);
auto baseValue = sl[1].toUInt(Q_NULLPTR, 16);
auto boardValue = _device.device.readWord(bar, address);
auto res = "NOK";
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);
csvWriteFile.write(str.toStdString().c_str(), str.length());
csvWriteFile.write("\r\n", 2);
readSize += static_cast<qint64>(line.length());
}
csvReadFile.close();
csvWriteFile.flush();
csvWriteFile.close();
#ifdef DEVELOP_UI
emit registerCsvCompareFlag();
#endif
/******************* Compare & Verify SRAM Params *******************/
QString sramScenario = "/hardware/sramScenario.bin";
QString sramReadParamsPath = scenPath + sramScenario;
QFile sramReadFile(sramReadParamsPath);
if(!sramReadFile.open(QFile::ReadOnly))
{
throw SonoException("Could not open the sram's scenario params due to the wrong path probably.");
}
qint64 sramScenarioLength = sramReadFile.size();
QByteArray fileByte;
fileByte = sramReadFile.readAll();
sramReadFile.close();
num = 0;
quint64 boardValue(0);
quint64 fileValue(0);
QByteArray temp;
while (num < sramScenarioLength)
{
boardValue = _device.device.readLong(BAR_SRAM, static_cast<quint32>(num));
for (quint8 j=0; j < sizeof (quint64); j++)
{
temp.append(fileByte[j+num]);
}
fileValue = byteArray2UintLittleEndian <quint64>(temp);
if (boardValue != fileValue)
{
throw SonoException("The sram scenario file is different to the sram params of board.");
}
temp.clear();
num += sizeof (quint64);
}
#ifdef DEVELOP_UI
emit sramVerifyMessage("Successful comparision without any difference.");
#endif
}
QList<quint32> TrxBoard::getAfeReg(eSlaveSelect sel, quint32 afeRegAddr)
{
QList<quint32> afeRegValue;
@ -574,14 +798,7 @@ QList<quint32> TrxBoard::getAfeReg(eSlaveSelect sel, quint32 afeRegAddr)
return afeRegValue;
}
void TrxBoard::setAfeConfig(AfeConfig afe)
{
this->_afeSlave0->setAfeParams(afe);
this->_afeSlave1->setAfeParams(afe);
this->_afeSlave2->setAfeParams(afe);
}
void TrxBoard::slaveFpgaProgram(QString path)
void TrxBoard::slaveFpgaProgram(const QString path)
{
scenParamsFilling(clear);
@ -637,13 +854,15 @@ void TrxBoard::scenPlayerStart(void)
this->_device.startDma();
#ifdef MPS_BOARD
this->_bCtrlMngt->mpsDacsOn();
#endif
this->_afeSlave0->setAfeGblPwr(afePwrdnDisable);
this->_afeSlave1->setAfeGblPwr(afePwrdnDisable);
this->_afeSlave2->setAfeGblPwr(afePwrdnDisable);
this->_scenPlayer->control.command(true);
this->_scenPlayer->control.setCommand(true);
_run = true;
@ -661,13 +880,15 @@ void TrxBoard::scenPlayerStop(void)
this->_device.stopDma();
this->_scenPlayer->control.command(false);
this->_scenPlayer->control.setCommand(false);
this->_afeSlave0->setAfeGblPwr(afePwrdnEnable);
this->_afeSlave1->setAfeGblPwr(afePwrdnEnable);
this->_afeSlave2->setAfeGblPwr(afePwrdnEnable);
#ifdef MPS_BOARD
this->_bCtrlMngt->mpsDacsOff();
#endif
}
//void TrxBoard::scenPlayerPause(bool pause) const
@ -684,7 +905,8 @@ void TrxBoard::emulatorInit(EmulatorProperties* config) const
void TrxBoard::fillRam(QString path)
{
scenPlayerStop();
if (this->_scenPlayer->control.getCommand())
scenPlayerStop();
emulatorStop();
QFile emulFile(path);
@ -724,7 +946,7 @@ void TrxBoard::emulatorStart()
{
_run = false;
this->_scenPlayer->control.command(false);
this->_scenPlayer->control.setCommand(false);
this->_emul->setEmulatorEn();
@ -758,141 +980,260 @@ quint32 TrxBoard::vendorId() const
return vid;
}
quint32 TrxBoard::trxId() const
void TrxBoard::trxState(EepromStatus &romStatus) const
{
QByteArray id = this->_bCtrlMngt->trxEepromRead(EEPROM_ID_BYTE_BEGIN, EEPROM_ID_BYTE_NUMBER);
QByteArray id;
QByteArray crcChk;
romStatus.ConnectionMode = connected;
return byteArray2UintBigEndian<quint16> (id);
id = this->_bCtrlMngt->trxEepromRead(EEPROM_ID_BEGIN, EEPROM_ID_NUMBER);
romStatus.id = byteArray2UintBigEndian<quint16> (id);
crcChk = this->_bCtrlMngt->trxEepromRead(EEPROM_CRC_BEGIN, EEPROM_CRC_NUMBER);
if (crcChk == _eepromCrc)
romStatus.errorCode = EEPROM_NO_ERROR;
else
romStatus.errorCode = EEPROM_CRC_ERROR;
}
quint32 TrxBoard::mpsId() const
void TrxBoard::mpsState(EepromStatus &romStatus) const
{
QByteArray id = this->_bCtrlMngt->mpsEepromRead(EEPROM_ID_BYTE_BEGIN, EEPROM_ID_BYTE_NUMBER);
QByteArray id;
QByteArray crcChk;
return byteArray2UintBigEndian<quint16> (id);
romStatus.ConnectionMode = connected;
id = this->_bCtrlMngt->mpsEepromRead(EEPROM_ID_BEGIN, EEPROM_ID_NUMBER);
romStatus.id = byteArray2UintBigEndian<quint16> (id);
crcChk = this->_bCtrlMngt->mpsEepromRead(EEPROM_CRC_BEGIN, EEPROM_CRC_NUMBER);
if (crcChk == _eepromCrc)
romStatus.errorCode = EEPROM_NO_ERROR;
else
romStatus.errorCode = EEPROM_CRC_ERROR;
}
quint32 TrxBoard::prbCtrlId() const
void TrxBoard::prbCtrlState(EepromStatus &romStatus) const
{
QByteArray id = this->_bCtrlMngt->prbCtrlEepromRead(EEPROM_ID_BYTE_BEGIN, EEPROM_ID_BYTE_NUMBER);
QByteArray id;
QByteArray crcChk;
return byteArray2UintBigEndian<quint16> (id);
romStatus.ConnectionMode = connected;
id = this->_bCtrlMngt->prbCtrlEepromRead(EEPROM_ID_BEGIN, EEPROM_ID_NUMBER);
romStatus.id = byteArray2UintBigEndian<quint16> (id);
crcChk = this->_bCtrlMngt->prbCtrlEepromRead(EEPROM_CRC_BEGIN, EEPROM_CRC_NUMBER);
if (crcChk == _eepromCrc)
romStatus.errorCode = EEPROM_NO_ERROR;
else
romStatus.errorCode = EEPROM_CRC_ERROR;
}
quint32 TrxBoard::prbId(eSelectProbe prbSel) const
void TrxBoard::selectedPrbState(EepromStatus &romStatus, eSelectProbe prbSel) const
{
QByteArray id = this->_bCtrlMngt->prbEepromRead(EEPROM_ID_BYTE_BEGIN,
EEPROM_ID_BYTE_NUMBER,
prbSel-1);
QVector<bool> vec;
QByteArray id;
QByteArray crcChk;
vec = this->_bCtrlMngt->getConnectedPrb();
if (prbSel == prbA && !vec.at(0))
throw SonoException("This probe is disconnected");
if (prbSel == prbB && !vec.at(1))
throw SonoException("This probe is disconnected");
if (prbSel == prbC && !vec.at(2))
throw SonoException("This probe is disconnected");
return byteArray2UintBigEndian<quint16> (id);
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);
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::getConnectedPrbId(ConnectedPrbId* prbId) const
void TrxBoard::prbState(PrbCase* prb) const
{
QVector<bool> vec;
QByteArray id;
vec.clear();
id.clear();
QByteArray crcChk;
vec = this->_bCtrlMngt->getConnectedPrb();
for(quint8 i(0); i < vec.size(); i++)
{
if(vec.at(i))
{
id = this->_bCtrlMngt->prbEepromRead(EEPROM_ID_BYTE_BEGIN, EEPROM_ID_BYTE_NUMBER, i);
}
else
{
id.append(nullptr);
id.append(nullptr);
}
{
switch(i)
{
case 0:
prbId->prbA = byteArray2UintBigEndian<quint16> (id);
case 0:
if(vec.at(i))
{
prb->prbA.ConnectionMode = connected;
id = this->_bCtrlMngt->prbEepromRead(EEPROM_ID_BEGIN, EEPROM_ID_NUMBER, i);
prb->prbA.id = byteArray2UintBigEndian<quint16> (id);
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
{
prb->prbA.ConnectionMode = disconnected;
prb->prbA.id = 0;
prb->prbA.errorCode = EEPROM_NO_ERROR;
}
break;
case 1:
prbId->prbB = byteArray2UintBigEndian<quint16> (id);
break;
if(vec.at(i))
{
prb->prbB.ConnectionMode = connected;
id = this->_bCtrlMngt->prbEepromRead(EEPROM_ID_BEGIN, EEPROM_ID_NUMBER, i);
prb->prbB.id = byteArray2UintBigEndian<quint16> (id);
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
{
prb->prbB.ConnectionMode = disconnected;
prb->prbB.id = 0;
prb->prbB.errorCode = EEPROM_NO_ERROR;
}
break;
case 2:
prbId->prbC = byteArray2UintBigEndian<quint16> (id);
break;
if(vec.at(i))
{
prb->prbC.ConnectionMode = connected;
id = this->_bCtrlMngt->prbEepromRead(EEPROM_ID_BEGIN, EEPROM_ID_NUMBER, i);
prb->prbC.id = byteArray2UintBigEndian<quint16> (id);
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
{
prb->prbC.ConnectionMode = disconnected;
prb->prbC.id = 0;
prb->prbC.errorCode = EEPROM_NO_ERROR;
}
break;
case 3:
prbId->prbD = byteArray2UintBigEndian<quint16> (id);
break;
if(vec.at(i))
{
prb->prbD.ConnectionMode = connected;
id = this->_bCtrlMngt->prbEepromRead(EEPROM_ID_BEGIN, EEPROM_ID_NUMBER, i);
prb->prbD.id = byteArray2UintBigEndian<quint16> (id);
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
{
prb->prbD.ConnectionMode = disconnected;
prb->prbD.id = 0;
prb->prbD.errorCode = EEPROM_NO_ERROR;
}
break;
}
id.clear();
crcChk.clear();
}
}
QByteArray TrxBoard::trxInfo() const
QString TrxBoard::trxInfo() const
{
return this->_bCtrlMngt->trxEepromRead(EEPROM_INFO_BYTE_BEGIN, EEPROM_INFO_BYTE_NUMBER);
FpgaCodeVersion version;
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) + ")");
}
QByteArray TrxBoard::mpsInfo() const
QString TrxBoard::mpsInfo() const
{
return this->_bCtrlMngt->mpsEepromRead(EEPROM_INFO_BYTE_BEGIN, EEPROM_INFO_BYTE_NUMBER);
return QString(this->_bCtrlMngt->mpsEepromRead(EEPROM_INFO_BEGIN, EEPROM_INFO_NUMBER));
}
QByteArray TrxBoard::prbCtrlInfo() const
QString TrxBoard::prbCtrlInfo() const
{
return this->_bCtrlMngt->prbCtrlEepromRead(EEPROM_INFO_BYTE_BEGIN, EEPROM_INFO_BYTE_NUMBER);
return QString(this->_bCtrlMngt->prbCtrlEepromRead(EEPROM_INFO_BEGIN, EEPROM_INFO_NUMBER));
}
QByteArray TrxBoard::prbInfo(quint8 prbSel) const
QByteArray TrxBoard::selectedPrbImpulseResponse(quint8 prbSel) const
{
return this->_bCtrlMngt->prbEepromRead(EEPROM_INFO_BYTE_BEGIN, EEPROM_INFO_BYTE_NUMBER, prbSel);
return this->_bCtrlMngt->prbEepromRead(EEPROM_IMPULSE_RESPONSE_BEGIN, EEPROM_IMPULSE_RESPONSE_NUMBER, prbSel);
}
void TrxBoard::getConnectedPrbInfo(ConnectedPrbInfo* prbInfo) const
void TrxBoard::prbImpulseResponse(ConnectedPrbInfo* prbInfo) const
{
QByteArray info;
QVector<bool> vec;
info.clear();
vec.clear();
QByteArray info;
QVector<bool> vec;
info.clear();
vec.clear();
vec = this->_bCtrlMngt->getConnectedPrb();
vec = this->_bCtrlMngt->getConnectedPrb();
for(quint8 i = 0; i < vec.size(); i++)
{
if(vec.at(i))
{
info = this->_bCtrlMngt->prbEepromRead(EEPROM_INFO_BYTE_BEGIN,
EEPROM_INFO_BYTE_NUMBER,
i);
}
else
{
info.append(nullptr);
}
for(quint8 i = 0; i < vec.size(); i++)
{
if(vec.at(i))
{
info = this->_bCtrlMngt->prbEepromRead(EEPROM_IMPULSE_RESPONSE_BEGIN,
EEPROM_IMPULSE_RESPONSE_NUMBER,
i);
}
else
{
info.append(nullptr);
}
switch(i)
{
case 0:
prbInfo->prbA = info;
break;
switch(i)
{
case 0:
prbInfo->prbA = info;
break;
case 1:
prbInfo->prbB = info;
break;
case 1:
prbInfo->prbB = info;
break;
case 2:
prbInfo->prbC = info;
break;
case 2:
prbInfo->prbC = info;
break;
case 3:
prbInfo->prbD = info;
break;
}
case 3:
prbInfo->prbD = info;
break;
}
info.clear();
}
}
}
void TrxBoard::supervisorRbValue(SupervisorRbValue* sValue) const

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

@ -640,10 +640,12 @@ void BoardsCtrlMngt::mpsHvSet(float &hva, float &hvb) const
_mpsDacs->hvaValue = 3.3f;
_mpsDacs->hvbValue = 1.53f;
}
// _mpsDacs->cwdValue = 0.0f;
// _mpsDacs->hvaValue = hva;
// _mpsDacs->hvbValue = hvb;
else
{
_mpsDacs->cwdValue = 0.0f;
_mpsDacs->hvaValue = hva;
_mpsDacs->hvbValue = hvb;
}
getSupervisorI2cTimeout();
setMpsDacsValue (_mpsDacs);

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

@ -30,12 +30,14 @@ 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);
#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())
{
@ -70,10 +72,11 @@ 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");
#ifdef DEVELOP_UI
progress.setValue(progByte);
if (progress.wasCanceled())
throw SonoException("Slaves fpga programming is canceled");
#endif
temp.clear();
progByte += sizeof(quint32);
}

9
src/model/hardware/core/register/scenPlayer/ScenPlayer.cpp

@ -35,13 +35,20 @@ quint32 ScenPalyer::getErrorCount(void) const
return errCnt;
}
void ScenPalyer::PlayerControl::command(bool start) const
void ScenPalyer::PlayerControl::setCommand(bool start) const
{
quint32 strCmd = start ? 1 : 0;
_playerctrl->start->setValue(strCmd);
_playerctrl->update();
}
bool ScenPalyer::PlayerControl::getCommand() const
{
_playerctrl->sync();
auto cmdValue = _playerctrl->start->getValue();
return (cmdValue!=0);
}
void ScenPalyer::PlayerControl::pause(bool pause) const
{
quint32 pusCmd = pause ? 1 : 0;

9
src/model/hardware/device/SonoDevice.cpp

@ -42,7 +42,14 @@ int SonoDevice::getCounter()
{
auto temp = device.readWord(BAR_BRAM, COUNTER_REG);
return temp & COUNTER_MASK;
return temp & COUNTER_MASK;
}
bool SonoDevice::isDmaBusy()
{
auto temp = device.readWord(BAR_BRAM, COUNTER_REG);
return ((temp & BUSY_MASK) != 0);
}
void SonoDevice::copy(int srcIndex, int dstIndex)

Loading…
Cancel
Save