### Xilinx Processor IP Library

<hl>Software Drivers</hl>

Main Page | Data Structures | File List | Data Fields | Globals

# xmpmc.h File Reference

## Detailed Description

## Data Structures

struct | XMpmc_Config
struct | XMpmc_Stats
struct | XMpmc

## Indexes for the different ports in MPMC.

#define | XMPMC_PM_PORT0
#define | XMPMC_PM_PORT1
#define | XMPMC_PM_PORT2
#define | XMPMC_PM_PORT3
#define | XMPMC_PM_PORT4
#define | XMPMC_PM_PORT5
#define | XMPMC_PM_PORT6
#define | XMPMC_PM_PORT7

## Functions

int | XMpmc_CfgInitialize (XMpmc *InstancePtr, XMpmc_Config *ConfigPtr, u32 EffectiveAddr)
void | XMpmc_EnableEcc (XMpmc *InstancePtr)
void | XMpmc_DisableEcc (XMpmc *InstancePtr)
void | XMpmc_SetControlEcc (XMpmc *InstancePtr, u32 Control)
u32 | XMpmc_GetControlEcc (XMpmc *InstancePtr)
u32 | XMpmc_GetStatusEcc (XMpmc *InstancePtr)
void | XMpmc_ClearStatusEcc (XMpmc *InstancePtr)
void | XMpmc_EnablePm (XMpmc *InstancePtr, u32 Mask)
void | XMpmc_DisablePm (XMpmc *InstancePtr, u32 Mask)
void | XMpmc_ClearDataBinPm (XMpmc *InstancePtr, u32 Mask)
u32 | XMpmc_GetStatusPm (XMpmc *InstancePtr)
void | XMpmc_ClearStatusPm (XMpmc *InstancePtr, u32 Mask)
Xuint64 | XMpmc_GetGlobalCycleCountPm (XMpmc *InstancePtr)
Xuint64 | XMpmc_GetDeadCycleCountPm (XMpmc *InstancePtr, u8 PortNum)
Xuint64 | XMpmc_GetDataBinCountPm (XMpmc *InstancePtr, u8 PortNum, u8 Qualifier, u8 AccessType, u8 BinNumber)
void | XMpmc_SetStaticPhyReg (XMpmc *InstancePtr, u32 Data)
u32 | XMpmc_GetStaticPhyReg (XMpmc *InstancePtr)
XMpmc_Config * | XMpmc_LookupConfig (u16 DeviceId)
void | XMpmc_GetStatsEcc (XMpmc *InstancePtr, XMpmc_Stats *StatsPtr)
void | XMpmc_ClearStatsEcc (XMpmc *InstancePtr)
int | XMpmc_SelfTest (XMpmc *InstancePtr)
void | XMpmc_IntrGlobalEnable (XMpmc *InstancePtr)
void | XMpmc_IntrGlobalDisable (XMpmc *InstancePtr)
void | XMpmc_IntrEnable (XMpmc *InstancePtr, u32 Mask)
void | XMpmc_IntrDisable (XMpmc *InstancePtr, u32 Mask)
void | XMpmc_IntrClear (XMpmc *InstancePtr, u32 Mask)
u32 | XMpmc_IntrGetEnabled (XMpmc *InstancePtr)
u32 | XMpmc_IntrGetStatus (XMpmc *InstancePtr)

## Define Documentation

#define XMPMC_PM_PORT0

| Port 0

#define XMPMC_PM_PORT1

| Port 1

#define XMPMC_PM_PORT2

| Port 2

#define XMPMC_PM_PORT3

| Port 3

#define XMPMC_PM_PORT4

| Port 4

#define XMPMC_PM_PORT5

| Port 5

#define XMPMC_PM_PORT6

| Port 6

#define XMPMC_PM_PORT7

| Port 7

## Function Documentation

int XMpmc_CfgInitialize | ( | XMpmc * | InstancePtr,
|  | XMpmc_Config * | ConfigPtr,
|  | u32 | EffectiveAddr
| ) |

This function initializes a specific XMpmc instance.

Parameters:

  | InstancePtr | is a pointer to the XMpmc instance.
  | ConfigPtr | points to the XMpmc device configuration structure.
  | EffectiveAddr | is the device base address in the virtual memory address space. If the address translation is not used then the physical address is passed. Unexpected errors may occur if the address mapping is changed after this function is invoked.

Returns:
  - XST_SUCCESS if successful.
  - XST_FAILURE if ECC support OR Static Phy OR Performance Monitor functionality is not configured in the device.

