rtems_task_wake_after
Jerry Needell
jerry.needell at unh.edu
Fri Jun 20 14:45:37 UTC 2003
On Friday, Jun 20, 2003, at 07:44 US/Eastern, Fabio Degiovanni - Eicas
wrote:
> Dear Jarry Needell,
> thank you very much. First of all, as I
> said I'm new with RTEM. What are sis/gdb and tsim-simulator? I'm using
> the sparc-rtems-gdb (within it I state "sim target", then "load", then
> "run" as I read on the "Getting Started with RTEMS for C/C++ Users").
sis is a "stand-alone version" of the erc32 simulator in gdb. If you
build gdb, from the sources, it is generated. I don't recall if it is
distribted as part of the rtems binary distribution. See if you have
sparc-rtems-sis in you rtems /opt/trems/bin directory.
TSIM is a much improved version of the erc32 simulator and was
developed by Jiri Gaisler. There is a lot of information about the
erc32 and the LEON project at his web site. I highly recommend looking
there.
> If I have well understood, you said that in your simulator if you
> expect 10s of blocking, you find more that 10s and not as on my
> Pentium4 2,0Ghz nearly 1s. Is it true? If my problem at 30th iteration
> is an overflow of the simulator clock after 2^32 clock cycles, what
> could I do to avoid this overflow? Does not the clock restart from 0
> automatically when it reaches its maximum value? Do I have to reset
> manually the clock?
As I sad, I think this limitation exists in gdb/sis and if so, I do not
know of any way around it. It seemed suspicious that it stopped at the
same time as in tsim.
Well one solution is to buy the "professional" version of Jiri's
simulator. :-) it has extended capabilities but it is expensive.
- Jerry
> Thank you very much
>
> Fabio Degiovanni
> Jerry Needell wrote:
>
>>
>> On Friday, Jun 20, 2003, at 06:20 US/Eastern, Fabio Degiovanni -
>> Eicas wrote:
>>
>>> Dear Sirs,
>>> I'm new with RTEMS; I installed it on a Linux RedHat
>>> 7.3, my target is SPARC ERC32. I run my application using the ERC32
>>> simulatoror within sparc-rtems-gdb.
>>>
>>> I tried with this simple example (see code below). I set up
>>> CONFIGURE_MICROSECONDS_PER_TICK 1000 and I ask
>>> rtems_task_wake_after(10000) whitch for me means that the task
>>> should be blocked for 10s.
>>> I have two problems:
>>> -rtems_task_wake_after instead of waking after 10s wakes after 1s
>>> -after 30 iteration the process doesn't go on; in the debugger I saw
>>> that it
>>
>>
>> On my 500 Mhz system, it runs with sis/gdb, but is much slower than
>> "real time".
>> It does stop after 30 iterations as you reported, but I think this is
>> due to a
>> limitation of the simulator.
>> I also ran it under Jiri Gaislers (www.gaisler.com) tsim - simulator.
>> It runs a lot faster - nearer to "real time" and also stops after 30
>> itereations due to an overflow of the simulator clock after 2^32
>> clock cycles. I am using the "personal" version which is limited by
>> design. I expect that sis has the same limitation.
>>
>>
>>
>> - Jerry
>>
>>> is in the funtion _CPU_Thread_Idle_body ()
>>>
>>> If I askrtems_task_wake_after(1000) rhe process doesn't freeze, but
>>> the time scale is still wrong.
>>> Can anyone of you help me?
>>>
>>> Thank you very much in advance
>>>
>>> Fabio Degiovanni
>>>
>>>
>>> my code:
>>>
>>> #include <bsp.h>
>>>
>>> #include <stdio.h>
>>>
>>> #include <rtems.h>
>>>
>>> rtems_task user_application(rtems_task_argument argument);
>>>
>>> rtems_task Init(
>>> rtems_task_argument ignored
>>> )
>>> {
>>> rtems_id tid;
>>> rtems_status_code status;
>>> rtems_name name;
>>>
>>>
>>>
>>> name=rtems_build_name('A','P','P','1');
>>>
>>>
>>> status=rtems_task_create(name,10,RTEMS_MINIMUM_STACK_SIZE,RTEMS_DEFAU
>>> LT _MODES,RTEMS_DEFAULT_ATTRIBUTES,&tid);
>>>
>>> if(status!=RTEMS_SUCCESSFUL){
>>> printf("rtems_task_create failed with status of
>>> %d.\n",status);
>>> exit(1);
>>> }
>>>
>>> status=rtems_task_start(tid,user_application,0);
>>>
>>>
>>> if(status!=RTEMS_SUCCESSFUL){
>>> printf("rtems_task_start failed with status of %d.\n",status);
>>> exit(1);
>>> }
>>>
>>> status=rtems_task_delete(RTEMS_SELF);
>>>
>>> printf("rtems_task_delete returned with status of %d.\n",status);
>>> exit(1);
>>> }
>>>
>>> rtems_task user_application(rtems_task_argument argument){
>>> rtems_interval inter=10000;
>>> int i=0;
>>> while(1){
>>> printf("user_application %d\n",i);
>>>
>>> rtems_task_wake_after(inter);
>>>
>>> i++;
>>> if(i==100){
>>> rtems_shutdown_executive(0);
>>> }
>>> }
>>>
>>> }
>>>
>>> /* configuration information */
>>>
>>> #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER /*for stdio*/
>>> #define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER /*for time
>>> services*/
>>>
>>> #define CONFIGURE_MICROSECONDS_PER_TICK 1000
>>>
>>> #define CONFIGURE_MAXIMUM_TASKS 2
>>>
>>> #define CONFIGURE_INIT_TASK_NAME rtems_build_name('E','X','A','M')
>>> #define CONFIGURE_RTEMS_INIT_TASKS_TABLE
>>>
>>> #define CONFIGURE_INIT
>>>
>>> #include <confdefs.h>
>>>
>>> /* end of file */
>>>
>>>
>>>
>>>
>>> my makefile:
>>>
>>> #
>>> # Makefile
>>> #
>>>
>>> #
>>> # RTEMS_MAKEFILE_PATH is typically set in an environment variable
>>> #
>>>
>>> EXEC=hello.exe
>>> PGM=${ARCH}/$(EXEC)
>>>
>>> # optional managers required
>>> MANAGERS=io
>>>
>>> # C source names
>>> CSRCS = test.c
>>> COBJS_ = $(CSRCS:.c=.o)
>>> COBJS = $(COBJS_:%=${ARCH}/%)
>>>
>>> # C++ source names
>>> CXXSRCS =
>>> CXXOBJS_ = $(CXXSRCS:.cc=.o)
>>> CXXOBJS = $(CXXOBJS_:%=${ARCH}/%)
>>>
>>> # AS source names
>>> ASSRCS =
>>> ASOBJS_ = $(ASSRCS:.s=.o)
>>> ASOBJS = $(ASOBJS_:%=${ARCH}/%)
>>>
>>> # Libraries
>>> LIBS = -lrtemsall -lc
>>>
>>> include $(RTEMS_MAKEFILE_PATH)/Makefile.inc
>>>
>>> include $(RTEMS_CUSTOM)
>>> include $(PROJECT_ROOT)/make/leaf.cfg
>>>
>>> OBJS= $(COBJS) $(CXXOBJS) $(ASOBJS)
>>>
>>> all: ${ARCH} $(PGM)
>>>
>>> $(PGM): $(OBJS)
>>> $(make-exe)
>>>
>>> --
>>> Dott. Ing. Degiovanni Fabio
>>> Eicas Automazione
>>> Via Vincenzo Vela, 27 10128 Torino (ITALIA)
>>> Telefoni +39-11-562.37.98/562.3088 Fax +39-11-436.06.79
>>>
>>
>
>
> --
> Dott. Ing. Degiovanni Fabio
> Eicas Automazione
> Via Vincenzo Vela, 27 10128 Torino (ITALIA)
> Telefoni +39-11-562.37.98/562.3088 Fax +39-11-436.06.79
>
>
More information about the users
mailing list