@ -134,12 +134,35 @@ void TrxBoard::afeAdcsSync() const
}
}
void TrxBoard : : waitForCaptureDone ( Debug * _dbg ) const
{
// Timeout to receive adc capture done.
this - > _bCtrlMngt - > timerShot ( 1000 ) ;
while ( ! ( _dbg - > getCapDone ( ) ) )
{
if ( this - > _bCtrlMngt - > checkTimeout ( ) )
throw SonoException ( " Failure to receive adc capture done. " ) ;
}
this - > _bCtrlMngt - > timerStop ( ) ;
}
void TrxBoard : : adcCaptureStop ( Debug * _dbg ) const
{
_dbg - > adcCaptureCmd ( captureStop ) ;
}
void TrxBoard : : adcCaptureStart ( Debug * _dbg ) const
{
_dbg - > adcCaptureCmd ( captureStart ) ;
}
void TrxBoard : : adcLogTransferRoutine ( Debug * _dbg , quint8 chNumPerFpga )
{
bool adcSamplerReady ( false ) ;
bool adcSamplerError ( false ) ;
// Adc logger start according to selected afe channel
// Adc logger start according to selected afe channel.
_dbg - > adcLoggerTransferCmd ( loggerStop ) ;
_dbg - > adcLoggerChannelNum ( chNumPerFpga ) ;
_dbg - > adcLoggerTransferCmd ( loggerStart ) ;
@ -262,7 +285,10 @@ TrxBoard::TrxBoard() : _offsetSlave0(0), _offsetSlave1(0x400000), _offsetSlave2(
_adc = new AdcVoltages ;
_pg = new VoltagesPg ;
scenParams = new ScenGenHardwareParam ;
_tachoRpm = new FanRpm ;
_coreVolt = new criticalComponentVoltages ;
_coreTemp = new criticalComponentTemperature ;
_scenParams = new ScenGenHardwareParam ;
_allow = false ;
_run = false ;
@ -312,7 +338,10 @@ TrxBoard::~TrxBoard()
delete _adc ;
delete _pg ;
delete scenParams ;
delete _tachoRpm ;
delete _coreVolt ;
delete _coreTemp ;
delete _scenParams ;
}
TrxBoard : : ScenHwRegister : : ~ ScenHwRegister ( )
@ -411,12 +440,8 @@ void TrxBoard::setProbeDependParams(ScenPrbDepHardwareParam& prbDepParams)
this - > _dsp - > lpfScaleCoefficient ( prbDepParams . prbDepParams . lpfScaleCoeff ) ;
/////////////////////////// AFE setting ///////////////////////////
this - > _afeSlave0 - > setAfeParams ( prbDepParams . afeCfg ) ;
this - > _afeSlave1 - > setAfeParams ( prbDepParams . afeCfg ) ;
this - > _afeSlave2 - > setAfeParams ( prbDepParams . afeCfg ) ;
this - > _afeSlave0 - > setAfeGblPwr ( afePwrdnEnable ) ;
this - > _afeSlave1 - > setAfeGblPwr ( afePwrdnEnable ) ;
this - > _afeSlave2 - > setAfeGblPwr ( afePwrdnEnable ) ;
setAfeConfig ( prbDepParams . afeCfg ) ;
setAfePwr ( afePwrdnEnable ) ;
}
void TrxBoard : : setScenario ( ScenGenHardwareOutput_t & scenGenHw )
@ -428,178 +453,178 @@ void TrxBoard::setScenario(ScenGenHardwareOutput_t& scenGenHw)
emulatorStop ( ) ;
sramClear ( first4M ) ;
scenParams - > focusTypeNumber = scenGenHw . focusTypeNumber ;
if ( scenParams - > focusTypeNumber > FOCUS_TYPE_NUMBER_MAX )
_ scenParams - > focusTypeNumber = scenGenHw . focusTypeNumber ;
if ( _ scenParams- > focusTypeNumber > FOCUS_TYPE_NUMBER_MAX )
{
throw SonoException ( " Focus type number is out of range " ) ;
}
scenParams - > totalTxShotNumber = scenGenHw . totalTxShotNumber ;
if ( scenParams - > totalTxShotNumber > TOTAL_TX_SHOT_NUMBER_MAX )
_ scenParams - > totalTxShotNumber = scenGenHw . totalTxShotNumber ;
if ( _ scenParams- > totalTxShotNumber > TOTAL_TX_SHOT_NUMBER_MAX )
{
throw SonoException ( " Total tx shot number is out of range " ) ;
}
scenParams - > rxBeamFormerNumber = scenGenHw . rxBeamFormerNumber . toVector ( ) ;
if ( scenParams - > rxBeamFormerNumber . size ( ) > RX_BEAMFORMER_NUMBER_MAX )
_ scenParams- > rxBeamFormerNumber = scenGenHw . rxBeamFormerNumber . toVector ( ) ;
if ( _ scenParams- > rxBeamFormerNumber . size ( ) > RX_BEAMFORMER_NUMBER_MAX )
{
throw SonoException ( " Rx beam former number is out of range " ) ;
}
scenParams - > scenarioStartIndex = scenGenHw . hwRegister . scenarioStartIndex ;
scenParams - > scenarioEndIndex = scenGenHw . hwRegister . scenarioEndIndex ;
_ scenParams- > scenarioStartIndex = scenGenHw . hwRegister . scenarioStartIndex ;
_ scenParams- > scenarioEndIndex = scenGenHw . hwRegister . scenarioEndIndex ;
if ( scenParams - > scenarioEndIndex > SCENARIO_INDEX_MAX )
if ( _ scenParams- > scenarioEndIndex > SCENARIO_INDEX_MAX )
{
throw SonoException ( " Scenario end index is out of range " ) ;
}
if ( scenParams - > scenarioEndIndex < scenParams - > scenarioStartIndex )
if ( _ scenParams- > scenarioEndIndex < _ scenParams- > 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 ( _ scenParams- > scenarioEndIndex ! = ( _ scenParams- > totalTxShotNumber - 1 ) )
{
throw SonoException (
" The scenario end index must be equal to the total tx shot number minus one " ) ;
}
scenParams - > hwRegister - > blendWeight = scenGenHw . hwRegister . blendWeight ;
if ( scenParams - > hwRegister - > blendWeight . size ( ) ! = BLENDWEIGHT_LUT_MAX )
_ scenParams- > hwRegister - > blendWeight = scenGenHw . hwRegister . blendWeight ;
if ( _ scenParams- > hwRegister - > blendWeight . size ( ) ! = BLENDWEIGHT_LUT_MAX )
{
throw SonoException ( " Blend weight lut is out of range " ) ;
}
scenParams - > hwRegister - > elementPosition - > xPosition = scenGenHw . hwRegister . elementXPosition ;
if ( scenParams - > hwRegister - > elementPosition - > xPosition . size ( ) ! = ELEMENT_POSITION_LUT_MAX )
_ scenParams- > hwRegister - > elementPosition - > xPosition = scenGenHw . hwRegister . elementXPosition ;
if ( _ scenParams- > hwRegister - > elementPosition - > xPosition . size ( ) ! = ELEMENT_POSITION_LUT_MAX )
{
throw SonoException ( " Element position x is out of range " ) ;
}
scenParams - > hwRegister - > elementPosition - > yPosition = scenGenHw . hwRegister . elementYPosition ;
if ( scenParams - > hwRegister - > elementPosition - > yPosition . size ( ) ! = ELEMENT_POSITION_LUT_MAX )
_ scenParams- > hwRegister - > elementPosition - > yPosition = scenGenHw . hwRegister . elementYPosition ;
if ( _ scenParams- > hwRegister - > elementPosition - > yPosition . size ( ) ! = ELEMENT_POSITION_LUT_MAX )
{
throw SonoException ( " Element position y is out of range " ) ;
}
scenParams - > hwRegister - > elementPosition - > zPosition = scenGenHw . hwRegister . elementZPosition ;
if ( scenParams - > hwRegister - > elementPosition - > zPosition . size ( ) ! = ELEMENT_POSITION_LUT_MAX )
_ scenParams- > hwRegister - > elementPosition - > zPosition = scenGenHw . hwRegister . elementZPosition ;
if ( _ scenParams- > hwRegister - > elementPosition - > zPosition . size ( ) ! = ELEMENT_POSITION_LUT_MAX )
{
throw SonoException ( " Element position z is out of range " ) ;
}
scenParams - > hwRegister - > freqLut = scenGenHw . hwRegister . freqLut ;
if ( scenParams - > hwRegister - > freqLut . size ( ) ! = FREQUENCY_LUT_MAX )
_ scenParams- > hwRegister - > freqLut = scenGenHw . hwRegister . freqLut ;
if ( _ scenParams- > hwRegister - > freqLut . size ( ) ! = FREQUENCY_LUT_MAX )
{
throw SonoException ( " Frequency lut is out of range " ) ;
}
scenParams - > hwRegister - > dtgcLut = scenGenHw . hwRegister . dtgcLut ;
if ( scenParams - > hwRegister - > dtgcLut . size ( ) ! = DTGC_LUT_MAX )
_ scenParams - > hwRegister - > dtgcLut = scenGenHw . hwRegister . dtgcLut ;
if ( _ scenParams- > hwRegister - > dtgcLut . size ( ) ! = DTGC_LUT_MAX )
{
throw SonoException ( " Dtgc lut is out of range " ) ;
}
scenParams - > hwRegister - > pulseTypeNumber = scenGenHw . hwRegister . pulseTypeNumber ;
if ( scenParams - > hwRegister - > pulseTypeNumber > PULSE_LUT_MAX )
_ scenParams - > hwRegister - > pulseTypeNumber = scenGenHw . hwRegister . pulseTypeNumber ;
if ( _ scenParams- > hwRegister - > pulseTypeNumber > PULSE_LUT_MAX )
{
throw SonoException ( " Pulse type number is out of range " ) ;
}
scenParams - > hwRegister - > rxBeamFormerTypeNumber = scenGenHw . hwRegister . rxBeamFormerTypeNumber ;
if ( scenParams - > hwRegister - > rxBeamFormerTypeNumber > RXBEAMFORMER_LUT_MAX )
_ scenParams- > hwRegister - > rxBeamFormerTypeNumber = scenGenHw . hwRegister . rxBeamFormerTypeNumber ;
if ( _ scenParams- > hwRegister - > rxBeamFormerTypeNumber > RXBEAMFORMER_LUT_MAX )
{
throw SonoException ( " Rx beam former type number is out of range " ) ;
}
scenParams - > hwRegister - > receiverConfigTypeNumber =
_ scenParams- > hwRegister - > receiverConfigTypeNumber =
scenGenHw . hwRegister . receiverConfigTypeNumber ;
if ( scenParams - > hwRegister - > receiverConfigTypeNumber > RRECEIVER_CONFIGURATION_LUT_MAX )
if ( _ scenParams- > hwRegister - > receiverConfigTypeNumber > RRECEIVER_CONFIGURATION_LUT_MAX )
{
throw SonoException ( " Receiver config type number is out of range " ) ;
}
scenParams - > hwRegister - > pulse - > clear ( ) ;
_ scenParams- > hwRegister - > pulse - > clear ( ) ;
foreach ( auto i , scenGenHw . hwRegister . pulseProps )
{
scenParams - > hwRegister - > pulse - > halfPeriod . append ( i . halfPeriod ) ;
scenParams - > hwRegister - > pulse - > startPhase . append ( i . startPhase ) ;
scenParams - > hwRegister - > pulse - > halfCycleNo . append ( i . halfCycleNo ) ;
scenParams - > hwRegister - > pulse - > pulseVoltSel . append ( i . pulseVoltSel ) ;
scenParams - > hwRegister - > pulse - > dampingPulseWidth . append ( i . dampingPulseWidth ) ;
_ scenParams- > hwRegister - > pulse - > halfPeriod . append ( i . halfPeriod ) ;
_ scenParams- > hwRegister - > pulse - > startPhase . append ( i . startPhase ) ;
_ scenParams- > hwRegister - > pulse - > halfCycleNo . append ( i . halfCycleNo ) ;
_ scenParams- > hwRegister - > pulse - > pulseVoltSel . append ( i . pulseVoltSel ) ;
_ scenParams- > hwRegister - > pulse - > dampingPulseWidth . append ( i . dampingPulseWidth ) ;
}
scenParams - > hwRegister - > rxBeamformer - > clear ( ) ;
_ scenParams- > hwRegister - > rxBeamformer - > clear ( ) ;
foreach ( auto j , scenGenHw . hwRegister . rxBeamFormerProps )
{
scenParams - > hwRegister - > rxBeamformer - > lag . append ( j . lag ) ;
scenParams - > hwRegister - > rxBeamformer - > mla . append ( j . mla ) ;
scenParams - > hwRegister - > rxBeamformer - > apodization . append ( j . apodizationSel ) ;
_ scenParams- > hwRegister - > rxBeamformer - > lag . append ( j . lag ) ;
_ scenParams- > hwRegister - > rxBeamformer - > mla . append ( j . mla ) ;
_ scenParams- > hwRegister - > rxBeamformer - > apodization . append ( j . apodizationSel ) ;
}
scenParams - > hwRegister - > configLut - > clear ( ) ;
_ scenParams- > hwRegister - > configLut - > clear ( ) ;
foreach ( auto k , scenGenHw . hwRegister . receiverConfigProps )
{
scenParams - > hwRegister - > configLut - > mla . append ( k . mla ) ;
scenParams - > hwRegister - > configLut - > stb . append ( k . stb ) ;
scenParams - > hwRegister - > configLut - > absEn . append ( k . absEn ) ;
scenParams - > hwRegister - > configLut - > ddcEn . append ( k . ddcn ) ;
scenParams - > hwRegister - > configLut - > dpeEn . append ( k . dpeEn ) ;
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 - > ncoFreqSel . append ( k . ncoFreqSel ) ;
scenParams - > hwRegister - > configLut - > dcCancelerEn . append ( k . dcCancelEn ) ;
scenParams - > hwRegister - > configLut - > lineFilterEn . append ( k . lineFilterEn ) ;
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 - > indexParams - > firstLineInFrame = scenGenHw . indexParams . firstLineInFrame ;
scenParams - > indexParams - > shotPropertiesIndex = scenGenHw . indexParams . shotPropertiesIndex ;
scenParams - > indexParams - > pulsePropertiesIndex = scenGenHw . indexParams . pulsePropertiesIndex ;
scenParams - > indexParams - > receiverConfigurationIndex =
_ scenParams- > hwRegister - > configLut - > mla . append ( k . mla ) ;
_ scenParams- > hwRegister - > configLut - > stb . append ( k . stb ) ;
_ scenParams- > hwRegister - > configLut - > absEn . append ( k . absEn ) ;
_ scenParams- > hwRegister - > configLut - > ddcEn . append ( k . ddcn ) ;
_ scenParams- > hwRegister - > configLut - > dpeEn . append ( k . dpeEn ) ;
_ 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 - > ncoFreqSel . append ( k . ncoFreqSel ) ;
_ scenParams- > hwRegister - > configLut - > dcCancelerEn . append ( k . dcCancelEn ) ;
_ scenParams- > hwRegister - > configLut - > lineFilterEn . append ( k . lineFilterEn ) ;
_ 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 - > indexParams - > firstLineInFrame = scenGenHw . indexParams . firstLineInFrame ;
_ scenParams - > indexParams - > shotPropertiesIndex = scenGenHw . indexParams . shotPropertiesIndex ;
_ scenParams - > indexParams - > pulsePropertiesIndex = scenGenHw . indexParams . pulsePropertiesIndex ;
_ scenParams - > indexParams - > receiverConfigurationIndex =
scenGenHw . indexParams . receiverConfigurationIndex ;
scenParams - > txParams - > maxDelayQ = scenGenHw . txParams . maxDelayQ ;
scenParams - > txParams - > txFocusXPos = scenGenHw . txParams . txFocusXPos ;
scenParams - > txParams - > txFocusYPos = scenGenHw . txParams . txFocusYPos ;
scenParams - > txParams - > txFocusZPos = scenGenHw . txParams . txFocusZPos ;
scenParams - > txParams - > pulseInterval = scenGenHw . pulseInterval ;
scenParams - > txParams - > txActiveElementNumber = scenGenHw . txParams . txActiveElementNumber ;
scenParams - > txParams - > txStartActiveElementNumber =
_ scenParams - > txParams - > maxDelayQ = scenGenHw . txParams . maxDelayQ ;
_ scenParams - > txParams - > txFocusXPos = scenGenHw . txParams . txFocusXPos ;
_ scenParams - > txParams - > txFocusYPos = scenGenHw . txParams . txFocusYPos ;
_ scenParams - > txParams - > txFocusZPos = scenGenHw . txParams . txFocusZPos ;
_ scenParams - > txParams - > pulseInterval = scenGenHw . pulseInterval ;
_ scenParams - > txParams - > txActiveElementNumber = scenGenHw . txParams . txActiveElementNumber ;
_ scenParams - > txParams - > txStartActiveElementNumber =
scenGenHw . txParams . txStartActiveElementNumber ;
scenParams - > rxParams - > phiCos = scenGenHw . rxParams . phiCos ;
scenParams - > rxParams - > phiSin = scenGenHw . rxParams . phiSin ;
scenParams - > rxParams - > thetaCos = scenGenHw . rxParams . thetaCos ;
scenParams - > rxParams - > thetaSin = scenGenHw . rxParams . thetaSin ;
scenParams - > rxParams - > r0Position = scenGenHw . rxParams . r0Position ;
scenParams - > rxParams - > interceptXPos = scenGenHw . rxParams . interceptXPos ;
scenParams - > rxParams - > interceptYPos = scenGenHw . rxParams . interceptYPos ;
scenParams - > rxParams - > interceptZPos = scenGenHw . rxParams . interceptZPos ;
scenParams - > rxParams - > rxR0MaxDelayQ = scenGenHw . rxParams . rxR0MaxDelayQ ;
scenParams - > rxParams - > rxR0MinDelayQ = scenGenHw . rxParams . rxR0MinDelayQ ;
scenParams - > rxParams - > txR0MinDelayQ = scenGenHw . rxParams . txR0MinDelayQ ;
scenParams - > rxParams - > rxFocusPointNumber = scenGenHw . rxParams . rxFocusPointNumber ;
scenParams - > rxParams - > rxActiveElementStep = scenGenHw . rxParams . rxActiveElementStep ;
scenParams - > rxParams - > rxR0ActiveElementNumber = scenGenHw . rxParams . rxR0ActiveElementNumber ;
scenParams - > rxParams - > interceptPointFiringTime = scenGenHw . rxParams . interceptPointFiringTime ;
scenParams - > rxParams - > rxR0CenterActiveElementNumber =
_ scenParams - > rxParams - > phiCos = scenGenHw . rxParams . phiCos ;
_ scenParams - > rxParams - > phiSin = scenGenHw . rxParams . phiSin ;
_ scenParams - > rxParams - > thetaCos = scenGenHw . rxParams . thetaCos ;
_ scenParams - > rxParams - > thetaSin = scenGenHw . rxParams . thetaSin ;
_ scenParams - > rxParams - > r0Position = scenGenHw . rxParams . r0Position ;
_ scenParams - > rxParams - > interceptXPos = scenGenHw . rxParams . interceptXPos ;
_ scenParams - > rxParams - > interceptYPos = scenGenHw . rxParams . interceptYPos ;
_ scenParams - > rxParams - > interceptZPos = scenGenHw . rxParams . interceptZPos ;
_ scenParams - > rxParams - > rxR0MaxDelayQ = scenGenHw . rxParams . rxR0MaxDelayQ ;
_ scenParams - > rxParams - > rxR0MinDelayQ = scenGenHw . rxParams . rxR0MinDelayQ ;
_ scenParams - > rxParams - > txR0MinDelayQ = scenGenHw . rxParams . txR0MinDelayQ ;
_ scenParams - > rxParams - > rxFocusPointNumber = scenGenHw . rxParams . rxFocusPointNumber ;
_ scenParams - > rxParams - > rxActiveElementStep = scenGenHw . rxParams . rxActiveElementStep ;
_ scenParams - > rxParams - > rxR0ActiveElementNumber = scenGenHw . rxParams . rxR0ActiveElementNumber ;
_ scenParams - > rxParams - > interceptPointFiringTime = scenGenHw . rxParams . interceptPointFiringTime ;
_ scenParams - > rxParams - > rxR0CenterActiveElementNumber =
scenGenHw . rxParams . rxR0CenterActiveElementNumber ;
this - > setScenario ( scenParams ) ;
this - > setScenario ( _ scenParams) ;
}
void TrxBoard : : setScenario ( ScenGenHardwareParam * scenParams )
void TrxBoard : : setScenario ( ScenGenHardwareParam * _ scenParams)
{
///////////////////////////////// BeamFormer setting ///////////////////////////////
QList < QList < quint32 > > elementPosition ;
@ -608,7 +633,7 @@ void TrxBoard::setScenario (ScenGenHardwareParam* scenParams)
QList < quint32 > z ;
//_signedQntzrVec.clear();
_unsignedQntzrVec = Calculation : : qntzr ( scenParams - > hwRegister - > elementPosition - > xPosition ,
_unsignedQntzrVec = Calculation : : qntzr ( _ scenParams- > hwRegister - > elementPosition - > xPosition ,
1 ,
18 ,
0 ,
@ -619,7 +644,7 @@ void TrxBoard::setScenario (ScenGenHardwareParam* scenParams)
QList < quint32 > xPosQ = _unsignedQntzrVec . toList ( ) ;
//QList<quint32> xPosQ = signedVector2unsignedList(_signedQntzrVec);
_unsignedQntzrVec = Calculation : : qntzr ( scenParams - > hwRegister - > elementPosition - > yPosition ,
_unsignedQntzrVec = Calculation : : qntzr ( _ scenParams- > hwRegister - > elementPosition - > yPosition ,
1 ,
18 ,
0 ,
@ -629,7 +654,7 @@ void TrxBoard::setScenario (ScenGenHardwareParam* scenParams)
true ) ;
QList < quint32 > yPosQ = _unsignedQntzrVec . toList ( ) ;
_unsignedQntzrVec = Calculation : : qntzr ( scenParams - > hwRegister - > elementPosition - > zPosition ,
_unsignedQntzrVec = Calculation : : qntzr ( _ scenParams- > hwRegister - > elementPosition - > zPosition ,
0 ,
17 ,
0 ,
@ -674,44 +699,44 @@ void TrxBoard::setScenario (ScenGenHardwareParam* scenParams)
}
scenParamsFilling ( set ) ;
this - > _beamFormerSlave0 - > rxBeamformerProperties ( scenParams - > hwRegister - > rxBeamFormerTypeNumber ,
scenParams - > hwRegister - > rxBeamformer ) ;
this - > _beamFormerSlave1 - > rxBeamformerProperties ( scenParams - > hwRegister - > rxBeamFormerTypeNumber ,
scenParams - > hwRegister - > rxBeamformer ) ;
this - > _beamFormerSlave2 - > rxBeamformerProperties ( scenParams - > hwRegister - > rxBeamFormerTypeNumber ,
scenParams - > hwRegister - > rxBeamformer ) ;
this - > _beamFormerSlave0 - > rxBeamformerProperties ( _ scenParams- > hwRegister - > rxBeamFormerTypeNumber ,
_ scenParams- > hwRegister - > rxBeamformer ) ;
this - > _beamFormerSlave1 - > rxBeamformerProperties ( _ scenParams- > hwRegister - > rxBeamFormerTypeNumber ,
_ scenParams- > hwRegister - > rxBeamformer ) ;
this - > _beamFormerSlave2 - > rxBeamformerProperties ( _ scenParams- > hwRegister - > rxBeamFormerTypeNumber ,
_ scenParams- > hwRegister - > rxBeamformer ) ;
scenParamsFilling ( set ) ;
this - > _beamFormerSlave0 - > pulseProperties ( scenParams - > hwRegister - > pulseTypeNumber ,
scenParams - > hwRegister - > pulse ) ;
this - > _beamFormerSlave1 - > pulseProperties ( scenParams - > hwRegister - > pulseTypeNumber ,
scenParams - > hwRegister - > pulse ) ;
this - > _beamFormerSlave2 - > pulseProperties ( scenParams - > hwRegister - > pulseTypeNumber ,
scenParams - > hwRegister - > pulse ) ;
this - > _beamFormerSlave0 - > pulseProperties ( _ scenParams- > hwRegister - > pulseTypeNumber ,
_ scenParams- > hwRegister - > pulse ) ;
this - > _beamFormerSlave1 - > pulseProperties ( _ scenParams- > hwRegister - > pulseTypeNumber ,
_ scenParams- > hwRegister - > pulse ) ;
this - > _beamFormerSlave2 - > pulseProperties ( _ scenParams- > hwRegister - > pulseTypeNumber ,
_ scenParams- > hwRegister - > pulse ) ;
scenParamsFilling ( set ) ;
////this->_beamFormerSlave0->afeLut(scenParams->hwRegister->afe);
////this->_beamFormerSlave1->afeLut(scenParams->hwRegister->afe);
////this->_beamFormerSlave2->afeLut(scenParams->hwRegister->afe);
////this->_beamFormerSlave0->afeLut(_ scenParams->hwRegister->afe);
////this->_beamFormerSlave1->afeLut(_ scenParams->hwRegister->afe);
////this->_beamFormerSlave2->afeLut(_ scenParams->hwRegister->afe);
////scenParamsFilling(set);
///////////////////////////////// DSP setting ///////////////////////////////
this - > _dsp - > receiverConfigurationLut ( scenParams - > hwRegister - > receiverConfigTypeNumber ,
scenParams - > hwRegister - > configLut ) ;
this - > _dsp - > receiverConfigurationLut ( _ scenParams- > hwRegister - > receiverConfigTypeNumber ,
_ scenParams- > hwRegister - > configLut ) ;
_unsignedQntzrVec = Calculation : : qntzr ( scenParams - > hwRegister - > freqLut , 0 , 24 , 0 , 0 , true ) ;
_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 - > dtgcLut , 0 , 12 , 8 , 0 , true , false ) ;
Calculation : : qntzr ( _ scenParams- > hwRegister - > dtgcLut , 0 , 12 , 8 , 0 , true , false ) ;
QList < quint32 > dtgcLutQ = _unsignedQntzrVec . toList ( ) ;
this - > _dsp - > dtgcLut ( dtgcLutQ ) ;
QList < quint32 > temp ;
QList < QList < quint32 > > blendWeightQ ;
//_signedQntzrVec.clear();
foreach ( auto vec , scenParams - > hwRegister - > blendWeight )
foreach ( auto vec , _ scenParams- > hwRegister - > blendWeight )
{
temp . clear ( ) ;
_unsignedQntzrVec = Calculation : : qntzr ( vec , 0 , 9 , 8 , 0 , true , false , true ) ;
@ -721,19 +746,19 @@ void TrxBoard::setScenario (ScenGenHardwareParam* scenParams)
this - > _dsp - > blendWeight ( blendWeightQ ) ;
///////////////////////////////// Sram setting ///////////////////////////////
this - > _sram - > setSramIndex ( scenParams - > totalTxShotNumber , scenParams - > indexParams ) ;
this - > _sram - > setSramIndex ( _ scenParams- > totalTxShotNumber , _ scenParams- > indexParams ) ;
this - > _sram - > setSramTx ( scenParams - > focusTypeNumber , scenParams - > txParams ) ;
this - > _sram - > setSramTx ( _ scenParams- > focusTypeNumber , _ scenParams- > txParams ) ;
this - > _sram - > setSramRx ( scenParams - > rxBeamFormerNumber ,
scenParams - > focusTypeNumber ,
scenParams - > rxParams ) ;
this - > _sram - > setSramRx ( _ scenParams- > rxBeamFormerNumber ,
_ scenParams- > focusTypeNumber ,
_ scenParams- > rxParams ) ;
scenParamsFilling ( set ) ;
////////////////////////////// Scen Index setting ////////////////////////////
this - > _scenPlayer - > setStartIndex ( scenParams - > scenarioStartIndex ) ;
this - > _scenPlayer - > setEndIndex ( scenParams - > scenarioEndIndex ) ;
this - > _scenPlayer - > setStartIndex ( _ scenParams- > scenarioStartIndex ) ;
this - > _scenPlayer - > setEndIndex ( _ scenParams- > scenarioEndIndex ) ;
}
void TrxBoard : : setLineFilterCoefficient ( QVector < float > & lineFilterLut )
@ -795,43 +820,32 @@ void TrxBoard::setFramesMetaData(const QByteArray& metaData) const
void TrxBoard : : setBiteDacData ( const QByteArray & iData , const QByteArray & qData ) const
{
this - > _builtInTest - > biteDacEnable ( BITE_INTERVAL , false ) ;
this - > _builtInTest - > biteDacMemoryWrite ( iData , qData ) ;
}
void TrxBoard : : biteScenPlayerStart ( )
{
DebugMode debug ;
DebugMode debugRb ;
debug . rxBfDbgModeEn = false ;
debug . rxBfSimDataGenModeEn = false ;
debug . txBfTestModeEn = true ;
debug . txBfTestModeCfg = pulserTr ;
setDebuggerMode ( pulserTr , true ) ;
this - > debuggerMode ( _debugSlave0 , debug , debugRb , " slave0 " ) ;
this - > debuggerMode ( _debugSlave1 , debug , debugRb , " slave1 " ) ;
this - > debuggerMode ( _debugSlave2 , debug , debugRb , " slave2 " ) ;
setAdgCfg ( adgIQ ) ;
setTxDacEnable ( BITE_INTERVAL , true ) ;
this - > _builtInTest - > biteAdgCfg ( adgIQ ) ;
this - > _builtInTest - > biteDacEnable ( BITE_INTERVAL , true ) ;
this - > scenPlayerStart ( true ) ;
}
void TrxBoard : : biteScenPlayerStop ( )
{
DebugMode debug ;
DebugMode debugRb ;
debug . rxBfDbgModeEn = false ;
debug . rxBfSimDataGenModeEn = false ;
debug . txBfTestModeEn = false ;
debug . txBfTestModeCfg = pulserHz ;
this - > scenPlayerStop ( true ) ;
this - > _builtInTest - > biteDacEnable ( BITE_INTERVAL , false ) ;
this - > _builtInTest - > biteAdgCfg ( adgGnd ) ;
this - > debuggerMode ( _debugSlave0 , debug , debugRb , " slave0 " ) ;
this - > debuggerMode ( _debugSlave1 , debug , debugRb , " slave1 " ) ;
this - > debuggerMode ( _debugSlave2 , debug , debugRb , " slave2 " ) ;
setTxDacEnable ( BITE_INTERVAL , false ) ;
setAdgCfg ( adgGnd ) ;
setDebuggerMode ( pulserHz , true ) ;
setDebuggerMode ( pulserHz , false ) ;
}
void TrxBoard : : setScenarioCompare ( const QString scenPath )
@ -1020,13 +1034,25 @@ QList<quint32> TrxBoard::getAfeReg(eSlaveSelect sel, quint32 afeRegAddr)
return afeRegValue ;
}
void TrxBoard : : setAdgCfg ( eBiteDacOutput adg ) const
{
this - > _builtInTest - > biteAdgCfg ( adg ) ;
}
void TrxBoard : : setTxDacEnable ( quint8 biteInterval , bool cmd ) const
{
this - > _builtInTest - > biteDacEnable ( biteInterval , cmd ) ;
}
void TrxBoard : : slaveFpgaProgram ( const QString path )
{
scenParamsFilling ( clear ) ;
fpgaProgram ( path ) ;
# ifndef DEVELOP_UI
afeAdcsSync ( ) ;
# endif
}
void TrxBoard : : setBeamFormerMode ( eClkMode mode ) const
@ -1544,12 +1570,20 @@ void TrxBoard::selectProbe(eSelectProbe prbSel)
void TrxBoard : : getHealthStatus ( HealthStatus * healStat ) const
{
//healStat->criticalComponentTemperature = this->_bCtrlMngt->getTrxFpgaTemp();
healStat - > systemTemperature = this - > _bCtrlMngt - > getTrxTempSensor ( ) ;
this - > _bCtrlMngt - > getTrxBoardVoltages ( _adc , _pg ) ;
this - > _bCtrlMngt - > getTrxVoltagesPg ( _pg ) ;
healStat - > adcMon = _adc ;
healStat - > voltsPg = _pg ;
this - > _bCtrlMngt - > getFanRpm ( _tachoRpm ) ;
this - > _bCtrlMngt - > getTrxVoltagesPg ( _pg ) ;
this - > _bCtrlMngt - > getFpgaTemp ( _coreTemp ) ;
this - > _bCtrlMngt - > getTrxBoardVoltages ( _adc , _pg ) ;
this - > _bCtrlMngt - > getFpgaVccInt ( _coreVolt - > vccInt ) ;
this - > _bCtrlMngt - > getFpgaVccAux ( _coreVolt - > vccAux ) ;
this - > _bCtrlMngt - > getFpgaVccBram ( _coreVolt - > vccBram ) ;
healStat - > voltsPg = _pg ;
healStat - > adcMon = _adc ;
healStat - > fanRpm = _tachoRpm ;
healStat - > fpgaCoreVoltages = _coreVolt ;
healStat - > fpgaCoreTemperature = _coreTemp ;
healStat - > systemTemperature = this - > _bCtrlMngt - > getTrxTempSensor ( ) ;
}
void TrxBoard : : mcsProgram ( QString path )
@ -1592,7 +1626,7 @@ void TrxBoard::mcsVerify(QString path) const
QTextStream save ( & mcsFile ) ;
this - > _bpiFlash - > readMcs ( & mcsList ) ;
mcsList = this - > _bpiFlash - > readMcs ( ) ;
for ( auto i = 0 ; i < MCS_FILE_SIZE ; i + + )
{
@ -1624,7 +1658,15 @@ quint32 TrxBoard::getFrameLostCounter() const
return ( this - > _misc - > getFrameLostCount ( ) ) ;
}
void TrxBoard : : adcCaptureStart ( captureConfig & capCfg , eSyncMode syncMode )
void TrxBoard : : adcCaptureConfig ( captureConfig & capCfg ) const
{
// ADC capture config
this - > _debugSlave0 - > adcLoggerConfig ( capCfg ) ;
this - > _debugSlave1 - > adcLoggerConfig ( capCfg ) ;
this - > _debugSlave2 - > adcLoggerConfig ( capCfg ) ;
}
void TrxBoard : : adcCaptureStart ( void ) const
{
// ADC capture reset
this - > _debugSlave0 - > adcLoggerRst ( true ) ;
@ -1634,43 +1676,36 @@ void TrxBoard::adcCaptureStart(captureConfig &capCfg, eSyncMode syncMode)
this - > _debugSlave1 - > adcLoggerRst ( false ) ;
this - > _debugSlave2 - > adcLoggerRst ( false ) ;
// ADC capture config
this - > _debugSlave0 - > adcLoggerConfig ( capCfg ) ;
this - > _debugSlave1 - > adcLoggerConfig ( capCfg ) ;
this - > _debugSlave2 - > adcLoggerConfig ( capCfg ) ;
// Sync mode config in case of the manual sync is selected
if ( syncMode = = manualSync )
{
this - > _misc - > setSyncMode ( bfAdcLogMode ) ;
this - > _misc - > setManualSync ( true ) ;
this - > _misc - > setManualSync ( false ) ;
this - > _misc - > setSyncMode ( bfSyncMode ) ;
}
// ADC capture enable
this - > _debugSlave0 - > adcCaptureCmd ( captureStart ) ;
// ADC capture start
adcCaptureStart ( _debugSlave0 ) ;
adcCaptureStart ( _debugSlave1 ) ;
adcCaptureStart ( _debugSlave2 ) ;
}
void TrxBoard : : setCaptureManualSync ( void ) const
{
this - > _misc - > setSyncMode ( otherAdcLogMode ) ;
this - > _misc - > setManualSync ( true ) ;
this - > _misc - > setManualSync ( false ) ;
this - > _misc - > setSyncMode ( bfSyncMode ) ;
}
void TrxBoard : : adcLoggerStart ( const QString path )
void TrxBoard : : adcCaptureDone ( void ) const
{
// // Timeout to receive adc capture done.
// this->_bCtrlMngt->timerShot(100);
// while (!(_dbg->getCapDone()))
// {
// if(this->_bCtrlMngt->checkTimeout())
// throw SonoException("Failure to receive adc capture done.");
waitForCaptureDone ( _debugSlave0 ) ;
waitForCaptureDone ( _debugSlave1 ) ;
waitForCaptureDone ( _debugSlave2 ) ;
// }
// this->_bCtrlMngt->timerStop();
//this->_debugSlave0->adcCaptureCmd(captureStop);
adcCaptureStop ( _debugSlave0 ) ;
adcCaptureStop ( _debugSlave1 ) ;
adcCaptureStop ( _debugSlave2 ) ;
}
void TrxBoard : : adcLoggerStart ( const QString path , const QString fileName )
{
quint8 fpgaSel ( 0 ) ;
quint8 chNumPerFpga ( 0 ) ;
QList < qint16 > adcDataList ;
QTime t = QTime : : currentTime ( ) ;
QString logPath = path + " /adcLog_ " + QString ( " %1_%2_%3.csv " )
QString logPath = path + " / " + fileName + " _ adcLog" + QString ( " _ %1_%2_%3.csv" )
. arg ( t . hour ( ) )
. arg ( t . minute ( ) )
. arg ( t . second ( ) ) ;
@ -1688,27 +1723,24 @@ void TrxBoard::adcLoggerStart(const QString path)
}
log < < " SYNC Offset(ns): " ;
log < < this - > _debugSlave0 - > getCapSyncOffset ( ) * 5 < < ' , ' ;
log < < this - > _debugSlave1 - > getCapSyncOffset ( ) * 5 < < ' , ' ;
log < < this - > _debugSlave2 - > getCapSyncOffset ( ) * 5 < < ' , ' ;
log < < endl ;
log < < this - > _debugSlave0 - > getCapSyncOffset ( ) * 5 < < " , " ;
log < < this - > _debugSlave1 - > getCapSyncOffset ( ) * 5 < < " , " ;
log < < this - > _debugSlave2 - > getCapSyncOffset ( ) * 5 < < endl ;
log < < " ADC Sample Latancy(ns): " ;
log < < this - > _afeSlave0 - > getAdcLatency ( ) * 2.5f < < ' , ' ;
log < < this - > _afeSlave1 - > getAdcLatency ( ) * 2.5f < < ' , ' ;
log < < this - > _afeSlave2 - > getAdcLatency ( ) * 2.5f < < ' , ' ;
log < < endl ;
log < < this - > _afeSlave0 - > getAdcLatency ( ) * 2.5f < < " , " ;
log < < this - > _afeSlave1 - > getAdcLatency ( ) * 2.5f < < " , " ;
log < < this - > _afeSlave2 - > getAdcLatency ( ) * 2.5f < < endl ;
log < < " ADC Sample Logger Offset(sample): " ;
log < < this - > _debugSlave0 - > getCaptureSampleNo ( ) < < ' , ' ;
log < < this - > _debugSlave1 - > getCaptureSampleNo ( ) < < ' , ' ;
log < < this - > _debugSlave2 - > getCaptureSampleNo ( ) < < ' , ' ;
log < < endl ;
log < < this - > _debugSlave0 - > getCaptureSampleNo ( ) < < " , " ;
log < < this - > _debugSlave1 - > getCaptureSampleNo ( ) < < " , " ;
log < < this - > _debugSlave2 - > getCaptureSampleNo ( ) < < endl ;
// Set gt to adc mode
// Set gt to adc mode.
this - > _misc - > setGtSendMode ( adcMode ) ;
// Stop adc log transfer
// Stop adc log transfer.
this - > _debugSlave0 - > adcLoggerTransferCmd ( loggerStop ) ;
this - > _debugSlave1 - > adcLoggerTransferCmd ( loggerStop ) ;
this - > _debugSlave2 - > adcLoggerTransferCmd ( loggerStop ) ;
@ -1718,7 +1750,7 @@ void TrxBoard::adcLoggerStart(const QString path)
fpgaSel = chNum / AFE_CHANNEL_NUM_PER_SLAVE ;
chNumPerFpga = chNum % AFE_CHANNEL_NUM_PER_SLAVE ;
// ADC sampler start according to selected fpga
// ADC sampler start according to selected fpga.
this - > _misc - > setAdcSamplerCmd ( samplerStop ) ;
this - > _misc - > setAdcSamplerFpgaSel ( fpgaSel ) ;
this - > _misc - > setAdcSamplerCmd ( samplerStart ) ;
@ -1738,21 +1770,49 @@ void TrxBoard::adcLoggerStart(const QString path)
break ;
}
// Read adc data bram
this - > _misc - > getAdcDataBram ( & adcDataList ) ;
// Read adc data bram.
QList < qint16 > adcDataList = this - > _misc - > getAdcDataBram ( ) ;
foreach ( auto data , adcDataList )
{
log < < data < < ' , ' ;
}
log < < endl ;
// ADC sampler stop
// ADC sampler stop.
this - > _misc - > setAdcSamplerCmd ( samplerStop ) ;
}
logFile . flush ( ) ;
logFile . close ( ) ;
// Set gt to beamformer mode
// Set gt to beamformer mode.
this - > _misc - > setGtSendMode ( bfMode ) ;
}
void TrxBoard : : setDebuggerMode ( eDebugMode bfMode , bool enable )
{
DebugMode debug ;
DebugMode debugRb ;
debug . rxBfDbgModeEn = false ;
debug . rxBfSimDataGenModeEn = false ;
debug . txBfTestModeEn = enable ;
debug . txBfTestModeCfg = bfMode ;
this - > debuggerMode ( _debugSlave0 , debug , debugRb , " slave0 " ) ;
this - > debuggerMode ( _debugSlave1 , debug , debugRb , " slave1 " ) ;
this - > debuggerMode ( _debugSlave2 , debug , debugRb , " slave2 " ) ;
}
void TrxBoard : : setAfeConfig ( AfeConfig & afeCfg ) const
{
this - > _afeSlave0 - > setAfeParams ( afeCfg ) ;
this - > _afeSlave1 - > setAfeParams ( afeCfg ) ;
this - > _afeSlave2 - > setAfeParams ( afeCfg ) ;
}
void TrxBoard : : setAfePwr ( eAfePwrdnMode pwrMode ) const
{
this - > _afeSlave0 - > setAfeGblPwr ( pwrMode ) ;
this - > _afeSlave1 - > setAfeGblPwr ( pwrMode ) ;
this - > _afeSlave2 - > setAfeGblPwr ( pwrMode ) ;
}