/****************************************************************************** * * Copyright (C) 2013 - 2014 Xilinx, Inc. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * Use of the Software is limited solely to applications: * (a) running on a Xilinx device, or * (b) that interact with a Xilinx device through a bus or interconnect. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * XILINX CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * * Except as contained in this notice, the name of the Xilinx shall not be used * in advertising or otherwise to promote the sale, use or other dealings in * this Software without prior written authorization from Xilinx. * ******************************************************************************/ /*****************************************************************************/ /** * * @file xtrafgen_static_mode_example.c * * This file demonstrates how to use the xtrafgen driver on the Xilinx AXI * Traffic Generator core. The AXI Traffic Generator IP is designed to * generate AXI4 traffic which can be used to stress different modules/ * interconnect connected in the system. * * This example demonstrates how to use the Static mode in the Axi Traffic * Genrator.In Static mode the core continously genrates fixed address and * fixed INCR type read and write transfers based on the burst length * configured. * *
* MODIFICATION HISTORY: * * Ver Who Date Changes * ----- ---- -------- ------------------------------------------------------- * 1.01a adk 03/09/13 First release * 2.00a adk 16/09/13 Fixed CR:737291 * ** * *************************************************************************** */ /***************************** Include Files *********************************/ #include "xtrafgen.h" #include "xparameters.h" #include "xil_exception.h" #ifdef XPAR_UARTNS550_0_BASEADDR #include "xuartns550_l.h" /* to use uartns550 */ #endif /**************************** Type Definitions *******************************/ /***************** Macros (Inline Functions) Definitions *********************/ #define TRAFGEN_DEV_ID XPAR_XTRAFGEN_0_DEVICE_ID #define BURST_LEN 255 #define MEM_ADDR XPAR_AXI_BRAM_CTRL_2_S_AXI_BASEADDR #define DATA 0xc0015afe #undef DEBUG /************************** Function Prototypes ******************************/ int XTrafGenStaticModeExample(XTrafGen *InstancePtr, u16 DeviceId); #ifdef XPAR_UARTNS550_0_BASEADDR static void Uart550_Setup(void); #endif /************************** Variable Definitions *****************************/ /* * Device instance definitions */ XTrafGen XTrafGenInstance; /*****************************************************************************/ /** * * Main function * * This function is the main entry of the traffic generator test. * * @param None * * @return - XST_SUCCESS if tests pass * - XST_FAILURE if fails. * * @note None. * ******************************************************************************/ int main() { int Status; xil_printf("--- Entering main() ---\n\r"); Status = XTrafGenStaticModeExample(&XTrafGenInstance, TRAFGEN_DEV_ID); if (Status != XST_SUCCESS) { xil_printf("TrafficGen Static mode Example Test Failed\n\r"); xil_printf("--- Exiting main() ---\n\r"); return XST_FAILURE; } xil_printf("TrafficGen Static mode Example Test passed\n\r"); xil_printf("--- Exiting main() ---\n\r"); return XST_SUCCESS; } /*****************************************************************************/ /** * * This function demonstrates the usage Traffic Generator * It does the following: * - Set up the output terminal if UART16550 is in the hardware build * - Initialize the AXI Traffic Generator device * - Fill's the Target memory with required data * - Enable the Traffic genration * - Disable the Traffic genration * - Return test status and exit * * @param InstancePtr is a pointer to the instance of the * XTrafGen component. * @param DeviceId is Device ID of the Axi Traffic Generator Device, * * * @param InstancePtr is a pointer to the instance of the * XTrafGen component. * @param DeviceId is Device ID of the Axi Traffic Generator Device, * typically XPAR_