cframe
Vitis Drivers API Documentation
xcframe.c File Reference

Overview

This file which contains the code related to CFRAME block.

MODIFICATION HISTORY:
Ver   Who  Date        Changes
----- ---- -------- -------------------------------------------------------
1.00  kc   11/10/2017 Initial release
1.01  bsv  05/29/2019 XCframe_ReadReg API added
1.02  bsv  11/06/2019 XCframe_ClearCframeErr API added
1.03  bsv  02/17/2020 XCframe_SafetyWriteReg API added
1.04  bsv  07/15/2021 Fix doxygen warnings
1.5   mss  09/04/2023 Fixed MISRA-C violation 10.1
      mss  09/04/2023 Fixed MISRA-C violation 10.4
      mss  09/04/2023 Fixed MISRA-C violation 7.2
      mss  09/04/2023 Fixed MISRA-C violation 4.6
      mss  09/04/2023 Fixed MISRA-C violation 8.13
      pre  08/22/2024 Added XCframe_GetLastFrameAddr function and modified
                      XCframe_SetReadParam function
Note

Macros

#define XCFRAME_LAST_FRAME_BOT_OFFSET   (0x220U)
 Offset of LAST_FRAME_BOT register. More...
 
#define XCFRAME_MAX_BLKTYPE_IN_FAR_BOT   (4U)
 Maximum value of block type in FAR_BOT register. More...
 
#define XCFRAME_FAR_TOP_OFFSET_WRT_BOT   (0x10U)
 Offset of CFRAME_FAR_TOP regiter w.r.t CFRAME_FAR_BOT. More...
 
#define XCFRAME_128BIT_IN_WORDS   (4U)
 Size of 128bit in words. More...
 
#define XCFRAME_BLKTYPE0_MASK   (0xFFFFFU)
 Mask to read blocktype 0 values. More...
 
#define XCFRAME_BLKTYPE1_WORD0_SHIFT   (20U)
 Shift value to read blocktype1 value from word0. More...
 
#define XCFRAME_BLKTYPE1_WORD0_MASK   (0xFFFU)
 Mask to read blocktype1 value from word0. More...
 
#define XCFRAME_BLKTYPE1_WORD1_SHIFT   (12U)
 Shift value to read blocktype1 value from word1. More...
 
#define XCFRAME_BLKTYPE1_WORD1_MASK   (0xFFU)
 Mask to read blocktype1 value from word1. More...
 
#define XCFRAME_BLKTYPE2_WORD1_SHIFT   (8U)
 Shift value to read blocktype2 value from word1. More...
 
#define XCFRAME_BLKTYPE2_WORD1_MASK   (0xFFFFFU)
 Mask to read blocktype1 value from word1. More...
 
#define XCFRAME_BLKTYPE3_WORD1_SHIFT   (28U)
 Shift value to read blocktype3 value from word1. More...
 
#define XCFRAME_BLKTYPE3_WORD1_MASK   (0xFU)
 Mask to read blocktype3 value from word1. More...
 
#define XCFRAME_BLKTYPE3_WORD2_SHIFT   (4U)
 Shift value to read blocktype3 value from word2. More...
 
#define XCFRAME_BLKTYPE3_WORD2_MASK   (0xFFFFU)
 Mask to read blocktype3 value from word2. More...
 
#define XCFRAME_WORD0_OFFSET   (0U)
 Offset of word0. More...
 
#define XCFRAME_WORD1_OFFSET   (1U)
 Offset of word1. More...
 
#define XCFRAME_WORD2_OFFSET   (2U)
 Offset of word2. More...
 

Enumerations

enum  XCframe_Blktype {
  BLOCKTYPE0 = 0, BLOCKTYPE1, BLOCKTYPE2, BLOCKTYPE3,
  BLOCKTYPE4, BLOCKTYPE5, BLOCKTYPE6
}
 

Functions

s32 XCframe_CfgInitialize (XCframe *InstancePtr, const XCframe_Config *CfgPtr, u32 EffectiveAddr)
 This function initializes an CFRAME core. More...
 
void XCframe_WriteReg (const XCframe *InstancePtr, u32 AddrOffset, XCframe_FrameNo FrameNo, const Xuint128 *Val)
 This function writes to 128 bit CFRAME register. More...
 
void XCframe_ReadReg (const XCframe *InstancePtr, u32 AddrOffset, XCframe_FrameNo FrameNo, u32 *ValPtr)
 This function reads the 128 bit CFRAME register. More...
 