Note:
  None.

void XMpmc_ClearDataBinPm | ( | XMpmc * | InstancePtr,
|  | u32 | Mask
| ) |

Clear the Performance Monitoring Data Bins for the specified ports.

Parameters:

  | InstancePtr | is a pointer to an XMpmc instance to be worked on.
  | Mask | is the bit-mask of the ports for which the PM Data bins are to be cleared. Bit positions of 1 are cleared. The mask is formed by OR'ing bits from XMPMC_PMREG_*_MASK.

Returns:
  None.

Note:
  None.

void XMpmc_ClearStatsEcc | ( | XMpmc * | InstancePtr | ) |

Clear the statistics of the MPMC device including the Single Error Count, Double Error Count, and Parity Field Error Count. The counts are all contained in registers of the MPMC device.

Parameters:

  | InstancePtr | is a pointer to an XMpmc instance to be worked on.

Returns:
  None.

Note:
  None.

void XMpmc_ClearStatusEcc | ( | XMpmc * | InstancePtr | ) |

Clear the ECC Status Register contents of the MPMC device. This function can be used to clear errors in the status that have been processed.

Parameters:

  | InstancePtr | is a pointer to an XMpmc instance to be worked on.

Returns:
  None.

Note:
  None.

void XMpmc_ClearStatusPm | ( | XMpmc * | InstancePtr,
|  | u32 | Mask
| ) |

Clears the Performance Monitoring Data Bin Clear Status for the specified bins.

Parameters:

  | InstancePtr | is a pointer to an XMpmc instance to be worked on.
  | Mask | is the of the ports for which the PM Data bin clear status bits are to be cleared. Bit positions of 1 are cleared. The mask is formed by OR'ing bits from XMPMC_PMREG_*_MASK.

Returns:
  None.

Note:
  None.

void XMpmc_DisableEcc | ( | XMpmc * | InstancePtr | ) |

Disable the ECC mode for both read and write operations in the MPMC device.

Parameters:

  | InstancePtr | is a pointer to an XMpmc instance to be worked on.

Returns:
  None.

Note:
  None.

void XMpmc_DisablePm | ( | XMpmc * | InstancePtr,
|  | u32 | Mask
| ) |

Disable the Performance Monitoring for the specified ports.

Parameters:

  | InstancePtr | is a pointer to an XMpmc instance to be worked on.
  | Mask | is the bit-mask of the ports for which the PM is to be disabled. Bit positions of 1 are disabled. The mask is formed by OR'ing bits from XMPMC_PMREG_*_MASK.

Returns:
  None.

Note:
  None.

void XMpmc_EnableEcc | ( | XMpmc * | InstancePtr | ) |

Enable the ECC mode for both read and write operations in the MPMC device.

Parameters:

  | InstancePtr | is a pointer to an XMpmc instance to be worked on.

Returns:
  None.

Note:
  None.

void XMpmc_EnablePm | ( | XMpmc * | InstancePtr,
|  | u32 | Mask
| ) |

Enable the Performance Monitoring for the specified ports.

Parameters:

  | InstancePtr | is a pointer to an XMpmc instance to be worked on.
  | Mask | is the of the ports for which the PM is to be enabled. Bit positions of 1 are enabled. The mask is formed by OR'ing bits from XMPMC_PMREG_*_MASK.

Returns:
  None.

Note:
  None.

u32 XMpmc_GetControlEcc | ( | XMpmc * | InstancePtr | ) |

Get the ECC Control Register contents of the MPMC device. This function can be used to determine which features are enabled in the device.

Parameters:

  | InstancePtr | is a pointer to an XMpmc instance to be worked on.

Returns:
  The value read from the register which consists of constants named XMPMC_ECCCR* for each bit field as specified in xmpmc_hw.h.

Note:
  None.

Xuint64 XMpmc_GetDataBinCountPm | ( | XMpmc * | InstancePtr,
|  | u8 | PortNum,
|  | u8 | Qualifier,
|  | u8 | AccessType,
|  | u8 | BinNumber
| ) |

Get the Performance Monitoring Data for the specified bin.

