8#ifndef AIE_TEST_LIBRARY_H
9#define AIE_TEST_LIBRARY_H
17#define mlir_aie_check(s, r, v, errors) \
19 printf("ERROR %s: %s expected %d, but was %d!\n", s, #r, v, r); \
22#define mlir_aie_check_float(s, r, v, errors) \
24 printf("ERROR %s: %s expected %f, but was %f!\n", s, #r, v, r); \
32 XAie_Events _startE, XAie_Events _endE, XAie_Events _resetE,
33 XAie_ModuleType _module) {
43 XAie_PerfCounterControlSet(devInst, XAie_TileLoc(col, row), mode, pfc,
57 XAie_PerfCounterGet(devInst, XAie_TileLoc(col, row), mode, pfc, &start);
68 XAie_PerfCounterGet(devInst, XAie_TileLoc(col, row), mode, pfc, &val);
80 XAie_PerfCounterGet(devInst, XAie_TileLoc(col, row), mode, pfc, &end);
89 printf(
"WARNING: EventMonitor: performance counter wrapped!\n");
101 XAie_DevInst *devInst;
118 int lockval,
int timeout);
120 int lockval,
int timeout);
EventMonitor(aie_libxaie_ctx_t *_xaie, u32 _col, u32 _row, u32 _pfc, XAie_Events _startE, XAie_Events _endE, XAie_Events _resetE, XAie_ModuleType _module)
XAie_DevInst * XAieDevInst
void mlir_aie_print_memtiledma_status(aie_libxaie_ctx_t *ctx, int col, int row)
Print the status of a memtiledma represented by the given location.
int mlir_aie_acquire_lock(aie_libxaie_ctx_t *ctx, int col, int row, int lockid, int lockval, int timeout)
Acquire a physical lock.
u32 mlir_aie_data_mem_rd_word(aie_libxaie_ctx_t *ctx, int col, int row, u64 addr)
Read a value from the data memory of a particular tile memory.
void mlir_aie_clear_tile_memory(aie_libxaie_ctx_t *ctx, int col, int row)
Clear the contents of the memory associated with the given tile.
u64 mlir_aie_get_tile_addr(aie_libxaie_ctx_t *ctx, int col, int row)
Return the base address of the given tile.
void mlir_aie_clear_shim_config(aie_libxaie_ctx_t *ctx, int col, int row)
Zero out the configuration memory of the shim tile.
void mlir_aie_clear_config(aie_libxaie_ctx_t *ctx, int col, int row)
Zero out the program and configuration memory of the tile.
void mlir_aie_print_dma_status(aie_libxaie_ctx_t *ctx, int col, int row)
Print the status of a dma represented by the given tile.
void mlir_aie_deinit_libxaie(aie_libxaie_ctx_t *)
Release access to the libXAIE context.
int mlir_aie_release_lock(aie_libxaie_ctx_t *ctx, int col, int row, int lockid, int lockval, int timeout)
Release a physical lock.
int mlir_aie_init_device(aie_libxaie_ctx_t *ctx, uint32_t device_id=0)
Initialize the device represented by the context.
void mlir_aie_print_shimdma_status(aie_libxaie_ctx_t *ctx, int col, int row)
Print the status of a shimdma represented by the given location (row = 0).
u32 mlir_aie_read32(aie_libxaie_ctx_t *ctx, u64 addr)
Read the AIE configuration memory at the given physical address.
void mlir_aie_dump_tile_memory(aie_libxaie_ctx_t *ctx, int col, int row)
Dump the contents of the memory associated with the given tile.
void computeStats(u32 performance_counter[], int n)
Given an array of values, compute and print statistics about those values.
void mlir_aie_write32(aie_libxaie_ctx_t *ctx, u64 addr, u32 val)
Write the AIE configuration memory at the given physical address.
aie_libxaie_ctx_t * mlir_aie_init_libxaie()
Initialize libXAIE and allocate a new context object.
void mlir_aie_data_mem_wr_word(aie_libxaie_ctx_t *ctx, int col, int row, u64 addr, u32 data)
Write a value to the data memory of a particular tile memory.
void mlir_aie_print_tile_status(aie_libxaie_ctx_t *ctx, int col, int row)
Print the status of a core represented by the given tile.