s32 XCframe_SafetyWriteReg (const XCframe *InstancePtr, u32 AddrOffset, XCframe_FrameNo FrameNo, const Xuint128 *Val)
 This function writes to 128 bit CFRAME register and reads it back to validate the write operation. More...
 
void XCframe_WriteCmd (const XCframe *InstancePtr, XCframe_FrameNo CframeNo, u32 Cmd)
 This function writes the value to CFRAME cmd register. More...
 
void XCframe_VggTrim (const XCframe *InstancePtr, const Xuint128 *TrimVal)
 This function writes the VGG TRIM value. More...
 
void XCframe_CramTrim (const XCframe *InstancePtr, u32 TrimValue)
 This function writes the CRAM TRIM value. More...
 
void XCframe_BramTrim (const XCframe *InstancePtr, u32 TrimValue)
 This function writes the BRAM TRIM value. More...
 
void XCframe_UramTrim (const XCframe *InstancePtr, u32 TrimValue)
 This function writes the BRAM TRIM value. More...
 
void XCframe_SetReadParam (const XCframe *InstancePtr, XCframe_FrameNo CframeNo, u32 CframeLen, u32 FrameAddr)
 This function sets the CFRAME read parameters with mentioned CFRAME length and frame number. More...
 
void XCframe_ClearCframeErr (const XCframe *InstancePtr)
 This function clears CFRAME ISRs and is called as part of CFRAME error recovery. More...
 
u32 XCframe_GetLastFrameAddr (XCframe *InstancePtr, u32 BlockType, XCframe_FrameNo CframeNo)
 This function returns the last Cframe address of given cframeno and blocktype. More...
 

Macro Definition Documentation

#define XCFRAME_128BIT_IN_WORDS   (4U)

Size of 128bit in words.

#define XCFRAME_BLKTYPE0_MASK   (0xFFFFFU)

Mask to read blocktype 0 values.

#define XCFRAME_BLKTYPE1_WORD0_MASK   (0xFFFU)

Mask to read blocktype1 value from word0.

#define XCFRAME_BLKTYPE1_WORD0_SHIFT   (20U)

Shift value to read blocktype1 value from word0.

#define XCFRAME_BLKTYPE1_WORD1_MASK   (0xFFU)

Mask to read blocktype1 value from word1.

#define XCFRAME_BLKTYPE1_WORD1_SHIFT   (12U)

Shift value to read blocktype1 value from word1.

#define XCFRAME_BLKTYPE2_WORD1_MASK   (0xFFFFFU)

Mask to read blocktype1 value from word1.

#define XCFRAME_BLKTYPE2_WORD1_SHIFT   (8U)

Shift value to read blocktype2 value from word1.

#define XCFRAME_BLKTYPE3_WORD1_MASK   (0xFU)

Mask to read blocktype3 value from word1.

#define XCFRAME_BLKTYPE3_WORD1_SHIFT   (28U)

Shift value to read blocktype3 value from word1.

#define XCFRAME_BLKTYPE3_WORD2_MASK   (0xFFFFU)

Mask to read blocktype3 value from word2.

#define XCFRAME_BLKTYPE3_WORD2_SHIFT   (4U)

Shift value to read blocktype3 value from word2.

#define XCFRAME_FAR_TOP_OFFSET_WRT_BOT   (0x10U)

Offset of CFRAME_FAR_TOP regiter w.r.t CFRAME_FAR_BOT.

#define XCFRAME_LAST_FRAME_BOT_OFFSET   (0x220U)

Offset of LAST_FRAME_BOT register.

#define XCFRAME_MAX_BLKTYPE_IN_FAR_BOT   (4U)

Maximum value of block type in FAR_BOT register.

#define XCFRAME_WORD0_OFFSET   (0U)

Offset of word0.

#define XCFRAME_WORD1_OFFSET   (1U)

Offset of word1.

#define XCFRAME_WORD2_OFFSET   (2U)

Offset of word2.

Enumeration Type Documentation

Enumerator
BLOCKTYPE0 

Blocktype - 0.

BLOCKTYPE1 

Blocktype - 1.

BLOCKTYPE2 

Blocktype - 2.

BLOCKTYPE3 

Blocktype - 3.

BLOCKTYPE4 

Blocktype - 4.

BLOCKTYPE5 

Blocktype - 5.

BLOCKTYPE6 

