bram
Vitis Drivers API Documentation
 All Data Structures Files Functions Variables Groups Pages
xbram_intr_example.c File Reference

Overview

This file contains a design example using the BRAM driver (XBram) in an interrupt driven mode of operation.

This example assumes that there is an interrupt controller in the hardware system and the BRAM device is connected to the interrupt controller.

MODIFICATION HISTORY:
Ver   Who  Date  Changes


1.00a sa 05/11/10 Initial release. 3.01a sa 13/01/12 Changed XBram_SelfTest(InstancePtr) to XBram_SelfTest(InstancePtr, XBRAM_IR_ALL_MASK) as per new API (CR 639274) 4.1 ms 01/23/17 Modified xil_printf statement in main function to ensure that "Successfully ran" and "Failed" strings are available in all examples. This is a fix for CR-965028. 4.7 mus 08/25/21 BRAM and interrupt controller instance need not to be declared in case of peripheral test, added condition to skip them in case of peripheral test (CR#1108877) 4.9 sd 07/07/23 Added SDT support. 4.13 ml 07/14/25 Fix GCC warnings. 4.14 vlt 12/12/25 Update Doxygen comments to include SDT flow details.

#include "xparameters.h"
#include "xbram.h"
#include "xil_exception.h"
#include "xil_cache.h"
#include <stdio.h>
#include "xinterrupt_wrap.h"

Functions

int BramIntrExample (XBram *InstancePtr, UINTPTR BaseAddress)
 This is the entry function from the TestAppGen tool generated application which tests the interrupts when enabled in the BRAM. More...
 
int main (void)
 This function is the main function of the BRAM example. More...
 

Function Documentation

int BramIntrExample ( XBram InstancePtr,
UINTPTR  BaseAddress 
)

This is the entry function from the TestAppGen tool generated application which tests the interrupts when enabled in the BRAM.

Parameters
InstancePtris a reference to the BRAM driver Instance
BaseAddresscontains the base address of the device
Returns
  • XST_SUCCESS if the example is successful.
  • XST_FAILURE if the example failed.
Note
In XSCT/classic flow, DeviceId is used to look up the device configuration.

References XBram_Config::CtrlBaseAddress, XBram_Config::EccStatusInterruptPresent, XBram_Config::FaultInjectionPresent, XBram_Config::IntId, XBram_Config::IntrParent, XBram_Config::UncorrectableFailingDataRegs, XBram_CfgInitialize(), XBRAM_IR_ALL_MASK, XBram_LookupConfig(), and XBram_SelfTest().

Referenced by main().

int main ( void  )

This function is the main function of the BRAM example.

It is for initializing the BRAM device and setting up interrupts.

Parameters
None.
Returns
  • XST_SUCCESS to indicate success.
  • XST_FAILURE to indicate failure.
Note
None.

References BramIntrExample().