XilinxProcessorIPLib/drivers/v_vscaler/src/xv_vscaler_l2.c
void XV_VScalerDbgReportStatus(XV_Vscaler_l2 *InstancePtr)
{
  XV_vscaler *VscPtr = &InstancePtr->Vsc;
  u32 done, idle, ready, ctrl;
  u32 widthin, heightin, heightout, linerate, cformat;
  u32 taps, phases, i, j;
  UINTPTR baseAddr;
  u16 allow420;
  int val;
  const char *ScalerTypeStr[] = {"Bilinear", "Bicubic", "Polyphase"};

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

  xil_printf("\r\n\r\n----->V SCALER IP STATUS<----\r\n");
  done  = XV_vscaler_IsDone(VscPtr);
  idle  = XV_vscaler_IsIdle(VscPtr);
  ready = XV_vscaler_IsReady(VscPtr);
  ctrl =  XV_vscaler_ReadReg(VscPtr->Config.BaseAddress, XV_VSCALER_CTRL_ADDR_AP_CTRL);

  heightin  = XV_vscaler_Get_HwReg_HeightIn(VscPtr);
  widthin   = XV_vscaler_Get_HwReg_Width(VscPtr);
  heightout = XV_vscaler_Get_HwReg_HeightOut(VscPtr);
  linerate  = XV_vscaler_Get_HwReg_LineRate(VscPtr);
  cformat   = XV_vscaler_Get_HwReg_ColorMode(VscPtr);
  allow420  = XV_VscalerIs420Enabled(InstancePtr);

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

  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(VscPtr->Config.ScalerType <= XV_VSCALER_POLYPHASE)
  {
    xil_printf("Scaler Type:     %s\r\n",ScalerTypeStr[VscPtr->Config.ScalerType]);
  }
  else
  {
    xil_printf("Scaler Type:     Unknown\r\n");
  }
  xil_printf("Input Width:      %d\r\n",widthin);
  xil_printf("Input Height:     %d\r\n",heightin);
  xil_printf("Output Height:    %d\r\n",heightout);
  xil_printf("4:2:0 processing: %s\r\n", allow420?"Enabled":"Disabled");
  xil_printf("Color Format:     %s\r\n",
		  XVidC_GetColorFormatStr((XVidC_ColorFormat)cformat));
  xil_printf("Line Rate:        %d\r\n",linerate);
  xil_printf("Num Phases:       %d\r\n",phases);

  if(VscPtr->Config.ScalerType == XV_VSCALER_POLYPHASE)
  {
    short lsb, msb;

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

    baseAddr = XV_vscaler_Get_HwReg_vfltCoeff_BaseAddress(VscPtr);
    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 & XVSC_MASK_LOW_16BITS);
        msb = (short)((val & XVSC_MASK_HIGH_16BITS)>>16);

        xil_printf("%5d %5d ", lsb, msb);
      }
    }
  }
}
/*****************************************************************************/
/**
*
* This function prints V Scaler status on the console
*
* @param	InstancePtr is the instance pointer to the core instance.
*
* @return	None
*
******************************************************************************/
This function prints V Scaler status on the console
This function prints V Scaler status on the console
void XV_VScalerDbgReportStatus(XV_Vscaler_l2 *InstancePtr)
{
  XV_vscaler *VscPtr = &InstancePtr->Vsc;
  u32 done, idle, ready, ctrl;
  u32 widthin, heightin, heightout, linerate, cformat;
  u32 taps, phases, i, j;
  UINTPTR baseAddr;
  u16 allow420;
  int val;
  const char *ScalerTypeStr[] = {"Bilinear", "Bicubic", "Polyphase"};
  Xil_AssertVoid(InstancePtr != NULL);
  xil_printf("\r\n\r\n----->V SCALER IP STATUS<----\r\n");
  done  = XV_vscaler_IsDone(VscPtr);
  idle  = XV_vscaler_IsIdle(VscPtr);
  ready = XV_vscaler_IsReady(VscPtr);
  ctrl =  XV_vscaler_ReadReg(VscPtr->Config.BaseAddress, XV_VSCALER_CTRL_ADDR_AP_CTRL);
  heightin  = XV_vscaler_Get_HwReg_HeightIn(VscPtr);
  widthin   = XV_vscaler_Get_HwReg_Width(VscPtr);
  heightout = XV_vscaler_Get_HwReg_HeightOut(VscPtr);
  linerate  = XV_vscaler_Get_HwReg_LineRate(VscPtr);
  cformat   = XV_vscaler_Get_HwReg_ColorMode(VscPtr);
  allow420  = XV_VscalerIs420Enabled(InstancePtr);
  taps   = VscPtr->Config.NumTaps/2;
  phases = (1<<VscPtr->Config.PhaseShift);
  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(VscPtr->Config.ScalerType <= XV_VSCALER_POLYPHASE)
  {
    xil_printf("Scaler Type:     %s\r\n",ScalerTypeStr[VscPtr->Config.ScalerType]);
  }
  else
  {
    xil_printf("Scaler Type:     Unknown\r\n");
  }
  xil_printf("Input Width:      %d\r\n",widthin);
  xil_printf("Input Height:     %d\r\n",heightin);
  xil_printf("Output Height:    %d\r\n",heightout);
  xil_printf("4:2:0 processing: %s\r\n", allow420?"Enabled":"Disabled");
  xil_printf("Color Format:     %s\r\n",
		  XVidC_GetColorFormatStr((XVidC_ColorFormat)cformat));
  xil_printf("Line Rate:        %d\r\n",linerate);
  xil_printf("Num Phases:       %d\r\n",phases);
  if(VscPtr->Config.ScalerType == XV_VSCALER_POLYPHASE)
  {
    short lsb, msb;
    xil_printf("Num Taps:        %d\r\n",taps*2);
    xil_printf("\r\nCoefficients:");
    baseAddr = XV_vscaler_Get_HwReg_vfltCoeff_BaseAddress(VscPtr);
    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 & XVSC_MASK_LOW_16BITS);
        msb = (short)((val & XVSC_MASK_HIGH_16BITS)>>16);
        xil_printf("%5d %5d ", lsb, msb);
      }
    }
  }
}
void XV_VScalerDbgReportStatus ( XV_Vscaler_l2 * InstancePtr ) { XV_vscaler * VscPtr = & InstancePtr -> Vsc ; u32 done , idle , ready , ctrl ; u32 widthin , heightin , heightout , linerate , cformat ; u32 taps , phases , i , j ; UINTPTR baseAddr ; u16 allow420 ; int val ; const char * ScalerTypeStr [ ] = { " " , " " , " " } ; Xil_AssertVoid ( InstancePtr != NULL ) ; xil_printf ( " \r \n \r \n \r \n " ) ; done = XV_vscaler_IsDone ( VscPtr ) ; idle = XV_vscaler_IsIdle ( VscPtr ) ; ready = XV_vscaler_IsReady ( VscPtr ) ; ctrl = XV_vscaler_ReadReg ( VscPtr -> Config . BaseAddress , XV_VSCALER_CTRL_ADDR_AP_CTRL ) ; heightin = XV_vscaler_Get_HwReg_HeightIn ( VscPtr ) ; widthin = XV_vscaler_Get_HwReg_Width ( VscPtr ) ; heightout = XV_vscaler_Get_HwReg_HeightOut ( VscPtr ) ; linerate = XV_vscaler_Get_HwReg_LineRate ( VscPtr ) ; cformat = XV_vscaler_Get_HwReg_ColorMode ( VscPtr ) ; allow420 = XV_VscalerIs420Enabled ( InstancePtr ) ; taps = VscPtr -> Config . NumTaps / 2 ; phases = ( 1 << VscPtr -> Config . PhaseShift ) ; xil_printf ( " \r \n " , done ) ; xil_printf ( " \r \n " , idle ) ; xil_printf ( " \r \n " , ready ) ; xil_printf ( " \r \n \r \n " , ctrl ) ; if ( VscPtr -> Config . ScalerType <= XV_VSCALER_POLYPHASE ) { xil_printf ( " \r \n " , ScalerTypeStr [ VscPtr -> Config . ScalerType ] ) ; } else { xil_printf ( " \r \n " ) ; } xil_printf ( " \r \n " , widthin ) ; xil_printf ( " \r \n " , heightin ) ; xil_printf ( " \r \n " , heightout ) ; xil_printf ( " \r \n " , allow420 ? " " : " " ) ; xil_printf ( " \r \n " , XVidC_GetColorFormatStr ( ( XVidC_ColorFormat ) cformat ) ) ; xil_printf ( " \r \n " , linerate ) ; xil_printf ( " \r \n " , phases ) ; if ( VscPtr -> Config . ScalerType == XV_VSCALER_POLYPHASE ) { short lsb , msb ; xil_printf ( " \r \n " , taps * 2 ) ; xil_printf ( " \r \n " ) ; baseAddr = XV_vscaler_Get_HwReg_vfltCoeff_BaseAddress ( VscPtr ) ; 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 & XVSC_MASK_LOW_16BITS ) ; msb = ( short ) ( ( val & XVSC_MASK_HIGH_16BITS ) >> 16 ) ; xil_printf ( " " , lsb , msb ) ; } } } }
This function prints V Scaler status on the console
This function prints V Scaler status on the console
/*
   * Assert validates the input arguments
   */ //coefficients are 12-bits