From ceefa3fae9dc1941192dad7146541f3749de5463 Mon Sep 17 00:00:00 2001 From: Arash Aletayeb Date: Wed, 9 Feb 2022 14:40:29 +0100 Subject: [PATCH] temp commit --- developHw.pro.user | 2 +- hdf5Scenario/hdf5Scenario.cpp | 109 +++++++++++++----- .../hardware/core/lowLevelApi/TrxBoard.h | 2 + .../TrxBoardUtils/TrxBoardStructures.h | 2 +- .../core/lowLevelApi/register/dsp/Dsp.h | 8 +- .../register/dsp/registerDefinition/AtgcLut.h | 30 ++++- .../dsp/registerDefinition/MlaOffset.h | 44 +++++++ .../dsp/registerDefinition/NoiseRejectValue.h | 31 +++++ .../ReceiverConfigurationLut.h | 56 +++++---- .../misc/registerDefinition/FrameLostCount.h | 2 +- .../register/sram/registerDefinition/Index.h | 55 +++++---- .../sram/registerDefinition/SramStructures.h | 10 +- .../core/scenario/type/misc/ReceiverConfig.h | 7 +- .../dto/hardware/HwScenarioDependent.h | 2 + .../dto/hardware/SramIndex.h | 8 +- .../hardware/core/lowLevelApi/TrxBoard.cpp | 24 ++-- .../core/lowLevelApi/register/dsp/Dsp.cpp | 22 +++- .../core/lowLevelApi/register/sram/Sram.cpp | 2 +- .../core/scenario/B/BModeScenario.cpp | 2 +- .../core/scenario/Bm/BmModeScenario.cpp | 2 +- 20 files changed, 311 insertions(+), 109 deletions(-) create mode 100644 include/model/hardware/core/lowLevelApi/register/dsp/registerDefinition/MlaOffset.h create mode 100644 include/model/hardware/core/lowLevelApi/register/dsp/registerDefinition/NoiseRejectValue.h diff --git a/developHw.pro.user b/developHw.pro.user index 19d23b5..7c75ee7 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 161bec1..a11cdbd 100644 --- a/hdf5Scenario/hdf5Scenario.cpp +++ b/hdf5Scenario/hdf5Scenario.cpp @@ -67,23 +67,35 @@ void Hdf5::scenarioRead(ScenGenHardwareOutput_t &scenParams) for (quint32 var = 0; var < scenParams.totalTxShotNumber; var++) scenParams.indexParams.firstLineInFrame.push_back(static_cast(floatArray[var])); - /**************** /sramParameters/indexParameters/lastLineInFrame ********************/ - datasetBranch ("/sramParameters/indexParameters/lastLineInFrame", floatArray); - scenParams.indexParams.lastLineInFrame.clear(); + /**************** /sramParameters/indexParameters/startOfSubBatch ********************/ + datasetBranch ("/sramParameters/indexParameters/startOfSubBatch", floatArray); + scenParams.indexParams.startOfSubBatch.clear(); for (quint32 var = 0; var < scenParams.totalTxShotNumber; var++) - scenParams.indexParams.lastLineInFrame.push_back(static_cast(floatArray[var])); + scenParams.indexParams.startOfSubBatch.push_back(static_cast(floatArray[var])); - /**************** /sramParameters/indexParameters/dLineNum ********************/ - datasetBranch ("/sramParameters/indexParameters/dLineNum", floatArray); - scenParams.indexParams.dLineNum.clear(); + /**************** /sramParameters/indexParameters/endOfSubBatch ********************/ + datasetBranch ("/sramParameters/indexParameters/endOfSubBatch", floatArray); + scenParams.indexParams.endOfSubBatch.clear(); for (quint32 var = 0; var < scenParams.totalTxShotNumber; var++) - scenParams.indexParams.dLineNum.push_back(static_cast(floatArray[var])); + scenParams.indexParams.endOfSubBatch.push_back(static_cast(floatArray[var])); - /**************** /sramParameters/indexParameters/dEnsembleNum ********************/ - datasetBranch ("/sramParameters/indexParameters/dEnsembleNum", floatArray); - scenParams.indexParams.dEnsembleNum.clear(); + /**************** /sramParameters/indexParameters/endOfSubFrame ********************/ + datasetBranch ("/sramParameters/indexParameters/endOfSubFrame", floatArray); + scenParams.indexParams.endOfSubFrame.clear(); for (quint32 var = 0; var < scenParams.totalTxShotNumber; var++) - scenParams.indexParams.dEnsembleNum.push_back(static_cast(floatArray[var])); + scenParams.indexParams.endOfSubFrame.push_back(static_cast(floatArray[var])); + + /**************** /sramParameters/indexParameters/endOfEnsemble ********************/ + datasetBranch ("/sramParameters/indexParameters/endOfEnsemble", floatArray); + scenParams.indexParams.endOfEnsemble.clear(); + for (quint32 var = 0; var < scenParams.totalTxShotNumber; var++) + scenParams.indexParams.endOfEnsemble.push_back(static_cast(floatArray[var])); + + /**************** /sramParameters/indexParameters/isLastSubBatch ********************/ + datasetBranch ("/sramParameters/indexParameters/isLastSubBatch", floatArray); + scenParams.indexParams.isLastSubBatch.clear(); + for (quint32 var = 0; var < scenParams.totalTxShotNumber; var++) + scenParams.indexParams.isLastSubBatch.push_back(static_cast(floatArray[var])); /**************** /sramParameters/txParameters/txFocusXPos ********************/ datasetBranch ("/sramParameters/txParameters/txFocusXPos", floatArray); @@ -544,22 +556,22 @@ void Hdf5::scenarioRead(ScenGenHardwareOutput_t &scenParams) focusNo.push_back(static_cast(floatArray[j])); } - /**************** /registerParameters/receiverConfigProperties/lineFilterEn ********************/ - datasetBranch ("/registerParameters/receiverConfigProperties/lineFilterEn", floatArray); - QList lineFilterEn; + /**************** /registerParameters/receiverConfigProperties/iqDataCrossEn ********************/ + datasetBranch ("/registerParameters/receiverConfigProperties/iqDataCrossEn", floatArray); + QList iqDataCrossEn; for (quint32 j = 0; j < scenParams.hwRegister.receiverConfigTypeNumber; j++) { - lineFilterEn.push_back(static_cast(floatArray[j])); + iqDataCrossEn.push_back(static_cast(floatArray[j])); } - /**************** /registerParameters/receiverConfigProperties/dpeEn ********************/ - datasetBranch ("/registerParameters/receiverConfigProperties/dpeEn", floatArray); - QList dpeEn; + /**************** /registerParameters/receiverConfigProperties/logEn ********************/ + datasetBranch ("/registerParameters/receiverConfigProperties/logEn", floatArray); + QList logEn; for (quint32 j = 0; j < scenParams.hwRegister.receiverConfigTypeNumber; j++) { - dpeEn.push_back(static_cast(floatArray[j])); + logEn.push_back(static_cast(floatArray[j])); } /**************** /registerParameters/receiverConfigProperties/ddcEn ********************/ @@ -571,13 +583,22 @@ void Hdf5::scenarioRead(ScenGenHardwareOutput_t &scenParams) ddcEn.push_back(static_cast(floatArray[j])); } - /**************** /registerParameters/receiverConfigProperties/wmfEn ********************/ - datasetBranch ("/registerParameters/receiverConfigProperties/wmfEn", floatArray); - QList wmfEn; + /**************** /registerParameters/receiverConfigProperties/frameType ********************/ + datasetBranch ("/registerParameters/receiverConfigProperties/frameType", floatArray); + QList frameType; + + for (quint32 j = 0; j < scenParams.hwRegister.receiverConfigTypeNumber; j++) + { + frameType.push_back(static_cast(floatArray[j])); + } + + /**************** /registerParameters/receiverConfigProperties/noiseRejectEn ********************/ + datasetBranch ("/registerParameters/receiverConfigProperties/noiseRejectEn", floatArray); + QList noiseRejectEn; for (quint32 j = 0; j < scenParams.hwRegister.receiverConfigTypeNumber; j++) { - wmfEn.push_back(static_cast(floatArray[j])); + noiseRejectEn.push_back(static_cast(floatArray[j])); } /**************** /registerParameters/receiverConfigProperties ********************/ @@ -586,24 +607,46 @@ void Hdf5::scenarioRead(ScenGenHardwareOutput_t &scenParams) for (qint32 j = 0; j < scenParams.hwRegister.receiverConfigTypeNumber; j++) { - receiverCfgObj.mla = receiverCfgMla.at(j); receiverCfgObj.stb = stb.at(j); receiverCfgObj.ddcEn = ddcEn.at(j); receiverCfgObj.absEn = absEn.at(j); - receiverCfgObj.dpeEn = dpeEn.at(j); + receiverCfgObj.logEn = logEn.at(j); receiverCfgObj.stbEn = stbEn.at(j); - receiverCfgObj.wmfEn = wmfEn.at(j); receiverCfgObj.lpfSel = lpfSel.at(j); receiverCfgObj.aTgcSel = aTgcSel.at(j); receiverCfgObj.focusNo = focusNo.at(j); receiverCfgObj.lineMode = lineMode.at(j); + receiverCfgObj.mla = receiverCfgMla.at(j); + receiverCfgObj.frameType = frameType.at(j); receiverCfgObj.dcCancelEn = dcCancelEn.at(j); receiverCfgObj.ncoFreqSel = ncoFreqSel.at(j); - receiverCfgObj.lineFilterEn = lineFilterEn.at(j); + receiverCfgObj.iqDataCrossEn = iqDataCrossEn.at(j); + receiverCfgObj.noiseRejectEn = noiseRejectEn.at(j); receiverCfgObj.subtractFilterEn = subtractFilterEn.at(j); scenParams.hwRegister.receiverConfigProps.push_back(receiverCfgObj); } + + scenParams.hwRegister.mlaOffsetAddr.clear(); + /**************** /registerParameters/sramFrameParameters/bOffset *****************/ + datasetBranch ("/registerParameters/sramFrameParameters/bOffset", floatArray); + scenParams.hwRegister.mlaOffsetAddr.push_back(static_cast(floatArray[0])); + + /**************** /registerParameters/sramFrameParameters/dOffset *****************/ + datasetBranch ("/registerParameters/sramFrameParameters/dOffset", floatArray); + scenParams.hwRegister.mlaOffsetAddr.push_back(static_cast(floatArray[0])); + + /**************** /registerParameters/sramFrameParameters/bLastOffset *****************/ + datasetBranch ("/registerParameters/sramFrameParameters/bLastOffset", floatArray); + scenParams.hwRegister.mlaOffsetAddr.push_back(static_cast(floatArray[0])); + + /**************** /registerParameters/sramFrameParameters/dLastOffset *****************/ + datasetBranch ("/registerParameters/sramFrameParameters/dLastOffset", floatArray); + scenParams.hwRegister.mlaOffsetAddr.push_back(static_cast(floatArray[0])); + + /**************** /registerParameters/noiseRejectValue *****************/ + datasetBranch ("/registerParameters/noiseRejectValue", floatArray); + scenParams.hwRegister.noiseRejectValue = static_cast(floatArray[0]); } @@ -624,6 +667,16 @@ void Hdf5::prbDependParamsRead(ScenPrbDepHardwareParam &prbDepParams) prbDepParams.prbDepParams.apodizationLut.push_back(tempApodization); } + +// /**************** /registerParameters/aTgcLut ********************/ +// datasetBranch ("/registerParameters/aTgcLut", floatArray); +// QList atgc; + +// for (quint32 j = 0; j < 128; j++) +// { +// atgc.push_back(static_cast(floatArray[j + i * 128])); +// } + /**************** /registerParameters/aTgcLut ********************/ datasetBranch ("/registerParameters/aTgcLut", floatArray); prbDepParams.prbDepParams.atgcLut.clear(); diff --git a/include/model/hardware/core/lowLevelApi/TrxBoard.h b/include/model/hardware/core/lowLevelApi/TrxBoard.h index 4b86c73..5cf9be5 100644 --- a/include/model/hardware/core/lowLevelApi/TrxBoard.h +++ b/include/model/hardware/core/lowLevelApi/TrxBoard.h @@ -123,6 +123,8 @@ private: ReceiverConfiguration* configLut; QVector > blendWeight; quint8 receiverConfigTypeNumber; + QList mlaOffsetAddr; + quint32 noiseReject; ScenHwRegister(); ~ScenHwRegister(); }; diff --git a/include/model/hardware/core/lowLevelApi/TrxBoardUtils/TrxBoardStructures.h b/include/model/hardware/core/lowLevelApi/TrxBoardUtils/TrxBoardStructures.h index 226cc6d..76c586e 100644 --- a/include/model/hardware/core/lowLevelApi/TrxBoardUtils/TrxBoardStructures.h +++ b/include/model/hardware/core/lowLevelApi/TrxBoardUtils/TrxBoardStructures.h @@ -57,7 +57,7 @@ struct ScenPrbDepHwRegister { QList lpfScaleCoeff; QList> lpfLut; - QList> atgcLut; + QList atgcLut; QList> apodizationLut; }; diff --git a/include/model/hardware/core/lowLevelApi/register/dsp/Dsp.h b/include/model/hardware/core/lowLevelApi/register/dsp/Dsp.h index 757c209..6de642f 100644 --- a/include/model/hardware/core/lowLevelApi/register/dsp/Dsp.h +++ b/include/model/hardware/core/lowLevelApi/register/dsp/Dsp.h @@ -3,10 +3,12 @@ #include "registerDefinition/ReceiverConfigurationLut.h" #include "registerDefinition/LineFilterCoefficient.h" +#include "registerDefinition/NoiseRejectValue.h" #include "registerDefinition/StbCoefficient.h" #include "registerDefinition/FrequencyLut.h" #include "registerDefinition/BlendWeight.h" #include "registerDefinition/ManualAtgc.h" +#include "registerDefinition/MlaOffset.h" #include "registerDefinition/DtgcLut.h" #include "registerDefinition/AtgcLut.h" #include "registerDefinition/BfScale.h" @@ -27,10 +29,12 @@ class Dsp private: ReceiverConfigurationLut* _configLut; LineFilterCoefficient* _lineFilterLut; + NoiseRejectValue* _noiseReject; StbCoefficient* _stbLut; FrequencyLut* _freqLut; BlendWeight* _blendWeight; ManualAtgc* _manualAtgc; + MlaOffset* _mlaOffset; DtgcLut* _dtgcLut; AtgcLut* _atgcLut; BfScale* _bfScale; @@ -44,11 +48,13 @@ public: void lineFilterCoefficient (QList& lineFilterLut) const; void lpfScaleCoefficient (QList& lpfScaleCoeff) const; void stbCoefficient (QList& stbLut) const; + void mlaOffsetAddr(QList& mlaLut) const; void frequencyLut (QList& freqLut) const; void blendWeight (QList>& blendWeight) const; + void noiseReject(quint32& rejectValue) const; void atgcMode (eAtgcMode mode, quint16 value) const; void dtgcLut (QList& dtgcLut) const; - void atgcLut (QList>& atgcLut) const; + void atgcLut (QList atgcLut) const; void lpfLut (QList>& lpfLut) const; }; 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 02cb821..50eadf6 100644 --- a/include/model/hardware/core/lowLevelApi/register/dsp/registerDefinition/AtgcLut.h +++ b/include/model/hardware/core/lowLevelApi/register/dsp/registerDefinition/AtgcLut.h @@ -3,39 +3,59 @@ #include "model/hardware/core/lowLevelApi/register/Register.h" #include "model/hardware/core/lowLevelApi/register/RegUtils.h" +#include "model/scenarioGenerator/core/general/Calculation.h" #undef BAR -#define ATGC_LUT_MASK 0x00000FFF +#define ATGC_LUT_MASK 0x00000FFF +#define ATGC_COMPENSATE_LUT_MASK 0xFFFF0FFF #define BAR 0 #define OFFSET 0x85000 #define LENGTH 128U +struct Atgc +{ + QList atgcLut; + QVector atgcCompensateLut; + void clear() + { + atgcLut.clear(); + atgcCompensateLut.clear(); + } +}; + class AtgcLut : public Register { private: - QList _atgcLut; + Atgc* _atgc; + QVector _atgcCompensateLutQ; void prepareData(quint32 index) override { - atgcLut->setValue(_atgcLut[static_cast(index)]); + atgcLut->setValue(_atgc->atgcLut[static_cast(index)]); + atgcCompensateLut->setValue(_atgcCompensateLutQ[static_cast(index)]); } public: Field* atgcLut; + Field* atgcCompensateLut; - void setAtgcLut (QList& atgcLut) { - _atgcLut = atgcLut; + void setAtgcLut (Atgc* atgc) + { + _atgc = atgc; + _atgcCompensateLutQ = Calculation::qntzr(_atgc->atgcCompensateLut, 0, 16, 8, 0, true, false); } AtgcLut(SonoDevice* device) : Register(BAR, OFFSET, device, LENGTH) { ADD_UNSIGNED_FIELD(atgcLut, ATGC_LUT_MASK); + ADD_UNSIGNED_FIELD(atgcCompensateLut, ATGC_COMPENSATE_LUT_MASK); } }; #undef ATGC_LUT_MASK +#undef ATGC_COMPENSATE_LUT_MASK #undef BAR #undef OFFSET diff --git a/include/model/hardware/core/lowLevelApi/register/dsp/registerDefinition/MlaOffset.h b/include/model/hardware/core/lowLevelApi/register/dsp/registerDefinition/MlaOffset.h new file mode 100644 index 0000000..008cc89 --- /dev/null +++ b/include/model/hardware/core/lowLevelApi/register/dsp/registerDefinition/MlaOffset.h @@ -0,0 +1,44 @@ +#ifndef MLAOFFSET_H +#define MLAOFFSET_H + +#include "model/hardware/core/lowLevelApi/register/Register.h" +#include "model/hardware/core/lowLevelApi/register/RegUtils.h" + +#undef BAR + +#define OFFSET_ADDR_MASK 0x001FFFFF + +#define BAR 0 +#define OFFSET 0X86020 +#define LENGTH 4U + +class MlaOffset : public Register +{ +private: + QList _mlaLut; + + void prepareData(quint32 index) override + { + mlaOffsetLut->setValue(_mlaLut[static_cast(index)]); + } + +public: + Field* mlaOffsetLut; + + void setMlaOffsetLut (QList& mlaLut) { + _mlaLut = mlaLut; + } + + MlaOffset(SonoDevice* device) : Register(BAR, OFFSET, device, LENGTH) + { + ADD_UNSIGNED_FIELD(mlaOffsetLut, OFFSET_ADDR_MASK); + } +}; + +#undef OFFSET_ADDR_MASK + +#undef BAR +#undef OFFSET +#undef LENGTH + +#endif // MLAOFFSET_H diff --git a/include/model/hardware/core/lowLevelApi/register/dsp/registerDefinition/NoiseRejectValue.h b/include/model/hardware/core/lowLevelApi/register/dsp/registerDefinition/NoiseRejectValue.h new file mode 100644 index 0000000..77b757a --- /dev/null +++ b/include/model/hardware/core/lowLevelApi/register/dsp/registerDefinition/NoiseRejectValue.h @@ -0,0 +1,31 @@ +#ifndef NOISEREJECTVALUE_H +#define NOISEREJECTVALUE_H + +#include "model/hardware/core/lowLevelApi/register/Register.h" +#include "model/hardware/core/lowLevelApi/register/RegUtils.h" + +#undef BAR + +#define REJECT_VALUE_MASK 0x00FFFFFF + +#define BAR 0 +#define OFFSET 0x86030 + +class NoiseRejectValue : public Register +{ +public: + Field* rejectValue; + + NoiseRejectValue(SonoDevice* device) : Register(BAR, OFFSET, device) + { + ADD_UNSIGNED_FIELD(rejectValue, REJECT_VALUE_MASK); + } +}; + +#undef REJECT_VALUE_MASK + +#undef BAR +#undef OFFSET +#undef LENGTH + +#endif // NOISEREJECTVALUE_H 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 18c84a6..966d24e 100644 --- a/include/model/hardware/core/lowLevelApi/register/dsp/registerDefinition/ReceiverConfigurationLut.h +++ b/include/model/hardware/core/lowLevelApi/register/dsp/registerDefinition/ReceiverConfigurationLut.h @@ -17,10 +17,11 @@ #define LPF_SEL_PRP_MASK 0x00060000 #define ABS_EN_PRP_MASK 0x00080000 #define FOCUS_NO_PRP_MASK 0x00300000 -#define LINE_FILTER_EN_PRP_MASK 0x00400000 +#define NOISE_REJECTION_EN_PRP_MASK 0x00400000 #define DDC_EN_PRP_MASK 0x00800000 -#define WMF_EN_PRP_MASK 0x01000000 -#define DPE_EN_PRP_MASK 0x02000000 +#define FRAME_TYPE_PRP_MASK 0x0F000000 +#define IQ_DATA_CROSS_EN_PRP_MASK 0x10000000 +#define LOG_EN_PRP_MASK 0x20000000 #define BAR 0U #define OFFSET 0X80000 @@ -39,10 +40,11 @@ struct ReceiverConfiguration QList lpfSel; QList absEn; QList focusNo; - QList lineFilterEn; + QList noiseRejectionEn; QList ddcEn; - QList wmfEn; - QList dpeEn; + QList frameType; + QList iqDataCrossEn; + QList logEn; void clear() { mla.clear(); @@ -56,10 +58,11 @@ struct ReceiverConfiguration lpfSel.clear(); absEn.clear(); focusNo.clear(); - lineFilterEn.clear(); + noiseRejectionEn.clear(); ddcEn.clear(); - wmfEn.clear(); - dpeEn.clear(); + frameType.clear(); + iqDataCrossEn.clear(); + logEn.clear(); } }; @@ -98,17 +101,19 @@ private: focusNoPrp->setValue(_configLut->focusNo.at(static_cast(index)) - 1); - //value = _configLut->lineFilterEn.at(static_cast(index)) ? 1 : 0; - lineFilterEnPrp->setValue(_configLut->lineFilterEn.at(static_cast(index))); + //value = _configLut->noiseRejectionEn.at(static_cast(index)) ? 1 : 0; + noiseRejectionEnPrp->setValue(_configLut->noiseRejectionEn.at(static_cast(index))); //value = _configLut->ddcEn.at(static_cast(index)) ? 1 : 0; ddcEnPrp->setValue(_configLut->ddcEn.at(static_cast(index))); - //value = _configLut->wmfEn.at(static_cast(index)) ? 1 : 0; - wmfEnPrp->setValue(_configLut->wmfEn.at(static_cast(index))); + frameTypePrp->setValue(_configLut->frameType.at(static_cast(index))); - //value = _configLut->dpeEn.at(static_cast(index)) ? 1 : 0; - dpeEnPrp->setValue(_configLut->dpeEn.at(static_cast(index))); + //value = _configLut->iqDataCrc.at(static_cast(index)) ? 1 : 0; + iqDataCrossEncPrp->setValue(_configLut->iqDataCrossEn.at(static_cast(index))); + + //value = _configLut->logEn.at(static_cast(index)) ? 1 : 0; + logEnPrp->setValue(_configLut->logEn.at(static_cast(index))); } public: @@ -123,10 +128,11 @@ public: Field* lpfSelPrp; Field* absEnPrp; Field* focusNoPrp; - Field* lineFilterEnPrp; + Field* noiseRejectionEnPrp; Field* ddcEnPrp; - Field* wmfEnPrp; - Field* dpeEnPrp; + Field* frameTypePrp; + Field* iqDataCrossEncPrp; + Field* logEnPrp; void setReceiverConfigurationLut (ReceiverConfiguration* configLut) { @@ -146,10 +152,11 @@ public: ADD_UNSIGNED_FIELD(lpfSelPrp, LPF_SEL_PRP_MASK); ADD_UNSIGNED_FIELD(absEnPrp, ABS_EN_PRP_MASK); ADD_UNSIGNED_FIELD(focusNoPrp, FOCUS_NO_PRP_MASK); - ADD_UNSIGNED_FIELD(lineFilterEnPrp, LINE_FILTER_EN_PRP_MASK); + ADD_UNSIGNED_FIELD(noiseRejectionEnPrp, NOISE_REJECTION_EN_PRP_MASK); ADD_UNSIGNED_FIELD(ddcEnPrp, DDC_EN_PRP_MASK); - ADD_UNSIGNED_FIELD(wmfEnPrp, WMF_EN_PRP_MASK); - ADD_UNSIGNED_FIELD(dpeEnPrp, DPE_EN_PRP_MASK); + ADD_UNSIGNED_FIELD(frameTypePrp, FRAME_TYPE_PRP_MASK); + ADD_UNSIGNED_FIELD(iqDataCrossEncPrp, IQ_DATA_CROSS_EN_PRP_MASK); + ADD_UNSIGNED_FIELD(logEnPrp, LOG_EN_PRP_MASK); } }; @@ -164,10 +171,11 @@ public: #undef LPF_SEL_PRP_MASK #undef ABS_EN_PRP_MASK #undef FOCUS_NO_PRP_MASK -#undef LINE_FILTER_EN_PRP_MASK +#undef NOISE_REJECTION_EN_PRP_MASK #undef DDC_EN_PRP_MASK -#undef WMF_EN_PRP_MASK -#undef DPE_EN_PRP_MASK +#undef FRAME_TYPE_PRP_MASK +#undef IQ_DATA_CROSS_EN_PRP_MASK +#undef LOG_EN_PRP_MASK #undef BAR #undef OFFSET 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 450e221..3f5882e 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 0x86028 +#define OFFSET 0x8603C class FrameLostCount : public Register { diff --git a/include/model/hardware/core/lowLevelApi/register/sram/registerDefinition/Index.h b/include/model/hardware/core/lowLevelApi/register/sram/registerDefinition/Index.h index d6f9d93..0ef25ea 100644 --- a/include/model/hardware/core/lowLevelApi/register/sram/registerDefinition/Index.h +++ b/include/model/hardware/core/lowLevelApi/register/sram/registerDefinition/Index.h @@ -11,10 +11,11 @@ #define RECEIVER_CONFIGURATION_INDEX_MASK 0x0000000000E00000 #define PULSE_PROPERTIES_INDEX_MASK 0x0000000007000000 #define FIRST_LINE_IN_FRAME_MASK 0x0000000008000000 -#define LAST_LINE_IN_FRAME_MASK 0x0000000010000000 -#define D_LINE_NUM_MASK 0x0000001FE0000000 -#define D_ENSEMBLE_NUM_MASK 0x000003E000000000 -#define FRAME_TYPE_MASK 0xFF00000000000000 +#define START_OF_SUB_BATCH_MASK 0x0000000010000000 +#define END_OF_SUB_BATCH_MASK 0x0000000020000000 +#define END_OF_SUB_FRAME_MASK 0x0000000040000000 +#define END_OF_ENSEMBLE_MASK 0x0000000080000000 +#define IS_LAST_SUB_BATCH_MASK 0x0000000100000000 #define BAR 1U #define OFFSET 0x0 @@ -41,17 +42,20 @@ private: value = _index->firstLineInFrame[static_cast(index)] ? 1 : 0; firstLineInFrame->setValueLong(value); - value = _index->lastLineInFrame[static_cast(index)] ? 1 : 0; - lastLineInFrame->setValueLong(value); + value = _index->startOfSubBatch[static_cast(index)] ? 1 : 0; + startOfSubBatch->setValueLong(value); - dLineNum->setValueLong(_index->dLineNum[static_cast(index)]); + value = _index->endOfSubBatch[static_cast(index)] ? 1 : 0; + endOfSubBatch->setValueLong(value); - dEnsembleNum->setValueLong(_index->dEnsembleNum[static_cast(index)]); + value = _index->endOfSubFrame[static_cast(index)] ? 1 : 0; + endOfSubFrame->setValueLong(value); - if (index==0) - frameType->setValueLong(_index->frameType); - else - frameType->setValueLong(0); + value = _index->endOfEnsemble[static_cast(index)] ? 1 : 0; + endOfEnsemble->setValueLong(value); + + value = _index->isLastSubBatch[static_cast(index)] ? 1 : 0; + isLastSubBatch->setValueLong(value); } public: @@ -59,10 +63,11 @@ public: Field* receiverConfigurationIndex; Field* pulsePropertiesIndex; Field* firstLineInFrame; - Field* lastLineInFrame; - Field* dLineNum; - Field* dEnsembleNum; - Field* frameType; + Field* startOfSubBatch; + Field* endOfSubBatch; + Field* endOfSubFrame; + Field* endOfEnsemble; + Field* isLastSubBatch; void setIndex (SramIndex* index) { @@ -75,10 +80,11 @@ public: ADD_UNSIGNED_FIELD_LONG(receiverConfigurationIndex, RECEIVER_CONFIGURATION_INDEX_MASK); ADD_UNSIGNED_FIELD_LONG(pulsePropertiesIndex, PULSE_PROPERTIES_INDEX_MASK ); ADD_UNSIGNED_FIELD_LONG(firstLineInFrame, FIRST_LINE_IN_FRAME_MASK ); - ADD_UNSIGNED_FIELD_LONG(lastLineInFrame, LAST_LINE_IN_FRAME_MASK ); - ADD_UNSIGNED_FIELD_LONG(dLineNum, D_LINE_NUM_MASK ); - ADD_UNSIGNED_FIELD_LONG(dEnsembleNum, D_ENSEMBLE_NUM_MASK ); - ADD_UNSIGNED_FIELD_LONG(frameType, FRAME_TYPE_MASK ); + ADD_UNSIGNED_FIELD_LONG(startOfSubBatch, START_OF_SUB_BATCH_MASK ); + ADD_UNSIGNED_FIELD_LONG(endOfSubBatch, END_OF_SUB_BATCH_MASK ); + ADD_UNSIGNED_FIELD_LONG(endOfSubFrame, END_OF_SUB_FRAME_MASK ); + ADD_UNSIGNED_FIELD_LONG(endOfEnsemble, END_OF_ENSEMBLE_MASK ); + ADD_UNSIGNED_FIELD_LONG(isLastSubBatch, IS_LAST_SUB_BATCH_MASK ); } }; @@ -86,10 +92,11 @@ public: #undef PULSE_PROPERTIES_INDEX_MASK #undef RECEIVER_CONFIGURATION_INDEX_MASK #undef FIRST_LINE_IN_FRAME_MASK -#undef LAST_LINE_IN_FRAME_MASK -#undef D_LINE_NUM_MASK -#undef D_ENSEMBLE_NUM_MASK -#undef FRAME_TYPE_MASK +#undef START_OF_SUB_BATCH_MASK +#undef END_OF_SUB_BATCH_MASK +#undef END_OF_SUB_FRAME_MASK +#undef END_OF_ENSEMBLE_MASK +#undef IS_LAST_SUB_BATCH_MASK #undef BAR #undef OFFSET diff --git a/include/model/hardware/core/lowLevelApi/register/sram/registerDefinition/SramStructures.h b/include/model/hardware/core/lowLevelApi/register/sram/registerDefinition/SramStructures.h index 2a3a3f7..9ed68cc 100644 --- a/include/model/hardware/core/lowLevelApi/register/sram/registerDefinition/SramStructures.h +++ b/include/model/hardware/core/lowLevelApi/register/sram/registerDefinition/SramStructures.h @@ -9,13 +9,13 @@ struct SramIndex { QVector receiverConfigurationIndex; QVector pulsePropertiesIndex; QVector firstLineInFrame; - QVector lastLineInFrame; - QVector dLineNum; - QVector dEnsembleNum; - quint8 frameType; + QVector startOfSubBatch; + QVector endOfSubBatch; + QVector endOfSubFrame; + QVector endOfEnsemble; + QVector isLastSubBatch; }; - struct SramRx { QVector rxActiveElementStep; QVector interceptPointFiringTime; diff --git a/include/model/scenarioGenerator/core/scenario/type/misc/ReceiverConfig.h b/include/model/scenarioGenerator/core/scenario/type/misc/ReceiverConfig.h index b6c6ac4..af8e967 100644 --- a/include/model/scenarioGenerator/core/scenario/type/misc/ReceiverConfig.h +++ b/include/model/scenarioGenerator/core/scenario/type/misc/ReceiverConfig.h @@ -15,10 +15,11 @@ struct ReceiverConfig_t { quint32 lpfSel; quint32 absEn; quint32 focusNo; - quint32 lineFilterEn; + quint32 noiseRejectEn; quint32 ddcEn; - quint32 wmfEn; - quint32 dpeEn; + quint32 frameType; + quint32 iqDataCrossEn; + quint32 logEn; }; #endif //RECEIVERCONFIG_H diff --git a/include/model/scenarioGenerator/dto/hardware/HwScenarioDependent.h b/include/model/scenarioGenerator/dto/hardware/HwScenarioDependent.h index b247bf7..3ff6dfd 100644 --- a/include/model/scenarioGenerator/dto/hardware/HwScenarioDependent.h +++ b/include/model/scenarioGenerator/dto/hardware/HwScenarioDependent.h @@ -24,6 +24,8 @@ struct HwRegister_t { QList> lpfLut; QList> atgcLut; QList> apodizationLut; + QList mlaOffsetAddr; + quint32 noiseRejectValue; }; diff --git a/include/model/scenarioGenerator/dto/hardware/SramIndex.h b/include/model/scenarioGenerator/dto/hardware/SramIndex.h index 4cedc9a..a984962 100644 --- a/include/model/scenarioGenerator/dto/hardware/SramIndex.h +++ b/include/model/scenarioGenerator/dto/hardware/SramIndex.h @@ -8,9 +8,11 @@ struct SramIndex_t { QVector pulsePropertiesIndex; QVector receiverConfigurationIndex; QVector firstLineInFrame; - QVector lastLineInFrame; - QVector dLineNum; - QVector dEnsembleNum; + QVector startOfSubBatch; + QVector endOfSubBatch; + QVector endOfSubFrame; + QVector endOfEnsemble; + QVector isLastSubBatch; }; #endif //SRAMINDEX_H diff --git a/src/model/hardware/core/lowLevelApi/TrxBoard.cpp b/src/model/hardware/core/lowLevelApi/TrxBoard.cpp index e625f0d..cd2ad0f 100644 --- a/src/model/hardware/core/lowLevelApi/TrxBoard.cpp +++ b/src/model/hardware/core/lowLevelApi/TrxBoard.cpp @@ -738,23 +738,29 @@ void TrxBoard::setScenario(ScenGenHardwareOutput_t& scenGenHw) _scenParams->hwRegister->configLut->stb.append(k.stb); _scenParams->hwRegister->configLut->absEn.append(k.absEn); _scenParams->hwRegister->configLut->ddcEn.append(k.ddcEn); - _scenParams->hwRegister->configLut->dpeEn.append(k.dpeEn); + _scenParams->hwRegister->configLut->logEn.append(k.logEn); _scenParams->hwRegister->configLut->stbEn.append(k.stbEn); - _scenParams->hwRegister->configLut->wmfEn.append(k.wmfEn); _scenParams->hwRegister->configLut->lpfSel.append(k.lpfSel); _scenParams->hwRegister->configLut->aTgcSel.append(k.aTgcSel); _scenParams->hwRegister->configLut->focusNo.append(k.focusNo); _scenParams->hwRegister->configLut->lineMode.append(k.lineMode); + _scenParams->hwRegister->configLut->frameType.append(k.frameType); + _scenParams->hwRegister->configLut->iqDataCrossEn.append(k.iqDataCrossEn); _scenParams->hwRegister->configLut->ncoFreqSel.append(k.ncoFreqSel); _scenParams->hwRegister->configLut->dcCancelerEn.append(k.dcCancelEn); - _scenParams->hwRegister->configLut->lineFilterEn.append(k.lineFilterEn); + _scenParams->hwRegister->configLut->noiseRejectionEn.append(k.noiseRejectEn); _scenParams->hwRegister->configLut->subtractFilterEn.append(k.subtractFilterEn); } - _scenParams->indexParams->dLineNum = scenGenHw.indexParams.dLineNum; - _scenParams->indexParams->frameType = scenGenHw.frameType; - _scenParams->indexParams->dEnsembleNum = scenGenHw.indexParams.dEnsembleNum; - _scenParams->indexParams->lastLineInFrame = scenGenHw.indexParams.lastLineInFrame; + _scenParams->hwRegister->mlaOffsetAddr = scenGenHw.hwRegister.mlaOffsetAddr; + + _scenParams->hwRegister->noiseReject = scenGenHw.hwRegister.noiseRejectValue; + + _scenParams->indexParams->endOfEnsemble = scenGenHw.indexParams.endOfEnsemble; + _scenParams->indexParams->endOfSubBatch = scenGenHw.indexParams.endOfSubBatch; + _scenParams->indexParams->endOfSubFrame = scenGenHw.indexParams.endOfSubFrame; + _scenParams->indexParams->isLastSubBatch = scenGenHw.indexParams.isLastSubBatch; + _scenParams->indexParams->startOfSubBatch = scenGenHw.indexParams.startOfSubBatch; _scenParams->indexParams->firstLineInFrame = scenGenHw.indexParams.firstLineInFrame; _scenParams->indexParams->shotPropertiesIndex = scenGenHw.indexParams.shotPropertiesIndex; _scenParams->indexParams->pulsePropertiesIndex = scenGenHw.indexParams.pulsePropertiesIndex; @@ -912,6 +918,10 @@ void TrxBoard::setScenario (ScenGenHardwareParam* _scenParams) } this->_dsp->blendWeight(blendWeightQ); + this->_dsp->mlaOffsetAddr(_scenParams->hwRegister->mlaOffsetAddr); + + this->_dsp->noiseReject(_scenParams->hwRegister->noiseReject); + ///////////////////////////////// Sram setting /////////////////////////////// this->_sram->setSramIndex(_scenParams->totalTxShotNumber, _scenParams->indexParams); diff --git a/src/model/hardware/core/lowLevelApi/register/dsp/Dsp.cpp b/src/model/hardware/core/lowLevelApi/register/dsp/Dsp.cpp index e30f7e2..e371f17 100644 --- a/src/model/hardware/core/lowLevelApi/register/dsp/Dsp.cpp +++ b/src/model/hardware/core/lowLevelApi/register/dsp/Dsp.cpp @@ -4,10 +4,12 @@ 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); @@ -19,8 +21,10 @@ Dsp::~Dsp() { delete _lineFilterLut; delete _blendWeight; + delete _noiseReject; delete _manualAtgc; delete _configLut; + delete _mlaOffset; delete _freqLut; delete _dtgcLut; delete _atgcLut; @@ -108,13 +112,13 @@ void Dsp::dtgcLut(QList &dtgcLut) const this->_dtgcLut->updateArray(); } -void Dsp::atgcLut(QList > &atgcLut) const +void Dsp::atgcLut(QList atgcLut) const { quint32 baseOffset = this->_atgcLut->getCurrentOffset(); - foreach (QList temp, atgcLut) + foreach (Atgc *tempObj, atgcLut) { - this->_atgcLut->setAtgcLut(temp); + this->_atgcLut->setAtgcLut(tempObj); this->_atgcLut->updateArray(); quint32 curOffset = this->_atgcLut->getCurrentOffset(); this->_atgcLut->changeOffset(curOffset + ATGC_OFFSET); @@ -137,3 +141,15 @@ void Dsp::lpfLut(QList> &lpfLut) const this->_lpfLut->changeOffset(baseOffset); } + +void Dsp::mlaOffsetAddr(QList &mlaLut) const +{ + this->_mlaOffset->setMlaOffsetLut(mlaLut); + this->_mlaOffset->updateArray(); +} + +void Dsp::noiseReject(quint32 &rejectValue) const +{ + this->_noiseReject->rejectValue->setValue(rejectValue); + this->_noiseReject->update(); +} diff --git a/src/model/hardware/core/lowLevelApi/register/sram/Sram.cpp b/src/model/hardware/core/lowLevelApi/register/sram/Sram.cpp index 075c977..11c9aa5 100644 --- a/src/model/hardware/core/lowLevelApi/register/sram/Sram.cpp +++ b/src/model/hardware/core/lowLevelApi/register/sram/Sram.cpp @@ -73,7 +73,7 @@ void Sram::setSramRx(QVector &rxBeamFormerNumber, quint32 &focusTypeNumb this->_rxDegree->changeOffset(rxDegreeBaseOffset); // return to base offset address this->_rxPos->changeOffset(rxPosBaseOffset); // return to base offset address - this->_rxDelay->changeOffset(rxDelayBaseOffset); // return to base offset address + this->_rxDelay->changeOffset(rxDelayBaseOffset); // return to base offset address } void Sram::setSramMetaData(QList &metaData) const diff --git a/src/model/scenarioGenerator/core/scenario/B/BModeScenario.cpp b/src/model/scenarioGenerator/core/scenario/B/BModeScenario.cpp index 832ed61..2f8ceb5 100644 --- a/src/model/scenarioGenerator/core/scenario/B/BModeScenario.cpp +++ b/src/model/scenarioGenerator/core/scenario/B/BModeScenario.cpp @@ -255,7 +255,7 @@ void BModeScenario::calcReceiverConfigProperties() temp.lpfSel = 1; temp.absEn = true; temp.focusNo = frameParams[0]->focusNumber; - temp.lineFilterEn = true; + //temp.lineFilterEn = true; hardwareOuput.hwRegister.receiverConfigProps.append(temp); } diff --git a/src/model/scenarioGenerator/core/scenario/Bm/BmModeScenario.cpp b/src/model/scenarioGenerator/core/scenario/Bm/BmModeScenario.cpp index c332aae..5493ace 100644 --- a/src/model/scenarioGenerator/core/scenario/Bm/BmModeScenario.cpp +++ b/src/model/scenarioGenerator/core/scenario/Bm/BmModeScenario.cpp @@ -412,7 +412,7 @@ void BmModeScenario::calcReceiverConfigProperties() ReceiverConfig_t temp; temp.lineMode = lineModeVals[i]; temp.stbEn = stbEnVals[i]; - temp.lineFilterEn = lineFilterEnVals[i]; + //temp.lineFilterEn = lineFilterEnVals[i]; temp.mla = frameParams[i]->mla; temp.aTgcSel = 1; temp.stb = frameParams[i]->stb;