tmr_inject
Xilinx SDK Drivers API Documentation
Tmr_inject_v1_1

Data Structures

struct  XTMR_Inject_Config
 This typedef contains configuration information for the device. More...
 
struct  XTMR_Inject
 The XTMR_Inject driver instance data. More...
 

Macros

#define XTMR_Inject_WriteReg(BaseAddress, RegOffset, Data)   XTMR_Inject_Out32((BaseAddress) + (RegOffset), (u32)(Data))
 Write a value to a TMRInject register. More...
 
#define XTMR_Inject_WriteReg64(BaseAddress, RegOffset, Data)   XTMR_Inject_Out64((BaseAddress) + (RegOffset), (UINTPTR)(Data))
 Write a value to a TMRInject register. More...
 
#define XTMR_Inject_SetControlReg(BaseAddress, Mask)   XTMR_Inject_WriteReg((BaseAddress), XTI_CONTROL_REG_OFFSET, (Mask))
 Set the contents of the control register. More...
 

Functions

int XTMR_Inject_CfgInitialize (XTMR_Inject *InstancePtr, XTMR_Inject_Config *Config, UINTPTR EffectiveAddr)
 Initialize a XTMR_Inject instance. More...
 
void XTMR_Inject_Enable (XTMR_Inject *InstancePtr, u8 CpuId)
 This function enables fault injection for the indicated CPU. More...
 
void XTMR_Inject_Disable (XTMR_Inject *InstancePtr)
 This function disables fault injection. More...
 
u32 XTMR_Inject_InjectBit (XTMR_Inject *InstancePtr, u32 Value, u8 Bit)
 This function can be used to inject a fault in either: More...
 
u32 XTMR_Inject_InjectMask (XTMR_Inject *InstancePtr, u32 Value, u32 Mask)
 This function can be used to inject any number of faults defined by the Mask parameter in either: More...
 
int XTMR_Inject_Initialize (XTMR_Inject *InstancePtr, u16 DeviceId)
 Initialize a XTMR_Inject instance. More...
 
int XTMR_Inject_SelfTest (XTMR_Inject *InstancePtr)
 Runs a self-test on the device hardware. More...
 

Variables

XTMR_Inject_Config XTMR_Inject_ConfigTable [XPAR_XTMR_INJECT_NUM_INSTANCES]
 The configuration table for TMR Inject devices. More...
 
XTMR_Inject_Config XTMR_Inject_ConfigTable []
 The configuration table for TMR Inject devices. More...
 

Macro Definition Documentation

◆ XTMR_Inject_SetControlReg

#define XTMR_Inject_SetControlReg (   BaseAddress,
  Mask 
)    XTMR_Inject_WriteReg((BaseAddress), XTI_CONTROL_REG_OFFSET, (Mask))

#include <xtmr_inject_l.h>

Set the contents of the control register.

Use the XUL_CR_* constants defined above to create the bit-mask to be written to the register.

Parameters
BaseAddressis the base address of the device
Maskis the 32-bit value to write to the control register
Returns
None.
Note
C-style Signature: void XTMR_Inject_SetControlReg(u32 BaseAddress, u32 Mask);

◆ XTMR_Inject_WriteReg

#define XTMR_Inject_WriteReg (   BaseAddress,
  RegOffset,
  Data 
)    XTMR_Inject_Out32((BaseAddress) + (RegOffset), (u32)(Data))

#include <xtmr_inject_l.h>

Write a value to a TMRInject register.

A 32 bit write is performed.

Parameters
BaseAddressis the base address of the TMRInject device.
RegOffsetis the register offset from the base to write to.
Datais the data written to the register.
Returns
None.
Note
C-style signature: void XTMR_Inject_WriteReg(u32 BaseAddress, u32 RegOffset, u32 Data)

Referenced by XTMR_Inject_Disable(), and XTMR_Inject_Enable().

◆ XTMR_Inject_WriteReg64

#define XTMR_Inject_WriteReg64 (   BaseAddress,
  RegOffset,
  Data 
)    XTMR_Inject_Out64((BaseAddress) + (RegOffset), (UINTPTR)(Data))

#include <xtmr_inject_l.h>

Write a value to a TMRInject register.

A 64 bit write is performed.

Parameters
BaseAddressis the base address of the TMRInject device.
RegOffsetis the register offset from the base to write to.
Datais the data written to the register.
Returns
None.
Note
C-style signature: void XTMR_Inject_WriteReg64(UINTPTR BaseAddress, u32 RegOffset, u64 Data)

Function Documentation

◆ XTMR_Inject_CfgInitialize()

int XTMR_Inject_CfgInitialize ( XTMR_Inject InstancePtr,
XTMR_Inject_Config Config,
UINTPTR  EffectiveAddr 
)

#include <xtmr_inject.c>

Initialize a XTMR_Inject instance.

The receive and transmit FIFOs of the core are not flushed, so the user may want to flush them. The hardware device does not have any way to disable the receiver such that any valid data may be present in the receive FIFO. This function disables the core interrupt. The baudrate and format of the data are fixed in the hardware at hardware build time.

