diff --git a/developHw.pro.user b/developHw.pro.user index 28c2adc..677045e 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 fcba3a0..db6f29c 100644 --- a/hdf5Scenario/hdf5Scenario.cpp +++ b/hdf5Scenario/hdf5Scenario.cpp @@ -324,55 +324,78 @@ void Hdf5::scenarioRead(ScenGenHardwareOutput_t &scenParams) /*********** /registerParameters/ddcParameters/startFreqLut ***************/ datasetBranch ("/registerParameters/ddcParameters/startFreqLut", floatArray); - scenParams.hwRegister.startFreqLut.clear(); + scenParams.hwRegister.ddcParams.startFreqLut.clear(); for (quint32 var = 0; var < 4; var++) - scenParams.hwRegister.startFreqLut.push_back(static_cast(floatArray[var])); + scenParams.hwRegister.ddcParams.startFreqLut.push_back(static_cast(floatArray[var])); /*********** /registerParameters/ddcParameters/endFreqLut ***************/ datasetBranch ("/registerParameters/ddcParameters/endFreqLut", floatArray); - scenParams.hwRegister.endFreqLut.clear(); + scenParams.hwRegister.ddcParams.endFreqLut.clear(); for (quint32 var = 0; var < 4; var++) - scenParams.hwRegister.endFreqLut.push_back(static_cast(floatArray[var])); + scenParams.hwRegister.ddcParams.endFreqLut.push_back(static_cast(floatArray[var])); /*********** /registerParameters/ddcParameters/startFreqPointLut ***************/ datasetBranch ("/registerParameters/ddcParameters/startFreqPointLut", floatArray); - QList startFreqPoint; + scenParams.hwRegister.ddcParams.startFreqPoint.clear(); for (quint32 var = 0; var < 4; var++) - startFreqPoint.push_back(static_cast(floatArray[var])); + scenParams.hwRegister.ddcParams.startFreqPoint.push_back(static_cast(floatArray[var])); /*********** /registerParameters/ddcParameters/endFreqPointLut ***************/ datasetBranch ("/registerParameters/ddcParameters/endFreqPointLut", floatArray); - QList endFreqPoint; + scenParams.hwRegister.ddcParams.endFreqPoint.clear(); 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); - } + scenParams.hwRegister.ddcParams.endFreqPoint.push_back(static_cast(floatArray[var])); /*********** /registerParameters/ddcParameters/freqStepLut ***************/ datasetBranch ("/registerParameters/ddcParameters/freqStepLut", floatArray); - scenParams.hwRegister.freqStepLut.clear(); + scenParams.hwRegister.ddcParams.freqStepLut.clear(); for (quint32 var = 0; var < 4; var++) - scenParams.hwRegister.freqStepLut.push_back(floatArray[var]); + scenParams.hwRegister.ddcParams.freqStepLut.push_back(floatArray[var]); /*********** /registerParameters/ddcParameters/lpfWeightStepLut ***************/ datasetBranch ("/registerParameters/ddcParameters/lpfWeightStepLut", floatArray); - scenParams.hwRegister.lpfWeightStepLut.clear(); + scenParams.hwRegister.ddcParams.lpfWeightStepLut.clear(); for (quint32 var = 0; var < 4; var++) - scenParams.hwRegister.lpfWeightStepLut.push_back(floatArray[var]); + scenParams.hwRegister.ddcParams.lpfWeightStepLut.push_back(floatArray[var]); /*********** /registerParameters/ddcParameters/startLpfWeightLut ***************/ datasetBranch ("/registerParameters/ddcParameters/startLpfWeightLut", floatArray); - scenParams.hwRegister.startLpfWeightLut.clear(); + scenParams.hwRegister.ddcParams.startLpfWeightLut.clear(); for (quint32 var = 0; var < 4; var++) - scenParams.hwRegister.startLpfWeightLut.push_back(floatArray[var]); + scenParams.hwRegister.ddcParams.startLpfWeightLut.push_back(floatArray[var]); + + /*********** /registerParameters/ddcParameters/startLpfLut ****************/ + datasetBranch ("/registerParameters/ddcParameters/startLpfLut", floatArray); + scenParams.hwRegister.ddcParams.startLpf.clear(); + 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])); + } + scenParams.hwRegister.ddcParams.startLpf.push_back(temp); + } + + /*********** /registerParameters/ddcParameters/endLpfLut ****************/ + datasetBranch ("/registerParameters/ddcParameters/endLpfLut", floatArray); + scenParams.hwRegister.ddcParams.endLpf.clear(); + + 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])); + } + scenParams.hwRegister.ddcParams.endLpf.push_back(temp); + } + + /************* /registerParameters/ddcParameters/lpfScale *****************/ + datasetBranch ("/registerParameters/ddcParameters/lpfScale", floatArray); + scenParams.hwRegister.ddcParams.lpfScale.clear(); + for (quint8 i = 0; i < 4; i++) + scenParams.hwRegister.ddcParams.lpfScale.push_back(static_cast(floatArray[i])); /**************** /registerParameters/dTgcLut ********************/ datasetBranch ("/registerParameters/dTgcLut", floatArray); @@ -510,95 +533,75 @@ void Hdf5::scenarioRead(ScenGenHardwareOutput_t &scenParams) /********* /registerParameters/apodizationParameters/maxApertureSize ************/ datasetBranch ("/registerParameters/apodizationParameters/maxApertureSize", floatArray); - QList maxApertureSize; + scenParams.hwRegister.apodizationParams.maxApertureSize.clear(); for (quint32 var = 0; var < scenParams.hwRegister.rxBeamFormerTypeNumber; var++) - maxApertureSize.push_back(static_cast(floatArray[var])); + scenParams.hwRegister.apodizationParams.maxApertureSize.push_back(static_cast(floatArray[var])); /********* /registerParameters/apodizationParameters/winOpenStartPoint ************/ datasetBranch ("/registerParameters/apodizationParameters/winOpenStartPoint", floatArray); - QList winOpenStartPoint; + scenParams.hwRegister.apodizationParams.winOpenStartPoint.clear(); for (quint32 var = 0; var < scenParams.hwRegister.rxBeamFormerTypeNumber; var++) - winOpenStartPoint.push_back(static_cast(floatArray[var])); + scenParams.hwRegister.apodizationParams.winOpenStartPoint.push_back(static_cast(floatArray[var])); /********* /registerParameters/apodizationParameters/winOpenStopPoint ************/ datasetBranch ("/registerParameters/apodizationParameters/winOpenStopPoint", floatArray); - QList winOpenStopPoint; + scenParams.hwRegister.apodizationParams.winOpenStopPoint.clear(); for (quint32 var = 0; var < scenParams.hwRegister.rxBeamFormerTypeNumber; var++) - winOpenStopPoint.push_back(static_cast(floatArray[var])); + scenParams.hwRegister.apodizationParams.winOpenStopPoint.push_back(static_cast(floatArray[var])); /********* /registerParameters/apodizationParameters/winOpenStartVal ************/ datasetBranch ("/registerParameters/apodizationParameters/winOpenStartVal", floatArray); - QList winOpenStartVal; + scenParams.hwRegister.apodizationParams.winOpenStartVal.clear(); for (quint32 var = 0; var < scenParams.hwRegister.rxBeamFormerTypeNumber; var++) - winOpenStartVal.push_back(floatArray[var]); + scenParams.hwRegister.apodizationParams.winOpenStartVal.push_back(floatArray[var]); /********* /registerParameters/apodizationParameters/winOpenStopVal ************/ datasetBranch ("/registerParameters/apodizationParameters/winOpenStopVal", floatArray); - QList winOpenStopVal; + scenParams.hwRegister.apodizationParams.winOpenStopVal.clear(); for (quint32 var = 0; var < scenParams.hwRegister.rxBeamFormerTypeNumber; var++) - winOpenStopVal.push_back(floatArray[var]); + scenParams.hwRegister.apodizationParams.winOpenStopVal.push_back(floatArray[var]); /********* /registerParameters/apodizationParameters/winOpenStepVal ************/ datasetBranch ("/registerParameters/apodizationParameters/winOpenStepVal", floatArray); - QList winOpenStepVal; + scenParams.hwRegister.apodizationParams.winOpenStepVal.clear(); for (quint32 var = 0; var < scenParams.hwRegister.rxBeamFormerTypeNumber; var++) - winOpenStepVal.push_back(floatArray[var]); + scenParams.hwRegister.apodizationParams.winOpenStepVal.push_back(floatArray[var]); /********* /registerParameters/apodizationParameters/minApertureSize ************/ datasetBranch ("/registerParameters/apodizationParameters/minApertureSize", floatArray); - QList minApertureSize; + scenParams.hwRegister.apodizationParams.minApertureSize.clear(); for (quint32 var = 0; var < scenParams.hwRegister.rxBeamFormerTypeNumber; var++) - minApertureSize.push_back(static_cast(floatArray[var])); + scenParams.hwRegister.apodizationParams.minApertureSize.push_back(static_cast(floatArray[var])); /********* /registerParameters/apodizationParameters/rxActiveElementStep1 ************/ datasetBranch ("/registerParameters/apodizationParameters/rxActiveElementStep1", floatArray); - QList rxActiveElementStep1; + scenParams.hwRegister.apodizationParams.rxActiveElementStep1.clear(); for (quint32 var = 0; var < scenParams.hwRegister.rxBeamFormerTypeNumber; var++) - rxActiveElementStep1.push_back(floatArray[var]); + scenParams.hwRegister.apodizationParams.rxActiveElementStep1.push_back(floatArray[var]); /********* /registerParameters/apodizationParameters/rxActiveElementStep2 ************/ datasetBranch ("/registerParameters/apodizationParameters/rxActiveElementStep2", floatArray); - QList rxActiveElementStep2; + scenParams.hwRegister.apodizationParams.rxActiveElementStep2.clear(); for (quint32 var = 0; var < scenParams.hwRegister.rxBeamFormerTypeNumber; var++) - rxActiveElementStep2.push_back(floatArray[var]); + scenParams.hwRegister.apodizationParams.rxActiveElementStep2.push_back(floatArray[var]); /********* /registerParameters/apodizationParameters/rxActiveElementStepStartPoint ************/ datasetBranch ("/registerParameters/apodizationParameters/rxActiveElementStepStartPoint", floatArray); - QList rxActiveElementStepStartPoint; + scenParams.hwRegister.apodizationParams.rxActiveElementStepStartPoint.clear(); for (quint32 var = 0; var < scenParams.hwRegister.rxBeamFormerTypeNumber; var++) - rxActiveElementStepStartPoint.push_back(static_cast(floatArray[var])); + scenParams.hwRegister.apodizationParams.rxActiveElementStepStartPoint.push_back(static_cast(floatArray[var])); /********* /registerParameters/apodizationParameters/rxActiveElementStepStopPoint ************/ datasetBranch ("/registerParameters/apodizationParameters/rxActiveElementStepStopPoint", floatArray); - QList rxActiveElementStepStopPoint; + scenParams.hwRegister.apodizationParams.rxActiveElementStepStopPoint.clear(); for (quint32 var = 0; var < scenParams.hwRegister.rxBeamFormerTypeNumber; var++) - rxActiveElementStepStopPoint.push_back(static_cast(floatArray[var])); + scenParams.hwRegister.apodizationParams.rxActiveElementStepStopPoint.push_back(static_cast(floatArray[var])); /********* /registerParameters/apodizationParameters/rxActiveElementStepChangePoint ************/ datasetBranch ("/registerParameters/apodizationParameters/rxActiveElementStepChangePoint", floatArray); - QList rxActiveElementStepChangePoint; + scenParams.hwRegister.apodizationParams.rxActiveElementStepChangePoint.clear(); 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); - } + scenParams.hwRegister.apodizationParams.rxActiveElementStepChangePoint.push_back(static_cast(floatArray[var])); /**************** /registerParameters/receiverConfigProperties/mla ********************/ datasetBranch ("/registerParameters/receiverConfigProperties/mla", floatArray); @@ -869,51 +872,6 @@ void Hdf5::prbDependParamsRead(ScenPrbDepHardwareParam &prbDepParams) atgcObj.atgcCompensateLut = atgcCompensationLut.at(i); prbDepParams.prbDepParams.atgcLut.push_back(atgcObj); } - - /*********** /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++) - { - QList temp; - for (quint32 j = 0; j < 64; j++) - { - temp.push_back(static_cast(floatArray[j + i * 64])); - } - 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/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 ac3c729..0ffec59 100644 --- a/include/model/hardware/core/lowLevelApi/TrxBoard.h +++ b/include/model/hardware/core/lowLevelApi/TrxBoard.h @@ -118,7 +118,7 @@ private: struct ScenHwRegister { ///////////// BeamFormer ///////////// - QList apodizationParams; + QList apodizationParams; ProbeElementPosition* elementPosition; RxBeamformerProperties* rxBeamformer; PulseProperties* pulse; @@ -133,13 +133,15 @@ private: QVector dtgcLut; ReceiverConfiguration* configLut; FreqPoint* freqPoint; - QVector > blendWeight; - quint8 receiverConfigTypeNumber; + QVector > blendWeight; + quint8 receiverConfigTypeNumber; QList mlaOffsetAddr; QList startFreqLut; QList endFreqLut; quint32 noiseReject; quint32 frameLoggerControl; + QList lpfScaleCoeff; + QList lpfLut; ScenHwRegister(); ~ScenHwRegister(); }; diff --git a/include/model/hardware/core/lowLevelApi/TrxBoardUtils/ScenParamsRanges.h b/include/model/hardware/core/lowLevelApi/TrxBoardUtils/ScenParamsRanges.h index 0df77dc..7f9aa9e 100644 --- a/include/model/hardware/core/lowLevelApi/TrxBoardUtils/ScenParamsRanges.h +++ b/include/model/hardware/core/lowLevelApi/TrxBoardUtils/ScenParamsRanges.h @@ -9,7 +9,7 @@ #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_POINT_LUT_MAX 4 #define FREQ_STEP_LUT_MAX 4U #define FREQUENCY_LUT_MAX 8 #define END_FREQ_LUT_MAX 4U diff --git a/include/model/hardware/core/lowLevelApi/TrxBoardUtils/TrxBoardStructures.h b/include/model/hardware/core/lowLevelApi/TrxBoardUtils/TrxBoardStructures.h index caff6ea..0ebc7fa 100644 --- a/include/model/hardware/core/lowLevelApi/TrxBoardUtils/TrxBoardStructures.h +++ b/include/model/hardware/core/lowLevelApi/TrxBoardUtils/TrxBoardStructures.h @@ -55,8 +55,6 @@ struct ConnectedPrbInfo struct ScenPrbDepHwRegister { - QList lpfScaleCoeff; - 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 fb748ba..c8f4377 100644 --- a/include/model/hardware/core/lowLevelApi/register/beamFormer/BeamFormer.h +++ b/include/model/hardware/core/lowLevelApi/register/beamFormer/BeamFormer.h @@ -1,7 +1,7 @@ #ifndef BEAMFORMER_H #define BEAMFORMER_H -#include "registerDefinition/ApodizationParameters.h" +#include "registerDefinition/ApoParams.h" #include "registerDefinition/ElementsActiveEnable.h" #include "registerDefinition/RxActiveElementPoint.h" #include "registerDefinition/RxActiveElementStep.h" @@ -42,7 +42,7 @@ public: ~BeamFormer(); void rxBeamformerProperties (quint8& rxBeamFormerTypeNumber, RxBeamformerProperties* rxBeamformer) const; - void apodizationParameters (QList& apoParams) const; + void apodizationParameters (QList& apoParams) const; void probeElementPosition (QList>& elementPosition) const; void pulseProperties (quint8& pulseTypeNumber, PulseProperties* pulse) const; void elementActiveEn(QList &elements) const; diff --git a/include/model/hardware/core/lowLevelApi/register/beamFormer/registerDefinition/ApodizationParameters.h b/include/model/hardware/core/lowLevelApi/register/beamFormer/registerDefinition/ApoParams.h similarity index 80% rename from include/model/hardware/core/lowLevelApi/register/beamFormer/registerDefinition/ApodizationParameters.h rename to include/model/hardware/core/lowLevelApi/register/beamFormer/registerDefinition/ApoParams.h index d4dff17..dbbde6b 100644 --- a/include/model/hardware/core/lowLevelApi/register/beamFormer/registerDefinition/ApodizationParameters.h +++ b/include/model/hardware/core/lowLevelApi/register/beamFormer/registerDefinition/ApoParams.h @@ -1,10 +1,11 @@ -#ifndef APODIZATIONPARAMETERS_H -#define APODIZATIONPARAMETERS_H +#ifndef APOPARAMS_H +#define APOPARAMS_H #include "model/hardware/core/lowLevelApi/register/Register.h" #include "model/hardware/core/lowLevelApi/register/RegUtils.h" -struct ApodizationParameters { +struct ApoParams +{ quint32 rxActiveElementStepStartPoint; quint32 rxActiveElementStepStopPoint; quint32 rxActiveElementStepChangePoint; @@ -20,4 +21,4 @@ struct ApodizationParameters { float winOpenStopVal; }; -#endif // APODIZATIONPARAMETERS_H +#endif // APOPARAMS_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 index 978e65c..1e6aab4 100644 --- a/include/model/hardware/core/lowLevelApi/register/beamFormer/registerDefinition/MaxApertureSize.h +++ b/include/model/hardware/core/lowLevelApi/register/beamFormer/registerDefinition/MaxApertureSize.h @@ -4,7 +4,7 @@ #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" +#include "ApoParams.h" #undef BAR @@ -31,7 +31,7 @@ public: Field* rxActiveElementStepChangePoint; Field* maxApertureSize; - void setMaxApertureSize (ApodizationParameters* params) + void setMaxApertureSize (ApoParams* params) { _rxActiveElementStepChangePointQ = params->rxActiveElementStepChangePoint; _maxApertureSizeQ = params->maxApertureSize; diff --git a/include/model/hardware/core/lowLevelApi/register/beamFormer/registerDefinition/MinApertureSize.h b/include/model/hardware/core/lowLevelApi/register/beamFormer/registerDefinition/MinApertureSize.h index 976f95e..956e72f 100644 --- a/include/model/hardware/core/lowLevelApi/register/beamFormer/registerDefinition/MinApertureSize.h +++ b/include/model/hardware/core/lowLevelApi/register/beamFormer/registerDefinition/MinApertureSize.h @@ -4,7 +4,7 @@ #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" +#include "ApoParams.h" #undef BAR @@ -31,7 +31,7 @@ public: Field* winOpenStepVal; Field* minApertureSize; - void setMinApertureSize (ApodizationParameters* params) + void setMinApertureSize (ApoParams* params) { QVector temp; temp.append(params->winOpenStepVal); diff --git a/include/model/hardware/core/lowLevelApi/register/beamFormer/registerDefinition/RxActiveElementPoint.h b/include/model/hardware/core/lowLevelApi/register/beamFormer/registerDefinition/RxActiveElementPoint.h index eec97f4..6dcd379 100644 --- a/include/model/hardware/core/lowLevelApi/register/beamFormer/registerDefinition/RxActiveElementPoint.h +++ b/include/model/hardware/core/lowLevelApi/register/beamFormer/registerDefinition/RxActiveElementPoint.h @@ -4,7 +4,7 @@ #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" +#include "ApoParams.h" #undef BAR @@ -31,7 +31,7 @@ public: Field* rxActiveElementStepStartPoint; Field* rxActiveElementStepStopPoint; - void setRxActiveElementPoint (ApodizationParameters* params) + void setRxActiveElementPoint (ApoParams* params) { _rxActiveElementStepStartPointQ = params->rxActiveElementStepStartPoint; _rxActiveElementStepStopPointQ = params->rxActiveElementStepStopPoint; diff --git a/include/model/hardware/core/lowLevelApi/register/beamFormer/registerDefinition/RxActiveElementStep.h b/include/model/hardware/core/lowLevelApi/register/beamFormer/registerDefinition/RxActiveElementStep.h index ca248e0..1cff149 100644 --- a/include/model/hardware/core/lowLevelApi/register/beamFormer/registerDefinition/RxActiveElementStep.h +++ b/include/model/hardware/core/lowLevelApi/register/beamFormer/registerDefinition/RxActiveElementStep.h @@ -4,7 +4,7 @@ #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" +#include "ApoParams.h" #undef BAR @@ -31,7 +31,7 @@ public: Field* rxActiveElementStep1; Field* rxActiveElementStep2; - void setRxActiveElementStep (ApodizationParameters* params) + void setRxActiveElementStep (ApoParams* params) { QVector temp; temp.append(params->rxActiveElementStep1); diff --git a/include/model/hardware/core/lowLevelApi/register/beamFormer/registerDefinition/WinOpenPoint.h b/include/model/hardware/core/lowLevelApi/register/beamFormer/registerDefinition/WinOpenPoint.h index 37983a5..6dea21c 100644 --- a/include/model/hardware/core/lowLevelApi/register/beamFormer/registerDefinition/WinOpenPoint.h +++ b/include/model/hardware/core/lowLevelApi/register/beamFormer/registerDefinition/WinOpenPoint.h @@ -4,7 +4,7 @@ #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" +#include "ApoParams.h" #undef BAR @@ -31,7 +31,7 @@ public: Field* winOpenStartPoint; Field* winOpenStopPoint; - void setWinOpenPoint (ApodizationParameters* params) + void setWinOpenPoint (ApoParams* params) { _winOpenStartPointQ = params->winOpenStartPoint; _winOpenStopPointQ = params->winOpenStopPoint; diff --git a/include/model/hardware/core/lowLevelApi/register/beamFormer/registerDefinition/WinOpenVal.h b/include/model/hardware/core/lowLevelApi/register/beamFormer/registerDefinition/WinOpenVal.h index 6712542..a1bfce0 100644 --- a/include/model/hardware/core/lowLevelApi/register/beamFormer/registerDefinition/WinOpenVal.h +++ b/include/model/hardware/core/lowLevelApi/register/beamFormer/registerDefinition/WinOpenVal.h @@ -4,7 +4,7 @@ #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" +#include "ApoParams.h" #undef BAR @@ -31,7 +31,7 @@ public: Field* winOpenStartVal; Field* winOpenStopVal; - void setWinOpenVal (ApodizationParameters* params) + void setWinOpenVal (ApoParams* params) { QVector temp; temp.append(params->winOpenStartVal); diff --git a/include/model/scenarioGenerator/core/scenario/type/misc/ApodizationParameters.h b/include/model/scenarioGenerator/core/scenario/type/misc/ApodizationParameters.h new file mode 100644 index 0000000..67f46d8 --- /dev/null +++ b/include/model/scenarioGenerator/core/scenario/type/misc/ApodizationParameters.h @@ -0,0 +1,23 @@ +#ifndef APODIZATIONPARAMETERS_H +#define APODIZATIONPARAMETERS_H + +#include + +struct ApodizationParameters_t +{ + QList rxActiveElementStepStartPoint; + QList rxActiveElementStepStopPoint; + QList rxActiveElementStepChangePoint; + QList winOpenStartPoint; + QList winOpenStopPoint; + QList minApertureSize; + QList maxApertureSize; + + QVector rxActiveElementStep1; + QVector rxActiveElementStep2; + QVector winOpenStartVal; + QVector winOpenStepVal; + QVector winOpenStopVal; +}; + +#endif // APODIZATIONPARAMETERS_H diff --git a/include/model/scenarioGenerator/core/scenario/type/misc/ApodizationParams.h b/include/model/scenarioGenerator/core/scenario/type/misc/ApodizationParams.h deleted file mode 100644 index f278c50..0000000 --- a/include/model/scenarioGenerator/core/scenario/type/misc/ApodizationParams.h +++ /dev/null @@ -1,23 +0,0 @@ -#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/DdcParameters.h b/include/model/scenarioGenerator/core/scenario/type/misc/DdcParameters.h new file mode 100644 index 0000000..261b675 --- /dev/null +++ b/include/model/scenarioGenerator/core/scenario/type/misc/DdcParameters.h @@ -0,0 +1,20 @@ +#ifndef DDCPARAMETERS_H +#define DDCPARAMETERS_H + +#include + +struct DdcParameters_t +{ + QList startFreqLut; + QList endFreqLut; + QList startFreqPoint; + QList endFreqPoint; + QVector freqStepLut; + QVector lpfWeightStepLut; + QVector startLpfWeightLut; + QList> startLpf; + QList> endLpf; + QList lpfScale; +}; + +#endif // DDCPARAMETERS_H diff --git a/include/model/scenarioGenerator/core/scenario/type/misc/FrequencyPointLut.h b/include/model/scenarioGenerator/core/scenario/type/misc/FrequencyPointLut.h deleted file mode 100644 index e78e5b5..0000000 --- a/include/model/scenarioGenerator/core/scenario/type/misc/FrequencyPointLut.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef FREQUENCYPOINTLUT_H -#define FREQUENCYPOINTLUT_H - -#include - -struct FrequencyPointLut_t { - quint32 startFreqPoint; - quint32 endFreqPoint; -}; - -#endif // FREQUENCYPOINTLUT_H diff --git a/include/model/scenarioGenerator/dto/hardware/HwScenarioDependent.h b/include/model/scenarioGenerator/dto/hardware/HwScenarioDependent.h index d7c00e4..98427de 100644 --- a/include/model/scenarioGenerator/dto/hardware/HwScenarioDependent.h +++ b/include/model/scenarioGenerator/dto/hardware/HwScenarioDependent.h @@ -5,8 +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" +#include "model/scenarioGenerator/core/scenario/type/misc/DdcParameters.h" +#include "model/scenarioGenerator/core/scenario/type/misc/ApodizationParameters.h" struct HwRegister_t { QVector dtgcLut; @@ -26,16 +26,11 @@ 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; + DdcParameters_t ddcParams; + ApodizationParameters_t apodizationParams; }; diff --git a/src/model/hardware/core/lowLevelApi/TrxBoard.cpp b/src/model/hardware/core/lowLevelApi/TrxBoard.cpp index 841c1c1..f16a55d 100644 --- a/src/model/hardware/core/lowLevelApi/TrxBoard.cpp +++ b/src/model/hardware/core/lowLevelApi/TrxBoard.cpp @@ -360,8 +360,8 @@ TrxBoard::ScenHwRegister::ScenHwRegister() elementPosition = new ProbeElementPosition; rxBeamformer = new RxBeamformerProperties; configLut = new ReceiverConfiguration; - pulse = new PulseProperties; freqPoint = new FreqPoint; + pulse = new PulseProperties; } TrxBoard::ScenGenHardwareParam::ScenGenHardwareParam() @@ -592,22 +592,8 @@ void TrxBoard::setProbeDependParams(ScenPrbDepHardwareParam& prbDepParams) { throw SonoException("Atgc lut is out of range"); } - this->_dsp->atgcLut(prbDepParams.prbDepParams.atgcLut); - if(prbDepParams.prbDepParams.lpfLut.size() != LPF_LUT_MAX) - { - throw SonoException("Lpf lut is out of range"); - } - - this->_dsp->lpfLut(prbDepParams.prbDepParams.lpfLut); - - if(prbDepParams.prbDepParams.lpfScaleCoeff.size() != LPF_SCALE_MAX) - { - throw SonoException("Lpf scale coefficient is out of range"); - } - this->_dsp->lpfScaleCoefficient(prbDepParams.prbDepParams.lpfScaleCoeff); - /////////////////////////// AFE setting /////////////////////////// setAfeConfig(prbDepParams.afeCfg); setAfePwr(afePwrdnEnable); @@ -714,71 +700,100 @@ void TrxBoard::setScenario(ScenGenHardwareOutput_t& scenGenHw) _scenParams->hwRegister->receiverConfigTypeNumber = scenGenHw.hwRegister.receiverConfigTypeNumber; - if(scenGenHw.hwRegister.startFreqLut.size() != START_FREQ_LUT_MAX) + if(scenGenHw.hwRegister.ddcParams.startLpf.size() != LPF_LUT_MAX) + { + throw SonoException("Start lpf lut is out of range"); + } + if(scenGenHw.hwRegister.ddcParams.endLpf.size() != LPF_LUT_MAX) + { + throw SonoException("End lpf lut is out of range"); + } + + _scenParams->hwRegister->lpfLut.clear(); + for (qint8 i = 0; i < LPF_LUT_MAX; i++) + { + Lpf lpfObj; + lpfObj.startLpf = scenGenHw.hwRegister.ddcParams.startLpf.at(i); + lpfObj.endLpf = scenGenHw.hwRegister.ddcParams.endLpf.at(i); + _scenParams->hwRegister->lpfLut.push_back(lpfObj); + } + + if(scenGenHw.hwRegister.ddcParams.lpfScale.size() != LPF_SCALE_MAX) + { + throw SonoException("Lpf scale coefficient is out of range"); + } + _scenParams->hwRegister->lpfScaleCoeff = scenGenHw.hwRegister.ddcParams.lpfScale; + + if(scenGenHw.hwRegister.ddcParams.startFreqLut.size() != START_FREQ_LUT_MAX) { throw SonoException("Start freq lut is out of range"); } - _scenParams->hwRegister->startFreqLut = scenGenHw.hwRegister.startFreqLut; + _scenParams->hwRegister->startFreqLut = scenGenHw.hwRegister.ddcParams.startFreqLut; - if(scenGenHw.hwRegister.endFreqLut.size() != END_FREQ_LUT_MAX) + if(scenGenHw.hwRegister.ddcParams.endFreqLut.size() != END_FREQ_LUT_MAX) { throw SonoException("End freq lut is out of range"); } - _scenParams->hwRegister->endFreqLut = scenGenHw.hwRegister.endFreqLut; + _scenParams->hwRegister->endFreqLut = scenGenHw.hwRegister.ddcParams.endFreqLut; - if(scenGenHw.hwRegister.freqPointLut.size() != FREQ_POINT_LUT_MAX) + if(scenGenHw.hwRegister.ddcParams.startFreqPoint.size() != FREQ_POINT_LUT_MAX) + { + throw SonoException("Start freq point lut is out of range"); + } + if(scenGenHw.hwRegister.ddcParams.endFreqPoint.size() != FREQ_POINT_LUT_MAX) { - throw SonoException("Freq point lut is out of range"); + throw SonoException("End freq point lut is out of range"); } _scenParams->hwRegister->freqPoint->clear(); - foreach(auto i, scenGenHw.hwRegister.freqPointLut) + for (qint8 i = 0; i < FREQ_POINT_LUT_MAX; i++) { - _scenParams->hwRegister->freqPoint->startFreqPoint.append(i.startFreqPoint); - _scenParams->hwRegister->freqPoint->endFreqPoint.append(i.endFreqPoint); + _scenParams->hwRegister->freqPoint->startFreqPoint = scenGenHw.hwRegister.ddcParams.startFreqPoint; + _scenParams->hwRegister->freqPoint->endFreqPoint = scenGenHw.hwRegister.ddcParams.endFreqPoint; } - if(scenGenHw.hwRegister.freqStepLut.size() != FREQ_STEP_LUT_MAX) + if(scenGenHw.hwRegister.ddcParams.freqStepLut.size() != FREQ_STEP_LUT_MAX) { throw SonoException("Freq step lut is out of range"); } - _scenParams->hwRegister->freqStepLut = scenGenHw.hwRegister.freqStepLut; + _scenParams->hwRegister->freqStepLut = scenGenHw.hwRegister.ddcParams.freqStepLut; - if(scenGenHw.hwRegister.lpfWeightStepLut.size() != LPF_WEIGHT_STEP_LUT_MAX) + if(scenGenHw.hwRegister.ddcParams.lpfWeightStepLut.size() != LPF_WEIGHT_STEP_LUT_MAX) { throw SonoException("Lpf weight step lut is out of range"); } - _scenParams->hwRegister->lpfWeightStepLut = scenGenHw.hwRegister.lpfWeightStepLut; + _scenParams->hwRegister->lpfWeightStepLut = scenGenHw.hwRegister.ddcParams.lpfWeightStepLut; - if(scenGenHw.hwRegister.startLpfWeightLut.size() != START_LPF_WEIGHT_LUT_MAX) + if(scenGenHw.hwRegister.ddcParams.startLpfWeightLut.size() != START_LPF_WEIGHT_LUT_MAX) { throw SonoException("Lpf weight step lut is out of range"); } - _scenParams->hwRegister->startLpfWeightLut = scenGenHw.hwRegister.startLpfWeightLut; + _scenParams->hwRegister->startLpfWeightLut = scenGenHw.hwRegister.ddcParams.startLpfWeightLut; - if(scenGenHw.hwRegister.apodizationParams.size() > RXBEAMFORMER_LUT_MAX) + if(scenGenHw.hwRegister.apodizationParams.winOpenStartPoint.size() > RXBEAMFORMER_LUT_MAX) { throw SonoException("Apodization parameters is out of range"); } _scenParams->hwRegister->apodizationParams.clear(); - foreach(auto temp, scenGenHw.hwRegister.apodizationParams) + + for (qint32 j = 0; j < scenGenHw.hwRegister.apodizationParams.winOpenStartPoint.size(); j++) { - 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; + ApoParams params; + params.winOpenStepVal = scenGenHw.hwRegister.apodizationParams.winOpenStepVal.at(j); + params.winOpenStopVal = scenGenHw.hwRegister.apodizationParams.winOpenStopVal.at(j); + params.maxApertureSize = scenGenHw.hwRegister.apodizationParams.maxApertureSize.at(j); + params.minApertureSize = scenGenHw.hwRegister.apodizationParams.minApertureSize.at(j); + params.winOpenStartVal = scenGenHw.hwRegister.apodizationParams.winOpenStartVal.at(j); + params.winOpenStopPoint = scenGenHw.hwRegister.apodizationParams.winOpenStopPoint.at(j); + params.winOpenStartPoint = scenGenHw.hwRegister.apodizationParams.winOpenStartPoint.at(j); + params.rxActiveElementStep1 = scenGenHw.hwRegister.apodizationParams.rxActiveElementStep1.at(j); + params.rxActiveElementStep2 = scenGenHw.hwRegister.apodizationParams.rxActiveElementStep2.at(j); + params.rxActiveElementStepStopPoint = scenGenHw.hwRegister.apodizationParams.rxActiveElementStepStopPoint.at(j); + params.rxActiveElementStepStartPoint = scenGenHw.hwRegister.apodizationParams.rxActiveElementStepStartPoint.at(j); + params.rxActiveElementStepChangePoint = scenGenHw.hwRegister.apodizationParams.rxActiveElementStepChangePoint.at(j); - _scenParams->hwRegister->apodizationParams.append(params); + _scenParams->hwRegister->apodizationParams.push_back(params); } _scenParams->hwRegister->pulse->clear(); @@ -1020,6 +1035,10 @@ void TrxBoard::setScenario (ScenGenHardwareParam* _scenParams) this->_dsp->frameLoggerCtrl(_scenParams->hwRegister->frameLoggerControl); + this->_dsp->lpfLut(_scenParams->hwRegister->lpfLut); + + this->_dsp->lpfScaleCoefficient(_scenParams->hwRegister->lpfScaleCoeff); + ///////////////////////////////// Sram setting /////////////////////////////// this->_sram->setSramIndex(_scenParams->totalTxShotNumber, _scenParams->indexParams); diff --git a/src/model/hardware/core/lowLevelApi/register/beamFormer/BeamFormer.cpp b/src/model/hardware/core/lowLevelApi/register/beamFormer/BeamFormer.cpp index 703a8e4..7a05f30 100644 --- a/src/model/hardware/core/lowLevelApi/register/beamFormer/BeamFormer.cpp +++ b/src/model/hardware/core/lowLevelApi/register/beamFormer/BeamFormer.cpp @@ -55,7 +55,7 @@ void BeamFormer::rxBeamformerProperties(quint8& rxBeamFormerTypeNumber, RxBeamfo this->_rxBeamformer->updateArray(true, rxBeamFormerTypeNumber); } -void BeamFormer::apodizationParameters(QList &apoParams) const +void BeamFormer::apodizationParameters(QList &apoParams) const { quint32 rxActiveElementPointBaseOffset = this->_rxActiveElementPoint->getCurrentOffset(); quint32 rxActiveElementStepBaseOffset = this->_rxActiveElementStep->getCurrentOffset();