Browse Source

DSP LUTs are changed and Apodization parameters are added

Arash Aletayeb 2 years ago
parent
commit
12d8972d4e
  1. 2
      developHw.pro.user
  2. 207
      hdf5Scenario/hdf5Scenario.cpp
  3. 22
      include/model/hardware/core/lowLevelApi/TrxBoard.h
  4. 12
      include/model/hardware/core/lowLevelApi/TrxBoardUtils/ScenParamsRanges.h
  5. 2
      include/model/hardware/core/lowLevelApi/TrxBoardUtils/TrxBoardStructures.h
  6. 26
      include/model/hardware/core/lowLevelApi/register/beamFormer/BeamFormer.h
  7. 23
      include/model/hardware/core/lowLevelApi/register/beamFormer/registerDefinition/ApodizationParameters.h
  8. 48
      include/model/hardware/core/lowLevelApi/register/beamFormer/registerDefinition/ElementsActiveEnable.h
  9. 54
      include/model/hardware/core/lowLevelApi/register/beamFormer/registerDefinition/MaxApertureSize.h
  10. 58
      include/model/hardware/core/lowLevelApi/register/beamFormer/registerDefinition/MinApertureSize.h
  11. 54
      include/model/hardware/core/lowLevelApi/register/beamFormer/registerDefinition/RxActiveElementPoint.h
  12. 61
      include/model/hardware/core/lowLevelApi/register/beamFormer/registerDefinition/RxActiveElementStep.h
  13. 2
      include/model/hardware/core/lowLevelApi/register/beamFormer/registerDefinition/RxBeamformerLut.h
  14. 54
      include/model/hardware/core/lowLevelApi/register/beamFormer/registerDefinition/WinOpenPoint.h
  15. 61
      include/model/hardware/core/lowLevelApi/register/beamFormer/registerDefinition/WinOpenVal.h
  16. 27
      include/model/hardware/core/lowLevelApi/register/dsp/Dsp.h
  17. 2
      include/model/hardware/core/lowLevelApi/register/dsp/registerDefinition/AtgcLut.h
  18. 2
      include/model/hardware/core/lowLevelApi/register/dsp/registerDefinition/BfScale.h
  19. 88
      include/model/hardware/core/lowLevelApi/register/dsp/registerDefinition/BlendWeight.h
  20. 2
      include/model/hardware/core/lowLevelApi/register/dsp/registerDefinition/DtgcLut.h
  21. 44
      include/model/hardware/core/lowLevelApi/register/dsp/registerDefinition/EndFreqLut.h
  22. 31
      include/model/hardware/core/lowLevelApi/register/dsp/registerDefinition/FrameLoggerCtrl.h
  23. 65
      include/model/hardware/core/lowLevelApi/register/dsp/registerDefinition/FreqPointLut.h
  24. 44
      include/model/hardware/core/lowLevelApi/register/dsp/registerDefinition/FreqStepLut.h
  25. 32
      include/model/hardware/core/lowLevelApi/register/dsp/registerDefinition/LpfLut.h
  26. 44
      include/model/hardware/core/lowLevelApi/register/dsp/registerDefinition/LpfWeightStepLut.h
  27. 2
      include/model/hardware/core/lowLevelApi/register/dsp/registerDefinition/ManualAtgc.h
  28. 2
      include/model/hardware/core/lowLevelApi/register/dsp/registerDefinition/MlaOffset.h
  29. 2
      include/model/hardware/core/lowLevelApi/register/dsp/registerDefinition/NoiseRejectValue.h
  30. 10
      include/model/hardware/core/lowLevelApi/register/dsp/registerDefinition/ReceiverConfigurationLut.h
  31. 44
      include/model/hardware/core/lowLevelApi/register/dsp/registerDefinition/StartFreqLut.h
  32. 44
      include/model/hardware/core/lowLevelApi/register/dsp/registerDefinition/StartLpfWeightLut.h
  33. 2
      include/model/hardware/core/lowLevelApi/register/dsp/registerDefinition/StbCoefficient.h
  34. 2
      include/model/hardware/core/lowLevelApi/register/misc/registerDefinition/FrameLostCount.h
  35. 23
      include/model/scenarioGenerator/core/scenario/type/misc/ApodizationParams.h
  36. 11
      include/model/scenarioGenerator/core/scenario/type/misc/FrequencyPointLut.h
  37. 1
      include/model/scenarioGenerator/core/scenario/type/misc/ReceiverConfig.h
  38. 10
      include/model/scenarioGenerator/dto/hardware/HwScenarioDependent.h
  39. 2
      mainwindow.cpp
  40. 197
      src/model/hardware/core/lowLevelApi/TrxBoard.cpp
  41. 84
      src/model/hardware/core/lowLevelApi/register/beamFormer/BeamFormer.cpp
  42. 91
      src/model/hardware/core/lowLevelApi/register/dsp/Dsp.cpp

