Browse Source

Quantizer convert to quint32 type cast

master v1.3
Arash Aletayeb 4 years ago
parent
commit
69c14debed
  1. 2
      developHw.pro.user
  2. 6
      include/model/hardware/core/TrxBoard.h
  3. 4
      include/model/hardware/core/register/sram/registerDefinition/RxParams.h
  4. 8
      include/model/hardware/core/register/sram/registerDefinition/RxParamsDegree.h
  5. 6
      include/model/hardware/core/register/sram/registerDefinition/RxParamsPos.h
  6. 6
      include/model/hardware/core/register/sram/registerDefinition/TxParamsFocus.h
  7. 2
      include/model/scenarioGenerator/core/general/Calculation.h
  8. 68
      src/model/hardware/core/TrxBoard.cpp
  9. 4
      src/model/scenarioGenerator/core/general/Calculation.cpp

2
developHw.pro.user

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject> <!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 4.10.0, 2021-05-29T14:13:29. --> <!-- Written by QtCreator 4.10.0, 2021-05-29T16:09:18. -->
<qtcreator> <qtcreator>
<data> <data>
<variable>EnvironmentId</variable> <variable>EnvironmentId</variable>

6
include/model/hardware/core/TrxBoard.h

@ -45,8 +45,8 @@ class TrxBoard : public QObject
Q_OBJECT Q_OBJECT
private: private:
QVector<quint8> _swapVec; QVector<quint8> _swapVec;
QVector<qint32> _signedQntzrVec; QVector<quint32> _unsignedQntzrVec;
QList<quint32> _unsignedQntzrList; QList<quint32> _unsignedQntzrList;
QList<quint32>* _mcsList; QList<quint32>* _mcsList;
QList<quint32> _afeModuleOffset; QList<quint32> _afeModuleOffset;
@ -133,7 +133,7 @@ private:
void setFpgaOffset(void); void setFpgaOffset(void);
void setAfeModuleOffset(void); void setAfeModuleOffset(void);
void scenParamsFilling(eScenParams cmd); void scenParamsFilling(eScenParams cmd);
QList<quint32> signedVector2unsignedList(QVector<qint32>& sgnVec); //QList<quint32> signedVector2unsignedList(QVector<qint32>& sgnVec);
signals: signals:
void sendFramePacket(QByteArray newPacket); void sendFramePacket(QByteArray newPacket);

4
include/model/hardware/core/register/sram/registerDefinition/RxParams.h

