XilinxProcessorIPLib/drivers/v_hscaler/src/xv_hscaler_l2.c
void XV_HScalerDbgReportStatus(XV_Hscaler_l2 *InstancePtr)
{
  XV_hscaler *HscPtr = &InstancePtr->Hsc;
  u32 done, idle, ready, ctrl;
  u32 widthin, widthout, height, pixrate, cformatin, cformatOut;
  u16 allow422, allow420, allowCsc;
  u32 taps, phases, i, j;
  UINTPTR baseAddr;
  int val;
  const char *ScalerTypeStr[] = {"Bilinear", "Bicubic", "Polyphase"};

  /*
   * Assert validates the input arguments
   */
  Xil_AssertVoid(InstancePtr != NULL);

  done  = XV_hscaler_IsDone(HscPtr);
  idle  = XV_hscaler_IsIdle(HscPtr);
  ready = XV_hscaler_IsReady(HscPtr);
  ctrl =  XV_hscaler_ReadReg(HscPtr->Config.BaseAddress, XV_HSCALER_CTRL_ADDR_AP_CTRL);

  height     = XV_hscaler_Get_HwReg_Height(HscPtr);
  widthin    = XV_hscaler_Get_HwReg_WidthIn(HscPtr);
  widthout   = XV_hscaler_Get_HwReg_WidthOut(HscPtr);
  cformatin  = XV_hscaler_Get_HwReg_ColorMode(HscPtr);
  cformatOut = XV_hscaler_Get_HwReg_ColorModeOut(HscPtr);
  pixrate    = XV_hscaler_Get_HwReg_PixelRate(HscPtr);
  allow422   = XV_HscalerIs422Enabled(InstancePtr);
  allow420   = XV_HscalerIs420Enabled(InstancePtr);
  allowCsc   = XV_HscalerIsCscEnabled(InstancePtr);

  taps   = HscPtr->Config.NumTaps/2;
  phases = (1<<HscPtr->Config.PhaseShift);

  xil_printf("\r\n\r\n----->H SCALER IP STATUS<----\r\n");
  xil_printf("IsDone:  %d\r\n", done);
  xil_printf("IsIdle:  %d\r\n", idle);
  xil_printf("IsReady: %d\r\n", ready);
  xil_printf("Ctrl:    0x%x\r\n\r\n", ctrl);

  if(HscPtr->Config.ScalerType <= XV_HSCALER_POLYPHASE) {
    xil_printf("Scaler Type:        %s\r\n",
      ScalerTypeStr[HscPtr->Config.ScalerType]);
  } else {
    xil_printf("Scaler Type:        Unknown\r\n");
  }
  xil_printf("Input&Output Height:    %d\r\n",height);
  xil_printf("Input Width:            %d\r\n",widthin);
  xil_printf("Output Width:           %d\r\n\r\n",widthout);

  xil_printf("4:2:2 processing:       %s\r\n", allow422?"Enabled":"Disabled");
  xil_printf("4:2:0 processing:       %s\r\n", allow420?"Enabled":"Disabled");
  xil_printf("Color space conversion: %s\r\n", allowCsc?"Enabled":"Disabled");
  xil_printf("Input Color Format:     %s\r\n",
		  XVidC_GetColorFormatStr((XVidC_ColorFormat)cformatin));
  xil_printf("Output Color Format:    %s\r\n",
		  XVidC_GetColorFormatStr((XVidC_ColorFormat)cformatOut));
  xil_printf("Pixel Rate:             %d\r\n\r\n",pixrate);

  xil_printf("Num Phases:          %d\r\n",phases);
  if(HscPtr->Config.ScalerType == XV_HSCALER_POLYPHASE)
  {
    short lsb, msb;

    xil_printf("Num Taps:            %d\r\n",taps*2);
    xil_printf("\r\nCoefficients:");

    baseAddr = XV_hscaler_Get_HwReg_hfltCoeff_BaseAddress(HscPtr);
    for(i = 0; i < phases; i++)
    {
      xil_printf("\r\nPhase %2d: ",i);
      for(j=0; j< taps; j++)
      {
        val = Xil_In32(baseAddr+((i*taps+j)*4));

        //coefficients are 12-bits
        lsb = (short)(val & XHSC_MASK_LOW_16BITS);
        msb = (short)((val & XHSC_MASK_HIGH_16BITS)>>16);

        xil_printf("%5d %5d ", lsb, msb);
      }
    }
  }
}
/*****************************************************************************/
/**
*
* This function prints H Scaler status on the console
*
* @param	InstancePtr is the instance pointer to the core instance.
*
* @return	None
*
******************************************************************************/
This function prints H Scaler status on the console
This function prints H Scaler status on the console
void XV_HScalerDbgReportStatus(XV_Hscaler_l2 *InstancePtr)
{
  XV_hscaler *HscPtr = &InstancePtr->Hsc;
  u32 done, idle, ready, ctrl;
  u32 widthin, widthout, height, pixrate, cformatin, cformatOut;
  u16 allow422, allow420, allowCsc;
  u32 taps, phases, i, j;
  UINTPTR baseAddr;
  int val;
  const char *ScalerTypeStr[] = {"Bilinear", "Bicubic", "Polyphase"};
  Xil_AssertVoid(InstancePtr != NULL);
  done  = XV_hscaler_IsDone(HscPtr);
  idle  = XV_hscaler_IsIdle(HscPtr);
  ready = XV_hscaler_IsReady(HscPtr);
  ctrl =  XV_hscaler_ReadReg(HscPtr->Config.BaseAddress, XV_HSCALER_CTRL_ADDR_AP_CTRL);
  height     = XV_hscaler_Get_HwReg_Height(HscPtr);
  widthin    = XV_hscaler_Get_HwReg_WidthIn(HscPtr);
  widthout   = XV_hscaler_Get_HwReg_WidthOut(HscPtr);
  cformatin  = XV_hscaler_Get_HwReg_ColorMode(HscPtr);
  cformatOut = XV_hscaler_Get_HwReg_ColorModeOut(HscPtr);
  pixrate    = XV_hscaler_Get_HwReg_PixelRate(HscPtr);
  allow422   = XV_HscalerIs422Enabled(InstancePtr);
  allow420   = XV_HscalerIs420Enabled(InstancePtr);
  allowCsc   = XV_HscalerIsCscEnabled(InstancePtr);
  taps   = HscPtr->Config.NumTaps/2;
  phases = (1<<HscPtr->Config.PhaseShift);
  xil_printf("\r\n\r\n----->H SCALER IP STATUS<----\r\n");
  xil_printf("IsDone:  %d\r\n", done);
  xil_printf("IsIdle:  %d\r\n", idle);
  xil_printf("IsReady: %d\r\n", ready);
  xil_printf("Ctrl:    0x%x\r\n\r\n", ctrl);
  if(HscPtr->Config.ScalerType <= XV_HSCALER_POLYPHASE) {
    xil_printf("Scaler Type:        %s\r\n",
      ScalerTypeStr[HscPtr->Config.ScalerType]);
  } else {
    xil_printf("Scaler Type:        Unknown\r\n");
  }
  xil_printf("Input&Output Height:    %d\r\n",height);
  xil_printf("Input Width:            %d\r\n",widthin);
  xil_printf("Output Width:           %d\r\n\r\n",widthout);
  xil_printf("4:2:2 processing:       %s\r\n", allow422?"Enabled":"Disabled");
  xil_printf("4:2:0 processing:       %s\r\n", allow420?"Enabled":"Disabled");
  xil_printf("Color space conversion: %s\r\n", allowCsc?"Enabled":"Disabled");
  xil_printf("Input Color Format:     %s\r\n",
		  XVidC_GetColorFormatStr((XVidC_ColorFormat)cformatin));
  xil_printf("Output Color Format:    %s\r\n",
		  XVidC_GetColorFormatStr((XVidC_ColorFormat)cformatOut));
  xil_printf("Pixel Rate:             %d\r\n\r\n",pixrate);
  xil_printf("Num Phases:          %d\r\n",phases);
  if(HscPtr->Config.ScalerType == XV_HSCALER_POLYPHASE)
  {
    short lsb, msb;
    xil_printf("Num Taps:            %d\r\n",taps*2);
    xil_printf("\r\nCoefficients:");
    baseAddr = XV_hscaler_Get_HwReg_hfltCoeff_BaseAddress(HscPtr);
    for(i = 0; i < phases; i++)
    {
      xil_printf("\r\nPhase %2d: ",i);
      for(j=0; j< taps; j++)
      {
        val = Xil_In32(baseAddr+((i*taps+j)*4));
        lsb = (short)(val & XHSC_MASK_LOW_16BITS);
        msb = (short)((val & XHSC_MASK_HIGH_16BITS)>>16);
        xil_printf("%5d %5d ", lsb, msb);
      }
    }
  }
}
void XV_HScalerDbgReportStatus ( XV_Hscaler_l2 * InstancePtr ) { XV_hscaler * HscPtr = & InstancePtr -> Hsc ; u32 done , idle , ready , ctrl ; u32 widthin , widthout , height , pixrate , cformatin , cformatOut ; u16 allow422 , allow420 , allowCsc ; u32 taps , phases , i , j ; UINTPTR baseAddr ; int val ; const char * ScalerTypeStr [ ] = { " " , " " , " " } ; Xil_AssertVoid ( InstancePtr != NULL ) ; done = XV_hscaler_IsDone ( HscPtr ) ; idle = XV_hscaler_IsIdle ( HscPtr ) ; ready = XV_hscaler_IsReady ( HscPtr ) ; ctrl = XV_hscaler_ReadReg ( HscPtr -> Config . BaseAddress , XV_HSCALER_CTRL_ADDR_AP_CTRL ) ; height = XV_hscaler_Get_HwReg_Height ( HscPtr ) ; widthin = XV_hscaler_Get_HwReg_WidthIn ( HscPtr ) ; widthout = XV_hscaler_Get_HwReg_WidthOut ( HscPtr ) ; cformatin = XV_hscaler_Get_HwReg_ColorMode ( HscPtr ) ; cformatOut = XV_hscaler_Get_HwReg_ColorModeOut ( HscPtr ) ; pixrate = XV_hscaler_Get_HwReg_PixelRate ( HscPtr ) ; allow422 = XV_HscalerIs422Enabled ( InstancePtr ) ; allow420 = XV_HscalerIs420Enabled ( InstancePtr ) ; allowCsc = XV_HscalerIsCscEnabled ( InstancePtr ) ; taps = HscPtr -> Config . NumTaps / 2 ; phases = ( 1 << HscPtr -> Config . PhaseShift ) ; xil_printf ( " \r \n \r \n \r \n " ) ; xil_printf ( " \r \n " , done ) ; xil_printf ( " \r \n " , idle ) ; xil_printf ( " \r \n " , ready ) ; xil_printf ( " \r \n \r \n " , ctrl ) ; if ( HscPtr -> Config . ScalerType <= XV_HSCALER_POLYPHASE ) { xil_printf ( " \r \n " , ScalerTypeStr [ HscPtr -> Config . ScalerType ] ) ; } else { xil_printf ( " \r \n " ) ; } xil_printf ( " \r \n " , height ) ; xil_printf ( " \r \n " , widthin ) ; xil_printf ( " \r \n \r \n " , widthout ) ; xil_printf ( " \r \n " , allow422 ? " " : " " ) ; xil_printf ( " \r \n " , allow420 ? " " : " " ) ; xil_printf ( " \r \n " , allowCsc ? " " : " " ) ; xil_printf ( " \r \n " , XVidC_GetColorFormatStr ( ( XVidC_ColorFormat ) cformatin ) ) ; xil_printf ( " \r \n " , XVidC_GetColorFormatStr ( ( XVidC_ColorFormat ) cformatOut ) ) ; xil_printf ( " \r \n \r \n " , pixrate ) ; xil_printf ( " \r \n " , phases ) ; if ( HscPtr -> Config . ScalerType == XV_HSCALER_POLYPHASE ) { short lsb , msb ; xil_printf ( " \r \n " , taps * 2 ) ; xil_printf ( " \r \n " ) ; baseAddr = XV_hscaler_Get_HwReg_hfltCoeff_BaseAddress ( HscPtr ) ; for ( i = 0 ; i < phases ; i ++ ) { xil_printf ( " \r \n " , i ) ; for ( j = 0 ; j < taps ; j ++ ) { val = Xil_In32 ( baseAddr + ( ( i * taps + j ) * 4 ) ) ; lsb = ( short ) ( val & XHSC_MASK_LOW_16BITS ) ; msb = ( short ) ( ( val & XHSC_MASK_HIGH_16BITS ) >> 16 ) ; xil_printf ( " " , lsb , msb ) ; } } } }
This function prints H Scaler status on the console
This function prints H Scaler status on the console
/*
   * Assert validates the input arguments
   */ //coefficients are 12-bits