Forum Discussion
timestamp
http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/biggrin.gif http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/biggrin.gif http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/biggrin.gif
hello to everybody i would like to use timestamp to monitoring my application time. In sopc builder i set timer 1 msec . I follow documents and then i include the header file such as the documents told me. but when i compile to download exe file (.elf ) occur a console warning that tell me is notpossible to find header file . Very strange . Somebody already use this function? thanks for helps ciao walter14 Replies
- Altera_Forum
Honored Contributor
Could you post the warning message you are seeing?
--chris --- Quote Start --- originally posted by pmicro@Jun 26 2006, 06:27 PM http://forum.niosforum.com/work2/style_emoticons/<#emo_dir#>/biggrin.gif http://forum.niosforum.com/work2/style_emoticons/<#emo_dir#>/biggrin.gif http://forum.niosforum.com/work2/style_emoticons/<#emo_dir#>/biggrin.gifhello to everybody
i would like to use timestamp to monitoring my application time.
in sopc builder i set timer 1 msec .
i follow documents and then i include the header file such as the documents
told me.
but when i compile to download exe file (.elf ) occur a console warning that
tell me is notpossible to find header file .
very strange .
somebody already use this function?
thanks for helps
ciao
walter
<div align='right'><{post_snapback}> (index.php?act=findpost&pid=16409)
--- quote end ---
--- Quote End ---
- Altera_Forum
Honored Contributor
#include "sys/alt_timestamp.h"# include "my_app.h"
alt_u32 time1; alt_u32 time2; int main(void) { if(alt_timestamp_start()<0) { printf("No timestamp device aviable\n"); } else { time1=alt_timestamp(); } while (1) { ....................... //my application ........................//my application time2=alt_timestamp(); printf("time execution= %u ticks\n",(unsigned int)(time2-time1)); } } "undefined reference to ' alt_timestamp_start ' undefined reference to ' alt_timestamp' In effects these functions are not in the file "sys/alt_timestamp.h" but i found them in the file "altera_avalon_timer_ts .c " I try also to include this file but nothing I cannot understand http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/sad.gif http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/sad.gif http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/sad.gif - Altera_Forum
Honored Contributor
Have you defined the timestamp timer in the IDE (checkbox on the System Library properties page)? The timestamp functions do not make use of the system clock timer.
- Altera_Forum
Honored Contributor
could you be clearer?
Please explain to me exactly informations about your question slacker thanks http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/wink.gif walter - Altera_Forum
Honored Contributor
Do you have a "Timestamp timer" defined on the System Library properties page? If you do not, or don't know what I'm referring to, please go look at this page (in the IDE).
The timestamp functions will not be compiled into your System Library unless you have one selected/defined. - Altera_Forum
Honored Contributor
these are the declarations related to the timer.
In sopc builder I have setted as from manual, but here in the file result me "none".You can see at the end of file # define SYSTEM_TIMER_NAME "/dev/system_timer"# define SYSTEM_TIMER_TYPE "altera_avalon_timer"# define SYSTEM_TIMER_BASE 0x00900800# define SYSTEM_TIMER_IRQ 1# define SYSTEM_TIMER_ALWAYS_RUN 0# define SYSTEM_TIMER_FIXED_PERIOD 1# define SYSTEM_TIMER_SNAPSHOT 1# define SYSTEM_TIMER_PERIOD 1# define SYSTEM_TIMER_PERIOD_UNITS "ms"# define SYSTEM_TIMER_RESET_OUTPUT 0# define SYSTEM_TIMER_TIMEOUT_PULSE_OUTPUT 0# define SYSTEM_TIMER_MULT 0.001# define SYSTEM_TIMER_FREQ 50000000 # define ALT_SYS_CLK SYSTEM_TIMER# define ALT_TIMESTAMP_CLK none# define ALT_MAX_FD 32 I follow instruction from manual . It's possible make some change in this file , without regenerate in sopc and compile in quartus II ? If not , how i have to set flags in sopc builder ? thanks for the answers ciao walter - Altera_Forum
Honored Contributor
Walter,
I'd advocate having two timers in your SOPC Builder system, one for the system clock timer and one timestamp timer. The reason your design is failing is
Unless your SOPC Builder system has two timers, already, you'll have to add another one and re-generate/re-compile. You could also use the "system_timer" timer as your timestamp clock, but then you wouldn't have a system clock timer, and I don't advocate that! Both the full_featured and standard "examples" have timestamp timers as well as system clock timers. You should change your SOPC Builder design so that it does too. The key part, that you missed, is that you've got to make sure your System Library properties are properly configured, prior to compiling your application. A quick browse through the Nios II IDE online help yields#define ALT_TIMESTAMP_CLK none
Unless you have a gigantic system, adding an additional timer to it shouldn't add more than a few seconds of generation/compilation time. Best of luck, - slackerTimestamp timer - Associates the timestamp driver to a timer device in the SOPC Builder system. The Timestamp timer and the Periodic system timer cannot specify the same physical device. - Altera_Forum
Honored Contributor
yesterday i also add a new timer
Generate system and ricompile in quartus II but in the system.h file i only read a new timer added , while the last lines at the end of file was the same "none2 . http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/sad.gif p.s. if i set "Writebke period " flag i loose full featured option I have to not set this flag from the manual if i want to use timestamp It's very uncredible , every little thing became big in this system To use timestamp is very easy from the manual , but what a have to do is not possible to know http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/dry.gif - Altera_Forum
Honored Contributor
Yes... the default for Timestamp timer, in the System Library Properties page, is none. The build process, used by the IDE, will not (cannot, could not) automagically detect your new timer, you have to tell it to include the timestamp timer, by setting on the System Library properties page.
The timestamp timer does, by the way, work. You just have to understand how important the System Library properties page is to the build process. Cheers, - slacker - Altera_Forum
Honored Contributor
yes i know
when i build a system in NIOS II IDE , the compiler take the system .ptf , after quartus II compile , and after sopv builder generate. So during building , IDE produce system. h , usiing address base specified in sopc builder , and map all register of all component used . Anyway , i posted the system.h above , and then i added a new timer in cops builder , generate , update in quartus II and "start compilation " again . After that in NIOS II IDE i build or rebuild all . In the system.h file appear a new timer , but the last three lines about timestamp remains the same . At the end i cannot understand what to do , really ...... http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/sad.gif http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/sad.gif http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/sad.gif I saw all documentation files , but they only explain how to use timestamp with some sample codes . they explain that it's possible to use timer driver in two ways , like timestamp or system timer and how to set the flags property page in sopc builder ... ...nothing else Tomorrow i try to use my oscilloscope connected to the pc and set one output port bit in the beginner and reset at the end of my program And after try to understand the cycle time . http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/blink.gif