Xilinx MicroBlaze Reference Manual page 121

Hide thumbs Also See for MicroBlaze:
Table of Contents

Advertisement

The standalone BSP provides the function
the entire LMB block RAM and all MicroBlaze internal block RAMs used in a particular
configuration. This function is intended to be called periodically from a timer interrupt
routine. One location of each block RAM is scrubbed every time it is called, using persistent
data to track the current locations.
The following example code illustrates how this can be done.
#include "xparameters.h"
#include "xtmrctr.h"
#include "xintc.h"
#include "mb_interface.h"
#define SCRUB_PERIOD ...
XIntc InterruptController; /* The Interrupt Controller instance */
XTmrCtr TimerCounterInst;/* The Timer Counter instance */
void MicroBlazeScrubHandler(void *CallBackRef, u8 TmrCtrNumber)
{
/* Perform other timer interrupt processing here */
microblaze_scrub();
}
int main (void)
{
int Status;
/*
* Initialize the timer counter so that it's ready to use,
* specify the device ID that is generated in xparameters.h
*/
Status = XTmrCtr_Initialize(&TimerCounterInst, TMRCTR_DEVICE_ID);
if (Status != XST_SUCCESS) {
return XST_FAILURE;
}
/*
* Connect the timer counter to the interrupt subsystem such that
* interrupts can occur.
*/
Status = XIntc_Initialize(&InterruptController, INTC_DEVICE_ID);
if (Status != XST_SUCCESS) {
return XST_FAILURE;
}
/*
* Connect a device driver handler that will be called when an
* interrupt for the device occurs, the device driver handler performs
* the specific interrupt processing for the device
*/
Status = XIntc_Connect(&InterruptController, TMRCTR_DEVICE_ID,
(XInterruptHandler)XTmrCtr_InterruptHandler,
(void *) &TimerCounterInst);
if (Status != XST_SUCCESS) {
return XST_FAILURE;
}
MicroBlaze Processor Reference Guide
UG984 (v2018.2) June 21, 2018
microblaze_scrub()
www.xilinx.com
Chapter 2: MicroBlaze Architecture
to perform scrubbing of
Send Feedback
121

Advertisement

Table of Contents
loading

Table of Contents