xWRL6432 MMWAVE-L-SDK  05.04.00.01
cfarprochwa.h
Go to the documentation of this file.
1 
40 /**************************************************************************
41  *************************** Include Files ********************************
42  **************************************************************************/
43 #ifndef CFAR_PROC_HWA_H
44 #define CFAR_PROC_HWA_H
45 
46 /* Standard Include Files. */
47 #include <stdint.h>
48 #include <stdlib.h>
49 #include <stddef.h>
50 #include <string.h>
51 #include <stdio.h>
52 #include <math.h>
53 
54 /* mmWave SDK Driver/Common Include Files */
55 #include <drivers/hwa.h>
56 #include <drivers/edma.h>
57 
58 #include <kernel/dpl/SemaphoreP.h>
59 
60 /* Datapath files */
62 #include <datapath/dpif/dpif_pointcloud.h>
64 #include <datapath/dpif/dp_error.h>
66 
67 #ifdef __cplusplus
68 extern "C" {
69 #endif
70 
78 #define DPU_CFARPROCHWA_DET_MATRIX_BYTE_ALIGNMENT (sizeof(uint16_t))
79 
83 #define DPU_CFARPROCHWA_CFAR_DET_LIST_BYTE_ALIGNMENT DPIF_CFAR_DET_LIST_CPU_BYTE_ALIGNMENT
84 
89 #define DPU_CFARPROCHWA_HWA_MEM_OUT_DOPPLER_BYTE_ALIGNMENT (sizeof(uint32_t))
90 
95 #define DPU_CFARPROCHWA_HWA_MEM_OUT_RANGE_BYTE_ALIGNMENT (sizeof(uint32_t))
96 
100 #define DPU_CFARPROCHWA_DOPPLER_DET_OUT_BIT_MASK_BYTE_ALIGNMENT (sizeof(uint32_t))
101 
114 #define DPU_CFARPROCHWA_EINVAL (DP_ERRNO_CFAR_PROC_BASE-1)
115 
119 #define DPU_CFARPROCHWA_EINVAL__DET_MATRIX_FORMAT (DP_ERRNO_CFAR_PROC_BASE-2)
120 
124 #define DPU_CFARPROCHWA_EINVAL__NUM_PARAM_SETS (DP_ERRNO_CFAR_PROC_BASE-3)
125 
129 #define DPU_CFARPROCHWA_ENOMEM (DP_ERRNO_CFAR_PROC_BASE-10)
130 
134 #define DPU_CFARPROCHWA_ENOMEM__DET_MATRIX_EXCEEDS_HWA_INP_MEM (DP_ERRNO_CFAR_PROC_BASE-11)
135 
139 #define DPU_CFARPROCHWA_ENOMEMALIGN_DET_MATRIX (DP_ERRNO_CFAR_PROC_BASE-12)
140 
144 #define DPU_CFARPROCHWA_ENOMEMALIGN_HWA_MEM_OUT_RANGE (DP_ERRNO_CFAR_PROC_BASE-15)
145 
149 #define DPU_CFARPROCHWA_NUM_RANGE_BINS_EXCEDED_LIMIT (DP_ERRNO_CFAR_PROC_BASE-18)
150 
154 #define DPU_CFARPROCEDMA_ESEMA (DP_ERRNO_CFAR_PROC_BASE-19)
155 
159 #define DPU_CFARPROCHWA_EINTERNAL (DP_ERRNO_CFAR_PROC_BASE-20)
160 
164 #define DPU_CFARPROCHWA_EHWA_PARAM_SAVE_LOC_SIZE (DP_ERRNO_CFAR_PROC_BASE-21)
165 
169 #define DPU_CFARPROCHWA_ENOTIMPL (DP_ERRNO_CFAR_PROC_BASE-30)
170 
174  #define DPU_CFARPROCHWA_ESEMA (DP_ERRNO_CFAR_PROC_BASE-40)
175 
183 #define DPU_CFARPROCHWA_SHIFT_Q8 8
184 #define DPU_CFARPROCHWA_ONE_Q8 (1<<DPU_CFARPROCHWA_SHIFT_Q8)
185 
189 #define DPU_CFARPROCHWA_MAX_NUM_HWA_PARAMSET 2
190 
200  typedef enum DPU_CFARProcHWA_Cmd_e
201  {
202 
205 
208 
212 
213 
221  typedef struct DPU_CFARProcHWA_HwaParamSaveLoc_t
222  {
224  void *data;
225 
227  uint32_t sizeBytes;
229 
239 typedef struct DPU_CFARProcHWA_HwaCfarConfig_t
240 {
243 
245  uint8_t numParamSet;
246 
250 
253  uint8_t dmaTrigSrcChan;
255 
262 typedef volatile struct DPU_CFARProcHWA_CfarDetOutput_t
263 {
264  uint32_t noise;
265  uint32_t cellIdx : 12;
266  uint32_t iterNum : 12;
267  uint32_t reserved : 8;
269 
270 
277 typedef volatile struct DPU_CFARProcHWA_HwaMaxOutput_t
278 {
279  uint32_t maxInd;
280  uint32_t peak;
282 
293 typedef struct DPU_CFARProcHWA_InitParams_t
294 {
298 
310 typedef struct DPU_CFARProcHWA_Resources_t
311 {
314 
317 
320 
323 
326 
329 
332 
335  uint16_t *hwaMemInp;
336 
339  uint32_t hwaMemInpSize;
340 
343 
347 
350 
353 
356 
360 
372 typedef struct DPU_CFARProcHWA_DynamicConfig_t
373 {
375 
377 
380 
383 
385 
397 typedef struct DPU_CFARProcHWA_StaticConfig_t
398 {
401 
403  uint16_t numRangeBins;
404 
406  uint16_t numDopplerBins;
407 
409  uint16_t azimuthFftSize;
410 
413 
415  float rangeStep;
416 
418  float dopplerStep;
419 
422 
425 
427  float rangeBias;
428 
433 
435  uint8_t angleDimension;
436 
439 
442 
445 
448 
450 
462 typedef struct DPU_CFARProcHWA_Config_t
463 {
466 
469 
473 
481 typedef struct DPU_CFARProcHWA_InputParams_t
482 {
485 
489 
501 typedef struct DPU_CFARProcHWA_OutParams_t
502 {
505 
508 
510  DPIF_PointCloudCartesianExt *detObjOut;
511 
513  DPIF_PointCloudRngAzimElevDopInd *detObjIndOut;
514 
517 
519  uint32_t *rangeProfile;
520 
523 
525  DPIF_CFARRngDopDetListElement *detRngDopList;
527 
537 
556 (
558  int32_t* errCode
559 );
560 
579 (
580  DPU_CFARProcHWA_Handle handle,
581  DPU_CFARProcHWA_Config *cfarHwaCfg
582 );
583 
604 (
605  DPU_CFARProcHWA_Handle handle,
606  DPIF_DetMatrix *detMatrix,
607  DPU_CFARProcHWA_InputParams *inputParams,
608  DPU_CFARProcHWA_OutParams *outParams
609 );
610 
631 (
632  DPU_CFARProcHWA_Handle handle,
634  void *arg,
635  uint32_t argSize
636 );
637 
656 (
658 );
659 
679 (
680  DPU_CFARProcHWA_Handle handle,
681  uint8_t *numUsedHwaParamSets
682 );
683 
684 #ifdef __cplusplus
685 }
686 #endif
687 
688 #endif
DPU_CFARProcHWA_OutParams::detObjOutMaxSize
uint32_t detObjOutMaxSize
point-cloud output list size
Definition: cfarprochwa.h:516
DPU_CFARProcHWA_StaticConfig::elevationFftSize
uint16_t elevationFftSize
Elevation FFT size.
Definition: cfarprochwa.h:412
DPU_CFARProcHWA_HW_Resources::hwaMemOutDetList
DPU_CFARProcHWA_CfarDetOutput * hwaMemOutDetList
HWA memory for intermediate cfar detection list
Definition: cfarprochwa.h:342
DPIF_DetMatrix
Detection matrix buffer interface.
Definition: dpif_detmatrix.h:81
DPU_CFARProcHWA_InputParams::velocityInclusionThr
float velocityInclusionThr
Radial velocity inclusion threshold (m/sec) (exclude points with radial velocites greater than thresh...
Definition: cfarprochwa.h:484
DPU_CFARProcHWA_HW_Resources
CFAR Hardware resources.
Definition: cfarprochwa.h:311
DPU_CFARProcHWA_InputParams::forceVelocityToZero
bool forceVelocityToZero
Force radial velocity of included points to zero.
Definition: cfarprochwa.h:487
DPU_CFARProcHWA_StaticConfig::log2NumDopplerBins
uint8_t log2NumDopplerBins
Log2 of number of doppler bins.
Definition: cfarprochwa.h:400
DPU_CFARProcHWA_OutParams::detObjIndOut
DPIF_PointCloudRngAzimElevDopInd * detObjIndOut
point-cloud output list with range/azimuth/elevation/doppler indices (for testing)
Definition: cfarprochwa.h:513
DPU_CFARProcHWA_StaticConfig::lambdaOverDistX
float lambdaOverDistX
Lambda over antenna spacing in x-direction.
Definition: cfarprochwa.h:421
dpif_detmatrix.h
Defines the detection matrix buffer interface.
DPU_CFARProcHWA_StaticConfig::rangeStep
float rangeStep
Range conversion factor for FFT range index to meters.
Definition: cfarprochwa.h:415
DPU_CFARProcHWA_HwaMaxOutput
Maximum peaks filled by HWA statistics block.
Definition: cfarprochwa.h:278
cfarproccommon.h
Implements Common definition across cfarcaProc DPU.
DPU_CFARProc_AoaFovCfg
Field of view - AoA Configuration.
Definition: cfarproccommon.h:226
Edma_IntrObject
EDMA interrupt configuration object. The object is passed to the EDMA_registerIntr() function....
Definition: edma/v0/edma.h:451
DPU_CFARProcHWA_Config
HWA CFAR configuration.
Definition: cfarprochwa.h:463
DPU_CFARProcHWA_CfarDetOutput::cellIdx
uint32_t cellIdx
Sample index (i.e. cell under test index)
Definition: cfarprochwa.h:265
DPU_CFARProcHWA_HW_Resources::edmaHwaIn
DPEDMA_ChanCfg edmaHwaIn
EDMA configuration for CFAR data In.
Definition: cfarprochwa.h:316
DPU_CFARProcHWA_HW_Resources::hwaMemInp
uint16_t * hwaMemInp
HWA scratch memory to page-in detection matrix. Note two contiguous M memory banks (of the 4 banks) c...
Definition: cfarprochwa.h:335
DPU_CFARProcHWA_HwaParamSaveLoc::data
void * data
Pointer to save location for HWA PARAM sets.
Definition: cfarprochwa.h:224
DPU_CFARProcHWA_StaticConfig::numDopplerBins
uint16_t numDopplerBins
Number of doppler bins.
Definition: cfarprochwa.h:406
DPU_CFARProcHWA_StaticConfig
HWA CFAR static configuration.
Definition: cfarprochwa.h:398
DPU_CFARProcHWA_OutParams::detObjOut
DPIF_PointCloudCartesianExt * detObjOut
point-cloud output list
Definition: cfarprochwa.h:510
DPU_CFARProcHWA_control
int32_t DPU_CFARProcHWA_control(DPU_CFARProcHWA_Handle handle, DPU_CFARProcHWA_Cmd cmd, void *arg, uint32_t argSize)
DPU_CFARProcHWA_StaticConfig::rangeBias
float rangeBias
Range bias.
Definition: cfarprochwa.h:427
DPU_CFARProcHWA_OutParams::numCfarDetectedPoints
uint32_t numCfarDetectedPoints
Number of CFAR detected points.
Definition: cfarprochwa.h:507
DPU_CFARProc_CfarScndPassCfg
CFAR Configuration.
Definition: cfarproccommon.h:158
DPU_CFARProcHWA_DynamicConfig::cfarCfg
DPU_CFARProc_CfarCfg * cfarCfg
Definition: cfarprochwa.h:374
dp_error.h
Base error codes for the data path Modules.
DPU_CFARProcHWA_DynamicConfig
HWA CFAR dynamic configuration.
Definition: cfarprochwa.h:373
DPU_CFARProcHWA_InitParams::hwaHandle
HWA_Handle hwaHandle
HWA Handle.
Definition: cfarprochwa.h:296
SemaphoreP.h
DPU_CFARProcHWA_Cmd_FovAoaCfg
@ DPU_CFARProcHWA_Cmd_FovAoaCfg
Command to update field of view in angle domain, minimum and maximum angle limits (for azimuth and el...
Definition: cfarprochwa.h:210
DPU_CFARProcHWA_StaticConfig::angleDimension
uint8_t angleDimension
1 - 1D: 6x1 azimuth antenna array 2 - 2D: one lower row: 4 antennas, upper row 2 antennas
Definition: cfarprochwa.h:435
DPU_CFARProc_Stats
Data processing Unit statistics.
Definition: cfarproccommon.h:204
DPU_CFARProcHWA_StaticConfig::isDetMatrixLogScale
bool isDetMatrixLogScale
Detection matrix format 0 - Linear 32-bit integer, 1 - 16-bit log2 magnitude in Q11 format.
Definition: cfarprochwa.h:444
DPU_CFARProcHWA_Handle
void * DPU_CFARProcHWA_Handle
CFARHwa DPU Handle.
Definition: cfarprochwa.h:536
DPU_CFARProcHWA_CfarDetOutput::noise
uint32_t noise
Noise energy in CFAR cell.
Definition: cfarprochwa.h:264
DPU_CFARProc_RangeFovCfg
Field of view - Range Configuration.
Definition: cfarproccommon.h:251
edma.h
DPU_CFARProcHWA_HwaCfarConfig::hwaParamsSaveLoc
DPU_CFARProcHWA_HwaParamSaveLoc hwaParamsSaveLoc
HWA Params save location.
Definition: cfarprochwa.h:249
DPU_CFARProcHWA_StaticConfig::detectionHeatmapType
uint8_t detectionHeatmapType
0-Range-Azimuth heatmap, 1-Range-Doppler heatmap
Definition: cfarprochwa.h:438
DPU_CFARProcHWA_CfarDetOutput
Detected object parameters filled by HWA CFAR.
Definition: cfarprochwa.h:263
DPU_CFARProcHWA_HW_Resources::hwaCfg
DPU_CFARProcHWA_HwaCfarConfig hwaCfg
HWA Configuration.
Definition: cfarprochwa.h:328
DPU_CFARProcHWA_HW_Resources::hwaMemOutRangeProfile
DPU_CFARProcHWA_HwaMaxOutput * hwaMemOutRangeProfile
HWA memory to store range profile.
Definition: cfarprochwa.h:349
DPU_CFARProcHWA_HW_Resources::edmaHwaOut
DPEDMA_ChanCfg edmaHwaOut
EDMA configuration for CFAR data Out.
Definition: cfarprochwa.h:319
DPU_CFARProcHWA_InitParams
CFARCAProcHWA DPU initial configuration parameters.
Definition: cfarprochwa.h:294
DPU_CFARProcHWA_StaticConfig::dopplerStep
float dopplerStep
Doppler conversion factor for Doppler FFT index to m/s.
Definition: cfarprochwa.h:418
DPU_CFARProc_CfarCfg
CFAR Configuration.
Definition: cfarproccommon.h:90
DPU_CFARProcHWA_Cmd
DPU_CFARProcHWA_Cmd
cfarProc control command
Definition: cfarprochwa.h:201
DPU_CFARProcHWA_StaticConfig::azimuthFftSize
uint16_t azimuthFftSize
Azimuth FFT size.
Definition: cfarprochwa.h:409
DPU_CFARProcHWA_init
DPU_CFARProcHWA_Handle DPU_CFARProcHWA_init(DPU_CFARProcHWA_InitParams *initCfg, int32_t *errCode)
DPU_CFARProcHWA_HwaMaxOutput::peak
uint32_t peak
Maximum peak value.
Definition: cfarprochwa.h:280
DPU_CFARProcHWA_Config::staticCfg
DPU_CFARProcHWA_StaticConfig staticCfg
Static configuration.
Definition: cfarprochwa.h:471
DPU_CFARProcHWA_OutParams::stats
DPU_CFARProc_Stats stats
CFARCAProc statistics.
Definition: cfarprochwa.h:504
DPU_CFARProcHWA_HwaCfarConfig::numParamSet
uint8_t numParamSet
number of HWA paramset
Definition: cfarprochwa.h:245
DPU_CFARProcHWA_HW_Resources::edmaHwaInSignature
DPEDMA_ChanCfg edmaHwaInSignature
EDMA configuration for EDMA In to trigger HWA.
Definition: cfarprochwa.h:322
DPU_CFARProcHWA_Cmd_CfarCfg
@ DPU_CFARProcHWA_Cmd_CfarCfg
Command to update CFAR configuration in range domain.
Definition: cfarprochwa.h:204
DPU_CFARProcHWA_OutParams::detRngDopList
DPIF_CFARRngDopDetListElement * detRngDopList
CFAR final output detection list filled by CFAR DPU when running on Range/Doppler heatmap.
Definition: cfarprochwa.h:525
DPU_CFARProcHWA_StaticConfig::enableCfarPointCloudListWithIndices
bool enableCfarPointCloudListWithIndices
enable CFAR point cloud list with range/azimuth indices
Definition: cfarprochwa.h:447
DPU_CFARProcHWA_Cmd_FovRangeCfg
@ DPU_CFARProcHWA_Cmd_FovRangeCfg
Command to update field of view in range domain, minimum and maximum range limits.
Definition: cfarprochwa.h:207
DPU_CFARProcHWA_HW_Resources::hwaMemOutDetListSize
uint32_t hwaMemOutDetListSize
Maximum number of elements of type DPU_CFARProcHWA_CfarDetOutput of HWA memory for cfar detection lis...
Definition: cfarprochwa.h:346
DPU_CFARProcHWA_DynamicConfig::fovRange
DPU_CFARProc_RangeFovCfg * fovRange
Field of view configuration in range domain.
Definition: cfarprochwa.h:382
DPU_CFARProcHWA_StaticConfig::numRangeBins
uint16_t numRangeBins
Number of range bins.
Definition: cfarprochwa.h:403
DPU_CFARProcHWA_CfarDetOutput::reserved
uint32_t reserved
Reserved.
Definition: cfarprochwa.h:267
DPU_CFARProcHWA_StaticConfig::isStaticClutterRemovalEnabled
bool isStaticClutterRemovalEnabled
Static Clutter Removal Cfg.
Definition: cfarprochwa.h:441
DPU_CFARProcHWA_HW_Resources::hwaMemInpSize
uint32_t hwaMemInpSize
Number of elements of type uint16_t of HWA memory to hold detection matrix (associated with hwaMemInp...
Definition: cfarprochwa.h:339
hwa.h
DPU_CFARProcHWA_HwaParamSaveLoc
Structure for the HWA Params save location.
Definition: cfarprochwa.h:222
DPU_CFARProcHWA_OutParams::cfarRangeDetOutList
DPU_CFARProcHWA_CfarDetOutput * cfarRangeDetOutList
CFAR output detection list filled by HWA.
Definition: cfarprochwa.h:522
DPU_CFARProcHWA_Config::dynCfg
DPU_CFARProcHWA_DynamicConfig dynCfg
Dynamic configuration.
Definition: cfarprochwa.h:468
DPU_CFARProcHWA_HW_Resources::intrObj
Edma_IntrObject * intrObj
EDMA interrupt object.
Definition: cfarprochwa.h:325
DPU_CFARProcHWA_OutParams::rangeProfile
uint32_t * rangeProfile
range profile
Definition: cfarprochwa.h:519
DPU_CFARProcHWA_HwaCfarConfig
CFAR HWA configuration.
Definition: cfarprochwa.h:240
EDMA_Handle
void * EDMA_Handle
A handle that is returned from a EDMA_open() call.
Definition: edma/v0/edma.h:471
DPU_CFARProcHWA_DynamicConfig::fovAoaCfg
DPU_CFARProc_AoaFovCfg * fovAoaCfg
CFAR configuration in range direction.
Definition: cfarprochwa.h:379
DPU_CFARProcHWA_HW_Resources::detMatrix
DPIF_DetMatrix detMatrix
Pointer to detection matrix.
Definition: cfarprochwa.h:331
DPU_CFARProcHWA_HW_Resources::rangeDopplerDetPointBitMap
uint32_t * rangeDopplerDetPointBitMap
Range Doppler detection bitmap.
Definition: cfarprochwa.h:358
DPU_CFARProcHWA_process
int32_t DPU_CFARProcHWA_process(DPU_CFARProcHWA_Handle handle, DPIF_DetMatrix *detMatrix, DPU_CFARProcHWA_InputParams *inputParams, DPU_CFARProcHWA_OutParams *outParams)
DPU_CFARProcHWA_StaticConfig::lambdaOverDistZ
float lambdaOverDistZ
Lambda over antenna spacing in z-direction.
Definition: cfarprochwa.h:424
DPU_CFARProcHWA_HW_Resources::dopplerIndexMatrix
DPIF_DetMatrix dopplerIndexMatrix
Doppler index matrix.
Definition: cfarprochwa.h:352
DPU_CFARProcHWA_HW_Resources::edmaHandle
EDMA_Handle edmaHandle
EDMA Handle.
Definition: cfarprochwa.h:313
DPU_CFARProcHWA_StaticConfig::selectCoherentPeakInDopplerDim
uint8_t selectCoherentPeakInDopplerDim
1 - select the coherent peak in Doppler, 0 - non-coherently combine accross Doppler,...
Definition: cfarprochwa.h:432
DPU_CFARProcHWA_deinit
int32_t DPU_CFARProcHWA_deinit(DPU_CFARProcHWA_Handle handle)
DPU_CFARProcHWA_HW_Resources::elevationIndexMatrix
DPIF_DetMatrix elevationIndexMatrix
Elevation index matrix.
Definition: cfarprochwa.h:355
DPU_CFARProcHWA_OutParams
Output parameters populated during Processing time.
Definition: cfarprochwa.h:502
dpedma.h
EDMA Configuration Utility API definitions.
DPU_CFARProcHWA_Config::res
DPU_CFARProcHWA_HW_Resources res
Hardware resources.
Definition: cfarprochwa.h:465
DPU_CFARProcHWA_HwaParamSaveLoc::sizeBytes
uint32_t sizeBytes
Size of the save location for HWA PARAM sets in Bytes.
Definition: cfarprochwa.h:227
DPU_CFARProcHWA_config
int32_t DPU_CFARProcHWA_config(DPU_CFARProcHWA_Handle handle, DPU_CFARProcHWA_Config *cfarHwaCfg)
DPU_CFARProcHWA_InputParams
Input parameters populated during Processing time.
Definition: cfarprochwa.h:482
HWA_Handle
void * HWA_Handle
A handle that is returned from a HWA_open() call.
Definition: hwa/v0/hwa.h:620
DPU_CFARProcHWA_HwaMaxOutput::maxInd
uint32_t maxInd
Maximum peak index position.
Definition: cfarprochwa.h:279
DPU_CFARProcHWA_HwaCfarConfig::paramSetStartIdx
uint8_t paramSetStartIdx
HWA paramset Start index.
Definition: cfarprochwa.h:242
DPU_CFARProcHWA_DynamicConfig::cfarScndPassCfg
DPU_CFARProc_CfarScndPassCfg * cfarScndPassCfg
Definition: cfarprochwa.h:376
DPU_CFARProcHWA_CfarDetOutput::iterNum
uint32_t iterNum
Iteration number (i.e. REG_BCNT counter value)
Definition: cfarprochwa.h:266
DPEDMA_ChanCfg
EDMA channel configuration.
Definition: dpedma.h:132
DPU_CFARProcHWA_GetNumUsedHwaParamSets
int32_t DPU_CFARProcHWA_GetNumUsedHwaParamSets(DPU_CFARProcHWA_Handle handle, uint8_t *numUsedHwaParamSets)
DPU_CFARProcHWA_HwaCfarConfig::dmaTrigSrcChan
uint8_t dmaTrigSrcChan
HWA param set dma trigger source channel.
Definition: cfarprochwa.h:253