XilinxProcessorIPLib/drivers/prc/src/xprc.c
static u32 XPrc_GetRegisterOffset(XPrc *InstancePtr, u32 VsmId, u8 BankId,
			u8 TableInBank, u8 TableRow)
{
	u32 Offset = 0;

	if (InstancePtr != NULL) {
		Offset = VsmId << XPrc_GetRegVsmLsb(InstancePtr);
		Offset += BankId << XPrc_GetRegBankLsb(InstancePtr);
		Offset += TableRow << (XPrc_GetRegSelectLsb(InstancePtr) +
			XPrc_GetOffsetForTableType(BankId));
		Offset += TableInBank << XPrc_GetRegSelectLsb(InstancePtr);
	}

	return Offset;
}
/*****************************************************************************/
/**
*
* This function used to build the offset address for a register in a VSM.
* The register addresses are encoded as follows:
* [VSM Selector] [Bank Selector] [Row in the table][table][00]
*
* VSM Selector : The ID of the VSM.  0 = VSM0, 1 = VSM1, etc
* Table Selector : There are 4 tables of registers in each VSM. 3 are
*		   implemented as LUTRAM and 1 is just implemented using flops.
*			1. General Registers (Flops)
*			2. Trigger to RM Mapping Table (LUTRAM)
*			3. RM Information Table (LUTRAM)
*			4. BS Information Table (LUTRAM)
*
* Row in the table : This is the address of the register within the table.
*
* Table : The RM and BS banks implement several types of registers, each
*	  using its own LUTRAM table. This field specifies which LUTRAM
*	  to access.
*
* @param	InstancePtr is a pointer to the PRC instance.
* @param	VsmId is the identifier of the VSM to access.
* @param	BankId is an identifier to represent the bank of registers to
*		access.
* @param	TableInBank is the table within the bank register.
* @param	TableRow is the address of the register within the table.
*
* @return	Offset of the register.
*
* @note		None.
*
******************************************************************************/
This function used to build the offset address for a register in a VSM.
The register addresses are encoded as follows:
[VSM Selector] [Bank Selector] [Row in the table][table][00]

VSM Selector : The ID of the VSM.  0 = VSM0, 1 = VSM1, etc
Table Selector : There are 4 tables of registers in each VSM. 3 are
implemented as LUTRAM and 1 is just implemented using flops.
1. General Registers (Flops)
2. Trigger to RM Mapping Table (LUTRAM)
3. RM Information Table (LUTRAM)
4. BS Information Table (LUTRAM)

Row in the table : This is the address of the register within the table.

Table : The RM and BS banks implement several types of registers, each
using its own LUTRAM table. This field specifies which LUTRAM
to access.
This function used to build the offset address for a register in a VSM . The register addresses are encoded as follows : [ VSM Selector ] [ Bank Selector ] [ Row in the table ] [ table ] [ 00 ] VSM Selector : The ID of the VSM . 0 = VSM0 1 = VSM1 etc Table Selector : There are 4 tables of registers in each VSM . 3 are implemented as LUTRAM and 1 is just implemented using flops . 1 . General Registers ( Flops ) 2 . Trigger to RM Mapping Table ( LUTRAM ) 3 . RM Information Table ( LUTRAM ) 4 . BS Information Table ( LUTRAM ) Row in the table : This is the address of the register within the table . Table : The RM and BS banks implement several types of registers each using its own LUTRAM table . This field specifies which LUTRAM to access .
static u32 XPrc_GetRegisterOffset(XPrc *InstancePtr, u32 VsmId, u8 BankId,
			u8 TableInBank, u8 TableRow)
{
	u32 Offset = 0;
	if (InstancePtr != NULL) {
		Offset = VsmId << XPrc_GetRegVsmLsb(InstancePtr);
		Offset += BankId << XPrc_GetRegBankLsb(InstancePtr);
		Offset += TableRow << (XPrc_GetRegSelectLsb(InstancePtr) +
			XPrc_GetOffsetForTableType(BankId));
		Offset += TableInBank << XPrc_GetRegSelectLsb(InstancePtr);
	}
	return Offset;
}
static u32 XPrc_GetRegisterOffset ( XPrc * InstancePtr , u32 VsmId , u8 BankId , u8 TableInBank , u8 TableRow ) { u32 Offset = 0 ; if ( InstancePtr != NULL ) { Offset = VsmId << XPrc_GetRegVsmLsb ( InstancePtr ) ; Offset += BankId << XPrc_GetRegBankLsb ( InstancePtr ) ; Offset += TableRow << ( XPrc_GetRegSelectLsb ( InstancePtr ) + XPrc_GetOffsetForTableType ( BankId ) ) ; Offset += TableInBank << XPrc_GetRegSelectLsb ( InstancePtr ) ; } return Offset ; }
This function used to build the offset address for a register in a VSM.
This function used to build the offset address for a register in a VSM .