2
developHw.pro.user

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 4.10.0, 2022-08-17T16:01:38. -->
<!-- Written by QtCreator 4.10.0, 2022-11-09T15:18:43. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>

207
hdf5Scenario/hdf5Scenario.cpp

@ -316,11 +316,63 @@ void Hdf5::scenarioRead(ScenGenHardwareOutput_t &scenParams)
scenParams.hwRegister.blendWeight.push_back(tempBlendWeight);
}
/**************** /registerParameters/freqLut ********************/
datasetBranch <float_t>("/registerParameters/freqLut", floatArray);
scenParams.hwRegister.freqLut.clear();
for (quint32 var = 0; var < 8; var++)
scenParams.hwRegister.freqLut.push_back(floatArray[var]);
// /**************** /registerParameters/freqLut ********************/
// datasetBranch <float_t>("/registerParameters/freqLut", floatArray);
// scenParams.hwRegister.freqLut.clear();
// for (quint32 var = 0; var < 8; var++)
// scenParams.hwRegister.freqLut.push_back(floatArray[var]);
/*********** /registerParameters/ddcParameters/startFreqLut ***************/
datasetBranch <float_t>("/registerParameters/ddcParameters/startFreqLut", floatArray);
scenParams.hwRegister.startFreqLut.clear();
for (quint32 var = 0; var < 4; var++)
scenParams.hwRegister.startFreqLut.push_back(static_cast<quint32>(floatArray[var]));
/*********** /registerParameters/ddcParameters/endFreqLut ***************/
datasetBranch <float_t>("/registerParameters/ddcParameters/endFreqLut", floatArray);
scenParams.hwRegister.endFreqLut.clear();
for (quint32 var = 0; var < 4; var++)
scenParams.hwRegister.endFreqLut.push_back(static_cast<quint32>(floatArray[var]));
/*********** /registerParameters/ddcParameters/startFreqPointLut ***************/
datasetBranch <float_t>("/registerParameters/ddcParameters/startFreqPointLut", floatArray);
QList<quint32> startFreqPoint;
for (quint32 var = 0; var < 4; var++)
startFreqPoint.push_back(static_cast<quint32>(floatArray[var]));
/*********** /registerParameters/ddcParameters/endFreqPointLut ***************/
datasetBranch <float_t>("/registerParameters/ddcParameters/endFreqPointLut", floatArray);
QList<quint32> endFreqPoint;
for (quint32 var = 0; var < 4; var++)
endFreqPoint.push_back(static_cast<quint32>(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 <float_t>("/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 <float_t>("/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 <float_t>("/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 <float_t>("/registerParameters/dTgcLut", floatArray);
@ -456,6 +508,97 @@ void Hdf5::scenarioRead(ScenGenHardwareOutput_t &scenParams)
scenParams.hwRegister.rxBeamFormerProps.push_back(rxBeamformerObj);
}
/********* /registerParameters/apodizationParameters/maxApertureSize ************/
datasetBranch <float_t>("/registerParameters/apodizationParameters/maxApertureSize", floatArray);
QList<quint32> maxApertureSize;
for (quint32 var = 0; var < scenParams.hwRegister.rxBeamFormerTypeNumber; var++)
maxApertureSize.push_back(static_cast<quint32>(floatArray[var]));
/********* /registerParameters/apodizationParameters/winOpenStartPoint ************/
datasetBranch <float_t>("/registerParameters/apodizationParameters/winOpenStartPoint", floatArray);
QList<quint32> winOpenStartPoint;
for (quint32 var = 0; var < scenParams.hwRegister.rxBeamFormerTypeNumber; var++)
winOpenStartPoint.push_back(static_cast<quint32>(floatArray[var]));
/********* /registerParameters/apodizationParameters/winOpenStopPoint ************/
datasetBranch <float_t>("/registerParameters/apodizationParameters/winOpenStopPoint", floatArray);
QList<quint32> winOpenStopPoint;
for (quint32 var = 0; var < scenParams.hwRegister.rxBeamFormerTypeNumber; var++)
winOpenStopPoint.push_back(static_cast<quint32>(floatArray[var]));
/********* /registerParameters/apodizationParameters/winOpenStartVal ************/
datasetBranch <float_t>("/registerParameters/apodizationParameters/winOpenStartVal", floatArray);
QList<float> winOpenStartVal;
for (quint32 var = 0; var < scenParams.hwRegister.rxBeamFormerTypeNumber; var++)
winOpenStartVal.push_back(floatArray[var]);
/********* /registerParameters/apodizationParameters/winOpenStopVal ************/
datasetBranch <float_t>("/registerParameters/apodizationParameters/winOpenStopVal", floatArray);
QList<float> winOpenStopVal;
for (quint32 var = 0; var < scenParams.hwRegister.rxBeamFormerTypeNumber; var++)
winOpenStopVal.push_back(floatArray[var]);
/********* /registerParameters/apodizationParameters/winOpenStepVal ************/
datasetBranch <float_t>("/registerParameters/apodizationParameters/winOpenStepVal", floatArray);
QList<float> winOpenStepVal;
for (quint32 var = 0; var < scenParams.hwRegister.rxBeamFormerTypeNumber; var++)
winOpenStepVal.push_back(floatArray[var]);
/********* /registerParameters/apodizationParameters/minApertureSize ************/
datasetBranch <float_t>("/registerParameters/apodizationParameters/minApertureSize", floatArray);
QList<quint32> minApertureSize;
for (quint32 var = 0; var < scenParams.hwRegister.rxBeamFormerTypeNumber; var++)
minApertureSize.push_back(static_cast<quint32>(floatArray[var]));
/********* /registerParameters/apodizationParameters/rxActiveElementStep1 ************/
datasetBranch <float_t>("/registerParameters/apodizationParameters/rxActiveElementStep1", floatArray);
QList<float> rxActiveElementStep1;
for (quint32 var = 0; var < scenParams.hwRegister.rxBeamFormerTypeNumber; var++)
rxActiveElementStep1.push_back(floatArray[var]);
/********* /registerParameters/apodizationParameters/rxActiveElementStep2 ************/
datasetBranch <float_t>("/registerParameters/apodizationParameters/rxActiveElementStep2", floatArray);
QList<float> rxActiveElementStep2;
for (quint32 var = 0; var < scenParams.hwRegister.rxBeamFormerTypeNumber; var++)
rxActiveElementStep2.push_back(floatArray[var]);
/********* /registerParameters/apodizationParameters/rxActiveElementStepStartPoint ************/
datasetBranch <float_t>("/registerParameters/apodizationParameters/rxActiveElementStepStartPoint", floatArray);
QList<quint32> rxActiveElementStepStartPoint;
for (quint32 var = 0; var < scenParams.hwRegister.rxBeamFormerTypeNumber; var++)
rxActiveElementStepStartPoint.push_back(static_cast<quint32>(floatArray[var]));
/********* /registerParameters/apodizationParameters/rxActiveElementStepStopPoint ************/
datasetBranch <float_t>("/registerParameters/apodizationParameters/rxActiveElementStepStopPoint", floatArray);
QList<quint32> rxActiveElementStepStopPoint;
for (quint32 var = 0; var < scenParams.hwRegister.rxBeamFormerTypeNumber; var++)
rxActiveElementStepStopPoint.push_back(static_cast<quint32>(floatArray[var]));
/********* /registerParameters/apodizationParameters/rxActiveElementStepChangePoint ************/
datasetBranch <float_t>("/registerParameters/apodizationParameters/rxActiveElementStepChangePoint", floatArray);
QList<quint32> rxActiveElementStepChangePoint;
for (quint32 var = 0; var < scenParams.hwRegister.rxBeamFormerTypeNumber; var++)
rxActiveElementStepChangePoint.push_back(static_cast<quint32>(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 <float_t>("/registerParameters/receiverConfigProperties/mla", floatArray);
@ -610,6 +753,15 @@ void Hdf5::scenarioRead(ScenGenHardwareOutput_t &scenParams)
noiseRejectEn.push_back(static_cast<quint32>(floatArray[j]));
}
/**************** /registerParameters/receiverConfigProperties/blendEn ********************/
datasetBranch <float_t>("/registerParameters/receiverConfigProperties/blendEn", floatArray);
QList<quint32> blendEn;
for (quint32 j = 0; j < scenParams.hwRegister.receiverConfigTypeNumber; j++)
{
blendEn.push_back(static_cast<quint32>(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 <float_t>("/registerParameters/lpfLut", floatArray);
prbDepParams.prbDepParams.lpfLut.clear();
QList <quint32> tempLpf;
/*********** /registerParameters/ddcParameters/startLpfLut ****************/
datasetBranch <float_t>("/registerParameters/ddcParameters/startLpfLut", floatArray);
QList<QList<quint32>> startLpf;
for (quint32 i = 0; i < 4; i++)
{
QList<quint32> temp;
for (quint32 j = 0; j < 64; j++)
{
temp.push_back(static_cast<quint32>(floatArray[j + i * 64]));
}
startLpf.push_back(temp);
}
/*********** /registerParameters/ddcParameters/endLpfLut ****************/
datasetBranch <float_t>("/registerParameters/ddcParameters/endLpfLut", floatArray);
QList<QList<quint32>> endLpf;
for (quint32 i = 0; i < 4; i++)
{
tempLpf.clear();
QList<quint32> temp;
for (quint32 j = 0; j < 64; j++)
{
tempLpf.push_back(static_cast<quint32>(floatArray[j + i * 64]));
temp.push_back(static_cast<quint32>(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 <float_t>("/registerParameters/lpfScale", floatArray);
/************* /registerParameters/ddcParameters/lpfScale *****************/
datasetBranch <float_t>("/registerParameters/ddcParameters/lpfScale", floatArray);
prbDepParams.prbDepParams.lpfScaleCoeff.clear();
for (quint8 i = 0; i < 4; i++)
prbDepParams.prbDepParams.lpfScaleCoeff.push_back(static_cast<quint8>(floatArray[i]));

22
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<ApodizationParameters> apodizationParams;
ProbeElementPosition* elementPosition;
RxBeamformerProperties* rxBeamformer;
ProbeElementPosition* elementPosition;
PulseProperties* pulse;
quint8 pulseTypeNumber;
quint8 rxBeamFormerTypeNumber;
//////////////// DSP ////////////////
QVector<float> freqLut;
QVector<float> freqStepLut;
QVector<float> lpfWeightStepLut;
QVector<float> startLpfWeightLut;
QVector<float> freqLut;
QVector<float> dtgcLut;
ReceiverConfiguration* configLut;
FreqPoint* freqPoint;
QVector<QVector<float> > blendWeight;
quint8 receiverConfigTypeNumber;
QList<quint32> mlaOffsetAddr;
QList<quint32> startFreqLut;
QList<quint32> 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;

12
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 ************/

2
include/model/hardware/core/lowLevelApi/TrxBoardUtils/TrxBoardStructures.h

@ -56,7 +56,7 @@ struct ConnectedPrbInfo
struct ScenPrbDepHwRegister
{
QList<quint8> lpfScaleCoeff;
QList<QList<quint32>> lpfLut;
QList<Lpf> lpfLut;
QList<Atgc> atgcLut;
QList<QList<quint32>> apodizationLut;
};

26
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<QList<quint32>>& elementPosition) const;
void rxBeamformerProperties (quint8& rxBeamFormerTypeNumber, RxBeamformerProperties* rxBeamformer) const;
void apodizationLut (QList<QList<quint32>>& apodization) const;
void apodizationParameters (QList<ApodizationParameters>& apoParams) const;
void probeElementPosition (QList<QList<quint32>>& elementPosition) const;
void pulseProperties (quint8& pulseTypeNumber, PulseProperties* pulse) const;
void afeLut (AfeProperties* afe) const;
void elementActiveEn(QList<quint32> &elements) const;
void apodizationLut (QList<QList<quint32>>& apodization) const;
void regValid (bool valid) const;
void afeLut (AfeProperties* afe) const;
};
#endif // BEAMFORMER_H

23
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

48
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<quint32> _elements;
void prepareData(quint32 index) override
{
elements->setValue(_elements[static_cast<qint32>(index)]);
}
public:
Field* elements;
void setElementsActiveEnable (QList<quint32>& 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

54
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

58
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<float> temp;
temp.append(params->winOpenStepVal);
QVector<quint32> 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

54
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

61
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<float> temp;
temp.append(params->rxActiveElementStep1);
QVector<quint32> 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

2
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
{

54
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

61
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<float> temp;
temp.append(params->winOpenStartVal);
QVector<quint32> 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

27
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<quint32>& lineFilterLut) const;
void lpfScaleCoefficient (QList<quint8>& lpfScaleCoeff) const;
void startLpfWeightLut (QList<quint32>& startLpfWeightLut) const;
void lpfWeightStepLut (QList<quint32>& lpfWeightStepLut) const;
void frameLoggerCtrl (quint32& frameLoggerCtrl) const;
void stbCoefficient (QList<quint32>& stbLut) const;
void mlaOffsetAddr(QList<quint32>& mlaLut) const;
void frequencyLut (QList<quint32>& freqLut) const;
void blendWeight (QList<QList<quint32>>& blendWeight) const;
void frequencyLut (QList<quint32>& freqLut) const;
void startFreqLut (QList<quint32>& startFreq) const;
void freqPointLut (FreqPoint* freqPoint) const;
void freqStepLut (QList<quint32>& freqStep) const;
void noiseReject(quint32& rejectValue) const;
void endFreqLut (QList<quint32>& endFreq) const;
void atgcMode (eAtgcMode mode, quint16 value) const;
void dtgcLut (QList<quint32>& dtgcLut) const;
void atgcLut (QList<Atgc> atgcLut) const;
void lpfLut (QList<QList<quint32>>& lpfLut) const;
void lpfLut (QList<Lpf>& lpfLut) const;
};
#endif // DSP_H

2
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

2
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
{

88
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<quint32> _blendWeight;
void prepareData(quint32 index) override
{
blendWeight->setValue(_blendWeight[static_cast<qint32>(index)]);
}
public:
Field* blendWeight;
void setBlendWeight (QList<quint32>& 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<quint32> _blendWeight;
void prepareData(quint32 index) override
{
blendWeight->setValue(_blendWeight[static_cast<qint32>(index)]);
}
public:
Field* blendWeight;
void setBlendWeight (QList<quint32>& 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

2
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

44
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<quint32> _endFreqLut;
void prepareData(quint32 index) override
{
endFreqLut->setValue(_endFreqLut[static_cast<qint32>(index)]);
}
public:
Field* endFreqLut;
void setEndFreqLut (QList<quint32>& 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

31
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

65
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<quint32> startFreqPoint;
QList<quint32> 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<qint32>(index)));
endFreqPointLut->setValue(_freqLut->endFreqPoint.at(static_cast<qint32>(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

44
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<quint32> _freqStepLut;
void prepareData(quint32 index) override
{
freqStepLut->setValue(_freqStepLut[static_cast<qint32>(index)]);
}
public:
Field* freqStepLut;
void setFreqStepLut (QList<quint32>& 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

32
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<quint32> startLpf;
QList<quint32> endLpf;
void clear()
{
startLpf.clear();
endLpf.clear();
}
};
class LpfLut : public Register
{
private:
QList<quint32> _lpfLut;
Lpf* _lpf;
void prepareData(quint32 index) override
{
lpfLut->setValue(_lpfLut[static_cast<qint32>(index)]);
startLpfLut->setValue(_lpf->startLpf[static_cast<qint32>(index)]);
endLpfLut->setValue(_lpf->endLpf[static_cast<qint32>(index)]);
}
public:
Field* lpfLut;
Field* startLpfLut;
Field* endLpfLut;
void setLpfLut (QList<quint32>& 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

44
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<quint32> _lpfWeightStepLut;
void prepareData(quint32 index) override
{
lpfWeightStepLut->setValue(_lpfWeightStepLut[static_cast<qint32>(index)]);
}
public:
Field* lpfWeightStepLut;
void setLpfWeightStepLut (QList<quint32>& 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

2
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
{

2
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

2
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
{

10
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<quint32> iqDataCrossEn;
QList<quint32> logEn;
QList<quint32> dTgcEn;
QList<quint32> 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<qint32>(index)) ? 1 : 0;
dTgcEnPrp->setValue(_configLut->dTgcEn.at(static_cast<qint32>(index)));
//value = _configLut->blendEnPrp.at(static_cast<qint32>(index)) ? 1 : 0;
blendEnPrp->setValue(_configLut->blendEn.at(static_cast<qint32>(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

44
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<quint32> _startFreqLut;
void prepareData(quint32 index) override
{
startFreqLut->setValue(_startFreqLut[static_cast<qint32>(index)]);
}
public:
Field* startFreqLut;
void setStartFreqLut (QList<quint32>& 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

44
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<quint32> _startLpfWeightLut;
void prepareData(quint32 index) override
{
startLpfWeightLut->setValue(_startLpfWeightLut[static_cast<qint32>(index)]);
}
public:
Field* startLpfWeightLut;
void setStartLpfWeightLut (QList<quint32>& 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

2
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

2
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
{

23
include/model/scenarioGenerator/core/scenario/type/misc/ApodizationParams.h

@ -0,0 +1,23 @@
#ifndef APODIZATIONPARAMS_H
#define APODIZATIONPARAMS_H
#include <QObject>
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

11
include/model/scenarioGenerator/core/scenario/type/misc/FrequencyPointLut.h

@ -0,0 +1,11 @@
#ifndef FREQUENCYPOINTLUT_H
#define FREQUENCYPOINTLUT_H
#include <QObject>
struct FrequencyPointLut_t {
quint32 startFreqPoint;
quint32 endFreqPoint;
};
#endif // FREQUENCYPOINTLUT_H

1
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

10
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<float> dtgcLut;
@ -24,8 +26,16 @@ struct HwRegister_t {
QList<QVector<quint32>> lpfLut;
QList<QVector<quint32>> atgcLut;
QList<QVector<quint32>> apodizationLut;
QList<ApodizationParams_t> apodizationParams;
QList<quint32> mlaOffsetAddr;
quint32 noiseRejectValue;
quint32 frameLoggerControl;
QList<quint32> startFreqLut;
QList<quint32> endFreqLut;
QList<FrequencyPointLut_t> freqPointLut;
QVector<float> freqStepLut;
QVector<float> lpfWeightStepLut;
QVector<float> startLpfWeightLut;
};

2
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;

197
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<quint32> freqLutQ = _unsignedQntzrVec.toList();
this->_dsp->frequencyLut(freqLutQ);
// _unsignedQntzrVec = Calculation::qntzr(_scenParams->hwRegister->freqLut, 0, 24, 0, 0, true);
// QList<quint32> freqLutQ = _unsignedQntzrVec.toList();
// this->_dsp->frequencyLut(freqLutQ);
_unsignedQntzrVec = Calculation::qntzr(_scenParams->hwRegister->freqStepLut, 1, 32, 16, 0, true, true, true);
QList<quint32> freqStepLutQ = _unsignedQntzrVec.toList();
this->_dsp->freqStepLut(freqStepLutQ);
_unsignedQntzrVec = Calculation::qntzr(_scenParams->hwRegister->lpfWeightStepLut, 0, 16, 23, 0, true);
QList<quint32> lpfWeightStepLutQ = _unsignedQntzrVec.toList();
this->_dsp->lpfWeightStepLut(lpfWeightStepLutQ);
_unsignedQntzrVec = Calculation::qntzr(_scenParams->hwRegister->startLpfWeightLut, 0, 17, 16, 0, true);
QList<quint32> 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<quint32> 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

84
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<QList<quint32>> &elementPosition) const
@ -41,6 +55,56 @@ void BeamFormer::rxBeamformerProperties(quint8& rxBeamFormerTypeNumber, RxBeamfo
this->_rxBeamformer->updateArray(true, rxBeamFormerTypeNumber);
}
void BeamFormer::apodizationParameters(QList<ApodizationParameters> &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<QList<quint32>>& 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<quint32> &elements) const
{
this->_elementsActiveEnable->setElementsActiveEnable(elements);
this->_elementsActiveEnable->updateArray();
}
void BeamFormer::afeLut(AfeProperties *afe) const
{
this->_afe->setAfeLut(afe);

91
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<quint8> &lpfScaleCoeff) const
this->_bfScale->update();
}
void Dsp::lpfWeightStepLut(QList<quint32> &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<quint32> &startLpfWeightLut) const
{
this->_startLpfWeightLut->setStartLpfWeightLut(startLpfWeightLut);
this->_startLpfWeightLut->updateArray();
}
void Dsp::stbCoefficient(QList<quint32> &stbLut) const
{
this->_stbLut->setStbLut(stbLut);
@ -67,7 +98,13 @@ void Dsp::frequencyLut(QList<quint32> &fLut) const
this->_freqLut->updateArray();
}
void Dsp::blendWeight(QList<QList<quint32> > &blendWeight) const
void Dsp::startFreqLut(QList<quint32> &startFreq) const
{
this->_startFreqLut->setStartFreqLut(startFreq);
this->_startFreqLut->updateArray();
}
void Dsp::blendWeight(QList<QList<quint32>> &blendWeight) const
{
quint32 baseOffset = this->_blendWeight->getCurrentOffset();
@ -79,7 +116,13 @@ void Dsp::blendWeight(QList<QList<quint32> > &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<quint32> &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<Atgc> atgcLut) const
this->_atgcLut->changeOffset(baseOffset); // return to base offset address
}
void Dsp::lpfLut(QList<QList<quint32>> &lpfLut) const
void Dsp::lpfLut(QList<Lpf> &lpfLut) const
{
quint32 baseOffset = this->_lpfLut->getCurrentOffset();
foreach (QList<quint32> 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<quint32> &endFreq) const
{
this->_endFreqLut->setEndFreqLut(endFreq);
this->_endFreqLut->updateArray();
}
void Dsp::freqPointLut(FreqPoint* freqPoint) const
{
this->_freqPointLut->setFreqPointLut(freqPoint);
this->_freqPointLut->updateArray();
}

Loading…
Cancel
Save