Blocktype - 6.

Function Documentation

void XCframe_BramTrim ( const XCframe InstancePtr,
u32  TrimValue 
)

This function writes the BRAM TRIM value.

Parameters
InstancePtris a pointer to the XCframe instance.
TrimValueis to hold BRAM TRIM value
Returns
None
s32 XCframe_CfgInitialize ( XCframe InstancePtr,
const XCframe_Config CfgPtr,
u32  EffectiveAddr 
)

This function initializes an CFRAME core.

This function must be called prior to using an CFRAME driver.

Parameters
InstancePtris a pointer to the XCframe instance.
CfgPtris a reference to a structure containing information about a specific XCframe instance.
EffectiveAddris the device base address in the virtual memory address space. The caller is responsible for keeping the address mapping from EffectiveAddr to the device physical base address unchanged once this function is invoked. Unexpected errors may occur if the address mapping changes after this function is called. If address translation is not used, pass in the physical address instead.
Returns
  • XST_SUCCESS if initialization was successful.
Note
None.
void XCframe_ClearCframeErr ( const XCframe InstancePtr)

This function clears CFRAME ISRs and is called as part of CFRAME error recovery.

Parameters
InstancePtris a pointer to the XCframe instance
Returns
None
void XCframe_CramTrim ( const XCframe InstancePtr,
u32  TrimValue 
)

This function writes the CRAM TRIM value.

Parameters
InstancePtris a pointer to the XCframe instance.
TrimValueis to hold CRAM TRIM value
Returns
None
u32 XCframe_GetLastFrameAddr ( XCframe InstancePtr,
u32  BlockType,
XCframe_FrameNo  CframeNo 
)

This function returns the last Cframe address of given cframeno and blocktype.

Parameters
InstancePtris a pointer to the XCframe instance
BlockTypeis block type
CframeNois the index of cframe
Returns
Last Frame Address
void XCframe_ReadReg ( const XCframe InstancePtr,
u32  AddrOffset,
XCframe_FrameNo  FrameNo,
u32 *  ValPtr 
)

This function reads the 128 bit CFRAME register.

Parameters
InstancePtris a pointer to the XCframe instance.
AddrOffsetis offset of the Cframe register
FrameNois the index of frame
ValPtr128 bit variable to store the read data
Returns
None
s32 XCframe_SafetyWriteReg ( const XCframe InstancePtr,
u32  AddrOffset,
XCframe_FrameNo  FrameNo,
const Xuint128 *  Val 
)

This function writes to 128 bit CFRAME register and reads it back to validate the write operation.

Parameters
InstancePtris a pointer to the XCframe instance.
AddrOffsetis offset of the Cframe register
FrameNois the index of frame
Valis pointer to the value to be written
Returns
Success or Failure
void XCframe_SetReadParam ( const XCframe InstancePtr,
XCframe_FrameNo  CframeNo,
u32  CframeLen,
u32  FrameAddr 
)

This function sets the CFRAME read parameters with mentioned CFRAME length and frame number.

Parameters
InstancePtris a pointer to the XCframe instance.
CframeNois the index of frame
CframeLenis total length of Cframes
FrameAddris frame address
Returns
None
void XCframe_UramTrim ( const XCframe InstancePtr,
u32  TrimValue 
)

This function writes the BRAM TRIM value.

Parameters
InstancePtris a pointer to the XCframe instance.
TrimValueis to hold URAM TRIM value
Returns
None
void XCframe_VggTrim ( const XCframe InstancePtr,
const Xuint128 *  TrimVal 
)

This function writes the VGG TRIM value.

Parameters
InstancePtris a pointer to the XCframe instance.
TrimValis pointer to the TRIM value
Returns
None
void XCframe_WriteCmd ( const XCframe InstancePtr,
XCframe_FrameNo  CframeNo,
u32  Cmd 
)

This function writes the value to CFRAME cmd register.

Parameters
InstancePtris a pointer to the XCframe instance.
CframeNois the index of frame
Cmdto be initiated by CFRAME block
Returns
None
void XCframe_WriteReg ( const XCframe InstancePtr,
u32  AddrOffset,
XCframe_FrameNo  FrameNo,
const Xuint128 *  Val 
)

This function writes to 128 bit CFRAME register.

Parameters
InstancePtris a pointer to the XCframe instance.
AddrOffsetis offset of the Cframe register
FrameNois the index of frame
Valis pointer to the value to be written
Returns
None