From 12d8972d4edaaa3f5214d04b4f69ded242b5f08b Mon Sep 17 00:00:00 2001 From: Arash Aletayeb Date: Wed, 9 Nov 2022 15:20:21 +0100 Subject: [PATCH] DSP LUTs are changed and Apodization parameters are added --- developHw.pro.user | 2 +- hdf5Scenario/hdf5Scenario.cpp | 207 ++++++++++++++++-- .../hardware/core/lowLevelApi/TrxBoard.h | 22 +- .../TrxBoardUtils/ScenParamsRanges.h | 12 +- .../TrxBoardUtils/TrxBoardStructures.h | 2 +- .../register/beamFormer/BeamFormer.h | 26 ++- .../ApodizationParameters.h | 23 ++ .../registerDefinition/ElementsActiveEnable.h | 48 ++++ .../registerDefinition/MaxApertureSize.h | 54 +++++ .../registerDefinition/MinApertureSize.h | 58 +++++ .../registerDefinition/RxActiveElementPoint.h | 54 +++++ .../registerDefinition/RxActiveElementStep.h | 61 ++++++ .../registerDefinition/RxBeamformerLut.h | 2 +- .../registerDefinition/WinOpenPoint.h | 54 +++++ .../registerDefinition/WinOpenVal.h | 61 ++++++ .../core/lowLevelApi/register/dsp/Dsp.h | 27 ++- .../register/dsp/registerDefinition/AtgcLut.h | 2 +- .../register/dsp/registerDefinition/BfScale.h | 2 +- .../dsp/registerDefinition/BlendWeight.h | 88 ++++---- .../register/dsp/registerDefinition/DtgcLut.h | 2 +- .../dsp/registerDefinition/EndFreqLut.h | 44 ++++ .../dsp/registerDefinition/FrameLoggerCtrl.h | 31 +++ .../dsp/registerDefinition/FreqPointLut.h | 65 ++++++ .../dsp/registerDefinition/FreqStepLut.h | 44 ++++ .../register/dsp/registerDefinition/LpfLut.h | 32 ++- .../dsp/registerDefinition/LpfWeightStepLut.h | 44 ++++ .../dsp/registerDefinition/ManualAtgc.h | 2 +- .../dsp/registerDefinition/MlaOffset.h | 2 +- .../dsp/registerDefinition/NoiseRejectValue.h | 2 +- .../ReceiverConfigurationLut.h | 10 + .../dsp/registerDefinition/StartFreqLut.h | 44 ++++ .../registerDefinition/StartLpfWeightLut.h | 44 ++++ .../dsp/registerDefinition/StbCoefficient.h | 2 +- .../misc/registerDefinition/FrameLostCount.h | 2 +- .../scenario/type/misc/ApodizationParams.h | 23 ++ .../scenario/type/misc/FrequencyPointLut.h | 11 + .../core/scenario/type/misc/ReceiverConfig.h | 1 + .../dto/hardware/HwScenarioDependent.h | 10 + mainwindow.cpp | 2 +- .../hardware/core/lowLevelApi/TrxBoard.cpp | 197 +++++++++++++---- .../register/beamFormer/BeamFormer.cpp | 84 ++++++- .../core/lowLevelApi/register/dsp/Dsp.cpp | 91 ++++++-- 42 files changed, 1436 insertions(+), 158 deletions(-) create mode 100644 include/model/hardware/core/lowLevelApi/register/beamFormer/registerDefinition/ApodizationParameters.h create mode 100644 include/model/hardware/core/lowLevelApi/register/beamFormer/registerDefinition/ElementsActiveEnable.h create mode 100644 include/model/hardware/core/lowLevelApi/register/beamFormer/registerDefinition/MaxApertureSize.h create mode 100644 include/model/hardware/core/lowLevelApi/register/beamFormer/registerDefinition/MinApertureSize.h create mode 100644 include/model/hardware/core/lowLevelApi/register/beamFormer/registerDefinition/RxActiveElementPoint.h create mode 100644 include/model/hardware/core/lowLevelApi/register/beamFormer/registerDefinition/RxActiveElementStep.h create mode 100644 include/model/hardware/core/lowLevelApi/register/beamFormer/registerDefinition/WinOpenPoint.h create mode 100644 include/model/hardware/core/lowLevelApi/register/beamFormer/registerDefinition/WinOpenVal.h create mode 100644 include/model/hardware/core/lowLevelApi/register/dsp/registerDefinition/EndFreqLut.h create mode 100644 include/model/hardware/core/lowLevelApi/register/dsp/registerDefinition/FrameLoggerCtrl.h create mode 100644 include/model/hardware/core/lowLevelApi/register/dsp/registerDefinition/FreqPointLut.h create mode 100644 include/model/hardware/core/lowLevelApi/register/dsp/registerDefinition/FreqStepLut.h create mode 100644 include/model/hardware/core/lowLevelApi/register/dsp/registerDefinition/LpfWeightStepLut.h create mode 100644 include/model/hardware/core/lowLevelApi/register/dsp/registerDefinition/StartFreqLut.h create mode 100644 include/model/hardware/core/lowLevelApi/register/dsp/registerDefinition/StartLpfWeightLut.h create mode 100644 include/model/scenarioGenerator/core/scenario/type/misc/ApodizationParams.h create mode 100644 include/model/scenarioGenerator/core/scenario/type/misc/FrequencyPointLut.h diff --git a/developHw.pro.user b/developHw.pro.user index 3843a9e..7b04dc7 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 935f2ed..fcba3a0 100644 --- a/hdf5Scenario/hdf5Scenario.cpp +++ b/hdf5Scenario/hdf5Scenario.cpp @@ -316,11 +316,63 @@ void Hdf5::scenarioRead(ScenGenHardwareOutput_t &scenParams) scenParams.hwRegister.blendWeight.push_back(tempBlendWeight); } - /**************** /registerParameters/freqLut ********************/ - datasetBranch ("/registerParameters/freqLut", floatArray); - scenParams.hwRegister.freqLut.clear(); - for (quint32 var = 0; var < 8; var++) - scenParams.hwRegister.freqLut.push_back(floatArray[var]); +// /**************** /registerParameters/freqLut ********************/ +// datasetBranch ("/registerParameters/freqLut", floatArray); +// scenParams.hwRegister.freqLut.clear(); +// for (quint32 var = 0; var < 8; var++) +// scenParams.hwRegister.freqLut.push_back(floatArray[var]); + + /*********** /registerParameters/ddcParameters/startFreqLut ***************/ + datasetBranch ("/registerParameters/ddcParameters/startFreqLut", floatArray); + scenParams.hwRegister.startFreqLut.clear(); + for (quint32 var = 0; var < 4; var++) + scenParams.hwRegister.startFreqLut.push_back(static_cast(floatArray[var])); + + /*********** /registerParameters/ddcParameters/endFreqLut ***************/ + datasetBranch ("/registerParameters/ddcParameters/endFreqLut", floatArray); + scenParams.hwRegister.endFreqLut.clear(); + for (quint32 var = 0; var < 4; var++) + scenParams.hwRegister.endFreqLut.push_back(static_cast(floatArray[var])); + + /*********** /registerParameters/ddcParameters/startFreqPointLut ***************/ + datasetBranch ("/registerParameters/ddcParameters/startFreqPointLut", floatArray); + QList startFreqPoint; + for (quint32 var = 0; var < 4; var++) + startFreqPoint.push_back(static_cast(floatArray[var])); + + /*********** /registerParameters/ddcParameters/endFreqPointLut ***************/ + datasetBranch ("/registerParameters/ddcParameters/endFreqPointLut", floatArray); + QList endFreqPoint; + for (quint32 var = 0; var < 4; var++) + endFreqPoint.push_back(static_cast(floatArray[var])); + + /*********** /registerParameters/ddcParameters/freqPointLut ***************/ + scenParams.hwRegister.freqPointLut.clear(); + for (qint32 var = 0; var < 4; var++) + { + FrequencyPointLut_t frequencyPointLut; + frequencyPointLut.startFreqPoint = startFreqPoint.at(var); + frequencyPointLut.endFreqPoint = endFreqPoint.at(var); + scenParams.hwRegister.freqPointLut.push_back(frequencyPointLut); + } + + /*********** /registerParameters/ddcParameters/freqStepLut ***************/ + datasetBranch ("/registerParameters/ddcParameters/freqStepLut", floatArray); + scenParams.hwRegister.freqStepLut.clear(); + for (quint32 var = 0; var < 4; var++) + scenParams.hwRegister.freqStepLut.push_back(floatArray[var]); + + /*********** /registerParameters/ddcParameters/lpfWeightStepLut ***************/ + datasetBranch ("/registerParameters/ddcParameters/lpfWeightStepLut", floatArray); + scenParams.hwRegister.lpfWeightStepLut.clear(); + for (quint32 var = 0; var < 4; var++) + scenParams.hwRegister.lpfWeightStepLut.push_back(floatArray[var]); + + /*********** /registerParameters/ddcParameters/startLpfWeightLut ***************/ + datasetBranch ("/registerParameters/ddcParameters/startLpfWeightLut", floatArray); + scenParams.hwRegister.startLpfWeightLut.clear(); + for (quint32 var = 0; var < 4; var++) + scenParams.hwRegister.startLpfWeightLut.push_back(floatArray[var]); /**************** /registerParameters/dTgcLut ********************/ datasetBranch ("/registerParameters/dTgcLut", floatArray); @@ -456,6 +508,97 @@ void Hdf5::scenarioRead(ScenGenHardwareOutput_t &scenParams) scenParams.hwRegister.rxBeamFormerProps.push_back(rxBeamformerObj); } + /********* /registerParameters/apodizationParameters/maxApertureSize ************/ + datasetBranch ("/registerParameters/apodizationParameters/maxApertureSize", floatArray); + QList maxApertureSize; + for (quint32 var = 0; var < scenParams.hwRegister.rxBeamFormerTypeNumber; var++) + maxApertureSize.push_back(static_cast(floatArray[var])); + + /********* /registerParameters/apodizationParameters/winOpenStartPoint ************/ + datasetBranch ("/registerParameters/apodizationParameters/winOpenStartPoint", floatArray); + QList winOpenStartPoint; + for (quint32 var = 0; var < scenParams.hwRegister.rxBeamFormerTypeNumber; var++) + winOpenStartPoint.push_back(static_cast(floatArray[var])); + + /********* /registerParameters/apodizationParameters/winOpenStopPoint ************/ + datasetBranch ("/registerParameters/apodizationParameters/winOpenStopPoint", floatArray); + QList winOpenStopPoint; + for (quint32 var = 0; var < scenParams.hwRegister.rxBeamFormerTypeNumber; var++) + winOpenStopPoint.push_back(static_cast(floatArray[var])); + + /********* /registerParameters/apodizationParameters/winOpenStartVal ************/ + datasetBranch ("/registerParameters/apodizationParameters/winOpenStartVal", floatArray); + QList winOpenStartVal; + for (quint32 var = 0; var < scenParams.hwRegister.rxBeamFormerTypeNumber; var++) + winOpenStartVal.push_back(floatArray[var]); + + /********* /registerParameters/apodizationParameters/winOpenStopVal ************/ + datasetBranch ("/registerParameters/apodizationParameters/winOpenStopVal", floatArray); + QList winOpenStopVal; + for (quint32 var = 0; var < scenParams.hwRegister.rxBeamFormerTypeNumber; var++) + winOpenStopVal.push_back(floatArray[var]); + + /********* /registerParameters/apodizationParameters/winOpenStepVal ************/ + datasetBranch ("/registerParameters/apodizationParameters/winOpenStepVal", floatArray); + QList winOpenStepVal; + for (quint32 var = 0; var < scenParams.hwRegister.rxBeamFormerTypeNumber; var++) + winOpenStepVal.push_back(floatArray[var]); + + /********* /registerParameters/apodizationParameters/minApertureSize ************/ + datasetBranch ("/registerParameters/apodizationParameters/minApertureSize", floatArray); + QList minApertureSize; + for (quint32 var = 0; var < scenParams.hwRegister.rxBeamFormerTypeNumber; var++) + minApertureSize.push_back(static_cast(floatArray[var])); + + /********* /registerParameters/apodizationParameters/rxActiveElementStep1 ************/ + datasetBranch ("/registerParameters/apodizationParameters/rxActiveElementStep1", floatArray); + QList rxActiveElementStep1; + for (quint32 var = 0; var < scenParams.hwRegister.rxBeamFormerTypeNumber; var++) + rxActiveElementStep1.push_back(floatArray[var]); + + /********* /registerParameters/apodizationParameters/rxActiveElementStep2 ************/ + datasetBranch ("/registerParameters/apodizationParameters/rxActiveElementStep2", floatArray); + QList rxActiveElementStep2; + for (quint32 var = 0; var < scenParams.hwRegister.rxBeamFormerTypeNumber; var++) + rxActiveElementStep2.push_back(floatArray[var]); + + /********* /registerParameters/apodizationParameters/rxActiveElementStepStartPoint ************/ + datasetBranch ("/registerParameters/apodizationParameters/rxActiveElementStepStartPoint", floatArray); + QList rxActiveElementStepStartPoint; + for (quint32 var = 0; var < scenParams.hwRegister.rxBeamFormerTypeNumber; var++) + rxActiveElementStepStartPoint.push_back(static_cast(floatArray[var])); + + /********* /registerParameters/apodizationParameters/rxActiveElementStepStopPoint ************/ + datasetBranch ("/registerParameters/apodizationParameters/rxActiveElementStepStopPoint", floatArray); + QList rxActiveElementStepStopPoint; + for (quint32 var = 0; var < scenParams.hwRegister.rxBeamFormerTypeNumber; var++) + rxActiveElementStepStopPoint.push_back(static_cast(floatArray[var])); + + /********* /registerParameters/apodizationParameters/rxActiveElementStepChangePoint ************/ + datasetBranch ("/registerParameters/apodizationParameters/rxActiveElementStepChangePoint", floatArray); + QList rxActiveElementStepChangePoint; + for (quint32 var = 0; var < scenParams.hwRegister.rxBeamFormerTypeNumber; var++) + rxActiveElementStepChangePoint.push_back(static_cast(floatArray[var])); + + /*********** registerParameters/apodizationParameters ***************/ + scenParams.hwRegister.apodizationParams.clear(); + for (qint32 var = 0; var < scenParams.hwRegister.rxBeamFormerTypeNumber; var++) + { + ApodizationParams_t apoParams; + apoParams.winOpenStepVal = winOpenStepVal.at(var); + apoParams.winOpenStopVal = winOpenStopVal.at(var); + apoParams.maxApertureSize = maxApertureSize.at(var); + apoParams.minApertureSize = minApertureSize.at(var); + apoParams.winOpenStartVal = winOpenStartVal.at(var); + apoParams.winOpenStopPoint = winOpenStopPoint.at(var); + apoParams.winOpenStartPoint = winOpenStartPoint.at(var); + apoParams.rxActiveElementStep1 = rxActiveElementStep1.at(var); + apoParams.rxActiveElementStep2 = rxActiveElementStep2.at(var); + apoParams.rxActiveElementStepStopPoint = rxActiveElementStepStopPoint.at(var); + apoParams.rxActiveElementStepStartPoint = rxActiveElementStepStartPoint.at(var); + apoParams.rxActiveElementStepChangePoint = rxActiveElementStepChangePoint.at(var); + scenParams.hwRegister.apodizationParams.push_back(apoParams); + } /**************** /registerParameters/receiverConfigProperties/mla ********************/ datasetBranch ("/registerParameters/receiverConfigProperties/mla", floatArray); @@ -610,6 +753,15 @@ void Hdf5::scenarioRead(ScenGenHardwareOutput_t &scenParams) noiseRejectEn.push_back(static_cast(floatArray[j])); } + /**************** /registerParameters/receiverConfigProperties/blendEn ********************/ + datasetBranch ("/registerParameters/receiverConfigProperties/blendEn", floatArray); + QList blendEn; + + for (quint32 j = 0; j < scenParams.hwRegister.receiverConfigTypeNumber; j++) + { + blendEn.push_back(static_cast(floatArray[j])); + } + /**************** /registerParameters/receiverConfigProperties ********************/ ReceiverConfig_t receiverCfgObj; scenParams.hwRegister.receiverConfigProps.clear(); @@ -623,6 +775,7 @@ void Hdf5::scenarioRead(ScenGenHardwareOutput_t &scenParams) receiverCfgObj.stbEn = stbEn.at(j); receiverCfgObj.lpfSel = lpfSel.at(j); receiverCfgObj.dTgcEn = dTgcEn.at(j); + receiverCfgObj.blendEn = blendEn.at(j); receiverCfgObj.aTgcSel = aTgcSel.at(j); receiverCfgObj.focusNo = focusNo.at(j); receiverCfgObj.lineMode = lineMode.at(j); @@ -706,7 +859,8 @@ void Hdf5::prbDependParamsRead(ScenPrbDepHardwareParam &prbDepParams) atgcCompensationLut.push_back(temp); } - /******************* /registerParameters/aTgc **********************/ + /************** /registerParameters/aTgcParameters/aTgc ******************/ + prbDepParams.prbDepParams.atgcLut.clear(); for (qint8 i = 0; i < 4; i++) { Atgc atgcObj; @@ -716,23 +870,46 @@ void Hdf5::prbDependParamsRead(ScenPrbDepHardwareParam &prbDepParams) prbDepParams.prbDepParams.atgcLut.push_back(atgcObj); } - /**************** /registerParameters/lpfLut ********************/ - datasetBranch ("/registerParameters/lpfLut", floatArray); - prbDepParams.prbDepParams.lpfLut.clear(); - QList tempLpf; + /*********** /registerParameters/ddcParameters/startLpfLut ****************/ + datasetBranch ("/registerParameters/ddcParameters/startLpfLut", floatArray); + QList> startLpf; + + for (quint32 i = 0; i < 4; i++) + { + QList temp; + for (quint32 j = 0; j < 64; j++) + { + temp.push_back(static_cast(floatArray[j + i * 64])); + } + startLpf.push_back(temp); + } + + /*********** /registerParameters/ddcParameters/endLpfLut ****************/ + datasetBranch ("/registerParameters/ddcParameters/endLpfLut", floatArray); + QList> endLpf; for (quint32 i = 0; i < 4; i++) { - tempLpf.clear(); + QList temp; for (quint32 j = 0; j < 64; j++) { - tempLpf.push_back(static_cast(floatArray[j + i * 64])); + temp.push_back(static_cast(floatArray[j + i * 64])); } - prbDepParams.prbDepParams.lpfLut.push_back(tempLpf); + endLpf.push_back(temp); + } + + /******************* /registerParameters/ddcParameters/lpfLut **********************/ + prbDepParams.prbDepParams.lpfLut.clear(); + for (qint8 i = 0; i < 4; i++) + { + Lpf lpfObj; + lpfObj.startLpf = startLpf.at(i); + lpfObj.endLpf = endLpf.at(i); + prbDepParams.prbDepParams.lpfLut.push_back(lpfObj); } - /**************** /registerParameters/lpfScale ********************/ - datasetBranch ("/registerParameters/lpfScale", floatArray); + /************* /registerParameters/ddcParameters/lpfScale *****************/ + datasetBranch ("/registerParameters/ddcParameters/lpfScale", floatArray); prbDepParams.prbDepParams.lpfScaleCoeff.clear(); for (quint8 i = 0; i < 4; i++) prbDepParams.prbDepParams.lpfScaleCoeff.push_back(static_cast(floatArray[i])); diff --git a/include/model/hardware/core/lowLevelApi/TrxBoard.h b/include/model/hardware/core/lowLevelApi/TrxBoard.h index 5cf9be5..ac3c729 100644 --- a/include/model/hardware/core/lowLevelApi/TrxBoard.h +++ b/include/model/hardware/core/lowLevelApi/TrxBoard.h @@ -35,7 +35,7 @@ #include "model/hardware/service/HardwarePacketEngine.h" #define SLAVE_ELEMENT_SEGMENT 64U -#define TOTAL_SCEN_LUT_SRAM 5U +#define TOTAL_SCEN_LUT_SRAM 6U #define MOUNTED_SLAVE_FPGA 7U #define CLOCK_DIVISION 0x55 @@ -108,23 +108,38 @@ private: set }; + enum eActiveElements : quint8 + { + slave0Elements, + slave1Elements, + slave2Elements + }; + struct ScenHwRegister { ///////////// BeamFormer ///////////// + QList apodizationParams; + ProbeElementPosition* elementPosition; RxBeamformerProperties* rxBeamformer; - ProbeElementPosition* elementPosition; PulseProperties* pulse; quint8 pulseTypeNumber; quint8 rxBeamFormerTypeNumber; //////////////// DSP //////////////// - QVector freqLut; + QVector freqStepLut; + QVector lpfWeightStepLut; + QVector startLpfWeightLut; + QVector freqLut; QVector dtgcLut; ReceiverConfiguration* configLut; + FreqPoint* freqPoint; QVector > blendWeight; quint8 receiverConfigTypeNumber; QList mlaOffsetAddr; + QList startFreqLut; + QList endFreqLut; quint32 noiseReject; + quint32 frameLoggerControl; ScenHwRegister(); ~ScenHwRegister(); }; @@ -273,6 +288,7 @@ public: void getFpgasCodeVersion(FpgaCodeVersion* version) const; void sramParityClear(); quint32 getFrameLostCounter(void) const; + void elementActiveEnable(eActiveElements &slaveElements, quint64 &elements) const; ////////////////////////////////// Logger API ///////////////////////////////// void adcCaptureConfig(captureConfig& capCfg) const; diff --git a/include/model/hardware/core/lowLevelApi/TrxBoardUtils/ScenParamsRanges.h b/include/model/hardware/core/lowLevelApi/TrxBoardUtils/ScenParamsRanges.h index 54ce023..0df77dc 100644 --- a/include/model/hardware/core/lowLevelApi/TrxBoardUtils/ScenParamsRanges.h +++ b/include/model/hardware/core/lowLevelApi/TrxBoardUtils/ScenParamsRanges.h @@ -3,10 +3,16 @@ /****************** DSP ******************/ #define RRECEIVER_CONFIGURATION_LUT_MAX 8U +#define START_LPF_WEIGHT_LUT_MAX 4U #define STB_COEFFICIENT_LUT_MAX 8 -#define LINE_FILTER_LUT_MAX 3 +#define LPF_WEIGHT_STEP_LUT_MAX 4U #define BLENDWEIGHT_LUT_MAX 4 +#define LINE_FILTER_LUT_MAX 3 +#define START_FREQ_LUT_MAX 4U +#define FREQ_POINT_LUT_MAX 4U +#define FREQ_STEP_LUT_MAX 4U #define FREQUENCY_LUT_MAX 8 +#define END_FREQ_LUT_MAX 4U #define LPF_SCALE_MAX 4 #define DTGC_LUT_MAX 1024 #define ATGC_LUT_MAX 4 @@ -15,12 +21,12 @@ /************** Beam Former **************/ #define ELEMENT_POSITION_LUT_MAX 192 #define APODIZATIONLUT_LUT_MAX 4 -#define RXBEAMFORMER_LUT_MAX 8U +#define RXBEAMFORMER_LUT_MAX 4 #define PULSE_LUT_MAX 8U /****************** SRAM *****************/ #define TOTAL_TX_SHOT_NUMBER_MAX 131072U -#define RX_BEAMFORMER_NUMBER_MAX 14563U +#define RX_BEAMFORMER_NUMBER_MAX 14563 #define FOCUS_TYPE_NUMBER_MAX 14563U /************* Scenario Index ************/ diff --git a/include/model/hardware/core/lowLevelApi/TrxBoardUtils/TrxBoardStructures.h b/include/model/hardware/core/lowLevelApi/TrxBoardUtils/TrxBoardStructures.h index 1c84700..caff6ea 100644 --- a/include/model/hardware/core/lowLevelApi/TrxBoardUtils/TrxBoardStructures.h +++ b/include/model/hardware/core/lowLevelApi/TrxBoardUtils/TrxBoardStructures.h @@ -56,7 +56,7 @@ struct ConnectedPrbInfo struct ScenPrbDepHwRegister { QList lpfScaleCoeff; - QList> lpfLut; + QList lpfLut; QList atgcLut; QList> apodizationLut; }; diff --git a/include/model/hardware/core/lowLevelApi/register/beamFormer/BeamFormer.h b/include/model/hardware/core/lowLevelApi/register/beamFormer/BeamFormer.h index c647e70..8b2a43c 100644 --- a/include/model/hardware/core/lowLevelApi/register/beamFormer/BeamFormer.h +++ b/include/model/hardware/core/lowLevelApi/register/beamFormer/BeamFormer.h @@ -1,22 +1,38 @@ #ifndef BEAMFORMER_H #define BEAMFORMER_H +#include "registerDefinition/ApodizationParameters.h" +#include "registerDefinition/ElementsActiveEnable.h" +#include "registerDefinition/RxActiveElementPoint.h" +#include "registerDefinition/RxActiveElementStep.h" #include "registerDefinition/ElementPositionLut.h" #include "registerDefinition/RxBeamformerLut.h" +#include "registerDefinition/MaxApertureSize.h" +#include "registerDefinition/MinApertureSize.h" #include "registerDefinition/ApodizationLut.h" +#include "registerDefinition/WinOpenPoint.h" +#include "registerDefinition/WinOpenVal.h" #include "registerDefinition/RegValid.h" #include "registerDefinition/PulseLut.h" #include "registerDefinition/AfeLut.h" -#define APODIZATION_OFFSET 0x4000 +#define APODIZATION_PARAMS_OFFSET 0x8 #define ELEMENT_POSITION_OFFSET 0x400 +#define APODIZATION_OFFSET 0x4000 class BeamFormer { private: + ElementsActiveEnable* _elementsActiveEnable; + RxActiveElementPoint* _rxActiveElementPoint; + RxActiveElementStep* _rxActiveElementStep; ElementPositionLut* _elementPosition; + MaxApertureSize* _maxApertureSize; + MinApertureSize* _minApertureSize; RxBeamformerLut* _rxBeamformer; ApodizationLut* _apodization; + WinOpenPoint* _winOpenPoint; + WinOpenVal* _winOpenVal; RegValid* _regValid; PulseLut* _pulse; AfeLut* _afe; @@ -25,12 +41,14 @@ public: explicit BeamFormer(SonoDevice* device, quint32 offset); ~BeamFormer(); - void probeElementPosition (QList>& elementPosition) const; void rxBeamformerProperties (quint8& rxBeamFormerTypeNumber, RxBeamformerProperties* rxBeamformer) const; - void apodizationLut (QList>& apodization) const; + void apodizationParameters (QList& apoParams) const; + void probeElementPosition (QList>& elementPosition) const; void pulseProperties (quint8& pulseTypeNumber, PulseProperties* pulse) const; - void afeLut (AfeProperties* afe) const; + void elementActiveEn(QList &elements) const; + void apodizationLut (QList>& apodization) const; void regValid (bool valid) const; + void afeLut (AfeProperties* afe) const; }; #endif // BEAMFORMER_H diff --git a/include/model/hardware/core/lowLevelApi/register/beamFormer/registerDefinition/ApodizationParameters.h b/include/model/hardware/core/lowLevelApi/register/beamFormer/registerDefinition/ApodizationParameters.h new file mode 100644 index 0000000..d4dff17 --- /dev/null +++ b/include/model/hardware/core/lowLevelApi/register/beamFormer/registerDefinition/ApodizationParameters.h @@ -0,0 +1,23 @@ +#ifndef APODIZATIONPARAMETERS_H +#define APODIZATIONPARAMETERS_H + +#include "model/hardware/core/lowLevelApi/register/Register.h" +#include "model/hardware/core/lowLevelApi/register/RegUtils.h" + +struct ApodizationParameters { + quint32 rxActiveElementStepStartPoint; + quint32 rxActiveElementStepStopPoint; + quint32 rxActiveElementStepChangePoint; + quint32 winOpenStartPoint; + quint32 winOpenStopPoint; + quint32 minApertureSize; + quint32 maxApertureSize; + + float rxActiveElementStep1; + float rxActiveElementStep2; + float winOpenStartVal; + float winOpenStepVal; + float winOpenStopVal; +}; + +#endif // APODIZATIONPARAMETERS_H diff --git a/include/model/hardware/core/lowLevelApi/register/beamFormer/registerDefinition/ElementsActiveEnable.h b/include/model/hardware/core/lowLevelApi/register/beamFormer/registerDefinition/ElementsActiveEnable.h new file mode 100644 index 0000000..ca1895e --- /dev/null +++ b/include/model/hardware/core/lowLevelApi/register/beamFormer/registerDefinition/ElementsActiveEnable.h @@ -0,0 +1,48 @@ +#ifndef ELEMENTSACTIVEENABLE_H +#define ELEMENTSACTIVEENABLE_H + +#include "model/hardware/core/lowLevelApi/register/Register.h" +#include "model/hardware/core/lowLevelApi/register/RegUtils.h" + +#undef BAR + +#define ELEMENTS_MASK 0xFFFFFFFF + +#define BAR 0 +#define OFFSET 0x4D0000 +#define LENGTH 2U + +class ElementsActiveEnable : public Register +{ +private: + QList _elements; + + void prepareData(quint32 index) override + { + elements->setValue(_elements[static_cast(index)]); + } + +public: + Field* elements; + + void setElementsActiveEnable (QList& elements) + { + _elements = elements; + } + + ElementsActiveEnable(SonoDevice* device, quint32 offset) : Register(BAR, + OFFSET + offset, + device, + LENGTH) + { + ADD_UNSIGNED_FIELD(elements, ELEMENTS_MASK); + } +}; + +#undef ELEMENTS_MASK + +#undef BAR +#undef OFFSET +#undef LENGTH + +#endif // ELEMENTSACTIVEENABLE_H diff --git a/include/model/hardware/core/lowLevelApi/register/beamFormer/registerDefinition/MaxApertureSize.h b/include/model/hardware/core/lowLevelApi/register/beamFormer/registerDefinition/MaxApertureSize.h new file mode 100644 index 0000000..978e65c --- /dev/null +++ b/include/model/hardware/core/lowLevelApi/register/beamFormer/registerDefinition/MaxApertureSize.h @@ -0,0 +1,54 @@ +#ifndef MAXAPERTURESIZE_H +#define MAXAPERTURESIZE_H + +#include "model/scenarioGenerator/core/general/Calculation.h" +#include "model/hardware/core/lowLevelApi/register/Register.h" +#include "model/hardware/core/lowLevelApi/register/RegUtils.h" +#include "ApodizationParameters.h" + +#undef BAR + +#define RX_ACTIVE_ELEMENT_STEP_CHANGE_POINT 0x0000FFFF +#define MAX_APERTURE_SIZE 0xFFFF0000 + +#define BAR 0U +#define OFFSET 0x480494 +#define LENGTH 1U + +class MaxApertureSize : public Register +{ +private: + quint32 _rxActiveElementStepChangePointQ; + quint32 _maxApertureSizeQ; + + void prepareData(quint32 index) override + { + rxActiveElementStepChangePoint->setValue(_rxActiveElementStepChangePointQ); + maxApertureSize->setValue(_maxApertureSizeQ); + } + +public: + Field* rxActiveElementStepChangePoint; + Field* maxApertureSize; + + void setMaxApertureSize (ApodizationParameters* params) + { + _rxActiveElementStepChangePointQ = params->rxActiveElementStepChangePoint; + _maxApertureSizeQ = params->maxApertureSize; + } + + MaxApertureSize(SonoDevice* device, quint32 offset) : Register(BAR, OFFSET+offset, device, LENGTH) + { + ADD_UNSIGNED_FIELD(rxActiveElementStepChangePoint, RX_ACTIVE_ELEMENT_STEP_CHANGE_POINT); + ADD_UNSIGNED_FIELD(maxApertureSize, MAX_APERTURE_SIZE); + } +}; + +#undef RX_ACTIVE_ELEMENT_STEP_CHANGE_POINT +#undef MAX_APERTURE_SIZE + +#undef BAR +#undef OFFSET +#undef LENGTH + +#endif // MAXAPERTURESIZE_H diff --git a/include/model/hardware/core/lowLevelApi/register/beamFormer/registerDefinition/MinApertureSize.h b/include/model/hardware/core/lowLevelApi/register/beamFormer/registerDefinition/MinApertureSize.h new file mode 100644 index 0000000..976f95e --- /dev/null +++ b/include/model/hardware/core/lowLevelApi/register/beamFormer/registerDefinition/MinApertureSize.h @@ -0,0 +1,58 @@ +#ifndef MINAPERTURESIZE_H +#define MINAPERTURESIZE_H + +#include "model/scenarioGenerator/core/general/Calculation.h" +#include "model/hardware/core/lowLevelApi/register/Register.h" +#include "model/hardware/core/lowLevelApi/register/RegUtils.h" +#include "ApodizationParameters.h" + +#undef BAR + +#define WIN_OPEN_STEP_VAL 0x0000FFFF +#define MIN_APERTURE_SIZE 0xFFFF0000 + +#define BAR 0U +#define OFFSET 0x480488 +#define LENGTH 1U + +class MinApertureSize : public Register +{ +private: + quint32 _winOpenStepValQ; + quint32 _minApertureSizeQ; + + void prepareData(quint32 index) override + { + winOpenStepVal->setValue(_winOpenStepValQ); + minApertureSize->setValue(_minApertureSizeQ); + } + +public: + Field* winOpenStepVal; + Field* minApertureSize; + + void setMinApertureSize (ApodizationParameters* params) + { + QVector temp; + temp.append(params->winOpenStepVal); + QVector tempQ = Calculation::qntzr(temp, 0, 16, 23, 0, true); + _winOpenStepValQ = tempQ.at(0); + + _minApertureSizeQ = params->minApertureSize; + } + + MinApertureSize(SonoDevice* device, quint32 offset) : Register(BAR, OFFSET+offset, device, LENGTH) + { + ADD_UNSIGNED_FIELD(winOpenStepVal, WIN_OPEN_STEP_VAL); + ADD_UNSIGNED_FIELD(minApertureSize, MIN_APERTURE_SIZE); + } +}; + +#undef WIN_OPEN_STEP_VAL +#undef MIN_APERTURE_SIZE + +#undef BAR +#undef OFFSET +#undef LENGTH + +#endif // MINAPERTURESIZE_H diff --git a/include/model/hardware/core/lowLevelApi/register/beamFormer/registerDefinition/RxActiveElementPoint.h b/include/model/hardware/core/lowLevelApi/register/beamFormer/registerDefinition/RxActiveElementPoint.h new file mode 100644 index 0000000..eec97f4 --- /dev/null +++ b/include/model/hardware/core/lowLevelApi/register/beamFormer/registerDefinition/RxActiveElementPoint.h @@ -0,0 +1,54 @@ +#ifndef RXACTIVEELEMENTPOINT_H +#define RXACTIVEELEMENTPOINT_H + +#include "model/scenarioGenerator/core/general/Calculation.h" +#include "model/hardware/core/lowLevelApi/register/Register.h" +#include "model/hardware/core/lowLevelApi/register/RegUtils.h" +#include "ApodizationParameters.h" + +#undef BAR + +#define RX_ACTIVE_ELEMENT_STEP_START_POINT 0x0000FFFF +#define RX_ACTIVE_ELEMENT_STEP_STOP_POINT 0xFFFF0000 + +#define BAR 0U +#define OFFSET 0x480490 +#define LENGTH 1U + +class RxActiveElementPoint : public Register +{ +private: + quint32 _rxActiveElementStepStartPointQ; + quint32 _rxActiveElementStepStopPointQ; + + void prepareData(quint32 index) override + { + rxActiveElementStepStartPoint->setValue(_rxActiveElementStepStartPointQ); + rxActiveElementStepStopPoint->setValue(_rxActiveElementStepStopPointQ); + } + +public: + Field* rxActiveElementStepStartPoint; + Field* rxActiveElementStepStopPoint; + + void setRxActiveElementPoint (ApodizationParameters* params) + { + _rxActiveElementStepStartPointQ = params->rxActiveElementStepStartPoint; + _rxActiveElementStepStopPointQ = params->rxActiveElementStepStopPoint; + } + + RxActiveElementPoint(SonoDevice* device, quint32 offset) : Register(BAR, OFFSET+offset, device, LENGTH) + { + ADD_UNSIGNED_FIELD(rxActiveElementStepStartPoint, RX_ACTIVE_ELEMENT_STEP_START_POINT); + ADD_UNSIGNED_FIELD(rxActiveElementStepStopPoint, RX_ACTIVE_ELEMENT_STEP_STOP_POINT); + } +}; + +#undef RX_ACTIVE_ELEMENT_STEP_START_POINT +#undef RX_ACTIVE_ELEMENT_STEP_STOP_POINT + +#undef BAR +#undef OFFSET +#undef LENGTH + +#endif // RXACTIVEELEMENTPOINT_H diff --git a/include/model/hardware/core/lowLevelApi/register/beamFormer/registerDefinition/RxActiveElementStep.h b/include/model/hardware/core/lowLevelApi/register/beamFormer/registerDefinition/RxActiveElementStep.h new file mode 100644 index 0000000..ca248e0 --- /dev/null +++ b/include/model/hardware/core/lowLevelApi/register/beamFormer/registerDefinition/RxActiveElementStep.h @@ -0,0 +1,61 @@ +#ifndef RXACTIVEELEMENTSTEP_H +#define RXACTIVEELEMENTSTEP_H + +#include "model/scenarioGenerator/core/general/Calculation.h" +#include "model/hardware/core/lowLevelApi/register/Register.h" +#include "model/hardware/core/lowLevelApi/register/RegUtils.h" +#include "ApodizationParameters.h" + +#undef BAR + +#define RX_ACTIVE_ELEMENT_STEP_1 0x0000FFFF +#define RX_ACTIVE_ELEMENT_STEP_2 0xFFFF0000 + +#define BAR 0U +#define OFFSET 0x48048C +#define LENGTH 1U + +class RxActiveElementStep : public Register +{ +private: + quint32 _rxActiveElementStep1Q; + quint32 _rxActiveElementStep2Q; + + void prepareData(quint32 index) override + { + rxActiveElementStep1->setValue(_rxActiveElementStep1Q); + rxActiveElementStep2->setValue(_rxActiveElementStep2Q); + } + +public: + Field* rxActiveElementStep1; + Field* rxActiveElementStep2; + + void setRxActiveElementStep (ApodizationParameters* params) + { + QVector temp; + temp.append(params->rxActiveElementStep1); + QVector tempQ = Calculation::qntzr(temp, 0, 16, 19, 0, true); + _rxActiveElementStep1Q = tempQ.at(0); + + temp.clear(); + temp.append(params->rxActiveElementStep2); + tempQ = Calculation::qntzr(temp, 0, 16, 19, 0, true); + _rxActiveElementStep2Q = tempQ.at(0); + } + + RxActiveElementStep(SonoDevice* device, quint32 offset) : Register(BAR, OFFSET+offset, device, LENGTH) + { + ADD_UNSIGNED_FIELD(rxActiveElementStep1, RX_ACTIVE_ELEMENT_STEP_1); + ADD_UNSIGNED_FIELD(rxActiveElementStep2, RX_ACTIVE_ELEMENT_STEP_2); + } +}; + +#undef RX_ACTIVE_ELEMENT_STEP_1 +#undef RX_ACTIVE_ELEMENT_STEP_2 + +#undef BAR +#undef OFFSET +#undef LENGTH + +#endif // RXACTIVEELEMENTSTEP_H diff --git a/include/model/hardware/core/lowLevelApi/register/beamFormer/registerDefinition/RxBeamformerLut.h b/include/model/hardware/core/lowLevelApi/register/beamFormer/registerDefinition/RxBeamformerLut.h index 8a97a3d..d0b927f 100644 --- a/include/model/hardware/core/lowLevelApi/register/beamFormer/registerDefinition/RxBeamformerLut.h +++ b/include/model/hardware/core/lowLevelApi/register/beamFormer/registerDefinition/RxBeamformerLut.h @@ -12,7 +12,7 @@ #define BAR 0U #define OFFSET 0x480400 -#define LENGTH 8U +#define LENGTH 4U struct RxBeamformerProperties { diff --git a/include/model/hardware/core/lowLevelApi/register/beamFormer/registerDefinition/WinOpenPoint.h b/include/model/hardware/core/lowLevelApi/register/beamFormer/registerDefinition/WinOpenPoint.h new file mode 100644 index 0000000..37983a5 --- /dev/null +++ b/include/model/hardware/core/lowLevelApi/register/beamFormer/registerDefinition/WinOpenPoint.h @@ -0,0 +1,54 @@ +#ifndef WINOPENPOINT_H +#define WINOPENPOINT_H + +#include "model/scenarioGenerator/core/general/Calculation.h" +#include "model/hardware/core/lowLevelApi/register/Register.h" +#include "model/hardware/core/lowLevelApi/register/RegUtils.h" +#include "ApodizationParameters.h" + +#undef BAR + +#define WIN_OPEN_START_POINT 0x0000FFFF +#define WIN_OPEN_STOP_POINT 0xFFFF0000 + +#define BAR 0U +#define OFFSET 0x480480 +#define LENGTH 1U + +class WinOpenPoint : public Register +{ +private: + quint32 _winOpenStartPointQ; + quint32 _winOpenStopPointQ; + + void prepareData(quint32 index) override + { + winOpenStartPoint->setValue(_winOpenStartPointQ); + winOpenStopPoint->setValue(_winOpenStopPointQ); + } + +public: + Field* winOpenStartPoint; + Field* winOpenStopPoint; + + void setWinOpenPoint (ApodizationParameters* params) + { + _winOpenStartPointQ = params->winOpenStartPoint; + _winOpenStopPointQ = params->winOpenStopPoint; + } + + WinOpenPoint(SonoDevice* device, quint32 offset) : Register(BAR, OFFSET+offset, device, LENGTH) + { + ADD_UNSIGNED_FIELD(winOpenStartPoint, WIN_OPEN_START_POINT); + ADD_UNSIGNED_FIELD(winOpenStopPoint, WIN_OPEN_STOP_POINT); + } +}; + +#undef WIN_OPEN_START_POINT +#undef WIN_OPEN_STOP_POINT + +#undef BAR +#undef OFFSET +#undef LENGTH + +#endif // WINOPENPOINT_H diff --git a/include/model/hardware/core/lowLevelApi/register/beamFormer/registerDefinition/WinOpenVal.h b/include/model/hardware/core/lowLevelApi/register/beamFormer/registerDefinition/WinOpenVal.h new file mode 100644 index 0000000..6712542 --- /dev/null +++ b/include/model/hardware/core/lowLevelApi/register/beamFormer/registerDefinition/WinOpenVal.h @@ -0,0 +1,61 @@ +#ifndef WINOPENVAL_H +#define WINOPENVAL_H + +#include "model/scenarioGenerator/core/general/Calculation.h" +#include "model/hardware/core/lowLevelApi/register/Register.h" +#include "model/hardware/core/lowLevelApi/register/RegUtils.h" +#include "ApodizationParameters.h" + +#undef BAR + +#define WIN_OPEN_START_VAL 0x0000FFFF +#define WIN_OPEN_STOP_VAL 0xFFFF0000 + +#define BAR 0U +#define OFFSET 0x480484 +#define LENGTH 1U + +class WinOpenVal : public Register +{ +private: + quint32 _winOpenStartValQ; + quint32 _winOpenStopValQ; + + void prepareData(quint32 index) override + { + winOpenStartVal->setValue(_winOpenStartValQ); + winOpenStopVal->setValue(_winOpenStopValQ); + } + +public: + Field* winOpenStartVal; + Field* winOpenStopVal; + + void setWinOpenVal (ApodizationParameters* params) + { + QVector temp; + temp.append(params->winOpenStartVal); + QVector tempQ = Calculation::qntzr(temp, 0, 16, 12, 0, true); + _winOpenStartValQ = tempQ.at(0); + + temp.clear(); + temp.append(params->winOpenStopVal); + tempQ = Calculation::qntzr(temp, 0, 16, 12, 0, true); + _winOpenStopValQ = tempQ.at(0); + } + + WinOpenVal(SonoDevice* device, quint32 offset) : Register(BAR, OFFSET+offset, device, LENGTH) + { + ADD_UNSIGNED_FIELD(winOpenStartVal, WIN_OPEN_START_VAL); + ADD_UNSIGNED_FIELD(winOpenStopVal, WIN_OPEN_STOP_VAL); + } +}; + +#undef WIN_OPEN_START_VAL +#undef WIN_OPEN_STOP_VAL + +#undef BAR +#undef OFFSET +#undef LENGTH + +#endif // WINOPENVAL_H diff --git a/include/model/hardware/core/lowLevelApi/register/dsp/Dsp.h b/include/model/hardware/core/lowLevelApi/register/dsp/Dsp.h index f59e227..ce5425d 100644 --- a/include/model/hardware/core/lowLevelApi/register/dsp/Dsp.h +++ b/include/model/hardware/core/lowLevelApi/register/dsp/Dsp.h @@ -3,10 +3,17 @@ #include "registerDefinition/ReceiverConfigurationLut.h" #include "registerDefinition/LineFilterCoefficient.h" +#include "registerDefinition/StartLpfWeightLut.h" #include "registerDefinition/NoiseRejectValue.h" +#include "registerDefinition/LpfWeightStepLut.h" +#include "registerDefinition/FrameLoggerCtrl.h" #include "registerDefinition/StbCoefficient.h" -#include "registerDefinition/FrequencyLut.h" #include "registerDefinition/BlendWeight.h" +#include "registerDefinition/FrequencyLut.h" +#include "registerDefinition/FreqPointLut.h" +#include "registerDefinition/StartFreqLut.h" +#include "registerDefinition/FreqStepLut.h" +#include "registerDefinition/EndFreqLut.h" #include "registerDefinition/ManualAtgc.h" #include "registerDefinition/MlaOffset.h" #include "registerDefinition/DtgcLut.h" @@ -29,10 +36,17 @@ class Dsp private: ReceiverConfigurationLut* _configLut; LineFilterCoefficient* _lineFilterLut; + StartLpfWeightLut* _startLpfWeightLut; NoiseRejectValue* _noiseReject; + LpfWeightStepLut* _lpfWeightStepLut; + FrameLoggerCtrl* _frameLoggerCtrl; StbCoefficient* _stbLut; FrequencyLut* _freqLut; + StartFreqLut* _startFreqLut; + FreqPointLut* _freqPointLut; + FreqStepLut* _freqStepLut; BlendWeight* _blendWeight; + EndFreqLut* _endFreqLut; ManualAtgc* _manualAtgc; MlaOffset* _mlaOffset; DtgcLut* _dtgcLut; @@ -47,15 +61,22 @@ public: void receiverConfigurationLut (quint8& receiverConfigTypeNumber, ReceiverConfiguration* configLut) const; void lineFilterCoefficient (QList& lineFilterLut) const; void lpfScaleCoefficient (QList& lpfScaleCoeff) const; + void startLpfWeightLut (QList& startLpfWeightLut) const; + void lpfWeightStepLut (QList& lpfWeightStepLut) const; + void frameLoggerCtrl (quint32& frameLoggerCtrl) const; void stbCoefficient (QList& stbLut) const; void mlaOffsetAddr(QList& mlaLut) const; - void frequencyLut (QList& freqLut) const; void blendWeight (QList>& blendWeight) const; + void frequencyLut (QList& freqLut) const; + void startFreqLut (QList& startFreq) const; + void freqPointLut (FreqPoint* freqPoint) const; + void freqStepLut (QList& freqStep) const; void noiseReject(quint32& rejectValue) const; + void endFreqLut (QList& endFreq) const; void atgcMode (eAtgcMode mode, quint16 value) const; void dtgcLut (QList& dtgcLut) const; void atgcLut (QList atgcLut) const; - void lpfLut (QList>& lpfLut) const; + void lpfLut (QList& lpfLut) const; }; #endif // DSP_H diff --git a/include/model/hardware/core/lowLevelApi/register/dsp/registerDefinition/AtgcLut.h b/include/model/hardware/core/lowLevelApi/register/dsp/registerDefinition/AtgcLut.h index 9bd594a..d4c940e 100644 --- a/include/model/hardware/core/lowLevelApi/register/dsp/registerDefinition/AtgcLut.h +++ b/include/model/hardware/core/lowLevelApi/register/dsp/registerDefinition/AtgcLut.h @@ -11,7 +11,7 @@ #define ATGC_COMPENSATE_LUT_MASK 0xFFFF0000 #define BAR 0 -#define OFFSET 0x85000 +#define OFFSET 0x85800 #define LENGTH 256U struct Atgc diff --git a/include/model/hardware/core/lowLevelApi/register/dsp/registerDefinition/BfScale.h b/include/model/hardware/core/lowLevelApi/register/dsp/registerDefinition/BfScale.h index 50828c9..31e8701 100644 --- a/include/model/hardware/core/lowLevelApi/register/dsp/registerDefinition/BfScale.h +++ b/include/model/hardware/core/lowLevelApi/register/dsp/registerDefinition/BfScale.h @@ -12,7 +12,7 @@ #define BF_COEFF4_MASK 0xFF000000 #define BAR 0 -#define OFFSET 0x86018 +#define OFFSET 0x86818 class BfScale : public Register { diff --git a/include/model/hardware/core/lowLevelApi/register/dsp/registerDefinition/BlendWeight.h b/include/model/hardware/core/lowLevelApi/register/dsp/registerDefinition/BlendWeight.h index ca45f9a..4341380 100644 --- a/include/model/hardware/core/lowLevelApi/register/dsp/registerDefinition/BlendWeight.h +++ b/include/model/hardware/core/lowLevelApi/register/dsp/registerDefinition/BlendWeight.h @@ -1,44 +1,44 @@ -#ifndef BLENDWEIGHT_H -#define BLENDWEIGHT_H - -#include "model/hardware/core/lowLevelApi/register/Register.h" -#include "model/hardware/core/lowLevelApi/register/RegUtils.h" - -#undef BAR - -#define BLEND_WEIGHT_MASK 0x000001FF - -#define BAR 0 -#define OFFSET 0x82000 -#define LENGTH 512U - -class BlendWeight : public Register -{ -private: - QList _blendWeight; - - void prepareData(quint32 index) override - { - blendWeight->setValue(_blendWeight[static_cast(index)]); - } - -public: - Field* blendWeight; - - void setBlendWeight (QList& blendWeight) { - _blendWeight = blendWeight; - } - - BlendWeight(SonoDevice* device) : Register(BAR, OFFSET, device, LENGTH) - { - ADD_UNSIGNED_FIELD(blendWeight, BLEND_WEIGHT_MASK); - } -}; - -#undef BLEND_WEIGHT_MASK - -#undef BAR -#undef OFFSET -#undef LENGTH - -#endif // BLENDWEIGHT_H +#ifndef BLENDWEIGHT_H +#define BLENDWEIGHT_H + +#include "model/hardware/core/lowLevelApi/register/Register.h" +#include "model/hardware/core/lowLevelApi/register/RegUtils.h" + +#undef BAR + +#define BLEND_WEIGHT_MASK 0x000001FF + +#define BAR 0 +#define OFFSET 0x82000 +#define LENGTH 512U + +class BlendWeight : public Register +{ +private: + QList _blendWeight; + + void prepareData(quint32 index) override + { + blendWeight->setValue(_blendWeight[static_cast(index)]); + } + +public: + Field* blendWeight; + + void setBlendWeight (QList& blendWeight) { + _blendWeight = blendWeight; + } + + BlendWeight(SonoDevice* device) : Register(BAR, OFFSET, device, LENGTH) + { + ADD_UNSIGNED_FIELD(blendWeight, BLEND_WEIGHT_MASK); + } +}; + +#undef BLEND_WEIGHT_MASK + +#undef BAR +#undef OFFSET +#undef LENGTH + +#endif // BLENDWEIGHT_H diff --git a/include/model/hardware/core/lowLevelApi/register/dsp/registerDefinition/DtgcLut.h b/include/model/hardware/core/lowLevelApi/register/dsp/registerDefinition/DtgcLut.h index 5c9fd98..b0f118d 100644 --- a/include/model/hardware/core/lowLevelApi/register/dsp/registerDefinition/DtgcLut.h +++ b/include/model/hardware/core/lowLevelApi/register/dsp/registerDefinition/DtgcLut.h @@ -9,7 +9,7 @@ #define DTGC_LUT_MASK 0x00000FFF #define BAR 0 -#define OFFSET 0X84000 +#define OFFSET 0X84800 #define LENGTH 1024U class DtgcLut : public Register diff --git a/include/model/hardware/core/lowLevelApi/register/dsp/registerDefinition/EndFreqLut.h b/include/model/hardware/core/lowLevelApi/register/dsp/registerDefinition/EndFreqLut.h new file mode 100644 index 0000000..4dac39d --- /dev/null +++ b/include/model/hardware/core/lowLevelApi/register/dsp/registerDefinition/EndFreqLut.h @@ -0,0 +1,44 @@ +#ifndef ENDFREQLUT_H +#define ENDFREQLUT_H + +#include "model/hardware/core/lowLevelApi/register/Register.h" +#include "model/hardware/core/lowLevelApi/register/RegUtils.h" + +#undef BAR + +#define END_FREQ_LUT_MASK 0x01FFFFFF + +#define BAR 0 +#define OFFSET 0x80840 +#define LENGTH 4U + +class EndFreqLut : public Register +{ +private: + QList _endFreqLut; + + void prepareData(quint32 index) override + { + endFreqLut->setValue(_endFreqLut[static_cast(index)]); + } + +public: + Field* endFreqLut; + + void setEndFreqLut (QList& endFreqLut) { + _endFreqLut = endFreqLut; + } + + EndFreqLut(SonoDevice* device) : Register(BAR, OFFSET, device, LENGTH) + { + ADD_UNSIGNED_FIELD(endFreqLut, END_FREQ_LUT_MASK); + } +}; + +#undef END_FREQ_LUT_MASK + +#undef BAR +#undef OFFSET +#undef LENGTH + +#endif // ENDFREQLUT_H diff --git a/include/model/hardware/core/lowLevelApi/register/dsp/registerDefinition/FrameLoggerCtrl.h b/include/model/hardware/core/lowLevelApi/register/dsp/registerDefinition/FrameLoggerCtrl.h new file mode 100644 index 0000000..0e4a5b1 --- /dev/null +++ b/include/model/hardware/core/lowLevelApi/register/dsp/registerDefinition/FrameLoggerCtrl.h @@ -0,0 +1,31 @@ +#ifndef FRAMELOGGERCTRL_H +#define FRAMELOGGERCTRL_H + +#include "model/hardware/core/lowLevelApi/register/Register.h" +#include "model/hardware/core/lowLevelApi/register/RegUtils.h" + +#undef BAR + +#define LOGGER_EN_MASK 0x00000001 + +#define BAR 0 +#define OFFSET 0x86830 + +class FrameLoggerCtrl : public Register +{ +public: + Field* loggerEn; + + FrameLoggerCtrl(SonoDevice* device) : Register(BAR, OFFSET, device) + { + ADD_UNSIGNED_FIELD(loggerEn, LOGGER_EN_MASK); + } +}; + +#undef LOGGER_EN_MASK + +#undef BAR +#undef OFFSET +#undef LENGTH + +#endif // FRAMELOGGERCTRL_H diff --git a/include/model/hardware/core/lowLevelApi/register/dsp/registerDefinition/FreqPointLut.h b/include/model/hardware/core/lowLevelApi/register/dsp/registerDefinition/FreqPointLut.h new file mode 100644 index 0000000..1a59e05 --- /dev/null +++ b/include/model/hardware/core/lowLevelApi/register/dsp/registerDefinition/FreqPointLut.h @@ -0,0 +1,65 @@ +#ifndef FREQPOINTLUT_H +#define FREQPOINTLUT_H + +#include "model/hardware/core/lowLevelApi/register/Register.h" +#include "model/hardware/core/lowLevelApi/register/RegUtils.h" + +#undef BAR + +#define START_FREQ_POINT_LUT_MASK 0x0000FFFF +#define END_FREQ_POINT_LUT_MASK 0xFFFF0000 + +#define BAR 0U +#define OFFSET 0X80880 +#define LENGTH 4U + +struct FreqPoint +{ + QList startFreqPoint; + QList endFreqPoint; + + void clear() + { + startFreqPoint.clear(); + endFreqPoint.clear(); + } +}; + +class FreqPointLut : public Register +{ +private: + FreqPoint* _freqLut; + + void prepareData(quint32 index) override + { + //quint32 value=0; + + startFreqPointLut->setValue(_freqLut->startFreqPoint.at(static_cast(index))); + + endFreqPointLut->setValue(_freqLut->endFreqPoint.at(static_cast(index))); + } + +public: + Field* startFreqPointLut; + Field* endFreqPointLut; + + void setFreqPointLut (FreqPoint* freqLut) + { + _freqLut = freqLut; + } + + FreqPointLut(SonoDevice* device) : Register(BAR, OFFSET, device, LENGTH) + { + ADD_UNSIGNED_FIELD(startFreqPointLut, START_FREQ_POINT_LUT_MASK); + ADD_UNSIGNED_FIELD(endFreqPointLut, END_FREQ_POINT_LUT_MASK); + } +}; + +#undef START_FREQ_POINT_LUT_MASK +#undef END_FREQ_POINT_LUT_MASK + +#undef BAR +#undef OFFSET +#undef LENGTH + +#endif // FREQPOINTLUT_H diff --git a/include/model/hardware/core/lowLevelApi/register/dsp/registerDefinition/FreqStepLut.h b/include/model/hardware/core/lowLevelApi/register/dsp/registerDefinition/FreqStepLut.h new file mode 100644 index 0000000..ca75ef1 --- /dev/null +++ b/include/model/hardware/core/lowLevelApi/register/dsp/registerDefinition/FreqStepLut.h @@ -0,0 +1,44 @@ +#ifndef FREQSTEPLUT_H +#define FREQSTEPLUT_H + +#include "model/hardware/core/lowLevelApi/register/Register.h" +#include "model/hardware/core/lowLevelApi/register/RegUtils.h" + +#undef BAR + +#define FREQ_STEP_LUT_MASK 0xFFFFFFFF + +#define BAR 0 +#define OFFSET 0x808C0 +#define LENGTH 4U + +class FreqStepLut : public Register +{ +private: + QList _freqStepLut; + + void prepareData(quint32 index) override + { + freqStepLut->setValue(_freqStepLut[static_cast(index)]); + } + +public: + Field* freqStepLut; + + void setFreqStepLut (QList& freqStepLut) { + _freqStepLut = freqStepLut; + } + + FreqStepLut(SonoDevice* device) : Register(BAR, OFFSET, device, LENGTH) + { + ADD_UNSIGNED_FIELD(freqStepLut, FREQ_STEP_LUT_MASK); + } +}; + +#undef FREQ_STEP_LUT_MASK + +#undef BAR +#undef OFFSET +#undef LENGTH + +#endif // FREQSTEPLUT_H diff --git a/include/model/hardware/core/lowLevelApi/register/dsp/registerDefinition/LpfLut.h b/include/model/hardware/core/lowLevelApi/register/dsp/registerDefinition/LpfLut.h index 7639012..70a28d6 100644 --- a/include/model/hardware/core/lowLevelApi/register/dsp/registerDefinition/LpfLut.h +++ b/include/model/hardware/core/lowLevelApi/register/dsp/registerDefinition/LpfLut.h @@ -6,36 +6,52 @@ #undef BAR -#define LPF_LUT_MASK 0x0003FFFF +#define START_LPF_LUT_MASK 0x0000FFFF +#define END_LPF_LUT_MASK 0xFFFF0000 #define BAR 0 #define OFFSET 0x81000 #define LENGTH 64U +struct Lpf +{ + QList startLpf; + QList endLpf; + void clear() + { + startLpf.clear(); + endLpf.clear(); + } +}; + class LpfLut : public Register { private: - QList _lpfLut; + Lpf* _lpf; void prepareData(quint32 index) override { - lpfLut->setValue(_lpfLut[static_cast(index)]); + startLpfLut->setValue(_lpf->startLpf[static_cast(index)]); + endLpfLut->setValue(_lpf->endLpf[static_cast(index)]); } public: - Field* lpfLut; + Field* startLpfLut; + Field* endLpfLut; - void setLpfLut (QList& lpfLut) { - _lpfLut = lpfLut; + void setLpfLut (Lpf* lpf) { + _lpf = lpf; } LpfLut(SonoDevice* device) : Register(BAR, OFFSET, device, LENGTH) { - ADD_UNSIGNED_FIELD(lpfLut, LPF_LUT_MASK); + ADD_UNSIGNED_FIELD(startLpfLut, START_LPF_LUT_MASK); + ADD_UNSIGNED_FIELD(endLpfLut, END_LPF_LUT_MASK); } }; -#undef LPF_LUT_MASK +#undef START_LPF_LUT_MASK +#undef END_LPF_LUT_MASK #undef BAR #undef OFFSET diff --git a/include/model/hardware/core/lowLevelApi/register/dsp/registerDefinition/LpfWeightStepLut.h b/include/model/hardware/core/lowLevelApi/register/dsp/registerDefinition/LpfWeightStepLut.h new file mode 100644 index 0000000..c426fbf --- /dev/null +++ b/include/model/hardware/core/lowLevelApi/register/dsp/registerDefinition/LpfWeightStepLut.h @@ -0,0 +1,44 @@ +#ifndef LPFWEIGHTSTEPLUT_H +#define LPFWEIGHTSTEPLUT_H + +#include "model/hardware/core/lowLevelApi/register/Register.h" +#include "model/hardware/core/lowLevelApi/register/RegUtils.h" + +#undef BAR + +#define LPF_WEIGHT_STEP_LUT_MASK 0xFFFFFFFF + +#define BAR 0 +#define OFFSET 0x80900 +#define LENGTH 4U + +class LpfWeightStepLut : public Register +{ +private: + QList _lpfWeightStepLut; + + void prepareData(quint32 index) override + { + lpfWeightStepLut->setValue(_lpfWeightStepLut[static_cast(index)]); + } + +public: + Field* lpfWeightStepLut; + + void setLpfWeightStepLut (QList& lpfWeightStepLut) { + _lpfWeightStepLut = lpfWeightStepLut; + } + + LpfWeightStepLut(SonoDevice* device) : Register(BAR, OFFSET, device, LENGTH) + { + ADD_UNSIGNED_FIELD(lpfWeightStepLut, LPF_WEIGHT_STEP_LUT_MASK); + } +}; + +#undef LPF_WEIGHT_STEP_LUT_MASK + +#undef BAR +#undef OFFSET +#undef LENGTH + +#endif // LPFWEIGHTSTEPLUT_H diff --git a/include/model/hardware/core/lowLevelApi/register/dsp/registerDefinition/ManualAtgc.h b/include/model/hardware/core/lowLevelApi/register/dsp/registerDefinition/ManualAtgc.h index 6f50dd6..7c9deee 100644 --- a/include/model/hardware/core/lowLevelApi/register/dsp/registerDefinition/ManualAtgc.h +++ b/include/model/hardware/core/lowLevelApi/register/dsp/registerDefinition/ManualAtgc.h @@ -11,7 +11,7 @@ #define USER_MODE_ENABLE_MASK 0x00002000 #define BAR 0U -#define OFFSET 0X8601C +#define OFFSET 0X8681C class ManualAtgc : public Register { diff --git a/include/model/hardware/core/lowLevelApi/register/dsp/registerDefinition/MlaOffset.h b/include/model/hardware/core/lowLevelApi/register/dsp/registerDefinition/MlaOffset.h index 008cc89..8a99f10 100644 --- a/include/model/hardware/core/lowLevelApi/register/dsp/registerDefinition/MlaOffset.h +++ b/include/model/hardware/core/lowLevelApi/register/dsp/registerDefinition/MlaOffset.h @@ -9,7 +9,7 @@ #define OFFSET_ADDR_MASK 0x001FFFFF #define BAR 0 -#define OFFSET 0X86020 +#define OFFSET 0X86820 #define LENGTH 4U class MlaOffset : public Register diff --git a/include/model/hardware/core/lowLevelApi/register/dsp/registerDefinition/NoiseRejectValue.h b/include/model/hardware/core/lowLevelApi/register/dsp/registerDefinition/NoiseRejectValue.h index 5992110..07e3e67 100644 --- a/include/model/hardware/core/lowLevelApi/register/dsp/registerDefinition/NoiseRejectValue.h +++ b/include/model/hardware/core/lowLevelApi/register/dsp/registerDefinition/NoiseRejectValue.h @@ -9,7 +9,7 @@ #define REJECT_VALUE_MASK 0x00FFFFFF #define BAR 0 -#define OFFSET 0x86034 +#define OFFSET 0x86834 class NoiseRejectValue : public Register { diff --git a/include/model/hardware/core/lowLevelApi/register/dsp/registerDefinition/ReceiverConfigurationLut.h b/include/model/hardware/core/lowLevelApi/register/dsp/registerDefinition/ReceiverConfigurationLut.h index fe1f698..cace655 100644 --- a/include/model/hardware/core/lowLevelApi/register/dsp/registerDefinition/ReceiverConfigurationLut.h +++ b/include/model/hardware/core/lowLevelApi/register/dsp/registerDefinition/ReceiverConfigurationLut.h @@ -23,6 +23,7 @@ #define IQ_DATA_CROSS_EN_PRP_MASK 0x10000000 #define LOG_EN_PRP_MASK 0x20000000 #define DTGC_EN_PRP_MASK 0x40000000 +#define BLEND_EN_PRP_MASK 0x80000000 #define BAR 0U #define OFFSET 0X80000 @@ -47,6 +48,8 @@ struct ReceiverConfiguration QList iqDataCrossEn; QList logEn; QList dTgcEn; + QList blendEn; + void clear() { mla.clear(); @@ -66,6 +69,7 @@ struct ReceiverConfiguration iqDataCrossEn.clear(); logEn.clear(); dTgcEn.clear(); + blendEn.clear(); } }; @@ -120,6 +124,9 @@ private: //value = _configLut->dTgcEnPrp.at(static_cast(index)) ? 1 : 0; dTgcEnPrp->setValue(_configLut->dTgcEn.at(static_cast(index))); + + //value = _configLut->blendEnPrp.at(static_cast(index)) ? 1 : 0; + blendEnPrp->setValue(_configLut->blendEn.at(static_cast(index))); } public: @@ -140,6 +147,7 @@ public: Field* iqDataCrossEncPrp; Field* logEnPrp; Field* dTgcEnPrp; + Field* blendEnPrp; void setReceiverConfigurationLut (ReceiverConfiguration* configLut) { @@ -165,6 +173,7 @@ public: ADD_UNSIGNED_FIELD(iqDataCrossEncPrp, IQ_DATA_CROSS_EN_PRP_MASK); ADD_UNSIGNED_FIELD(logEnPrp, LOG_EN_PRP_MASK); ADD_UNSIGNED_FIELD(dTgcEnPrp, DTGC_EN_PRP_MASK); + ADD_UNSIGNED_FIELD(blendEnPrp, BLEND_EN_PRP_MASK); } }; @@ -185,6 +194,7 @@ public: #undef IQ_DATA_CROSS_EN_PRP_MASK #undef LOG_EN_PRP_MASK #undef DTGC_EN_PRP_MASK +#undef BLEND_EN_PRP_MASK #undef BAR #undef OFFSET diff --git a/include/model/hardware/core/lowLevelApi/register/dsp/registerDefinition/StartFreqLut.h b/include/model/hardware/core/lowLevelApi/register/dsp/registerDefinition/StartFreqLut.h new file mode 100644 index 0000000..7e332ac --- /dev/null +++ b/include/model/hardware/core/lowLevelApi/register/dsp/registerDefinition/StartFreqLut.h @@ -0,0 +1,44 @@ +#ifndef STARTFREQLUT_H +#define STARTFREQLUT_H + +#include "model/hardware/core/lowLevelApi/register/Register.h" +#include "model/hardware/core/lowLevelApi/register/RegUtils.h" + +#undef BAR + +#define START_FREQ_LUT_MASK 0x01FFFFFF + +#define BAR 0 +#define OFFSET 0x80800 +#define LENGTH 4U + +class StartFreqLut : public Register +{ +private: + QList _startFreqLut; + + void prepareData(quint32 index) override + { + startFreqLut->setValue(_startFreqLut[static_cast(index)]); + } + +public: + Field* startFreqLut; + + void setStartFreqLut (QList& startFreqLut) { + _startFreqLut = startFreqLut; + } + + StartFreqLut(SonoDevice* device) : Register(BAR, OFFSET, device, LENGTH) + { + ADD_UNSIGNED_FIELD(startFreqLut, START_FREQ_LUT_MASK); + } +}; + +#undef START_FREQ_LUT_MASK + +#undef BAR +#undef OFFSET +#undef LENGTH + +#endif // STARTFREQLUT_H diff --git a/include/model/hardware/core/lowLevelApi/register/dsp/registerDefinition/StartLpfWeightLut.h b/include/model/hardware/core/lowLevelApi/register/dsp/registerDefinition/StartLpfWeightLut.h new file mode 100644 index 0000000..101e19f --- /dev/null +++ b/include/model/hardware/core/lowLevelApi/register/dsp/registerDefinition/StartLpfWeightLut.h @@ -0,0 +1,44 @@ +#ifndef STARTLPFWEIGHTLUT_H +#define STARTLPFWEIGHTLUT_H + +#include "model/hardware/core/lowLevelApi/register/Register.h" +#include "model/hardware/core/lowLevelApi/register/RegUtils.h" + +#undef BAR + +#define START_LPF_WEIGHT_LUT_MASK 0xFFFFFFFF + +#define BAR 0 +#define OFFSET 0x80940 +#define LENGTH 4U + +class StartLpfWeightLut : public Register +{ +private: + QList _startLpfWeightLut; + + void prepareData(quint32 index) override + { + startLpfWeightLut->setValue(_startLpfWeightLut[static_cast(index)]); + } + +public: + Field* startLpfWeightLut; + + void setStartLpfWeightLut (QList& startLpfWeightLut) { + _startLpfWeightLut = startLpfWeightLut; + } + + StartLpfWeightLut(SonoDevice* device) : Register(BAR, OFFSET, device, LENGTH) + { + ADD_UNSIGNED_FIELD(startLpfWeightLut, START_LPF_WEIGHT_LUT_MASK); + } +}; + +#undef START_LPF_WEIGHT_LUT_MASK + +#undef BAR +#undef OFFSET +#undef LENGTH + +#endif // STARTLPFWEIGHTLUT_H diff --git a/include/model/hardware/core/lowLevelApi/register/dsp/registerDefinition/StbCoefficient.h b/include/model/hardware/core/lowLevelApi/register/dsp/registerDefinition/StbCoefficient.h index 76c94ce..376a75d 100644 --- a/include/model/hardware/core/lowLevelApi/register/dsp/registerDefinition/StbCoefficient.h +++ b/include/model/hardware/core/lowLevelApi/register/dsp/registerDefinition/StbCoefficient.h @@ -10,7 +10,7 @@ #define STB_LUT_ODD_MASK 0xFFFF0000 #define BAR 0 -#define OFFSET 0x86000 +#define OFFSET 0x86800 #define LENGTH 4U // 8/2 class StbCoefficient : public Register diff --git a/include/model/hardware/core/lowLevelApi/register/misc/registerDefinition/FrameLostCount.h b/include/model/hardware/core/lowLevelApi/register/misc/registerDefinition/FrameLostCount.h index 3f5882e..e169492 100644 --- a/include/model/hardware/core/lowLevelApi/register/misc/registerDefinition/FrameLostCount.h +++ b/include/model/hardware/core/lowLevelApi/register/misc/registerDefinition/FrameLostCount.h @@ -9,7 +9,7 @@ #define LOST_COUNT 0x000000FF #define BAR 0U -#define OFFSET 0x8603C +#define OFFSET 0x86840 class FrameLostCount : public Register { diff --git a/include/model/scenarioGenerator/core/scenario/type/misc/ApodizationParams.h b/include/model/scenarioGenerator/core/scenario/type/misc/ApodizationParams.h new file mode 100644 index 0000000..f278c50 --- /dev/null +++ b/include/model/scenarioGenerator/core/scenario/type/misc/ApodizationParams.h @@ -0,0 +1,23 @@ +#ifndef APODIZATIONPARAMS_H +#define APODIZATIONPARAMS_H + +#include + +struct ApodizationParams_t +{ + quint32 rxActiveElementStepStartPoint; + quint32 rxActiveElementStepStopPoint; + quint32 rxActiveElementStepChangePoint; + quint32 winOpenStartPoint; + quint32 winOpenStopPoint; + quint32 minApertureSize; + quint32 maxApertureSize; + + float rxActiveElementStep1; + float rxActiveElementStep2; + float winOpenStartVal; + float winOpenStepVal; + float winOpenStopVal; +}; + +#endif // APODIZATIONPARAMS_H diff --git a/include/model/scenarioGenerator/core/scenario/type/misc/FrequencyPointLut.h b/include/model/scenarioGenerator/core/scenario/type/misc/FrequencyPointLut.h new file mode 100644 index 0000000..e78e5b5 --- /dev/null +++ b/include/model/scenarioGenerator/core/scenario/type/misc/FrequencyPointLut.h @@ -0,0 +1,11 @@ +#ifndef FREQUENCYPOINTLUT_H +#define FREQUENCYPOINTLUT_H + +#include + +struct FrequencyPointLut_t { + quint32 startFreqPoint; + quint32 endFreqPoint; +}; + +#endif // FREQUENCYPOINTLUT_H diff --git a/include/model/scenarioGenerator/core/scenario/type/misc/ReceiverConfig.h b/include/model/scenarioGenerator/core/scenario/type/misc/ReceiverConfig.h index cf9e87a..4786776 100644 --- a/include/model/scenarioGenerator/core/scenario/type/misc/ReceiverConfig.h +++ b/include/model/scenarioGenerator/core/scenario/type/misc/ReceiverConfig.h @@ -21,6 +21,7 @@ struct ReceiverConfig_t { quint32 iqDataCrossEn; quint32 logEn; quint32 dTgcEn; + quint32 blendEn; }; #endif //RECEIVERCONFIG_H diff --git a/include/model/scenarioGenerator/dto/hardware/HwScenarioDependent.h b/include/model/scenarioGenerator/dto/hardware/HwScenarioDependent.h index 3ff6dfd..d7c00e4 100644 --- a/include/model/scenarioGenerator/dto/hardware/HwScenarioDependent.h +++ b/include/model/scenarioGenerator/dto/hardware/HwScenarioDependent.h @@ -5,6 +5,8 @@ #include "model/scenarioGenerator/core/scenario/type/misc/Pulse.h" #include "model/scenarioGenerator/core/scenario/type/misc/RxBeamFormer.h" #include "model/scenarioGenerator/core/scenario/type/misc/ReceiverConfig.h" +#include "model/scenarioGenerator/core/scenario/type/misc/FrequencyPointLut.h" +#include "model/scenarioGenerator/core/scenario/type/misc/ApodizationParams.h" struct HwRegister_t { QVector dtgcLut; @@ -24,8 +26,16 @@ struct HwRegister_t { QList> lpfLut; QList> atgcLut; QList> apodizationLut; + QList apodizationParams; QList mlaOffsetAddr; quint32 noiseRejectValue; + quint32 frameLoggerControl; + QList startFreqLut; + QList endFreqLut; + QList freqPointLut; + QVector freqStepLut; + QVector lpfWeightStepLut; + QVector startLpfWeightLut; }; diff --git a/mainwindow.cpp b/mainwindow.cpp index 8b14623..41ac89b 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -3227,7 +3227,7 @@ void MainWindow::afeConfig(AfeConfig &afeConfig) afeConfig.lowNf = lowNfDisable; afeConfig.lnaHpf = lnaHpfEnable; afeConfig.pgaHpf = pgaHpfEnable; - afeConfig.lpfProg = LpfProg10MHz; + afeConfig.lpfProg = LpfProg15MHz; afeConfig.pgaGain = pgaGain30db; afeConfig.pgaClamp = pgaClampDisable; afeConfig.powModes = lowNoise; diff --git a/src/model/hardware/core/lowLevelApi/TrxBoard.cpp b/src/model/hardware/core/lowLevelApi/TrxBoard.cpp index 25ee4a7..989c707 100644 --- a/src/model/hardware/core/lowLevelApi/TrxBoard.cpp +++ b/src/model/hardware/core/lowLevelApi/TrxBoard.cpp @@ -357,10 +357,11 @@ TrxBoard::TrxBoard() : _offsetSlave0(0), _offsetSlave1(0x400000), _offsetSlave2( TrxBoard::ScenHwRegister::ScenHwRegister() { + elementPosition = new ProbeElementPosition; + rxBeamformer = new RxBeamformerProperties; configLut = new ReceiverConfiguration; - elementPosition = new ProbeElementPosition; - rxBeamformer = new RxBeamformerProperties; pulse = new PulseProperties; + freqPoint = new FreqPoint; } TrxBoard::ScenGenHardwareParam::ScenGenHardwareParam() @@ -403,16 +404,17 @@ TrxBoard::~TrxBoard() TrxBoard::ScenHwRegister::~ScenHwRegister() { + delete elementPosition; + delete rxBeamformer; delete configLut; - delete rxBeamformer; - delete elementPosition; + delete freqPoint; delete pulse; } TrxBoard::ScenGenHardwareParam::~ScenGenHardwareParam() { + delete indexParams; delete hwRegister; - delete indexParams; delete rxParams; delete txParams; } @@ -620,97 +622,162 @@ void TrxBoard::setScenario(ScenGenHardwareOutput_t& scenGenHw) emulatorStop(); sramClear(first4M); - _scenParams->focusTypeNumber = scenGenHw.focusTypeNumber; - if(_scenParams->focusTypeNumber > FOCUS_TYPE_NUMBER_MAX) + if(scenGenHw.focusTypeNumber > FOCUS_TYPE_NUMBER_MAX) { throw SonoException("Focus type number is out of range"); } + _scenParams->focusTypeNumber = scenGenHw.focusTypeNumber; - _scenParams->totalTxShotNumber = scenGenHw.totalTxShotNumber; - if(_scenParams->totalTxShotNumber > TOTAL_TX_SHOT_NUMBER_MAX) + if(scenGenHw.totalTxShotNumber > TOTAL_TX_SHOT_NUMBER_MAX) { throw SonoException("Total tx shot number is out of range"); } + _scenParams->totalTxShotNumber = scenGenHw.totalTxShotNumber; - _scenParams->rxBeamFormerNumber = scenGenHw.rxBeamFormerNumber; - if(_scenParams->rxBeamFormerNumber.size() > RX_BEAMFORMER_NUMBER_MAX) + if(scenGenHw.rxBeamFormerNumber.size() > RX_BEAMFORMER_NUMBER_MAX) { throw SonoException("Rx beam former number is out of range"); } + _scenParams->rxBeamFormerNumber = scenGenHw.rxBeamFormerNumber; - _scenParams->scenarioStartIndex = scenGenHw.hwRegister.scenarioStartIndex; - _scenParams->scenarioEndIndex = scenGenHw.hwRegister.scenarioEndIndex; - - if(_scenParams->scenarioEndIndex > SCENARIO_INDEX_MAX) + if(scenGenHw.hwRegister.scenarioEndIndex > SCENARIO_INDEX_MAX) { throw SonoException("Scenario end index is out of range"); } - if(_scenParams->scenarioEndIndex < _scenParams->scenarioStartIndex) + if(scenGenHw.hwRegister.scenarioEndIndex < scenGenHw.hwRegister.scenarioStartIndex) { throw SonoException( "The scenario end index must be greater than or equal to the scenario start index"); } - if(_scenParams->scenarioEndIndex != (_scenParams->totalTxShotNumber - 1)) + if(scenGenHw.hwRegister.scenarioEndIndex != (scenGenHw.totalTxShotNumber - 1)) { throw SonoException( "The scenario end index must be equal to the total tx shot number minus one"); } + _scenParams->scenarioStartIndex = scenGenHw.hwRegister.scenarioStartIndex; + _scenParams->scenarioEndIndex = scenGenHw.hwRegister.scenarioEndIndex; - _scenParams->hwRegister->blendWeight = scenGenHw.hwRegister.blendWeight; - if(_scenParams->hwRegister->blendWeight.size() != BLENDWEIGHT_LUT_MAX) + if(scenGenHw.hwRegister.blendWeight.size() != BLENDWEIGHT_LUT_MAX) { throw SonoException("Blend weight lut is out of range"); } + _scenParams->hwRegister->blendWeight = scenGenHw.hwRegister.blendWeight; - _scenParams->hwRegister->elementPosition->xPosition = scenGenHw.hwRegister.elementXPosition; - if(_scenParams->hwRegister->elementPosition->xPosition.size() != ELEMENT_POSITION_LUT_MAX) + if(scenGenHw.hwRegister.elementXPosition.size() != ELEMENT_POSITION_LUT_MAX) { throw SonoException("Element position x is out of range"); } + _scenParams->hwRegister->elementPosition->xPosition = scenGenHw.hwRegister.elementXPosition; - _scenParams->hwRegister->elementPosition->yPosition = scenGenHw.hwRegister.elementYPosition; - if(_scenParams->hwRegister->elementPosition->yPosition.size() != ELEMENT_POSITION_LUT_MAX) + if(scenGenHw.hwRegister.elementYPosition.size() != ELEMENT_POSITION_LUT_MAX) { throw SonoException("Element position y is out of range"); } + _scenParams->hwRegister->elementPosition->yPosition = scenGenHw.hwRegister.elementYPosition; - _scenParams->hwRegister->elementPosition->zPosition = scenGenHw.hwRegister.elementZPosition; - if(_scenParams->hwRegister->elementPosition->zPosition.size() != ELEMENT_POSITION_LUT_MAX) + if(scenGenHw.hwRegister.elementZPosition.size() != ELEMENT_POSITION_LUT_MAX) { throw SonoException("Element position z is out of range"); } + _scenParams->hwRegister->elementPosition->zPosition = scenGenHw.hwRegister.elementZPosition; - _scenParams->hwRegister->freqLut = scenGenHw.hwRegister.freqLut; - if(_scenParams->hwRegister->freqLut.size() != FREQUENCY_LUT_MAX) - { - throw SonoException("Frequency lut is out of range"); - } +// if(scenGenHw.hwRegister.freqLut.size() != FREQUENCY_LUT_MAX) +// { +// throw SonoException("Frequency lut is out of range"); +// } +// _scenParams->hwRegister->freqLut = scenGenHw.hwRegister.freqLut; - _scenParams->hwRegister->dtgcLut = scenGenHw.hwRegister.dtgcLut; - if(_scenParams->hwRegister->dtgcLut.size() != DTGC_LUT_MAX) + if(scenGenHw.hwRegister.dtgcLut.size() != DTGC_LUT_MAX) { throw SonoException("Dtgc lut is out of range"); } + _scenParams->hwRegister->dtgcLut = scenGenHw.hwRegister.dtgcLut; - _scenParams->hwRegister->pulseTypeNumber = scenGenHw.hwRegister.pulseTypeNumber; - if(_scenParams->hwRegister->pulseTypeNumber > PULSE_LUT_MAX) + if(scenGenHw.hwRegister.pulseTypeNumber > PULSE_LUT_MAX) { throw SonoException("Pulse type number is out of range"); } + _scenParams->hwRegister->pulseTypeNumber = scenGenHw.hwRegister.pulseTypeNumber; - _scenParams->hwRegister->rxBeamFormerTypeNumber = scenGenHw.hwRegister.rxBeamFormerTypeNumber; - if(_scenParams->hwRegister->rxBeamFormerTypeNumber > RXBEAMFORMER_LUT_MAX) + if(scenGenHw.hwRegister.rxBeamFormerTypeNumber > RXBEAMFORMER_LUT_MAX) { throw SonoException("Rx beam former type number is out of range"); } + _scenParams->hwRegister->rxBeamFormerTypeNumber = scenGenHw.hwRegister.rxBeamFormerTypeNumber; + if(scenGenHw.hwRegister.receiverConfigTypeNumber > RRECEIVER_CONFIGURATION_LUT_MAX) + { + throw SonoException("Receiver config type number is out of range"); + } _scenParams->hwRegister->receiverConfigTypeNumber = scenGenHw.hwRegister.receiverConfigTypeNumber; - if(_scenParams->hwRegister->receiverConfigTypeNumber > RRECEIVER_CONFIGURATION_LUT_MAX) + + if(scenGenHw.hwRegister.startFreqLut.size() != START_FREQ_LUT_MAX) { - throw SonoException("Receiver config type number is out of range"); + throw SonoException("Start freq lut is out of range"); + } + _scenParams->hwRegister->startFreqLut = scenGenHw.hwRegister.startFreqLut; + + if(scenGenHw.hwRegister.endFreqLut.size() != END_FREQ_LUT_MAX) + { + throw SonoException("End freq lut is out of range"); + } + _scenParams->hwRegister->endFreqLut = scenGenHw.hwRegister.endFreqLut; + + if(scenGenHw.hwRegister.freqPointLut.size() != FREQ_POINT_LUT_MAX) + { + throw SonoException("Freq point lut is out of range"); + } + + _scenParams->hwRegister->freqPoint->clear(); + foreach(auto i, scenGenHw.hwRegister.freqPointLut) + { + _scenParams->hwRegister->freqPoint->startFreqPoint.append(i.startFreqPoint); + _scenParams->hwRegister->freqPoint->endFreqPoint.append(i.endFreqPoint); + } + + if(scenGenHw.hwRegister.freqStepLut.size() != FREQ_STEP_LUT_MAX) + { + throw SonoException("Freq step lut is out of range"); + } + _scenParams->hwRegister->freqStepLut = scenGenHw.hwRegister.freqStepLut; + + if(scenGenHw.hwRegister.lpfWeightStepLut.size() != LPF_WEIGHT_STEP_LUT_MAX) + { + throw SonoException("Lpf weight step lut is out of range"); + } + _scenParams->hwRegister->lpfWeightStepLut = scenGenHw.hwRegister.lpfWeightStepLut; + + if(scenGenHw.hwRegister.startLpfWeightLut.size() != START_LPF_WEIGHT_LUT_MAX) + { + throw SonoException("Lpf weight step lut is out of range"); + } + _scenParams->hwRegister->startLpfWeightLut = scenGenHw.hwRegister.startLpfWeightLut; + + if(scenGenHw.hwRegister.apodizationParams.size() > RXBEAMFORMER_LUT_MAX) + { + throw SonoException("Apodization parameters is out of range"); + } + _scenParams->hwRegister->apodizationParams.clear(); + foreach(auto temp, scenGenHw.hwRegister.apodizationParams) + { + ApodizationParameters params; + params.winOpenStepVal = temp.winOpenStepVal; + params.winOpenStopVal = temp.winOpenStopVal; + params.maxApertureSize = temp.maxApertureSize; + params.minApertureSize = temp.minApertureSize; + params.winOpenStartVal = temp.winOpenStartVal; + params.winOpenStopPoint = temp.winOpenStopPoint; + params.winOpenStartPoint = temp.winOpenStartPoint; + params.rxActiveElementStep1 = temp.rxActiveElementStep1; + params.rxActiveElementStep2 = temp.rxActiveElementStep2; + params.rxActiveElementStepStopPoint = temp.rxActiveElementStepStopPoint; + params.rxActiveElementStepStartPoint = temp.rxActiveElementStepStartPoint; + params.rxActiveElementStepChangePoint = temp.rxActiveElementStepChangePoint; + + _scenParams->hwRegister->apodizationParams.append(params); } _scenParams->hwRegister->pulse->clear(); @@ -742,6 +809,7 @@ void TrxBoard::setScenario(ScenGenHardwareOutput_t& scenGenHw) _scenParams->hwRegister->configLut->stbEn.append(k.stbEn); _scenParams->hwRegister->configLut->lpfSel.append(k.lpfSel); _scenParams->hwRegister->configLut->dTgcEn.append(k.dTgcEn); + _scenParams->hwRegister->configLut->blendEn.append(k.blendEn); _scenParams->hwRegister->configLut->aTgcSel.append(k.aTgcSel); _scenParams->hwRegister->configLut->focusNo.append(k.focusNo); _scenParams->hwRegister->configLut->lineMode.append(k.lineMode); @@ -757,6 +825,8 @@ void TrxBoard::setScenario(ScenGenHardwareOutput_t& scenGenHw) _scenParams->hwRegister->noiseReject = scenGenHw.hwRegister.noiseRejectValue; + _scenParams->hwRegister->frameLoggerControl = scenGenHw.hwRegister.frameLoggerControl; + _scenParams->indexParams->endOfEnsemble = scenGenHw.indexParams.endOfEnsemble; _scenParams->indexParams->endOfSubBatch = scenGenHw.indexParams.endOfSubBatch; _scenParams->indexParams->endOfSubFrame = scenGenHw.indexParams.endOfSubFrame; @@ -889,6 +959,12 @@ void TrxBoard::setScenario (ScenGenHardwareParam* _scenParams) _scenParams->hwRegister->pulse); scenParamsFilling(set); + this->_beamFormerSlave0->apodizationParameters(_scenParams->hwRegister->apodizationParams); + this->_beamFormerSlave1->apodizationParameters(_scenParams->hwRegister->apodizationParams); + this->_beamFormerSlave2->apodizationParameters(_scenParams->hwRegister->apodizationParams); + + scenParamsFilling(set); + ////this->_beamFormerSlave0->afeLut(_scenParams->hwRegister->afe); ////this->_beamFormerSlave1->afeLut(_scenParams->hwRegister->afe); ////this->_beamFormerSlave2->afeLut(_scenParams->hwRegister->afe); @@ -898,9 +974,21 @@ void TrxBoard::setScenario (ScenGenHardwareParam* _scenParams) this->_dsp->receiverConfigurationLut(_scenParams->hwRegister->receiverConfigTypeNumber, _scenParams->hwRegister->configLut); - _unsignedQntzrVec = Calculation::qntzr(_scenParams->hwRegister->freqLut, 0, 24, 0, 0, true); - QList freqLutQ = _unsignedQntzrVec.toList(); - this->_dsp->frequencyLut(freqLutQ); +// _unsignedQntzrVec = Calculation::qntzr(_scenParams->hwRegister->freqLut, 0, 24, 0, 0, true); +// QList freqLutQ = _unsignedQntzrVec.toList(); +// this->_dsp->frequencyLut(freqLutQ); + + _unsignedQntzrVec = Calculation::qntzr(_scenParams->hwRegister->freqStepLut, 1, 32, 16, 0, true, true, true); + QList freqStepLutQ = _unsignedQntzrVec.toList(); + this->_dsp->freqStepLut(freqStepLutQ); + + _unsignedQntzrVec = Calculation::qntzr(_scenParams->hwRegister->lpfWeightStepLut, 0, 16, 23, 0, true); + QList lpfWeightStepLutQ = _unsignedQntzrVec.toList(); + this->_dsp->lpfWeightStepLut(lpfWeightStepLutQ); + + _unsignedQntzrVec = Calculation::qntzr(_scenParams->hwRegister->startLpfWeightLut, 0, 17, 16, 0, true); + QList startLpfWeightLutQ = _unsignedQntzrVec.toList(); + this->_dsp->startLpfWeightLut(startLpfWeightLutQ); _unsignedQntzrVec = Calculation::qntzr(_scenParams->hwRegister->dtgcLut, 0, 12, 8, 0, true, false); @@ -921,8 +1009,16 @@ void TrxBoard::setScenario (ScenGenHardwareParam* _scenParams) this->_dsp->mlaOffsetAddr(_scenParams->hwRegister->mlaOffsetAddr); + this->_dsp->startFreqLut(_scenParams->hwRegister->startFreqLut); + + this->_dsp->endFreqLut(_scenParams->hwRegister->endFreqLut); + + this->_dsp->freqPointLut(_scenParams->hwRegister->freqPoint); + this->_dsp->noiseReject(_scenParams->hwRegister->noiseReject); + this->_dsp->frameLoggerCtrl(_scenParams->hwRegister->frameLoggerControl); + ///////////////////////////////// Sram setting /////////////////////////////// this->_sram->setSramIndex(_scenParams->totalTxShotNumber, _scenParams->indexParams); @@ -1851,6 +1947,25 @@ quint32 TrxBoard::getFrameLostCounter() const return (this->_misc->getFrameLostCount()); } +void TrxBoard::elementActiveEnable(eActiveElements &slaveElements, quint64 &elements) const +{ + QList littleEndianList; + quint32 highElements = elements >> 32; + quint32 lowElements = elements & 0xFFFFFFFF; + littleEndianList.push_back(lowElements); + littleEndianList.push_back(highElements); + + switch (slaveElements) + { + case slave0Elements: this->_beamFormerSlave0->elementActiveEn(littleEndianList); + break; + case slave1Elements: this->_beamFormerSlave1->elementActiveEn(littleEndianList); + break; + case slave2Elements: this->_beamFormerSlave2->elementActiveEn(littleEndianList); + break; + } +} + void TrxBoard::adcCaptureConfig(captureConfig& capCfg) const { //ADC capture config diff --git a/src/model/hardware/core/lowLevelApi/register/beamFormer/BeamFormer.cpp b/src/model/hardware/core/lowLevelApi/register/beamFormer/BeamFormer.cpp index cb563ef..703a8e4 100644 --- a/src/model/hardware/core/lowLevelApi/register/beamFormer/BeamFormer.cpp +++ b/src/model/hardware/core/lowLevelApi/register/beamFormer/BeamFormer.cpp @@ -2,22 +2,36 @@ BeamFormer::BeamFormer(SonoDevice *device, quint32 offset) { - _elementPosition = new ElementPositionLut (device, offset); - _rxBeamformer = new RxBeamformerLut (device, offset); - _apodization = new ApodizationLut (device, offset); - _pulse = new PulseLut (device, offset); - _afe = new AfeLut (device, offset); - _regValid = new RegValid (device, offset); + _elementsActiveEnable = new ElementsActiveEnable(device, offset); + _rxActiveElementPoint = new RxActiveElementPoint(device, offset); + _rxActiveElementStep = new RxActiveElementStep (device, offset); + _elementPosition = new ElementPositionLut (device, offset); + _maxApertureSize = new MaxApertureSize (device, offset); + _minApertureSize = new MinApertureSize (device, offset); + _rxBeamformer = new RxBeamformerLut (device, offset); + _apodization = new ApodizationLut (device, offset); + _winOpenPoint = new WinOpenPoint (device, offset); + _winOpenVal = new WinOpenVal (device, offset); + _regValid = new RegValid (device, offset); + _pulse = new PulseLut (device, offset); + _afe = new AfeLut (device, offset); } BeamFormer::~BeamFormer() { + delete _elementsActiveEnable; + delete _rxActiveElementPoint; + delete _rxActiveElementStep; delete _elementPosition; + delete _maxApertureSize; + delete _minApertureSize; + delete _winOpenPoint; delete _rxBeamformer; delete _apodization; + delete _winOpenVal; + delete _regValid; delete _pulse; delete _afe; - delete _regValid; } void BeamFormer::probeElementPosition(QList> &elementPosition) const @@ -41,6 +55,56 @@ void BeamFormer::rxBeamformerProperties(quint8& rxBeamFormerTypeNumber, RxBeamfo this->_rxBeamformer->updateArray(true, rxBeamFormerTypeNumber); } +void BeamFormer::apodizationParameters(QList &apoParams) const +{ + quint32 rxActiveElementPointBaseOffset = this->_rxActiveElementPoint->getCurrentOffset(); + quint32 rxActiveElementStepBaseOffset = this->_rxActiveElementStep->getCurrentOffset(); + quint32 maxApertureSizeBaseOffset = this->_maxApertureSize->getCurrentOffset(); + quint32 minApertureSizeBaseOffset = this->_minApertureSize->getCurrentOffset(); + quint32 winOpenPointBaseOffset = this->_winOpenPoint->getCurrentOffset(); + quint32 winOpenValBaseOffset = this->_winOpenVal ->getCurrentOffset(); + + foreach (auto temp, apoParams) + { + this->_rxActiveElementPoint->setRxActiveElementPoint(&temp); + this->_rxActiveElementPoint->updateArray(); + quint32 curOffset = this->_rxActiveElementPoint->getCurrentOffset(); + this->_rxActiveElementPoint->changeOffset(curOffset + APODIZATION_PARAMS_OFFSET); + + this->_rxActiveElementStep->setRxActiveElementStep(&temp); + this->_rxActiveElementStep->updateArray(); + curOffset = this->_rxActiveElementStep->getCurrentOffset(); + this->_rxActiveElementStep->changeOffset(curOffset + APODIZATION_PARAMS_OFFSET); + + this->_maxApertureSize->setMaxApertureSize(&temp); + this->_maxApertureSize->updateArray(); + curOffset = this->_maxApertureSize->getCurrentOffset(); + this->_maxApertureSize->changeOffset(curOffset + APODIZATION_PARAMS_OFFSET); + + this->_minApertureSize->setMinApertureSize(&temp); + this->_minApertureSize->updateArray(); + curOffset = this->_minApertureSize->getCurrentOffset(); + this->_minApertureSize->changeOffset(curOffset + APODIZATION_PARAMS_OFFSET); + + this->_winOpenPoint->setWinOpenPoint(&temp); + this->_winOpenPoint->updateArray(); + curOffset = this->_winOpenPoint->getCurrentOffset(); + this->_winOpenPoint->changeOffset(curOffset + APODIZATION_PARAMS_OFFSET); + + this->_winOpenVal->setWinOpenVal(&temp); + this->_winOpenVal->updateArray(); + curOffset = this->_winOpenVal->getCurrentOffset(); + this->_winOpenVal->changeOffset(curOffset + APODIZATION_PARAMS_OFFSET); + } + + this->_rxActiveElementPoint->changeOffset(rxActiveElementPointBaseOffset); + this->_rxActiveElementStep->changeOffset(rxActiveElementStepBaseOffset); + this->_maxApertureSize->changeOffset(maxApertureSizeBaseOffset); + this->_minApertureSize->changeOffset(minApertureSizeBaseOffset); + this->_winOpenPoint->changeOffset(winOpenPointBaseOffset); + this->_winOpenVal->changeOffset(winOpenValBaseOffset); +} + void BeamFormer::apodizationLut(QList>& apodization) const { quint32 baseOffset = this->_apodization->getCurrentOffset(); @@ -62,6 +126,12 @@ void BeamFormer::pulseProperties(quint8& pulseTypeNumber, PulseProperties *pulse this->_pulse->updateArray(true, pulseTypeNumber); } +void BeamFormer::elementActiveEn(QList &elements) const +{ + this->_elementsActiveEnable->setElementsActiveEnable(elements); + this->_elementsActiveEnable->updateArray(); +} + void BeamFormer::afeLut(AfeProperties *afe) const { this->_afe->setAfeLut(afe); diff --git a/src/model/hardware/core/lowLevelApi/register/dsp/Dsp.cpp b/src/model/hardware/core/lowLevelApi/register/dsp/Dsp.cpp index e8050da..e2b7252 100644 --- a/src/model/hardware/core/lowLevelApi/register/dsp/Dsp.cpp +++ b/src/model/hardware/core/lowLevelApi/register/dsp/Dsp.cpp @@ -2,24 +2,37 @@ Dsp::Dsp(SonoDevice *device) { - _configLut = new ReceiverConfigurationLut (device); - _lineFilterLut = new LineFilterCoefficient (device); - _noiseReject = new NoiseRejectValue (device); - _stbLut = new StbCoefficient (device); - _freqLut = new FrequencyLut (device); - _blendWeight = new BlendWeight (device); - _manualAtgc = new ManualAtgc (device); - _mlaOffset = new MlaOffset (device); - _dtgcLut = new DtgcLut (device); - _atgcLut = new AtgcLut (device); - _bfScale = new BfScale (device); - _lpfLut = new LpfLut (device); - + _configLut = new ReceiverConfigurationLut (device); + _lineFilterLut = new LineFilterCoefficient (device); + _startLpfWeightLut = new StartLpfWeightLut (device); + _noiseReject = new NoiseRejectValue (device); + _lpfWeightStepLut = new LpfWeightStepLut (device); + _frameLoggerCtrl = new FrameLoggerCtrl (device); + _stbLut = new StbCoefficient (device); + _startFreqLut = new StartFreqLut (device); + _freqPointLut = new FreqPointLut (device); + _freqLut = new FrequencyLut (device); + _freqStepLut = new FreqStepLut (device); + _blendWeight = new BlendWeight (device); + _endFreqLut = new EndFreqLut (device); + _manualAtgc = new ManualAtgc (device); + _mlaOffset = new MlaOffset (device); + _dtgcLut = new DtgcLut (device); + _atgcLut = new AtgcLut (device); + _bfScale = new BfScale (device); + _lpfLut = new LpfLut (device); } Dsp::~Dsp() { + delete _startLpfWeightLut; + delete _lpfWeightStepLut; + delete _frameLoggerCtrl; delete _lineFilterLut; + delete _startFreqLut; + delete _freqPointLut; + delete _endFreqLut; + delete _freqStepLut; delete _blendWeight; delete _noiseReject; delete _manualAtgc; @@ -55,6 +68,24 @@ void Dsp::lpfScaleCoefficient(QList &lpfScaleCoeff) const this->_bfScale->update(); } +void Dsp::lpfWeightStepLut(QList &lpfWeightStepLut) const +{ + this->_lpfWeightStepLut->setLpfWeightStepLut(lpfWeightStepLut); + this->_lpfWeightStepLut->updateArray(); +} + +void Dsp::frameLoggerCtrl(quint32 &frameLoggerCtrl) const +{ + this->_frameLoggerCtrl->loggerEn->setValue(frameLoggerCtrl); + this->_frameLoggerCtrl->update(); +} + +void Dsp::startLpfWeightLut(QList &startLpfWeightLut) const +{ + this->_startLpfWeightLut->setStartLpfWeightLut(startLpfWeightLut); + this->_startLpfWeightLut->updateArray(); +} + void Dsp::stbCoefficient(QList &stbLut) const { this->_stbLut->setStbLut(stbLut); @@ -67,7 +98,13 @@ void Dsp::frequencyLut(QList &fLut) const this->_freqLut->updateArray(); } -void Dsp::blendWeight(QList > &blendWeight) const +void Dsp::startFreqLut(QList &startFreq) const +{ + this->_startFreqLut->setStartFreqLut(startFreq); + this->_startFreqLut->updateArray(); +} + +void Dsp::blendWeight(QList> &blendWeight) const { quint32 baseOffset = this->_blendWeight->getCurrentOffset(); @@ -79,7 +116,13 @@ void Dsp::blendWeight(QList > &blendWeight) const this->_blendWeight->changeOffset(curOffset + BLEND_WEIGHT_OFFSET); } - this->_blendWeight->changeOffset(baseOffset); // return to base offset address + this->_blendWeight->changeOffset(baseOffset); // return to base offset address +} + +void Dsp::freqStepLut(QList &freqStep) const +{ + this->_freqStepLut->setFreqStepLut(freqStep); + this->_freqStepLut->updateArray(); } void Dsp::atgcMode(eAtgcMode mode, quint16 value) const @@ -127,13 +170,13 @@ void Dsp::atgcLut(QList atgcLut) const this->_atgcLut->changeOffset(baseOffset); // return to base offset address } -void Dsp::lpfLut(QList> &lpfLut) const +void Dsp::lpfLut(QList &lpfLut) const { quint32 baseOffset = this->_lpfLut->getCurrentOffset(); - foreach (QList temp, lpfLut) + foreach (Lpf temp, lpfLut) { - this->_lpfLut->setLpfLut(temp); + this->_lpfLut->setLpfLut(&temp); this->_lpfLut->updateArray(); quint32 curOffset = this->_lpfLut->getCurrentOffset(); this->_lpfLut->changeOffset(curOffset + LPF_OFFSET); // return to base offset address @@ -153,3 +196,15 @@ void Dsp::noiseReject(quint32 &rejectValue) const this->_noiseReject->rejectValue->setValue(rejectValue); this->_noiseReject->update(); } + +void Dsp::endFreqLut(QList &endFreq) const +{ + this->_endFreqLut->setEndFreqLut(endFreq); + this->_endFreqLut->updateArray(); +} + +void Dsp::freqPointLut(FreqPoint* freqPoint) const +{ + this->_freqPointLut->setFreqPointLut(freqPoint); + this->_freqPointLut->updateArray(); +}