From 27893960895a1583a8532ddb87e0bd09568976cb Mon Sep 17 00:00:00 2001 From: Arash Aletayeb Date: Sun, 1 Jan 2023 14:06:08 +0100 Subject: [PATCH] TrxBoard structures are updated & preprocessor changed to sono --- developHw.pro.user | 2 +- hdf5Scenario/hdf5Scenario.cpp | 8 +- hdf5Scenario/hdf5Scenario.h | 2 +- .../hardware/core/lowLevelApi/TrxBoard.h | 33 ++-- .../TrxBoardUtils/PreProcessorDef.h | 2 +- .../TrxBoardUtils/TrxBoardStructures.h | 164 ++++++++++++++++++ mainwindow.cpp | 2 +- .../hardware/core/lowLevelApi/TrxBoard.cpp | 2 +- 8 files changed, 189 insertions(+), 26 deletions(-) diff --git a/developHw.pro.user b/developHw.pro.user index 4a32ba3..0c12675 100644 --- a/developHw.pro.user +++ b/developHw.pro.user @@ -1,6 +1,6 @@ - + EnvironmentId diff --git a/hdf5Scenario/hdf5Scenario.cpp b/hdf5Scenario/hdf5Scenario.cpp index db6f29c..59ca401 100644 --- a/hdf5Scenario/hdf5Scenario.cpp +++ b/hdf5Scenario/hdf5Scenario.cpp @@ -17,7 +17,7 @@ void Hdf5::hdf5Path(const string &h5Path) _file = file; } -void Hdf5::scenarioRead(ScenGenHardwareOutput_t &scenParams) +void Hdf5::scenarioRead(ScenHardware &scenParams) { // /****************** /sramParameters/frameType ******************/ // datasetBranch ("/sramParameters/frameType", floatArray); @@ -476,7 +476,7 @@ void Hdf5::scenarioRead(ScenGenHardwareOutput_t &scenParams) } /**************** /registerParameters/pulseProperties ********************/ - Pulse_t pulseObj; + Pulse pulseObj; scenParams.hwRegister.pulseProps.clear(); for (qint32 j = 0; j < scenParams.hwRegister.pulseTypeNumber; j++) @@ -519,7 +519,7 @@ void Hdf5::scenarioRead(ScenGenHardwareOutput_t &scenParams) } /**************** /registerParameters/rxBeamformerProperties ********************/ - RxBeamFormer_t rxBeamformerObj; + RxBeamFormer rxBeamformerObj; scenParams.hwRegister.rxBeamFormerProps.clear(); for (qint32 j = 0; j < scenParams.hwRegister.rxBeamFormerTypeNumber; j++) @@ -766,7 +766,7 @@ void Hdf5::scenarioRead(ScenGenHardwareOutput_t &scenParams) } /**************** /registerParameters/receiverConfigProperties ********************/ - ReceiverConfig_t receiverCfgObj; + ReceiverConfig receiverCfgObj; scenParams.hwRegister.receiverConfigProps.clear(); for (qint32 j = 0; j < scenParams.hwRegister.receiverConfigTypeNumber; j++) diff --git a/hdf5Scenario/hdf5Scenario.h b/hdf5Scenario/hdf5Scenario.h index 03083d3..35b9231 100644 --- a/hdf5Scenario/hdf5Scenario.h +++ b/hdf5Scenario/hdf5Scenario.h @@ -24,7 +24,7 @@ private: public: void hdf5Path (const string &h5Path); - void scenarioRead (ScenGenHardwareOutput_t &scenParams); + void scenarioRead (ScenHardware &scenParams); void prbDependParamsRead (ScenPrbDepHardwareParam &prbDepParams); QVector stbRead (void); diff --git a/include/model/hardware/core/lowLevelApi/TrxBoard.h b/include/model/hardware/core/lowLevelApi/TrxBoard.h index 0ffec59..8663723 100644 --- a/include/model/hardware/core/lowLevelApi/TrxBoard.h +++ b/include/model/hardware/core/lowLevelApi/TrxBoard.h @@ -10,27 +10,26 @@ #include #include -#include "model/hardware/core/lowLevelApi/register/clockDistributer/ClockDistributer.h" -#include "model/hardware/core/lowLevelApi/register/boardsCtrlMngt/BoardsCtrlMngt.h" -#include "model/hardware/core/lowLevelApi/register/fpgaProgram/FpgaProgram.h" -#include "model/hardware/core/lowLevelApi/register/builtInTest/BuiltInTest.h" -#include "model/hardware/core/lowLevelApi/register/beamFormer/BeamFormer.h" -#include "model/hardware/core/lowLevelApi/register/scenPlayer/ScenPlayer.h" -#include "model/hardware/core/lowLevelApi/register/bpiFlash/BpiFlash.h" -#include "model/hardware/core/lowLevelApi/register/emulator/Emulator.h" -#include "model/hardware/core/lowLevelApi/register/debug/Debug.h" -#include "model/hardware/core/lowLevelApi/register/misc/Misc.h" -#include "model/hardware/core/lowLevelApi/register/sram/Sram.h" -#include "model/hardware/core/lowLevelApi/register/dsp/Dsp.h" -#include "model/hardware/core/lowLevelApi/register/afe/Afe.h" - -#include "model/hardware/core/lowLevelApi/TrxBoardUtils/PreProcessorDef.h" +#include "register/clockDistributer/ClockDistributer.h" +#include "register/boardsCtrlMngt/BoardsCtrlMngt.h" +#include "register/fpgaProgram/FpgaProgram.h" +#include "register/builtInTest/BuiltInTest.h" +#include "register/beamFormer/BeamFormer.h" +#include "register/scenPlayer/ScenPlayer.h" +#include "register/bpiFlash/BpiFlash.h" +#include "register/emulator/Emulator.h" +#include "register/debug/Debug.h" +#include "register/misc/Misc.h" +#include "register/sram/Sram.h" +#include "register/dsp/Dsp.h" +#include "register/afe/Afe.h" + #include "model/hardware/device/SonoDevice.h" #include "TrxBoardUtils/TrxBoardStructures.h" #include "TrxBoardUtils/ScenParamsRanges.h" +#include "TrxBoardUtils/PreProcessorDef.h" #include "TrxBoardUtils/TrxBoardEnums.h" -#include "model/scenarioGenerator/dto/hardware/HardwareOutput.h" #include "model/scenarioGenerator/core/general/Calculation.h" #include "model/hardware/service/HardwarePacketEngine.h" @@ -217,7 +216,7 @@ public: ////////////////////////////////// Scenario API /////////////////////////////// void setProbeDependParams(ScenPrbDepHardwareParam& prbDepParams); - void setScenario(ScenGenHardwareOutput_t& scenGenHw); + void setScenario(ScenHardware& scenGenHw); void setLineFilterCoefficient(QVector& lineFilterLut); void setStbCoefficient(QVector& stbLut); diff --git a/include/model/hardware/core/lowLevelApi/TrxBoardUtils/PreProcessorDef.h b/include/model/hardware/core/lowLevelApi/TrxBoardUtils/PreProcessorDef.h index ed2d061..2063672 100644 --- a/include/model/hardware/core/lowLevelApi/TrxBoardUtils/PreProcessorDef.h +++ b/include/model/hardware/core/lowLevelApi/TrxBoardUtils/PreProcessorDef.h @@ -2,6 +2,6 @@ #define PREPROCESSORDEF_H #define MPS_BOARD -#define DEVELOP_UI +//#define DEVELOP_UI #endif //PREPROCESSORDEF_H diff --git a/include/model/hardware/core/lowLevelApi/TrxBoardUtils/TrxBoardStructures.h b/include/model/hardware/core/lowLevelApi/TrxBoardUtils/TrxBoardStructures.h index 0ebc7fa..6132a32 100644 --- a/include/model/hardware/core/lowLevelApi/TrxBoardUtils/TrxBoardStructures.h +++ b/include/model/hardware/core/lowLevelApi/TrxBoardUtils/TrxBoardStructures.h @@ -65,4 +65,168 @@ struct ScenPrbDepHardwareParam ScenPrbDepHwRegister prbDepParams; }; +struct Pulse +{ + quint32 halfPeriod; + quint32 halfCycleNo; + bool pulseVoltSel; + bool startPhase; + quint32 dampingPulseWidth; +}; + +struct RxBeamFormer +{ + quint32 mla; + quint32 lag; + quint32 apodizationSel; +}; + +struct ReceiverConfig +{ + quint32 mla; + quint32 lineMode; + quint32 aTgcSel; + quint32 stbEn; + quint32 stb; + quint32 subtractFilterEn; + quint32 dcCancelEn; + quint32 ncoFreqSel; + quint32 lpfSel; + quint32 absEn; + quint32 focusNo; + quint32 noiseRejectEn; + quint32 ddcEn; + quint32 frameType; + quint32 iqDataCrossEn; + quint32 logEn; + quint32 dTgcEn; + quint32 blendEn; +}; + +struct RxFreqResp +{ + QList startFreqLut; + QList endFreqLut; + QList startFreqPoint; + QList endFreqPoint; + QVector freqStepLut; + QVector lpfWeightStepLut; + QVector startLpfWeightLut; + QList> startLpf; + QList> endLpf; + QList lpfScale; +}; + +struct ApodizationParameters +{ + QList rxActiveElementStepStartPoint; + QList rxActiveElementStepStopPoint; + QList rxActiveElementStepChangePoint; + QList winOpenStartPoint; + QList winOpenStopPoint; + QList minApertureSize; + QList maxApertureSize; + + QVector rxActiveElementStep1; + QVector rxActiveElementStep2; + QVector winOpenStartVal; + QVector winOpenStepVal; + QVector winOpenStopVal; +}; + +struct HwRegister +{ + QVector dtgcLut; + QVector > blendWeight; + QVector elementXPosition; + QVector elementYPosition; + QVector elementZPosition; + QVector freqLut; + quint32 scenarioStartIndex; + quint32 scenarioEndIndex; + QList pulseProps; + quint8 pulseTypeNumber; + quint8 rxBeamFormerTypeNumber; + QList rxBeamFormerProps; + quint8 receiverConfigTypeNumber; + QList receiverConfigProps; + QList> lpfLut; + QList> atgcLut; + QList> apodizationLut; + QList mlaOffsetAddr; + quint32 noiseRejectValue; + quint32 frameLoggerControl; + RxFreqResp ddcParams; + ApodizationParameters apodizationParams; +}; + +struct HwSramIndex +{ + QVector shotPropertiesIndex; + QVector pulsePropertiesIndex; + QVector receiverConfigurationIndex; + QVector firstLineInFrame; + QVector startOfSubBatch; + QVector endOfSubBatch; + QVector endOfSubFrame; + QVector endOfEnsemble; + QVector isLastSubBatch; +}; + +struct HwSramRx +{ + QVector rxR0CenterActiveElementNumber; + QVector rxR0ActiveElementNumber; + QVector rxActiveElementStep; + QVector interceptPointFiringTime; + QVector r0Position; + QVector rxFocusPointNumber; + QVector thetaCos; + QVector thetaSin; + QVector phiCos; + QVector phiSin; + QVector interceptXPos; + QVector interceptYPos; + QVector interceptZPos; + QVector txR0MinDelay; + QVector rxR0MinDelay; + QVector rxR0MaxDelay; + QVector txR0MinDelayQ; + QVector rxR0MinDelayQ; + QVector rxR0MaxDelayQ; + QVector rxR0StartActiveElementNumber; + QVector r0XPosition; + QVector r0YPosition; + QVector r0ZPosition; +}; + +struct HwSramTx +{ + QVector txFocusXPos; + QVector txFocusYPos; + QVector txFocusZPos; + QVector txStartActiveElementNumber; + QVector txActiveElementNumber; + QVector minDelay; + QVector maxDelay; + QVector maxDelayQ; + QVector interceptXPos; + QVector interceptYPos; + QVector interceptZPos; +}; + +struct ScenHardware +{ + quint32 focusTypeNumber; + quint32 totalTxShotNumber; + QVector rxBeamFormerNumber; + QVector pulseInterval; + quint8 frameType; + + HwRegister hwRegister; + HwSramIndex indexParams; + HwSramRx rxParams; + HwSramTx txParams; +}; + #endif // TRXBOARDSTRUCTURES_H diff --git a/mainwindow.cpp b/mainwindow.cpp index 7385bd2..621f5ad 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -2511,7 +2511,7 @@ void MainWindow::setScenario(const QString& h5Path) afeConfig(afeConfigObj); Hdf5 hdf; - ScenGenHardwareOutput_t scenParams; + ScenHardware scenParams; ScenPrbDepHardwareParam prbDepParams; QVector lineFilterLut; QVector stbLut; diff --git a/src/model/hardware/core/lowLevelApi/TrxBoard.cpp b/src/model/hardware/core/lowLevelApi/TrxBoard.cpp index f16a55d..035164a 100644 --- a/src/model/hardware/core/lowLevelApi/TrxBoard.cpp +++ b/src/model/hardware/core/lowLevelApi/TrxBoard.cpp @@ -599,7 +599,7 @@ void TrxBoard::setProbeDependParams(ScenPrbDepHardwareParam& prbDepParams) setAfePwr(afePwrdnEnable); } -void TrxBoard::setScenario(ScenGenHardwareOutput_t& scenGenHw) +void TrxBoard::setScenario(ScenHardware& scenGenHw) { if(this->_scenPlayer->control.getCommand()) {