Parameters:

  | InstancePtr | is a pointer to an XMpmc instance to be worked on.
  | PortNum | is the Port Number. The valid port numbers are 0 to 7. Use the definitions XMPMC_PM_PORT* for specifying the port number.
  | Qualifier | is the qualifier type. The valid qualifier type is 0 to 5 . Use the definitions XMPMC_PM_DATABIN_QUAL* for specifying the Qualifier type.

  AccessType

  specifies whether the Data bin is for Read or Write access. Valid values are 0 to 1. Use the following definitions
  - Read access (XMPMC_PM_DATABIN_ACCESS_READ)
  - Write access (XMPMC_PM_DATABIN_ACCESS_WRITE)

  | BinNumber | is the Bin Number. The valid values are 0 to 31 .

Returns:
  The Data Bin Count for the specified Port/Qualifier/AccessType and BinNumber.

Note:
  The user is responsible for giving valid inputs to this function. The input arguments are not checked for correctness in this function.

Xuint64 XMpmc_GetDeadCycleCountPm | ( | XMpmc * | InstancePtr,
|  | u8 | PortNum
| ) |

Get the Performance Monitoring Dead Cycle Count for the specified port.

Parameters:

  | InstancePtr | is a pointer to an XMpmc instance to be worked on.
  | PortNum | is the Port Number. The valid port numbers are 0 to 7. Use the definitions XMPMC_PM_PORT* for specifying the port number.

Returns:
  The Dead Cycle Count for the specified port.

Note:
  The user is responsible for giving valid inputs to this function. The input arguments are not checked for correctness in this function.

Xuint64 XMpmc_GetGlobalCycleCountPm | ( | XMpmc * | InstancePtr | ) |

Get the Performance Monitoring Global Cycle Count.

Parameters:

  | InstancePtr | is a pointer to an XMpmc instance to be worked on.

Returns:
  The Global Cycle Count.

Note:
  None.

u32 XMpmc_GetStaticPhyReg | ( | XMpmc * | InstancePtr | ) |

Get the Static Phy Interface Register contents of the MPMC device.

Parameters:

  | InstancePtr | is a pointer to an XMpmc instance to be worked on.

Returns:
  The value read from the register which consists of constants Use the definitions XMPMC_SPIR_* in xmpmc_hw.h for interpreting the value.

Note:
  None.

void XMpmc_GetStatsEcc | ( | XMpmc * | InstancePtr,
|  | XMpmc_Stats * | StatsPtr
| ) |

Get the statistics of the MPMC device including the Single Error Count, Double Error Count, Parity Field Error Count and the address where the last error was detected in the memory. The counts are all contained in registers of the MPMC device.

Parameters:

  | InstancePtr | is a pointer to an XMpmc instance to be worked on.
  | StatsPtr | contains a pointer to a XMpmc_Stats data type. The function puts the statistics of the device into the specified data structure.

Returns:
  The statistics data type pointed to by input StatsPtr is modified.

Note:
  None.

u32 XMpmc_GetStatusEcc | ( | XMpmc * | InstancePtr | ) |

Get the ECC Status Register contents of the MPMC device. This function can be used to determine which errors have occurred for ECC mode.

Parameters:

  | InstancePtr | is a pointer to an XMpmc instance to be worked on.

Returns:
  The value read from the register which consists of constants named XMPMC_ECCSR* for each bit field as specified in xmpmc_hw.h.

Note:
  None.

u32 XMpmc_GetStatusPm | ( | XMpmc * | InstancePtr | ) |

Get the Performance Monitoring Data Bin Clear Status.

Parameters:

  | InstancePtr | is a pointer to an XMpmc instance to be worked on.

Returns:
  The Status of the Clear Operation on the Data Bins.

Note:
  None.

void XMpmc_IntrClear | ( | XMpmc * | InstancePtr,
|  | u32 | Mask
| ) |

Clear pending interrupts with the provided mask. An interrupt must be cleared after software has serviced it or it can cause another interrupt.

Parameters:

  | InstancePtr | is the MPMC component to operate on.
  | Mask | is the mask to clear pending interrupts for. Bit positions of 1 are cleared. This mask is formed by OR'ing bits from XMPMC_IPIXR_*_MASK.

Returns:
  None.

Note:
  This function will assert if the hardware device has not been built with interrupt capabilities.

void XMpmc_IntrDisable | ( | XMpmc * | InstancePtr,
|  | u32 | Mask
| ) |

Disable ECC interrupts so that ECC errors will not cause an interrupt.

Parameters:

  | InstancePtr | is the MPMC component to operate on.
  | Mask | is the mask to disable. Bits set to 1 are disabled. The mask is formed by OR'ing bits from XMPMC_IPIXR_*_MASK.

Returns:
  None.

Note:
  This function will assert if the hardware device has not been built with interrupt capabilities.

