T
Terrence Mak
Guest
Hi,
I am new in using the embeded device (VirtexII-Pro) to implement an
algorithm.
As I want to count the cpu time of the algorithm , I use the
XTime_GetTime(starttime) in the the xtime_l.h library.
Also I need to print out the result to a uart by using xil_printf. But the
result did not displayed successfully.
Please find the program as follows.
Is there any step missed?
Many thanks,
Terrence
#include "xgpio.h"
#include "xparameters.h"
#include "math.h"
#include "xtime_l.h"
main() {
XGpio gpio_reset, gpio_addr, gpio_data;
int i,j=0, count=0,k, site=0;
double likelihood[12], probability=0.0, lnL=0.0;
XTime *starttime, *endtime;
char *output;
xil_printf("start\n");
XTime_GetTime(starttime);
// Start computation
....
//End computation
XTime_GetTime(endtime);
//convert the long long to a string
sprintf(output, "%llu", *endtime);
//print the result
while(*output){
xil_printf("%c", *output);
++output;
}
}
I am new in using the embeded device (VirtexII-Pro) to implement an
algorithm.
As I want to count the cpu time of the algorithm , I use the
XTime_GetTime(starttime) in the the xtime_l.h library.
Also I need to print out the result to a uart by using xil_printf. But the
result did not displayed successfully.
Please find the program as follows.
Is there any step missed?
Many thanks,
Terrence
#include "xgpio.h"
#include "xparameters.h"
#include "math.h"
#include "xtime_l.h"
main() {
XGpio gpio_reset, gpio_addr, gpio_data;
int i,j=0, count=0,k, site=0;
double likelihood[12], probability=0.0, lnL=0.0;
XTime *starttime, *endtime;
char *output;
xil_printf("start\n");
XTime_GetTime(starttime);
// Start computation
....
//End computation
XTime_GetTime(endtime);
//convert the long long to a string
sprintf(output, "%llu", *endtime);
//print the result
while(*output){
xil_printf("%c", *output);
++output;
}
}