WARP Project Forums - Wireless Open-Access Research Platform

You are not logged in.

#1 2008-Jun-04 09:24:39

valeriav
Member
Registered: 2008-May-14
Posts: 4

Concurrent Timers

Hi everybody!

I have question concerning timers in WARP. I was just wondering whether we may have more than one timers running at the same time in WARP. As an example, assume that we have the following timer definition in our model:

Timer Type 1 = 5 X TIMEOUT
Timer Type 2 = 10 X TIMEOUT

In other words, when we want to initiate a timer of type I, then we simply use warpmac_setTimer(TIMEOUT), timer_type, and repetition_counter variables to identify what type of timer is running and how many times the timer, which has being loaded by TIMEOUT, already elapsed. When an interrupt due to a timeout is received, we check the type of timer (using timer_type variable) to determine how many times system timer is needed to be loaded by TIMEOUT based on the aforementioned definitions given above and how many times it has been loaded by TIMEOUT (using repetition_counter). In other words, in function timerExpire(timer_type) we have:

case TIMEOUT:

if (timer_type == 1) {
  repetition_counter ++;
  if (repetition_counter < 5) {
      warpmac_setTimer(TIMEOUT);
  }else{
  //my codes: do ... when timer of type I elapses.
  }   
}
else{
  repetition_counter ++;
  if (repetition_counter < 10) {
      warpmac_setTimer(TIMEOUT);
  }else{
  //my codes: do ... when timer of type II elapses.
  }
}

break;

case BACKOFF:

//my codes for backoff.

break;

Now my question is that what if we want to have an ongoing timer of, for example, type I while a BACKOFF timer has already initiated and progressing? In other words, assume that we have already issued warpmac_setTimer(BACKOFF) and the backoff timer is ongoing. Now we want to have another timer of either type I or II to work exactly at the same time when the backoff timer is progressing. I want to know whether it is possible or not? Does WARP platform use a single place (i.e., register) to resemble a timer or it can use multiple concurrent register to mimic concurrent ongoing timers? If it is not possible, how I can do such thing?

Lookin' forward to hearing from you and thanks in advance for your kind concern.

Offline

 

#2 2008-Jun-05 08:22:58

murphpo
Administrator
From: Mango Communications
Registered: 2006-Jul-03
Posts: 5159

Re: Concurrent Timers

We use a single timer in the OFDM reference design, as this is all that is required for CSMA. It is certainly possible to add additional timer cores. You can use our ofdm_timer core if you need to pause/start the timer based on medium activity. Otherwise you can use Xilinx's opb_timer. See the interrupt reference design for an example project using the opb_timer.

Offline

 

#3 2009-Dec-09 12:31:41

tojle
Member
Registered: 2009-Nov-23
Posts: 3

Re: Concurrent Timers

Hello,
I have also question about setting multiple timers. When I was using OFDM reference v12.1, I wrote it like this:

warpmac_setTimer(2,TIMEOUT)  and
warpmac_setTimerCallback(2,(void *)timer_callback);

and it worked good.
Now when I am using the same source code with OFDM reference v13.1 it gives me errors saying that there are too many arguments to the functions. Can you please give me some hint how to setup the multiple timers within the new OFDM reference design?
Thank you in advance.

Last edited by tojle (2009-Dec-09 12:35:31)

Offline

 

#4 2009-Dec-10 23:02:06

murphpo
Administrator
From: Mango Communications
Registered: 2006-Jul-03
Posts: 5159

Re: Concurrent Timers

We changed the timer in v13.1 in a few ways. We added more timers in the warp_timer core (there are 8 now) and added support for handling time in discrete slots (like in the 802.11 MAC spec).

In the latest code, warpmac_setTimer takes one argument- either TIMEOUT_TIMER or BACKOFF_TIMER. This function wraps calls to lower-level timer control functions (warp_timer_*).

To use the other timers, you'll need to use warp_timer_setTimer(timer, slotTime, slotCount), where timer is the timer ID (in [0,7]), slotTime is the number of bus clock cycles per time slot and slotCount is the number of time slots the timer counts down. To use the timer in a non-slotted mode, set slotTime to 0.

If you want to use additional timers, you also need to enable polling for those timers (the polling is disabled for unused timers to reduce overhead). Do this by commenting in/out the various #define POLL_TIMERX macros in warpmac.h.

Offline

 

Board footer