Parameters
InstancePtris a pointer to the XTMR_Inject instance.
Configis a reference to a structure containing information about a specific TMR Inject device. This function initializes an InstancePtr object for a specific device specified by the contents of Config. This function can initialize multiple instance objects with the use of multiple calls giving different Config information on each call.
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, use Config->BaseAddress for this parameters, passing the physical address instead.
Returns
  • XST_SUCCESS if everything starts up as expected.
Note
The Config pointer argument is not used by this function, but is provided to keep the function signature consistent with other drivers.

References XTMR_Inject::Address, XTMR_Inject_Config::MagicByte, and XTMR_Inject::MagicByte.

◆ XTMR_Inject_Disable()

void XTMR_Inject_Disable ( XTMR_Inject InstancePtr)

#include <xtmr_inject.c>

This function disables fault injection.

Parameters
InstancePtris a pointer to the XTMR_Inject instance.
Note
None.

References XTMR_Inject_WriteReg.

◆ XTMR_Inject_Enable()

void XTMR_Inject_Enable ( XTMR_Inject InstancePtr,
u8  CpuId 
)

#include <xtmr_inject.c>

This function enables fault injection for the indicated CPU.

Parameters
InstancePtris a pointer to the XTMR_Inject instance.
CpuIdis the CPU ID of the CPU where faults are to be injected. Must be 1 to 3.
Note
None.

References XTMR_Inject_WriteReg.

◆ XTMR_Inject_Initialize()

int XTMR_Inject_Initialize ( XTMR_Inject InstancePtr,
u16  DeviceId 
)

#include <xtmr_inject.h>

Initialize a XTMR_Inject instance.

Parameters
InstancePtris a pointer to the XTMR_Inject instance.
DeviceIdis the unique id of the device controlled by this XTMR_Inject instance. Passing in a device id associates the generic XTMR_Inject instance to a specific device, as chosen by the caller or application developer.
Returns
  • XST_SUCCESS if everything starts up as expected.
  • XST_DEVICE_NOT_FOUND if the device is not found in the configuration table.
Note
None.

Referenced by TMR_InjectSelfTestExample().

◆ XTMR_Inject_InjectBit()

u32 XTMR_Inject_InjectBit ( XTMR_Inject InstancePtr,
u32  Value,
u8  Bit 
)

#include <xtmr_inject.c>

This function can be used to inject a fault in either:

  • An address bit of a memory or memory mapped register address for any read or write access on AXI or LMB.
  • A data bit written to memory or a memory mapped register on AXI or LMB, as well as output on an AXI Stream. <
Parameters
InstancePtris a pointer to the XTMR_Inject instance.
Valueis the memory or register address, oro the data.
Bitis the bit where the fault is injected. Must be 0 to 31.
Returns
Either the unchanged value, or value with the fault injected for the CPU set up for fault injection.
Note
None.

◆ XTMR_Inject_InjectMask()

u32 XTMR_Inject_InjectMask ( XTMR_Inject InstancePtr,
u32  Value,
u32  Mask 
)

#include <xtmr_inject.c>

This function can be used to inject any number of faults defined by the Mask parameter in either:

  • Any address bits of a memory or memory mapped register address for any read or write access on AXI or LMB.
  • Any data bits written to memory or a memory mapped register on AXI or LMB, as well as output on an AXI Stream. <
Parameters
InstancePtris a pointer to the XTMR_Inject instance.
Valueis the memory or register address, oro the data.
Maskdefines the bits where faults are injected. A fault is injected for every bit in the mask set to 1.
Returns
Either the unchanged value, or value with the faults injected for the CPU set up for fault injection.
Note
None.

◆ XTMR_Inject_SelfTest()

int XTMR_Inject_SelfTest ( XTMR_Inject InstancePtr)

#include <xtmr_inject.h>

Runs a self-test on the device hardware.

Since there is no way to perform a loopback in the hardware, this test can only check the state of the status register to verify it is correct. This test assumes that the hardware device is still in its reset state, but has been initialized with the Initialize function.

Parameters
InstancePtris a pointer to the XTMR_Inject instance.
Returns
  • XST_SUCCESS if the self-test was successful.
  • XST_FAILURE if the self-test failed, the status register value was not correct
Note
None.

Referenced by TMR_InjectSelfTestExample().

Variable Documentation

◆ XTMR_Inject_ConfigTable [1/2]

XTMR_Inject_Config XTMR_Inject_ConfigTable[]

#include <xtmr_inject_i.h>

The configuration table for TMR Inject devices.

◆ XTMR_Inject_ConfigTable [2/2]

XTMR_Inject_Config XTMR_Inject_ConfigTable[XPAR_XTMR_INJECT_NUM_INSTANCES]

#include <xtmr_inject_g.c>

Initial value:
=
{
{
XPAR_TMRINJECT_0_DEVICE_ID,
XPAR_TMRINJECT_0_BASEADDR,
XPAR_TMRINJECT_0_MAGIC,
XPAR_TMRINJECT_0_CPU_ID
},
}

The configuration table for TMR Inject devices.