int main(){ /* Input values to be given to the multiplier */ u32 multiplierInput1 = 8; u32 multiplierInput2 = 4; /* TODO: Write into input registers */ /// Device definitions for each device coming from xparameter.h /// Memory offsets for registers coming from MYMULTIPLIER.h also device specific functions (mWriteReg, mReadeg etc) MYMULTIPLIER_mWriteReg(XPAR_MYMULTIPLIER_0_S00_AXI_BASEADDR, MYMULTIPLIER_S00_AXI_SLV_REG0_OFFSET, multiplierInput1); MYMULTIPLIER_mWriteReg(XPAR_MYMULTIPLIER_0_S00_AXI_BASEADDR, MYMULTIPLIER_S00_AXI_SLV_REG1_OFFSET, multiplierInput2); /* Print the inputs variables */ xil_printf ("Input 1: %d\n\r", (int)multiplierInput1); xil_printf ("Input 2: %d\n\r", (int)multiplierInput2); /* TODO: Send the "start calculation" signal (set and reset) */ MYMULTIPLIER_mWriteReg(XPAR_MYMULTIPLIER_0_S00_AXI_BASEADDR, MYMULTIPLIER_S00_AXI_SLV_REG2_OFFSET, 0x01); MYMULTIPLIER_mWriteReg(XPAR_MYMULTIPLIER_0_S00_AXI_BASEADDR, MYMULTIPLIER_S00_AXI_SLV_REG2_OFFSET, 0x00); ScuGicExample(INTC_DEVICE_ID); /* TODO: Read the result and store it in the "result" variable */ // result = MYMULTIPLIER_mReadReg(XPAR_MYMULTIPLIER_0_S00_AXI_BASEADDR, MYMULTIPLIER_S00_AXI_SLV_REG3_OFFSET); while (1) { if (InterruptProcessed) { break; } } /* Print the result */ xil_printf ("Result: %d\n\r", (int)result); return 0; }
/** * * This is the main function for the Interrupt Controller example. * * @param None. * * @return XST_SUCCESS to indicate success, otherwise XST_FAILURE. * * @note None. * ****************************************************************************/ int main(void) { int Status; /* * Setup an assert call back to get some info if we assert. */ Xil_AssertSetCallback(AssertPrint); xil_printf("GIC Example Test\r\n"); /* * Run the Gic example , specify the Device ID generated in xparameters.h */ Status = ScuGicExample(INTC_DEVICE_ID); if (Status != XST_SUCCESS) { xil_printf("GIC Example Test Failed\r\n"); return XST_FAILURE; } xil_printf("Successfully ran GIC Example Test\r\n"); return XST_SUCCESS; }