@ -21,8 +21,8 @@ class RxParams : public Register
{ {
private: private:
SramRx* _rx; SramRx* _rx;
QVector<qint32> rxActiveElementStepQ; QVector<quint32> rxActiveElementStepQ;
QVector<qint32> r0PositionQ; QVector<quint32> r0PositionQ;
void prepareData(quint32 index) override void prepareData(quint32 index) override
{ {

8
include/model/hardware/core/register/sram/registerDefinition/RxParamsDegree.h

@ -21,10 +21,10 @@ class RxParamsDegree : public Register
{ {
private: private:
SramRx* _rx; SramRx* _rx;
QVector<qint32> thetaCosQ; QVector<quint32> thetaCosQ;
QVector<qint32> thetaSinQ; QVector<quint32> thetaSinQ;
QVector<qint32> phiCosQ; QVector<quint32> phiCosQ;
QVector<qint32> phiSinQ; QVector<quint32> phiSinQ;
void prepareData(quint32 index) override void prepareData(quint32 index) override
{ {

6
include/model/hardware/core/register/sram/registerDefinition/RxParamsPos.h

@ -22,9 +22,9 @@ class RxParamsPos : public Register
{ {
private: private:
SramRx* _rx; SramRx* _rx;
QVector<qint32> interceptXPosQ; QVector<quint32> interceptXPosQ;
QVector<qint32> interceptYPosQ; QVector<quint32> interceptYPosQ;
QVector<qint32> interceptZPosQ; QVector<quint32> interceptZPosQ;
void prepareData(quint32 index) override void prepareData(quint32 index) override
{ {

6
include/model/hardware/core/register/sram/registerDefinition/TxParamsFocus.h

@ -20,9 +20,9 @@ class TxParamsFocus : public Register
{ {
private: private:
SramTx* _tx; SramTx* _tx;
QVector<qint32> txFocusXPosQ; QVector<quint32> txFocusXPosQ;
QVector<qint32> txFocusYPosQ; QVector<quint32> txFocusYPosQ;
QVector<qint32> txFocusZPosQ; QVector<quint32> txFocusZPosQ;
void prepareData(quint32 index) override void prepareData(quint32 index) override
{ {

2
include/model/scenarioGenerator/core/general/Calculation.h

@ -45,7 +45,7 @@ public:
float pointDax, float pointDax,
QList<float> shotWeight); QList<float> shotWeight);
static QVector<qint32> qntzr(QVector<float> data, static QVector<quint32> qntzr(QVector<float> data,
quint32 sign, quint32 sign,
quint32 wordlength, quint32 wordlength,
quint32 fractionalLength, quint32 fractionalLength,

68
src/model/hardware/core/TrxBoard.cpp

@ -84,18 +84,18 @@ void TrxBoard::setFpgaOffset()
_fpgaOffset << 0x100000 << 0x200000 << 0x300000; _fpgaOffset << 0x100000 << 0x200000 << 0x300000;
} }
QList<quint32> TrxBoard::signedVector2unsignedList (QVector<qint32>& sgnVec) //QList<quint32> TrxBoard::signedVector2unsignedList (QVector<qint32>& sgnVec)
{ //{
_unsignedQntzrList.clear(); // _unsignedQntzrList.clear();
// std::list<uint> _usgnList (sgnVec.begin(), sgnVec.end()); //// std::list<uint> _usgnList (sgnVec.begin(), sgnVec.end());
// _unsignedQntzrList.fromStdList(_usgnList); //// _unsignedQntzrList.fromStdList(_usgnList);
foreach (auto i, sgnVec) // foreach (auto i, sgnVec)
{ // {
_unsignedQntzrList.push_back(static_cast<quint32>(i)); // _unsignedQntzrList.push_back(static_cast<quint32>(i));
} // }
return _unsignedQntzrList; // return _unsignedQntzrList;
} //}
TrxBoard::TrxBoard() : _offsetSlave0(0), _offsetSlave1(0x400000), _offsetSlave2(0x800000) TrxBoard::TrxBoard() : _offsetSlave0(0), _offsetSlave1(0x400000), _offsetSlave2(0x800000)
{ {
@ -293,8 +293,8 @@ void TrxBoard::setScenario (ScenGenHardwareOutput* scenParams)
QList<quint32> y; QList<quint32> y;
QList<quint32> z; QList<quint32> z;
_signedQntzrVec.clear(); //_signedQntzrVec.clear();
_signedQntzrVec = Calculation::qntzr(scenParams->hwRegister->elementPosition->xPosition, _unsignedQntzrVec = Calculation::qntzr(scenParams->hwRegister->elementPosition->xPosition,
1, 1,
18, 18,
0, 0,
@ -302,11 +302,10 @@ void TrxBoard::setScenario (ScenGenHardwareOutput* scenParams)
true, true,
true, true,
true); true);
//QList<quint32> xPosQ = _unsignedQntzrVec.toList(); QList<quint32> xPosQ = _unsignedQntzrVec.toList();
QList<quint32> xPosQ = signedVector2unsignedList(_signedQntzrVec); //QList<quint32> xPosQ = signedVector2unsignedList(_signedQntzrVec);
_signedQntzrVec.clear(); _unsignedQntzrVec = Calculation::qntzr(scenParams->hwRegister->elementPosition->yPosition,
_signedQntzrVec = Calculation::qntzr(scenParams->hwRegister->elementPosition->yPosition,
1, 1,
18, 18,
0, 0,
@ -314,10 +313,9 @@ void TrxBoard::setScenario (ScenGenHardwareOutput* scenParams)
true, true,
true, true,
true); true);
QList<quint32> yPosQ = signedVector2unsignedList(_signedQntzrVec); QList<quint32> yPosQ = _unsignedQntzrVec.toList();
_signedQntzrVec.clear(); _unsignedQntzrVec = Calculation::qntzr(scenParams->hwRegister->elementPosition->zPosition,
_signedQntzrVec = Calculation::qntzr(scenParams->hwRegister->elementPosition->zPosition,
0, 0,
17, 17,
0, 0,
@ -325,7 +323,7 @@ void TrxBoard::setScenario (ScenGenHardwareOutput* scenParams)
true, true,
true, true,
true); true);
QList<quint32> zPosQ = signedVector2unsignedList(_signedQntzrVec); QList<quint32> zPosQ = _unsignedQntzrVec.toList();
for(quint8 i = 0; i < 3; i++) for(quint8 i = 0; i < 3; i++)
{ {
@ -397,24 +395,22 @@ void TrxBoard::setScenario (ScenGenHardwareOutput* scenParams)
this->_dsp->receiverConfigurationLut(scenParams->hwRegister->receiverConfigTypeNumber, this->_dsp->receiverConfigurationLut(scenParams->hwRegister->receiverConfigTypeNumber,
scenParams->hwRegister->configLut); scenParams->hwRegister->configLut);
_signedQntzrVec.clear(); _unsignedQntzrVec = Calculation::qntzr(scenParams->hwRegister->freqLut, 0, 24, 0, 0, true);
_signedQntzrVec = Calculation::qntzr(scenParams->hwRegister->freqLut, 0, 24, 0, 0, true); QList<quint32> freqLutQ = _unsignedQntzrVec.toList();
QList<quint32> freqLutQ = signedVector2unsignedList(_signedQntzrVec);
this->_dsp->frequencyLut(freqLutQ); this->_dsp->frequencyLut(freqLutQ);
_signedQntzrVec.clear(); _unsignedQntzrVec = Calculation::qntzr(scenParams->hwRegister->dtgcLut, 0, 12, 8, 0, true, false);
_signedQntzrVec = Calculation::qntzr(scenParams->hwRegister->dtgcLut, 0, 12, 8, 0, true, false); QList<quint32> dtgcLutQ = _unsignedQntzrVec.toList();
QList<quint32> dtgcLutQ = signedVector2unsignedList(_signedQntzrVec);
this->_dsp->dtgcLut(dtgcLutQ); this->_dsp->dtgcLut(dtgcLutQ);
QList<quint32> temp; QList<quint32> temp;
QList<QList<quint32> > blendWeightQ; QList<QList<quint32> > blendWeightQ;
_signedQntzrVec.clear(); //_signedQntzrVec.clear();
foreach(auto vec, scenParams->hwRegister->blendWeight) foreach(auto vec, scenParams->hwRegister->blendWeight)
{ {
temp.clear(); temp.clear();
_signedQntzrVec = Calculation::qntzr(vec, 0, 9, 8, 0, true, false, true); _unsignedQntzrVec = Calculation::qntzr(vec, 0, 9, 8, 0, true, false, true);
temp = signedVector2unsignedList(_signedQntzrVec); temp = _unsignedQntzrVec.toList();
blendWeightQ.push_back(temp); blendWeightQ.push_back(temp);
} }
this->_dsp->blendWeight(blendWeightQ); this->_dsp->blendWeight(blendWeightQ);
@ -458,9 +454,8 @@ void TrxBoard::setScenario (ScenGenHardwareOutput* scenParams)
void TrxBoard::setLineFilterCoefficient(QVector<float>& lineFilterLut) void TrxBoard::setLineFilterCoefficient(QVector<float>& lineFilterLut)
{ {
_signedQntzrVec.clear(); _unsignedQntzrVec = Calculation::qntzr(lineFilterLut, 0, 9, 8, 0, true, false);
_signedQntzrVec = Calculation::qntzr(lineFilterLut, 0, 9, 8, 0, true, false); QList<quint32> lineFilterLutQ = _unsignedQntzrVec.toList();
QList<quint32> lineFilterLutQ = signedVector2unsignedList(_signedQntzrVec);
this->_dsp->lineFilterCoefficient(lineFilterLutQ); this->_dsp->lineFilterCoefficient(lineFilterLutQ);
} }
@ -497,9 +492,8 @@ void TrxBoard::setMetaData(const QByteArray metaData) const
void TrxBoard::setDtgcLut(QVector<float>& dtgcLut) void TrxBoard::setDtgcLut(QVector<float>& dtgcLut)
{ {
_signedQntzrVec.clear(); _unsignedQntzrVec = Calculation::qntzr(dtgcLut, 0, 12, 8, 0, true, false);
_signedQntzrVec = Calculation::qntzr(dtgcLut, 0, 12, 8, 0, true, false); QList<quint32> dtgcLutQ = _unsignedQntzrVec.toList();
QList<quint32> dtgcLutQ = signedVector2unsignedList(_signedQntzrVec);
this->_dsp->dtgcLut(dtgcLutQ); this->_dsp->dtgcLut(dtgcLutQ);
} }

4
src/model/scenarioGenerator/core/general/Calculation.cpp

@ -273,7 +273,7 @@ QVector<QVector<float> > Calculation::blendCoeff(ScenGenUserParameters_t input,
* @return * @return
*/ */
/*************************************************************************************************/ /*************************************************************************************************/
QVector<qint32> Calculation::qntzr(QVector<float> data, QVector<quint32> Calculation::qntzr(QVector<float> data,
quint32 sign, quint32 sign,
quint32 wordLength, quint32 wordLength,
quint32 fractionalLength, quint32 fractionalLength,
@ -315,7 +315,7 @@ QVector<qint32> Calculation::qntzr(QVector<float> data,
} }
} }
QVector<qint32> output; QVector<quint32> output;
if(integerOutput) if(integerOutput)
{ {
for(auto i = 0; i < data.length(); i++) for(auto i = 0; i < data.length(); i++)

Loading…
Cancel
Save