*add physical logging

This commit is contained in:
Gatsby Van
2024-01-31 19:49:30 +08:00
parent bd51428bca
commit 15e0fc2e39
2 changed files with 24 additions and 0 deletions
@@ -311,6 +311,28 @@ void Phy_UpdateState(PHY_INST *instPtr)
instPtr->recvSlotTime.frac_part = PhyRead(instPtr, TM_TARGET_L);
instPtr->recvFsTime.int_part = PhyRead(instPtr, FSTIME_H);
instPtr->recvFsTime.frac_part = PhyRead(instPtr, FSTIME_L);
instPtr->phyLog.acqCnt = PhyRead(instPtr, PHY_ACQ_CNT);
instPtr->phyLog.fsyncCnt = PhyRead(instPtr, PHY_FRAME_SYNC_CNT);
instPtr->phyLog.decodeCnt = PhyRead(instPtr, PHY_DECODE_CNT);
instPtr->phyLog.crcCnt = PhyRead(instPtr, PHY_CRC_OK_CNT);
instPtr->phyLog.doppler = Phy_GetFreqEst(instPtr);
instPtr->phyLog.recvStamp = (uint64_t)instPtr->recvFsTime.frac_part * TIME_FRAC_MAX + instPtr->recvFsTime.int_part;
instPtr->phyLog.acqPeak = PhyRead(instPtr, PHY_ACQ_PEAK_L);
instPtr->phyLog.acqPeak = ((uint64_t)PhyRead(instPtr, PHY_ACQ_PEAK_H)) << 32;
instPtr->phyLog.acqMean = PhyRead(instPtr, PHY_ACQ_MEAN_L);
instPtr->phyLog.acqMean = ((uint64_t)PhyRead(instPtr, PHY_ACQ_MEAN_H)) << 32;
instPtr->phyLog.acqPhase = PhyRead(instPtr, PHY_ACQ_FREQEST) & PHY_ACQ_FREQEST_PHASE_MASK >> PHY_ACQ_FREQEST_PHASE_SHIFT;
instPtr->phyLog.acqFreqCh = PhyRead(instPtr, PHY_ACQ_FREQEST) & PHY_ACQ_FREQEST_CHANNEL_MASK >> PHY_ACQ_FREQEST_CHANNEL_SHIFT;
instPtr->phyLog.fsyncPeak = PhyRead(instPtr, PHY_FRAME_SYNC_PEAK_L);
instPtr->phyLog.fsyncPeak = ((uint64_t)PhyRead(instPtr, PHY_FRAME_SYNC_PEAK_H)) << 32;
instPtr->phyLog.fsyncMean = PhyRead(instPtr, PHY_FRAME_SYNC_MEAN_L);
instPtr->phyLog.fsyncMean = ((uint64_t)PhyRead(instPtr, PHY_FRAME_SYNC_MEAN_H)) << 32;
instPtr->phyLog.fsyncFreqCh = PhyRead(instPtr, PHY_FRAME_SYNC_FREQEST) & PHY_FRAME_SYNC_FREQEST_CHANNEL_MASK >> PHY_FRAME_SYNC_FREQEST_CHANNEL_SHIFT;
instPtr->phyLog.deintlvAmpEst = PhyRead(instPtr, PHY_DEINTLV_AMPEST) & PHY_DEINTLV_AMPEST_MASK;
instPtr->phyLog.reserve = 0;
SysMonitor_UpdatePhysicalLayerLog(&(instPtr->phyLog));
}
/*****************************************************************************/
@@ -357,6 +379,7 @@ int32_t Phy_InstInit(PHY_INST **instPtr, PHY_CONFIG *phyConfig)
memset(&((*instPtr)->beamNo), (int32_t)L1_INIT_ANT_NO, sizeof(PHY_RCD));
memset(&((*instPtr)->beamWd), (int32_t)L1_INIT_ANT_WD, sizeof(PHY_RCD));
memset(&((*instPtr)->hwSate), 0x00, sizeof(HWSTATE));
memset(&((*instPtr)->phyLog), 0x00, sizeof(PHYLOG));
#ifndef EMULATION
XBram_Config *bramConfigPtr;
@@ -218,6 +218,7 @@ typedef struct
XAdcPs hwXadc;
#endif
HWSTATE hwSate;
PHYLOG phyLog;
} PHY_INST;
/************************** Variable Definitions *****************************/