Forum Discussion
Altera_Forum
Honored Contributor
19 years agoHello Yong,
About your questions: 1) A way that I have to download data directly from host (I supposse it`s what you've questioned) it`s through opening files. In the C/C++ Application you simply lead with files through commands like "filePointer = fopen(file_name, "r");". However to lead with them it`s nececessary to change same settings your project in Nios. In the System Library Properties of your project, select 'Software Components...' --> 'Altera Host Based File System' and mark the box 'Add this software component'. Using this resource, however, is only possible in the Debug mode. An example of code in C/C++ APlication: FILE* fp = NULL; fp = fopen(\mnt\host\<file_name>,"r"); ... <read data from the file and stores them in a temporary variable, for example> ... fclose(fp); The path \mnt\host\ is necessary to the system localize the file which may be in the directory of your project. 2) You can use functions as 'clock()' in your C file, to measure time in ms. See also the file 'leading_zeros.c' avaliable in Altera page. It presents a way to measure time in clocks. Good Luck.