SPRUIL1D May 2019 – December 2024 DRA829J , DRA829J-Q1 , DRA829V , DRA829V-Q1 , TDA4VM , TDA4VM-Q1
The HWA0 schedule in HTS is used for the DOF. The HTS programming is as follows:
// RFGW Fetch
HTS->DMA0_SCHEDULER_CONTROL->sch_en = 1; // scheduler enable
HTS->DMA0_SCHEDULER_CONTROL->pipeline_num = 0; // Belongs to pipeline 0
HTS->DMA0_SCHEDULER_CONTROL->dma_channel_no = 0; // Assign appropriate DMA channel
HTS->DMA0_HOP->hop = 1;
HTS->DMA0_HOP->hop_thread_count = ImgHeight/2;
HTS->DMA0_PROD0_CONTROL->prod_en = 1;
HTS->DMA0_PROD0_CONTROL->cons_select = 0;
HTS->DMA0_PROD0_BUF_CONTROL->depth = (RefThreshold + 2)/2;
HTS->DMA0_PROD0_BUF_CONTROL->count_dec = 1;
if(RefThreshold > ImgHeight)
{
HTS->DMA0_PROD0_BUF_CONTROL->threshold = ImgHeight/2;
if((refBot + 2u) < dofConfig->height)
{
HTS->DMA0_PROD0_COUNT->count_preload = (ImgHeight - RefBot - 2)/2;
}
else
{
HTS->DMA0_PROD0_COUNT->count_preload = 0;
}
if(refBot < dofConfig->height)
{
HTS->DMA0_PROD0_COUNT->count_postload = RefBot/2 + mf_en
}
else
{
HTS->DMA0_PROD0_COUNT->count_postload = (ImgHeight - RefCurr)/2 + mf_en
}
}
else
{
HTS->DMA0_PROD0_BUF_CONTROL->threshold = (RefThreshold)/2;
HTS->DMA0_PROD0_COUNT->count_preload = RefTop/2
HTS->DMA0_PROD0_COUNT->count_postload = RefBot/2 + mf_en
}
// CFGW Fetch
HTS->DMA1_SCHEDULER_CONTROL->sch_en = 1; // scheduler enable
HTS->DMA1_SCHEDULER_CONTROL->pipeline_num = 0; // Belongs to pipeline 0
HTS->DMA1_SCHEDULER_CONTROL->dma_channel_no = 1; // Assign appropriate DMA channel
HTS->DMA1_HOP->hop = 1;
HTS->DMA1_HOP->hop_thread_count = ImgHeight/2;
HTS->DMA1_PROD0_CONTROL->prod_en = 1;
HTS->DMA1_PROD0_CONTROL->cons_select = 0;
HTS->DMA1_PROD0_BUF_CONTROL->depth = (CurThreshold + 2)/2;
HTS->DMA1_PROD0_BUF_CONTROL->count_dec = 1;
HTS->DMA1_PROD0_BUF_CONTROL->threshold = (CurThreshold)/2;
HTS->DMA1_PROD0_COUNT->count_preload = CurTop/2;
HTS->DMA1_PROD0_COUNT->count_postload = CurBot/2 + mf_en;
// Temporal predictor fetch
HTS->DMA2_SCHEDULER_CONTROL->sch_en = 1; // Only for Base pyramid
HTS->DMA2_SCHEDULER_CONTROL->pipeline_num = 0; // Belongs to pipeline 0
HTS->DMA2_SCHEDULER_CONTROL->dma_channel_no = 2; // Assign appropriate DMA channel
HTS->DMA2_HOP->hop = 1;
HTS->DMA2_HOP->hop_thread_count = ImgHeight/2;
HTS->DMA2_PROD0_CONTROL->prod_en = 1;
HTS->DMA2_PROD0_CONTROL->cons_select = 0;
HTS->DMA2_PROD0_BUF_CONTROL->depth = 2;
HTS->DMA2_PROD0_BUF_CONTROL->count_dec = 1;
HTS->DMA2_PROD0_BUF_CONTROL->threshold = 1;
HTS->DMA2_PROD0_COUNT->count_preload = 0;
HTS->DMA2_PROD0_COUNT->count_postload = mf_en;
// Pyramidal predictor fetch
HTS->DMA3_SCHEDULER_CONTROL->sch_en = 1; // Only if Pyramid predictor enabled
HTS->DMA3_SCHEDULER_CONTROL->pipeline_num = 0; // Belongs to pipeline 0
HTS->DMA3_SCHEDULER_CONTROL->dma_channel_no = 3; // Assign appropriate DMA channel
HTS->DMA3_HOP->hop = 1;
HTS->DMA3_HOP->hop_thread_count = ImgHeight/2;
HTS->DMA3_PROD0_CONTROL->prod_en = 1;
HTS->DMA3_PROD0_CONTROL->cons_select = 0;
HTS->DMA3_PROD0_BUF_CONTROL->depth = 2;
HTS->DMA3_PROD0_BUF_CONTROL->count_dec = 1;
HTS->DMA3_PROD0_BUF_CONTROL->threshold = 1;
HTS->DMA3_PROD0_COUNT->count_preload = 0;
HTS->DMA3_PROD0_COUNT->count_postload = mf_en;
// Sparse binary map fetch
HTS->DMA4_SCHEDULER_CONTROL->sch_en = 1; // Only if SOF enabled
HTS->DMA4_SCHEDULER_CONTROL->pipeline_num = 0; // Belongs to pipeline 0
HTS->DMA4_SCHEDULER_CONTROL->dma_channel_no = 4; // Assign appropriate DMA channel
HTS->DMA4_HOP->hop = 1;
HTS->DMA4_HOP->hop_thread_count = ImgHeight/2;
HTS->DMA4_PROD0_CONTROL->prod_en = 1;
HTS->DMA4_PROD0_CONTROL->cons_select = 0;
if(mf_en)
{
HTS->DMA4_PROD0_BUF_CONTROL->depth = 2;
}
else
{
HTS->DMA4_PROD0_BUF_CONTROL->depth = 3;
}
HTS->DMA4_PROD0_BUF_CONTROL->count_dec = 1;
HTS->DMA4_PROD0_BUF_CONTROL->threshold = 1;
HTS->DMA4_PROD0_COUNT->count_preload = 0;
HTS->DMA4_PROD0_COUNT->count_postload = mf_en;
// HWA0 Scheduler Programming
HTS->HWA0_SCHEDULER_CONTROL->sch_en = 1; // scheduler enable
HTS->HWA0_SCHEDULER_CONTROL->pipeline_num = 0; // Belongs to pipeline 0
HTS->HWA0_WDTIMER->watchdog_timer_en = 0; //Activate WD
HTS->HWA0_HOP->hop = 0;
HTS->HWA0_BW_LIMITER->BW_limiter_en = 0;
// HWA0 consumer and producer control
HTS->HWA0_CONS0_CONTROL->cons_en = 1; // Enable RFGW Fetch
HTS->HWA0_CONS1_CONTROL->cons_en = 1; // Enable CFGW Fetch
HTS->HWA0_CONS2_CONTROL->cons_en = 0/1; // 1: Only for Base layer if Temporal predictor enabled
HTS->HWA0_CONS3_CONTROL->cons_en = 0/1; // 1: Only if Pyramidal predictor enabled
HTS->HWA0_CONS4_CONTROL->cons_en = 0/1; // 1: Only if SOF enabled
HTS->HWA0_CONS0_CONTROL->prod_select = 0;
HTS->HWA0_CONS1_CONTROL->prod_select = 0;
HTS->HWA0_CONS2_CONTROL->prod_select = 0;
HTS->HWA0_CONS3_CONTROL->prod_select = 0;
HTS->HWA0_CONS4_CONTROL->prod_select = 0;
HTS->HWA0_PROD0_CONTROL->prod_en = 1; // Enable Producer socket
HTS->HWA0_PROD0_CONTROL->cons_select = 0; // Fixed to DMA
HTS->HWA0_PROD0_BUF_CONTROL->depth = 2;
HTS->HWA0_PROD0_BUF_CONTROL->threshold = 1;
HTS->HWA0_PROD0_BUF_CONTROL->count_dec = 1;
HTS->HWA0_PROD0_COUNT->count_preload = 0;
HTS->HWA0_PROD0_COUNT->count_postload = 0;
// Flow vector output
HTS->DMA240_SCHEDULER_CONTROL->sch_en = 1; // scheduler enable
HTS->DMA240_SCHEDULER_CONTROL->pipeline_num = 0; // Belongs to pipeline 0
HTS->DMA240_SCHEDULER_CONTROL->dma_channel_no = 5; // Assign appropriate DMA channel
HTS->DMA240_CONS0_CONTROL->cons_en = 1;
HTS->DMA240_CONS0_CONTROL->prod_select = 0;
// Enable Pipeline
HTS->PIPELINE_CONTROL_0->pipe_en = 1; // Enable DOF pipeline# 0