void XMpmc_IntrEnable | ( | XMpmc * | InstancePtr,
|  | u32 | Mask
| ) |

Enable ECC interrupts so that specific ECC errors will cause an interrupt. The function XMpmc_IntrGlobalEnable must also be called to enable any interrupt to occur.

Parameters:

  | InstancePtr | is the MPMC component to operate on.
  | Mask | is the mask to enable. Bit positions of 1 are enabled. The mask is formed by OR'ing bits from XMPMC_IPIXR_*_MASK.

Returns:
  None.

Note:
  This function will assert if the hardware device has not been built with interrupt capabilities.

u32 XMpmc_IntrGetEnabled | ( | XMpmc * | InstancePtr | ) |

Returns the interrupt enable mask as set by XMpmc_IntrEnable() which indicates which ECC interrupts are enabled or disabled.

Parameters:

  | InstancePtr | is the MPMC component to operate on.

Returns:
  Mask of bits made from XMPMC_IPIXR_*_MASK.

Note:
  This function will assert if the hardware device has not been built with interrupt capabilities.

u32 XMpmc_IntrGetStatus | ( | XMpmc * | InstancePtr | ) |

Returns the status of interrupts which indicates which ECC interrupts are pending.

Parameters:

  | InstancePtr | is the MPMC component to operate on.

Returns:
  Mask of bits made from XMPMC_IPIXR_*_MASK.

Note:
  The interrupt status indicates the status of the device irregardless if the interrupts from the devices have been enabled or not through XMpmc_IntrEnable().

This function will assert if the hardware device has not been built with interrupt capabilities.

void XMpmc_IntrGlobalDisable | ( | XMpmc * | InstancePtr | ) |

Disable the core's interrupt output signal. Interrupts enabled through XMpmc_IntrEnable() will not occur until the global enable bit is set by XMpmc_IntrGlobalEnable(). This function is designed to allow all interrupts to be disabled easily for entering a critical section.

Parameters:

  | InstancePtr | is the MPMC component to operate on.

Returns:
  None.

Note:
  This function will assert if the hardware device has not been built with interrupt capabilities.

void XMpmc_IntrGlobalEnable | ( | XMpmc * | InstancePtr | ) |

Enable the core's interrupt output signal. Interrupts enabled through XMpmc_IntrEnable() will not occur until the global enable bit is set by this function. This function is designed to allow all interrupts to be enabled easily for exiting a critical section.

Parameters:

  | InstancePtr | is the MPMC component to operate on.

Returns:
  None.

Note:
  This function will assert if the hardware device has not been built with interrupt capabilities.

XMpmc_Config* XMpmc_LookupConfig | ( | u16 | DeviceId | ) |

Looks up the device configuration based on the unique device ID. A table contains the configuration info for each device in the system.

Parameters:

  | DeviceId | contains the ID of the device for which the device configuration pointer is to be returned.

Returns:
  - A pointer to the configuration found.
  - NULL if the specified device ID was not found.

Note:
  None.

int XMpmc_SelfTest | ( | XMpmc * | InstancePtr | ) |

Perform a self-test on the MPMC device. Self-test will read, write and verify that some of the registers of the device are functioning correctly. This function will restore the state of the device to state it was in prior to the function call.

Parameters:

  | InstancePtr | is the MPMC component to operate on.

Returns:
  XST_SUCCESS if successful else XST_FAILURE.

Note:
  None.

void XMpmc_SetControlEcc | ( | XMpmc * | InstancePtr,
|  | u32 | Control
| ) |

Set the ECC Control Register of the MPMC device to the specified value. This function can be used to individually enable/disable read or write ECC and force specific types of ECC errors to occur.

Parameters:

  | InstancePtr | is a pointer to an XMpmc instance to be worked on.
  | Control | contains the value to be written to the register and consists of constants named XMPMC_ECCCR* for each bit field as specified in xmpmc_hw.h.

Returns:
  None.

Note:
  None.

void XMpmc_SetStaticPhyReg | ( | XMpmc * | InstancePtr,
|  | u32 | Data
| ) |

Set the Static Phy Interface Register of the MPMC device to the specified value.

Parameters:

  | InstancePtr | is a pointer to an XMpmc instance to be worked on.
  | Data | contains the value to be written to the register. and Use the definitions XMPMC_SPIR_* in xmpmc_hw.h for specifying the value.

Returns:
  None.

Note:
  None.

Copyright © 1995-2009 Xilinx, Inc. All rights reserved.